welcome back to the data science with MATLAB video series in this video we'll
work on visualizing the data which is a really fun and important aspect of data
science so we've been working so far with a lot of pre-processing and dealing
with all the different types of data that we have we also have different ways
to explore and visualize this data based on the types so for example we've seen a
lot of line plots so far you know we were looking at temperature variations
and damage costs but let's actually look at some other visualizations that are
really great for data science applications one thing which is nice if
you double-click on your variable and select the data that you're interested
in you can actually take a look at the plot tab and see what plots are
available to you and so this is a great way to explore if you don't even know
where to start with visualization just go ahead and select one and see what
happens
you
so in our live script we want to look at the storm events and based on location
and the damage costs so we want the frequency the damage costs and looking
at those by the event and the location we also want to explore different
connections between the events and the locations and then look at that free
text description of the narratives to see if we have any patterns or you know
see if there's anything interesting that come out of the data in that case so
first I'm gonna see the event frequency by location and so I'm also creating a
function called big figure so I can increase the size of my figure since I
have lots of locations and lots of types and so this gives us a quick indication
of how many of these events similar to our histogram but we also can see this
broke down broken down by state and so you know we can see that there was more
wind in California in South Dakota and Wyoming for example and so this is
showing our event frequency but what we really want to look for is our damage
and so I'm gonna create the same plot but also include damage cost as the
color variable and I'm also going to change the color so I can see that a
little bit easier looking at this one I can actually very very clearly see that
some of them the very expensive events are hurricanes coastal weather also
likely related to hurricanes and some others it also might make more sense to
look at this on a map and so it's fairly easy to do that we can use geo bubble
it's a nice function for this and it'll automatically use your categories as the
bubbles and so you know we can take a look at sort of the locations of the
different types of events you know perhaps we'll see that you know flooding
is likely to happen around rivers and oceans and we have you know certain
areas that are more prone to tornadoes and lightning and whatnot and so this is
a really great way to explore the locations of these events so we also
want to look at the connections between the events so maybe some events are you
know some events and locations are very highly connected than others and so we
can look at this using a graph or digraph to help understand their
relationships so for example so this is showing the red is the most highly
connected and blue is least connected so for something like flood this is very
highly connected to hail for example and also highly connected to wind also I can
explore different ways to slice and dice this visualization so here I'm using a
live control to select the different layout and the degree of connectivity so
for example I can just change the view a bit and that might help me you know pick
out more patterns you know again using the live controls to continue to explore
these connections it's extremely helpful in these kind of applications because I
might be able to you know combine some of these in our analysis or you know
remove some of them that are you know less connected so last but not least we
want to also look at our event descriptions so this is our the natural
free text that someone just wrote down about the event and so this can be
really interesting to see different patterns you know what events might
happen more than others you know what types of adjacent kind of events might
happen and we can use a word cloud for this alright so you know quickly we can
see that you know wind gusts miles per hour damage you know these are the most
frequent words also you know like I was saying about adjacent data you know we
see maybe there are a lot of trees down or you know roads impacted and so those
are additional things that we could take into account with our modeling and so if
we want to just take a look at certain events we again could use our live
control and so I'll just select certain events and just see what the
descriptions of those look like so if maybe we take a look at you know a
different event like a wildfire we should see you know more related words
to that event so you know again this is another great great way to explore your
data and start to make more decisions about further pre-processing or further
analysis and modeling steps that you might need to take thanks for watching
in the next video we'll look at machine learning or predictive modeling