Machine Learning Tutorial Python -1: What
is Machine Learning?
Codebasics
There are certain tasks where computers are really better than
humans such as driving the car. Natural language conversation is
also an area where humans outperform machines. Machine
learning tries to make computers better at things where
traditionally humans were outperforming machines. We make
machines learn things like humans do so the question is Why
humans are better in driving the cars and having a conversation ?
Machine learning is a science of field in computer science where
we use various techniques and deep learning is one of them.
Machine learning has a big implication on our real life. The next
tutorial we are going to write some Python code to make some
predictions using linear regression. We will also learn how to
make predictions using a simple linear regression technique.
Machine Learning Tutorial Python - 2:
Linear Regression Single Variable
codebasics
today we are going to write python code to predict home prices
using a machine learning technique called simple linear
regression in this table. The prices of home based on the area of
that home in my neighbourhood in Monroe township new jersey
using this data i will build a machine. model that can tell me the
prices of the homes whose area is 3 300 square feet and 5 000
square feet you can plot available prices and areas in form of a
scatter plot. Plotting a scatter plot to get an idea on the
distribution of my data point. I recommend you watching my
tutorials on pandas because pandas are going to be extremely
useful in your machine learning journey. Once I have a data frame
I will now go ahead and use the linear regression model. Using a
read csv file, you can create a data frame and export the value to
prediction. csv. Once you have this model built in you can apply
this model on a huge csv. file and come up with a list of
predictions now going back to our original example so let me go
back again.
,A simple linear regression model was all about building a simple
linear model using one variable. In the future, we are going to
cover a little more complex linear regression models in the future.
i highly recommend that you do the exercise because just by
watching the video you will not probably learn that much I mean
you'll learn something but it's not very effective so it's better that
you. do some practice as well.
Machine Learning Tutorial Python - 3:
Linear Regression Multiple Variables
codebasics
We are going to look into linear regression with multiple variables
also known as multivariate regression using this. Using this we
will predict the home prices in Monroe township new jersey here
in this table I have various metrics available such as area and
bedroom age and these are the factors that the ultimate price
depends on in the previous tutorial, we looked at simple linear
regression. Pandas are extremely useful while doing machine
learning so I highly recommend that if you don't know about it
already okay. I have done here is imported the necessary
modules and then I am going to load my data into pandas data
frame home prices dot csv. I will say median bedrooms are equal
to a matte dot floor and the medium bedrooms would be three
okays. The model is now ready once it is ready it's a good idea to
take a look at the coefficients I got was this uh just to summarize
what these coefficients are in this equation m1 m2 m3 and m3
are coefficients so this is m1. The coefficients are based on the
area of bedrooms and age and my target variable is price.
Using this data you have to build a model for your hr department
where they can feed in experience and various scores and they
can get some idea of what kind of salary they need to offer to a
candidate now in this data set. You will find a few interesting
things first of all in experience these two cells don't have values
so you can just assume them to be zero here. You can use
python's word-to-number module to convert that string into a
number.
Machine Learning Tutorial Python - 5: Save
Model Using Joblib And Pickle
, codebasics
We will look into two different approaches of saving a trend model
to a file which you can use later on to load the model from a file
into memory and use that to make actual predictions. solving a
problem using machine learning consists of two steps. Typically,
the first step is training a model using your training data set and
the second step is to ask your questions to the trained model
which sort of looks like a human brain. the difference between job
lib api and pickle Api is that job lib can take the file name directly.
So I have my model and I want to save that model to a file which
is using sk learns job lib.. If your model consists of large numpy
arrays, then using joblib might be more efficient, but essentially it
gives you the same functionality. you can save your model. using
joblib and pickle into a file using these modules. it 's saving all
these essential pieces for your model. I have gone through linear
regression models today, but you can pretty much save any other
kind of machine learning models using these two awesome
modules.
Machine Learning Tutorial Python - 6:
Dummy Variables & One Hot Encoding
codebasics
We are going to continue our linear regression tutorial series with
the discussion of categorical and dummy variables as well as one
hot encoding as usual. in categorical variables. There are two
types. First is nominal and ordinal, where the categories have
some sort of numerical ordering in between them.. we are going
to use this one hot encoding technique to solve our problem.
these extra variables which are created they are also called
dummy variables.. Pandas has this method called get dummies,
which will return the dummy variable columns. the rule of the
thumb is you have to drop one of the dummy variables columns,
so we are dropping two things from our merge data frame. the
most interesting part which is doing a prediction. First thing that I
want to predict is price of a 2800 square feet home in Robinsville
let 's see how my x looks. And as per that I I need to supply the
parameter so my X has first is area. The second one is Monroe
township, and third one is Robin 's field, so my second parameter
needs to be..
is Machine Learning?
Codebasics
There are certain tasks where computers are really better than
humans such as driving the car. Natural language conversation is
also an area where humans outperform machines. Machine
learning tries to make computers better at things where
traditionally humans were outperforming machines. We make
machines learn things like humans do so the question is Why
humans are better in driving the cars and having a conversation ?
Machine learning is a science of field in computer science where
we use various techniques and deep learning is one of them.
Machine learning has a big implication on our real life. The next
tutorial we are going to write some Python code to make some
predictions using linear regression. We will also learn how to
make predictions using a simple linear regression technique.
Machine Learning Tutorial Python - 2:
Linear Regression Single Variable
codebasics
today we are going to write python code to predict home prices
using a machine learning technique called simple linear
regression in this table. The prices of home based on the area of
that home in my neighbourhood in Monroe township new jersey
using this data i will build a machine. model that can tell me the
prices of the homes whose area is 3 300 square feet and 5 000
square feet you can plot available prices and areas in form of a
scatter plot. Plotting a scatter plot to get an idea on the
distribution of my data point. I recommend you watching my
tutorials on pandas because pandas are going to be extremely
useful in your machine learning journey. Once I have a data frame
I will now go ahead and use the linear regression model. Using a
read csv file, you can create a data frame and export the value to
prediction. csv. Once you have this model built in you can apply
this model on a huge csv. file and come up with a list of
predictions now going back to our original example so let me go
back again.
,A simple linear regression model was all about building a simple
linear model using one variable. In the future, we are going to
cover a little more complex linear regression models in the future.
i highly recommend that you do the exercise because just by
watching the video you will not probably learn that much I mean
you'll learn something but it's not very effective so it's better that
you. do some practice as well.
Machine Learning Tutorial Python - 3:
Linear Regression Multiple Variables
codebasics
We are going to look into linear regression with multiple variables
also known as multivariate regression using this. Using this we
will predict the home prices in Monroe township new jersey here
in this table I have various metrics available such as area and
bedroom age and these are the factors that the ultimate price
depends on in the previous tutorial, we looked at simple linear
regression. Pandas are extremely useful while doing machine
learning so I highly recommend that if you don't know about it
already okay. I have done here is imported the necessary
modules and then I am going to load my data into pandas data
frame home prices dot csv. I will say median bedrooms are equal
to a matte dot floor and the medium bedrooms would be three
okays. The model is now ready once it is ready it's a good idea to
take a look at the coefficients I got was this uh just to summarize
what these coefficients are in this equation m1 m2 m3 and m3
are coefficients so this is m1. The coefficients are based on the
area of bedrooms and age and my target variable is price.
Using this data you have to build a model for your hr department
where they can feed in experience and various scores and they
can get some idea of what kind of salary they need to offer to a
candidate now in this data set. You will find a few interesting
things first of all in experience these two cells don't have values
so you can just assume them to be zero here. You can use
python's word-to-number module to convert that string into a
number.
Machine Learning Tutorial Python - 5: Save
Model Using Joblib And Pickle
, codebasics
We will look into two different approaches of saving a trend model
to a file which you can use later on to load the model from a file
into memory and use that to make actual predictions. solving a
problem using machine learning consists of two steps. Typically,
the first step is training a model using your training data set and
the second step is to ask your questions to the trained model
which sort of looks like a human brain. the difference between job
lib api and pickle Api is that job lib can take the file name directly.
So I have my model and I want to save that model to a file which
is using sk learns job lib.. If your model consists of large numpy
arrays, then using joblib might be more efficient, but essentially it
gives you the same functionality. you can save your model. using
joblib and pickle into a file using these modules. it 's saving all
these essential pieces for your model. I have gone through linear
regression models today, but you can pretty much save any other
kind of machine learning models using these two awesome
modules.
Machine Learning Tutorial Python - 6:
Dummy Variables & One Hot Encoding
codebasics
We are going to continue our linear regression tutorial series with
the discussion of categorical and dummy variables as well as one
hot encoding as usual. in categorical variables. There are two
types. First is nominal and ordinal, where the categories have
some sort of numerical ordering in between them.. we are going
to use this one hot encoding technique to solve our problem.
these extra variables which are created they are also called
dummy variables.. Pandas has this method called get dummies,
which will return the dummy variable columns. the rule of the
thumb is you have to drop one of the dummy variables columns,
so we are dropping two things from our merge data frame. the
most interesting part which is doing a prediction. First thing that I
want to predict is price of a 2800 square feet home in Robinsville
let 's see how my x looks. And as per that I I need to supply the
parameter so my X has first is area. The second one is Monroe
township, and third one is Robin 's field, so my second parameter
needs to be..