‫Step five Modelling.
‫Part two Choosing.
‫We mentioned in the last lesson, there were three parts to modeling choosing a model, tuning a model
‫and comparing models.
‫Once you've got your data split into training, validation and test sets, you can start to go through
‫each of these steps.
‫In this lesson, we're going to cover some points on choosing a model, which is you choose a model
‫and train it on your training data.
‫Unlike creating your own algorithms from scratch, there are many prebuilt machine learning models which
‫you can take advantage of when you first begin.
‫Your main goal will be knowing what kind of machine learning algorithm to use with what kind of problem
‫this is because some algorithms work better than others on different types of data.
‫We'll have a look at this specifically when we get hands on with our projects.
‫But for now, a tidbit to remember is if you're working with structured data, decision trees such as
‫random forests and gradient boosting algorithms like Cat Boost and XG Boost tend to work best.
‫And if you're working with unstructured data, deep learning neural networks and transfer learning tend
‫to work best.
‫Once you've chosen a model, your next step is to train them.
‫The main goal here will be to line up the inputs and outputs.
‫For example, in our heart disease problem, we want our model to look at the feature variables, the
‫inputs, and then find the patterns and use them to predict the target variable.
‫So remember from a previous lesson these variables here are the feature variables.
‫We want to use these to predict the target variables.
‫Another common naming setting is to use X, which is the data to predict Y, which is the labels.
‫Different machine learning algorithms have different ways of doing this.
‫We'll see how to do it for a handful of useful ones in future projects.
‫And remember, training a model takes place on the training data split.
‫This is where your model learns the course material.
‫We don't want to let our models cheat and see the final exam before they do their study.
‫Depending on how much data you have and how complex your model is, training may take a while.
‫One of your biggest goals when training a model is to minimize the times between experiments.
‫So sometimes this will mean to use a small portion of your data first.
‫For example, if your training dataset had 100,000 examples, you might start training a model with
‫only the first 10,000 and see how it goes.
‫You might also decide to use a less complicated model to begin with.
‫Deep models such as neural networks generally take longer to train than other kinds of models.
‫Now, this is something worth considering when it comes to training your own models.
‫For example, if an experiment takes you 3 hours or even up to a couple of days for a small percentage
‫boost in performance of your model you might consider, is this experiment actually worth it?
‫Because machine learning is highly iterative, we want to minimize this experimentation time that we
‫can go from step one to step two to step three.
‫But again, if this looks confusing, we'll see it in practice in the hands on projects.
‫The things to remember.
‫Some models work better than others in different problems.
‫Don't be afraid to try things.
‫And this is really important.
‫Machine learning is, as we said before, a highly iterative process.
‫So some things that you try out may not work the first time, and that means you just neglect that thing
‫going forward and try something else.
‫Start small and build up.
‫Add complexity as you need.
‫What this means is, for example, if you had 100,000 examples, we're going to start on 10,000.
‫We're going to use a simple model first to begin with, rather than going to the the biggest and latest
‫and greatest model.
‫Because what we're after is practical results, not something that's that's the the best on paper.
‫We want to see something that can actually be used in the real world.
‫And part of your experiments will involve tuning a model which shows good initial results to get better
‫results, like tuning a car.
‫If your car does well on on one track, it might not do well on another track.
‫So you tune it up.
‫Let's have a look at how to do that.
‫But instead of for cars, we'll do it for machine learning models.