from sklearn.linear_model import LinearRegression, Ridge
from sklearn.linear_model import Lasso, ElasticNet
from sklearn.datasets import make_regression
X, y, true_coef = make_regression(n_samples = 50, n_features = 10,
n_informative = 5, noise = 5,
coef = True, random_state = 42)
lm = LinearRegression().fit(X, y)
ridge = Ridge(alpha=1.0).fit(X, y)
lasso = Lasso(alpha=1.0).fit(X, y)
enet = ElasticNet(alpha=1.0, l1_ratio=0.5).fit(X, y)