start	end	text
0	4660	Okay, looks like everybody's got a seat at this point pretty much.
4820	11440	And I wanted to let you guys know that I will be putting the code on GitHub that goes along with
11440	18360	the presentation that I'm giving. So if any of you are new to data analysis and want some code
18360	30570	to get started with, that will be available on GitHub. And my talk will be a combination of
30570	48400	different ways to explore... Oh, sorry about that. Okay. Oh, okay. Okay. So my talk is going
48400	55160	to be a combination of why you should do exploratory analysis and how to do exploratory
55160	62980	analysis. I'm not going to cover everything because that could take weeks, but just a couple
62980	69560	of graphs to get everyone started and thinking about why we do exploratory analysis, why it's
69560	79800	important, and what happens if you don't do it. So the biggest problem that I have seen with
79800	86200	machine learning is not that we don't have enough algorithms to use or that we don't have
86200	92440	enough techniques. It's that people don't want to start with the basics. They want to jump right to
92440	99720	the exciting stuff. Oh, let's throw a neural net at it. Oh, that'll fix it. Rather than just
99720	106360	looking at the basics of the problem. Kind of like eating your vegetables. People aren't super
106360	112900	excited about vegetables generally, but they help make you stronger and healthy. And exploratory
112900	125460	analysis can also help you make your data healthier. So some examples of why you want to do
125460	131200	exploratory analysis or even just sort of think about what you're doing with your data.
131720	144340	Because this article as an example, they were trying to identify criminals based on facial
144340	150280	recognition. Not a specific criminal, just criminals in general. That doesn't really
150280	156840	sound like a great idea if you think about it. Especially when you realize that, oh, hey,
156840	165220	they weren't even comparing pictures from the same source. They were comparing mug shots to
165880	170000	photos that they found on the internet of smiling people.
172700	178980	So, yeah, I think most of you are probably familiar enough with data science to realize
178980	186880	why that's a problem. But it's easy to just get so involved in what you're doing that you don't
186880	198780	stop and think about, is this actually a good idea, what I'm about to do? And another example
201900	207320	is this one I'm not as sure about. I think it's an interesting example
209060	214880	because there are some diseases that have hyphens in the name. And it turns out having a bunch of
214880	222460	hyphens in the title of your article has a negative correlation with how many citations your paper has.
223700	232200	Well, this could be a thing. Or it could just be that longer titles generally have more hyphens
232200	241280	and also are a more specialized article. So then it's going to be cited less because you're talking
241280	250500	about a niche within medical research. So maybe, maybe not. A lot of interesting correlations out
250500	259900	there. Something that I think needs to be looked into more. But just an example of why we need
259900	268980	exploratory analysis. We need to figure out what's actually there, what might not be important.
275210	279630	And the good news is that there's all sorts of Python packages out there to help you with your
279630	288770	data. And I'm going to go through a couple of my favorites and show you guys some examples of what
288770	299300	you can do with them. So I'm not going to cover a lot about feature extraction just because it's
299300	308750	very specific to the kind of data you have. For my dissertation research, I used inertial sensors.
309480	315790	So I dealt a lot with time series data. That is completely different from language processing.
316490	324070	So how you extract features from your data. Look within whatever area of research you're doing,
324070	332510	but also other areas that might have similar data. When I did my research, I used a lot of papers
332510	339770	that were from the aviation industry. Because it turns out it's a lot more important to keep a
339770	345310	plane upright while it's flying through the air than it is to make sure that you know the exact
345310	351010	position of grandma's ankle when she's walking around the house. So there's been a lot more
351010	356770	research for aviation applications. So had I just looked in medical journals, I would have missed
357330	362790	a lot of valuable information about how to deal with the data from these sensors.
363610	368810	So just something to keep in mind that you don't have to stick to exactly the application that
368810	381370	you're using something for. And another thing to keep in mind with feature extraction.
383120	391100	So for categorical data, there's really two different kinds of categorical data.
391100	400420	Some of it is in order, some of it not really so much. And I've seen these mixed up and
401040	410320	people will try and turn nominal data into numerical data.
411360	418760	It can work if you look at it and you see if there's some sort of correlation, put it in a
418760	425980	specific order. I mean there's always exceptions. It is specific to the data you use, but in general
425980	432500	if you haven't explored your data, you probably don't want to take something like colors, like
432500	439520	what's someone's favorite color, and just randomly say, oh zero is going to be blue and one is going
439520	453990	to be red, without looking at your data first. And another thing that I just wanted to mention
453990	462050	was binning, because I've seen that done a variety of different ways.
462410	466390	When something is not continuously distributed,
466390	470810	it's probably worth looking at your data before you make your bins.
472970	481010	I'm going to use an example of the Titanic data set from Kaggle, just because there's so many
481010	488970	different options out there for code to analyze it already. Once you get familiar with that
488970	495590	particular data set, then looking at the different ways it's been reanalyzed is a good way to get
495590	502670	started with visualization. I think that's how I decided to get started looking into different
502670	511990	kinds of visualization, so I'm going to use the same example here, except for a couple of
511990	518690	different graphs that don't really lend themselves well to the data from the Titanic data set.
524980	529100	So the first thing that I usually do is just use describe,
531950	536470	and that will work on your numerical data sets.
536470	542890	A good way to get started, find out how many things there are,
542890	552030	some standard information, very easy to do, worthwhile information.
556720	567900	The next thing is pandas profiling. If you haven't heard of pandas profiling, it's really great.
570240	576920	Please use it. It gives you so much information. It can be overwhelming if you're not used to doing
576920	581980	data analysis, but it's a great place to get started. You get a bunch of different graphs
581980	589380	with distributions of the different features that you have. It will give you warnings. I've put an
589380	596720	example up on the screen of what happens when you run pandas profiling on the Titanic data set.
599970	607470	So definitely pandas profiling, great way to get started. It won't necessarily tell you everything
607470	612950	you need to know about your data though, so that shouldn't be the only thing you do. It just sort
612950	625230	of gives you a direction to figure out what you might want to explore further. So the cons of
625230	637110	profiling, the output is HTML. I normally use spider. Spider is not super happy about HTML
637110	644270	files. You can save it to a file. That's pretty much your only option with spider.
644430	650530	If you use it with Jupyter notebooks, then it's going to be a lot easier.
656330	663070	But definitely worth using. I'll even open up Jupyter notebooks, even though it's not what I
663070	670390	usually use, just to look at something in pandas profiling real quick before I get started.
674950	681870	So once you use pandas profiling, get an idea of what might be interesting.
682430	689030	Then, if you have time series data, it's good to start with just a simple graph.
690190	698230	This graph is from the data analysis that I did as part of the data science boot camp that I went
698230	706910	to. And I realized partway through my project at the data science boot camp that, oh, hey,
707520	715240	I was classifying data that had come from two different wards of a hospital.
715590	724770	And I realized, oop, I'm pretty sure that they had two different kinds of sensors on the patients
724770	733330	in the two different wards. And that was kind of a problem, because I was classifying based on
733330	740210	what sensor they were using instead of if the patient was actually in the cardiac ward of the
740210	748270	hospital or not. So that was unfortunate for my project, but at least I didn't think that I
748270	755050	actually had something that was super exciting and useful. And then it turns out, oh, hey,
755050	759830	I was just classifying an artifact of the different machines that were used to collect the data.
761330	767110	So, yeah, I'm telling all of you guys about my very embarrassing story, just so that you know
767110	777930	that everyone has these stories. If they say they don't, they're lying. So, yeah, if I had started
777930	783950	with doing some of these graphs, just a simple graph of the data from the two different groups
783950	789750	that I was trying to classify, I could have saved myself a lot of time, and then it would have been
789750	796530	early enough into the boot camp that I could have picked a different project and not had to tell
796530	801970	potential employers that, oh, hey, here's this analysis I did. I think it might actually just
801970	808430	be a giant steaming pile, but it's what I did, because I figured it out too late to start a new
808430	830220	project. So, heat maps. Everyone loves heat maps. I like using them to help show data to people
830220	837960	that are not necessarily data scientists. It can be a good way to see what might be interesting
837960	845440	and correlated, but also it's easy for someone that's not super technical to understand. So,
845440	850480	I am a fan of heat maps. I realize that not everyone might be,
851840	858100	but I do find value in them. And it's also part of Panda's profiling, so
858100	864680	you get one of those without having to really do any extra analysis.
865680	874820	Oh, well, that's not great. Okay. But another thing that I like is violin plots, especially
874820	880300	if you have a binary classification, because then you can put your two classes on either side
880300	888560	and see if they are similarly distributed. So, this example is from the Titanic data set,
888560	898440	and you can see that, okay, this data is definitely dependent upon age,
899180	905440	which makes sense. They put all the children on the lifeboats first. Well,
905440	914480	especially the male children, it looks like. But, yeah, if you look back at the heat map
914480	921720	between survival and age, there's not really much of a correlation. But then if you start
921720	932240	breaking it out into different ages versus just age, then you can see, oh, hey, I might should
932240	939740	make my bins according to where these probabilities are. So, that's what I was talking about with
939740	945680	looking at your data first before you decide to bin it. Because this one, if you had just taken
945680	950900	the youngest and the oldest and divided it into a certain number of groups, you might have not
951720	957800	had the best classification based on the probabilities that are in there.
961340	967480	So, I prefer to look at data before just randomly assigning it to bins.
971890	981070	And another thing that I like, pair plots. And pair plots are great because you can see
981070	987110	how two variables are related. This is not the best example of a pair plot,
989610	997590	but you can sometimes see just, okay, all it really takes is those two variables to
997590	1003130	separate out your classes, if you're lucky. That happened with the pair plot for my
1003130	1010930	dissertation research, but unfortunately that one was really large and I wanted to
1010930	1019690	keep this consistent with showing you guys the same data. But it's not necessarily that
1020310	1025270	if you don't see a separation on a pair plot, you won't be able to classify your data.
1025270	1031850	It's just, if you see it, that's good news for you. Your life just got easier because you know
1031850	1045470	that, oh, hey, these two variables definitely can show you something. Okay. And here is a little
1045470	1053530	more of me showing you guys just how terrible my idea at the data science boot camp was.
1053530	1061030	Okay. Because if I can't be an example, at least I can be a terrible warning for all of you.
1061590	1069090	So this drift feature that was the most important when I used a tree-based classifier,
1069610	1079650	that was when I did that midline. So back, oh, I should have put these two slides next to each
1079650	1092530	other. Okay. So here when I did that midline correction, so that orange line, I took that
1092530	1099670	out and then you get the green one. So that orange line, the standard deviation of that line
1101190	1108750	was the most important feature that I found for my project. The thing that I took out to
1108750	1118150	try and make the two different datasets the same, yeah, that was my most important feature.
1118150	1127590	Because one of the datasets had already been normalized and had that midline correction
1127590	1137330	and the other did not. So, yeah, that was a frustrating experience for me.
1137330	1145450	But at least I found it out before I went any further with it. So I can't really complain.
1145710	1150030	And, I mean, I did learn something from going to the data science boot camp because
1151110	1159910	now I know the importance of doing much more EDA much earlier before I have to commit to an idea.
1164750	1173770	So, yeah, that was my boot camp experience. I would say if you are thinking about going to
1173950	1180950	a data science boot camp, they might tell you not to pick a project before you go there.
1181210	1185950	Definitely find some data you're interested in and look into it a little bit first.
1185950	1191990	Try to avoid doing what I did and realizing your project is a steaming pile
1192490	1208170	when it's too far in to switch. So, yeah, that just my rant on data science boot camps, but...
1208750	1216950	Okay. So, this was another thing that I did while I was at the data science boot camp because
1217950	1226630	I needed to get results that didn't look too terrible. So I just threw a bunch of classifiers
1226630	1232850	at my data because I was running out of ideas. I'm not saying that it's a bad idea to try a
1232850	1240890	bunch of different classifiers, but at least look at your data first so you don't end up
1240890	1249800	in the same situation that I was in. And in this case, yeah, there were a bunch of ones
1249800	1261060	that were overfitting. I should have also used more data. But it was a learning experience.
1268480	1279520	And here's another graph with me just telling you guys how terrible my idea was. So, yeah,
1279520	1287300	really high training accuracy, really low test accuracy. I was overfitting and it was so bad.
1289740	1299660	But... I at least was able to look at false positives versus false negatives. Since this
1299660	1306660	was a medical application, it's a little bit different than security. For medicine, we really,
1306660	1313200	to miss anything, like saying that, oh, hey, someone that's having a cardiac event is fine
1313200	1320100	is real bad. Better to accidentally say, oh, hey, someone might be having a cardiac event when they
1320100	1334580	aren't. So this is a little bit different than security. But... yeah. So...
1337700	1343440	Does anyone have any questions? Because...
1345180	1350700	I could just keep on going. But... okay. I guess...
1378850	1388570	So for that, there's a bunch of different techniques you can use. You could do...
1391410	1397910	dimensional reduction, so combining those features, seeing what features end up being combined.
1398930	1402270	But... yeah. I was just showing some ways to get started.
1402390	1407670	Definitely just looking at two variables together is not the only thing you want to do.
1407670	1411730	If two variables is all you need to start getting it separated, then
1412330	1418110	that's really good. But that's not how it usually works.
1420350	1442690	Sorry. Did I answer your question? There are a bunch of different techniques for that.
1443410	1452090	Principal component analysis, lasso, sorry, I'm drawing a blank on all of them. But yes,
1452090	1460170	there are definitely ways to do that. And then, again, one option you can use is
1461170	1465470	running it through a tree-based classifier. That might not be what you end up using in the end,
1465470	1471950	but it can show you if there are multiple variables that are important. So for this one,
1471950	1476730	it showed there wasn't just one or two standout variables that, okay,
1476730	1481310	that's the one that was really predicting what was going on.
1483630	1488850	So as far as if you want to visualize it, that could be an option, looking at that feature
1488850	1502790	importance. Oh, he was asking about when there would be more than two features that would be
1502790	1513270	important. So I was just, because I'd shown the pair plot, which only shows two features
1513270	1519270	combined with each other, but a lot of the time you're going to have a combination of
1519270	1529230	more than two features that will end up being what you use to predict whatever it is that
1529230	1534890	you're classifying. So yeah, there are other techniques beyond what I showed. This was just
1534890	1541610	more of a starting to think about your data and please, please think about what you're doing.
1541610	1545350	And if there's bias in your data before it was even collected,
1547990	1556370	like the example that I gave of my data science bootcamp project, where it turns out I was just
1556370	1563150	checking to see which kind of sensor had been used to collect the data versus what I was trying to
1563150	1572010	do. There's so much bias data out there and it's easy to not really think about where the data
1572010	1586050	came from. Is this a good idea? And that sort of thing. Like the, sorry, I keep on coming back to
1586050	1597250	this, but it's just, it's so bad. Like this, like if they would have just thought about, oh hey,
1597250	1605290	why am I trying to separate criminals from non-criminals? I feel like if they just spent
1605410	1610170	a little more time thinking about that, maybe they wouldn't have put that out there and
1611390	1614550	now everyone's seen it and sort of makes fun of it.
1621950	1643890	Okay. Oh yes. There are a lot of people I've seen that skip EDA because they either don't know how
1643890	1649010	to do it or they just get really excited about their project and want to just go straight to
1649010	1669630	classification. So I think EDA is so easy that there's not really any excuse to skip it. Like
1670330	1676410	you're never going to look back at a project and say, I really wish I hadn't spent that hour or
1676410	1684330	two looking into my data to make sure that it's what I think it is. But there are plenty of times
1684330	1691010	like my bootcamp project where I looked back and thought, I really wish I had spent more time
1691010	1699310	looking into that project before I committed to it. Yeah. So that's sort of why I am now
1700670	1706650	very passionate about EDA because I don't want to have any more of those experiences
1707210	1714130	and I want to help prevent others from having that experience because it was fairly unpleasant for me.
1714790	1721510	I mean, also I'm happy that I did discover it during the bootcamp and not try and submit it
1721510	1727150	and get a grant and then realize after I told even more people about it. So
1731490	1735050	but yeah, it would have been better if I'd found that earlier for sure.
1737430	1755600	Okay. Oh, and your question? So to be honest, most of my experiences with medical data
1756200	1759840	where there's not really an issue of ever having too much data
1761440	1768200	because there's so much regulation around medical data and rightly so, we don't want
1768200	1772160	medical records just being available freely on the internet.
1774180	1779480	So in medical research, it's more a problem of needing to get more data.
1780260	1788720	If you have tons and tons of data, then okay, number one, I'm jealous. I want your data.
1789530	1796400	I want that problem. But also, you can always take a subset of your data to
1797040	1804680	do some exploratory analysis with and then maybe do a couple of different comparisons
1804680	1810320	to make sure that that subset you took is representative of the entire data set.
1810620	1815220	If you want to do something like pandas profiling, running that on a very large
1815220	1821040	data set is going to take quite a while. So you could take a subset, do a couple of basic
1821040	1827880	comparisons to make sure that they are similar and then run that subset through your EDA
1831290	1835710	to do more extensive analysis. Some of the things like the correlation
1836810	1842270	coefficients can take a while if you've got a very large data set.
1844790	1849670	But definitely taking that step to do that comparison of, oh, hey, is this subset
1850510	1867680	comparative to the whole of the data set? That's valuable. Okay. Any other questions?
1870120	1871640	Okay.
1871860	1878970	How would you handle data that has sparsely populated features?
1878970	1891230	Sparsely populated features. So for that, probably the best way to deal with sparsely
1891230	1900910	populated features is to look into how language processing is done, because that is a common
1900910	1909950	problem in language processing, because they will vectorize word strings, or strings,
1909950	1915410	and then vectorize it. So one hot encoding of each word that is in a sentence, for example.
1915410	1922770	So there is a lot of very sparse data in NLP. So I'm not super familiar with NLP. I don't want to
1922770	1928690	tell you for sure. I do this and that. But even if you're not dealing with language data, I would
1928690	1940130	say look at some of the different processes that are used for NLP. And, yeah, one of the things
1940130	1948850	that is used for NLP is combining some of the fields so that then you don't have as many
1948850	1957870	different dimensions that are sparsely populated. And there's a bunch of different ways to do that.
1957870	1977340	It's going to be specific to your data. So, okay. Well, I guess that's all the questions.
1977960	1985760	Thank you for coming to my talk. And hopefully, if I have even prevented one person from making
1985760	1994760	the same mistake that I did, then I am very happy. Because it's really frustrating to get far into a
1994760	2003600	project and then realize, oh, hey, I missed a fundamental flaw in my data. Okay.
2003640	2004000	Thank you.
