-
Book Overview & Buying
-
Table Of Contents
scikit-learn Cookbook - Third Edition
By :
Linear models serve as the backbone for many predictive modeling techniques, offering an upfront approach to understanding relationships between variables. This recipe provides a foundation for understanding more complex linear techniques and their importance in predictive modeling, setting the stage for advanced topics such as regularized regression and logistic regression.
To get started, you'll notice that we're taking a familiar approach used in Chapter 4 by creating a synthetic dataset to demonstrate the concepts of linear models and regularization. scikit-learn provides a function called make_regression() that creates a synthetic regression dataset which we can further refine to create a more interesting dataset that includes some noise to make it more challenging.
Load libraries:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import make_regressionCreate synthetic regression dataset...