From the course: Machine Learning with Scikit-Learn
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Linear regression using scikit-learn - scikit-learn Tutorial
From the course: Machine Learning with Scikit-Learn
Linear regression using scikit-learn
- [Instructor] How do you create a complex model using scikit-learn? An easy solution is to start with a simple model like linear regression and go from there. In this image, we see a best fit line for a bunch of points. In this video, I'll show you how you can create a linear regression model using scikit-learn. So that more complex models will be easier to create. The first thing you have to do is import the libraries that you want to use. In this case Matplotlib, Pandas, train_test_split, as well as the model LinearRegression. From there, you need to load a dataset. This particular data set shows that scikit-learn requires data to be free of missing values. The goal of this dataset is to use the feature column X to predict the target column Y. Notice it looks like we have a missing value here. This is really important. As in scikit-learn, you can't have missing values input into a model. The next step is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
What is supervised learning?54s
-
(Locked)
How to format data for scikit-learn1m 55s
-
(Locked)
Linear regression using scikit-learn4m 32s
-
(Locked)
Train test split1m 53s
-
(Locked)
Logistic regression using scikit-learn3m 55s
-
(Locked)
Logistic regression for multiclass classification3m 36s
-
Decision trees using scikit-learn3m 9s
-
(Locked)
How to visualize decision trees using Matplotlib2m 5s
-
(Locked)
Bagged trees using scikit-learn2m
-
(Locked)
Random forests using scikit-learn2m 41s
-
(Locked)
Which machine learning model should you use?1m 23s
-
-
-