Okay, looks like everybody's got a seat at this point pretty much. And I wanted to let you guys know that I will be putting the code on GitHub that goes along with the presentation that I'm giving. So if any of you are new to data analysis and want some code to get started with, that will be available on GitHub. And my talk will be a combination of different ways to explore... Oh, sorry about that. Okay. Oh, okay. Okay. So my talk is going to be a combination of why you should do exploratory analysis and how to do exploratory analysis. I'm not going to cover everything because that could take weeks, but just a couple of graphs to get everyone started and thinking about why we do exploratory analysis, why it's important, and what happens if you don't do it. So the biggest problem that I have seen with machine learning is not that we don't have enough algorithms to use or that we don't have enough techniques. It's that people don't want to start with the basics. They want to jump right to the exciting stuff. Oh, let's throw a neural net at it. Oh, that'll fix it. Rather than just looking at the basics of the problem. Kind of like eating your vegetables. People aren't super excited about vegetables generally, but they help make you stronger and healthy. And exploratory analysis can also help you make your data healthier. So some examples of why you want to do exploratory analysis or even just sort of think about what you're doing with your data. Because this article as an example, they were trying to identify criminals based on facial recognition. Not a specific criminal, just criminals in general. That doesn't really sound like a great idea if you think about it. Especially when you realize that, oh, hey, they weren't even comparing pictures from the same source. They were comparing mug shots to photos that they found on the internet of smiling people. So, yeah, I think most of you are probably familiar enough with data science to realize why that's a problem. But it's easy to just get so involved in what you're doing that you don't stop and think about, is this actually a good idea, what I'm about to do? And another example is this one I'm not as sure about. I think it's an interesting example because there are some diseases that have hyphens in the name. And it turns out having a bunch of hyphens in the title of your article has a negative correlation with how many citations your paper has. Well, this could be a thing. Or it could just be that longer titles generally have more hyphens and also are a more specialized article. So then it's going to be cited less because you're talking about a niche within medical research. So maybe, maybe not. A lot of interesting correlations out there. Something that I think needs to be looked into more. But just an example of why we need exploratory analysis. We need to figure out what's actually there, what might not be important. And the good news is that there's all sorts of Python packages out there to help you with your data. And I'm going to go through a couple of my favorites and show you guys some examples of what you can do with them. So I'm not going to cover a lot about feature extraction just because it's very specific to the kind of data you have. For my dissertation research, I used inertial sensors. So I dealt a lot with time series data. That is completely different from language processing. So how you extract features from your data. Look within whatever area of research you're doing, but also other areas that might have similar data. When I did my research, I used a lot of papers that were from the aviation industry. Because it turns out it's a lot more important to keep a plane upright while it's flying through the air than it is to make sure that you know the exact position of grandma's ankle when she's walking around the house. So there's been a lot more research for aviation applications. So had I just looked in medical journals, I would have missed a lot of valuable information about how to deal with the data from these sensors. So just something to keep in mind that you don't have to stick to exactly the application that you're using something for. And another thing to keep in mind with feature extraction. So for categorical data, there's really two different kinds of categorical data. Some of it is in order, some of it not really so much. And I've seen these mixed up and people will try and turn nominal data into numerical data. It can work if you look at it and you see if there's some sort of correlation, put it in a specific order. I mean there's always exceptions. It is specific to the data you use, but in general if you haven't explored your data, you probably don't want to take something like colors, like what's someone's favorite color, and just randomly say, oh zero is going to be blue and one is going to be red, without looking at your data first. And another thing that I just wanted to mention was binning, because I've seen that done a variety of different ways. When something is not continuously distributed, it's probably worth looking at your data before you make your bins. I'm going to use an example of the Titanic data set from Kaggle, just because there's so many different options out there for code to analyze it already. Once you get familiar with that particular data set, then looking at the different ways it's been reanalyzed is a good way to get started with visualization. I think that's how I decided to get started looking into different kinds of visualization, so I'm going to use the same example here, except for a couple of different graphs that don't really lend themselves well to the data from the Titanic data set. So the first thing that I usually do is just use describe, and that will work on your numerical data sets. A good way to get started, find out how many things there are, some standard information, very easy to do, worthwhile information. The next thing is pandas profiling. If you haven't heard of pandas profiling, it's really great. Please use it. It gives you so much information. It can be overwhelming if you're not used to doing data analysis, but it's a great place to get started. You get a bunch of different graphs with distributions of the different features that you have. It will give you warnings. I've put an example up on the screen of what happens when you run pandas profiling on the Titanic data set. So definitely pandas profiling, great way to get started. It won't necessarily tell you everything you need to know about your data though, so that shouldn't be the only thing you do. It just sort of gives you a direction to figure out what you might want to explore further. So the cons of profiling, the output is HTML. I normally use spider. Spider is not super happy about HTML files. You can save it to a file. That's pretty much your only option with spider. If you use it with Jupyter notebooks, then it's going to be a lot easier. But definitely worth using. I'll even open up Jupyter notebooks, even though it's not what I usually use, just to look at something in pandas profiling real quick before I get started. So once you use pandas profiling, get an idea of what might be interesting. Then, if you have time series data, it's good to start with just a simple graph. This graph is from the data analysis that I did as part of the data science boot camp that I went to. And I realized partway through my project at the data science boot camp that, oh, hey, I was classifying data that had come from two different wards of a hospital. And I realized, oop, I'm pretty sure that they had two different kinds of sensors on the patients in the two different wards. And that was kind of a problem, because I was classifying based on what sensor they were using instead of if the patient was actually in the cardiac ward of the hospital or not. So that was unfortunate for my project, but at least I didn't think that I actually had something that was super exciting and useful. And then it turns out, oh, hey, I was just classifying an artifact of the different machines that were used to collect the data. So, yeah, I'm telling all of you guys about my very embarrassing story, just so that you know that everyone has these stories. If they say they don't, they're lying. So, yeah, if I had started with doing some of these graphs, just a simple graph of the data from the two different groups that I was trying to classify, I could have saved myself a lot of time, and then it would have been early enough into the boot camp that I could have picked a different project and not had to tell potential employers that, oh, hey, here's this analysis I did. I think it might actually just be a giant steaming pile, but it's what I did, because I figured it out too late to start a new project. So, heat maps. Everyone loves heat maps. I like using them to help show data to people that are not necessarily data scientists. It can be a good way to see what might be interesting and correlated, but also it's easy for someone that's not super technical to understand. So, I am a fan of heat maps. I realize that not everyone might be, but I do find value in them. And it's also part of Panda's profiling, so you get one of those without having to really do any extra analysis. Oh, well, that's not great. Okay. But another thing that I like is violin plots, especially if you have a binary classification, because then you can put your two classes on either side and see if they are similarly distributed. So, this example is from the Titanic data set, and you can see that, okay, this data is definitely dependent upon age, which makes sense. They put all the children on the lifeboats first. Well, especially the male children, it looks like. But, yeah, if you look back at the heat map between survival and age, there's not really much of a correlation. But then if you start breaking it out into different ages versus just age, then you can see, oh, hey, I might should make my bins according to where these probabilities are. So, that's what I was talking about with looking at your data first before you decide to bin it. Because this one, if you had just taken the youngest and the oldest and divided it into a certain number of groups, you might have not had the best classification based on the probabilities that are in there. So, I prefer to look at data before just randomly assigning it to bins. And another thing that I like, pair plots. And pair plots are great because you can see how two variables are related. This is not the best example of a pair plot, but you can sometimes see just, okay, all it really takes is those two variables to separate out your classes, if you're lucky. That happened with the pair plot for my dissertation research, but unfortunately that one was really large and I wanted to keep this consistent with showing you guys the same data. But it's not necessarily that if you don't see a separation on a pair plot, you won't be able to classify your data. It's just, if you see it, that's good news for you. Your life just got easier because you know that, oh, hey, these two variables definitely can show you something. Okay. And here is a little more of me showing you guys just how terrible my idea at the data science boot camp was. Okay. Because if I can't be an example, at least I can be a terrible warning for all of you. So this drift feature that was the most important when I used a tree-based classifier, that was when I did that midline. So back, oh, I should have put these two slides next to each other. Okay. So here when I did that midline correction, so that orange line, I took that out and then you get the green one. So that orange line, the standard deviation of that line was the most important feature that I found for my project. The thing that I took out to try and make the two different datasets the same, yeah, that was my most important feature. Because one of the datasets had already been normalized and had that midline correction and the other did not. So, yeah, that was a frustrating experience for me. But at least I found it out before I went any further with it. So I can't really complain. And, I mean, I did learn something from going to the data science boot camp because now I know the importance of doing much more EDA much earlier before I have to commit to an idea. So, yeah, that was my boot camp experience. I would say if you are thinking about going to a data science boot camp, they might tell you not to pick a project before you go there. Definitely find some data you're interested in and look into it a little bit first. Try to avoid doing what I did and realizing your project is a steaming pile when it's too far in to switch. So, yeah, that just my rant on data science boot camps, but... Okay. So, this was another thing that I did while I was at the data science boot camp because I needed to get results that didn't look too terrible. So I just threw a bunch of classifiers at my data because I was running out of ideas. I'm not saying that it's a bad idea to try a bunch of different classifiers, but at least look at your data first so you don't end up in the same situation that I was in. And in this case, yeah, there were a bunch of ones that were overfitting. I should have also used more data. But it was a learning experience. And here's another graph with me just telling you guys how terrible my idea was. So, yeah, really high training accuracy, really low test accuracy. I was overfitting and it was so bad. But... I at least was able to look at false positives versus false negatives. Since this was a medical application, it's a little bit different than security. For medicine, we really, to miss anything, like saying that, oh, hey, someone that's having a cardiac event is fine is real bad. Better to accidentally say, oh, hey, someone might be having a cardiac event when they aren't. So this is a little bit different than security. But... yeah. So... Does anyone have any questions? Because... I could just keep on going. But... okay. I guess... So for that, there's a bunch of different techniques you can use. You could do... dimensional reduction, so combining those features, seeing what features end up being combined. But... yeah. I was just showing some ways to get started. Definitely just looking at two variables together is not the only thing you want to do. If two variables is all you need to start getting it separated, then that's really good. But that's not how it usually works. Sorry. Did I answer your question? There are a bunch of different techniques for that. Principal component analysis, lasso, sorry, I'm drawing a blank on all of them. But yes, there are definitely ways to do that. And then, again, one option you can use is running it through a tree-based classifier. That might not be what you end up using in the end, but it can show you if there are multiple variables that are important. So for this one, it showed there wasn't just one or two standout variables that, okay, that's the one that was really predicting what was going on. So as far as if you want to visualize it, that could be an option, looking at that feature importance. Oh, he was asking about when there would be more than two features that would be important. So I was just, because I'd shown the pair plot, which only shows two features combined with each other, but a lot of the time you're going to have a combination of more than two features that will end up being what you use to predict whatever it is that you're classifying. So yeah, there are other techniques beyond what I showed. This was just more of a starting to think about your data and please, please think about what you're doing. And if there's bias in your data before it was even collected, like the example that I gave of my data science bootcamp project, where it turns out I was just checking to see which kind of sensor had been used to collect the data versus what I was trying to do. There's so much bias data out there and it's easy to not really think about where the data came from. Is this a good idea? And that sort of thing. Like the, sorry, I keep on coming back to this, but it's just, it's so bad. Like this, like if they would have just thought about, oh hey, why am I trying to separate criminals from non-criminals? I feel like if they just spent a little more time thinking about that, maybe they wouldn't have put that out there and now everyone's seen it and sort of makes fun of it. Okay. Oh yes. There are a lot of people I've seen that skip EDA because they either don't know how to do it or they just get really excited about their project and want to just go straight to classification. So I think EDA is so easy that there's not really any excuse to skip it. Like you're never going to look back at a project and say, I really wish I hadn't spent that hour or two looking into my data to make sure that it's what I think it is. But there are plenty of times like my bootcamp project where I looked back and thought, I really wish I had spent more time looking into that project before I committed to it. Yeah. So that's sort of why I am now very passionate about EDA because I don't want to have any more of those experiences and I want to help prevent others from having that experience because it was fairly unpleasant for me. I mean, also I'm happy that I did discover it during the bootcamp and not try and submit it and get a grant and then realize after I told even more people about it. So but yeah, it would have been better if I'd found that earlier for sure. Okay. Oh, and your question? So to be honest, most of my experiences with medical data where there's not really an issue of ever having too much data because there's so much regulation around medical data and rightly so, we don't want medical records just being available freely on the internet. So in medical research, it's more a problem of needing to get more data. If you have tons and tons of data, then okay, number one, I'm jealous. I want your data. I want that problem. But also, you can always take a subset of your data to do some exploratory analysis with and then maybe do a couple of different comparisons to make sure that that subset you took is representative of the entire data set. If you want to do something like pandas profiling, running that on a very large data set is going to take quite a while. So you could take a subset, do a couple of basic comparisons to make sure that they are similar and then run that subset through your EDA to do more extensive analysis. Some of the things like the correlation coefficients can take a while if you've got a very large data set. But definitely taking that step to do that comparison of, oh, hey, is this subset comparative to the whole of the data set? That's valuable. Okay. Any other questions? Okay. How would you handle data that has sparsely populated features? Sparsely populated features. So for that, probably the best way to deal with sparsely populated features is to look into how language processing is done, because that is a common problem in language processing, because they will vectorize word strings, or strings, and then vectorize it. So one hot encoding of each word that is in a sentence, for example. So there is a lot of very sparse data in NLP. So I'm not super familiar with NLP. I don't want to tell you for sure. I do this and that. But even if you're not dealing with language data, I would say look at some of the different processes that are used for NLP. And, yeah, one of the things that is used for NLP is combining some of the fields so that then you don't have as many different dimensions that are sparsely populated. And there's a bunch of different ways to do that. It's going to be specific to your data. So, okay. Well, I guess that's all the questions. Thank you for coming to my talk. And hopefully, if I have even prevented one person from making the same mistake that I did, then I am very happy. Because it's really frustrating to get far into a project and then realize, oh, hey, I missed a fundamental flaw in my data. Okay. Thank you.