Luyện tập câu hỏi phỏng vấn Machine Learning bằng Python
Lisa Stuart
Data Scientist






| Chuẩn hoá | L1 (Lasso) | L2 (Ridge) |
|---|---|---|
| phạt | tổng giá trị tuyệt đối hệ số | tổng bình phương hệ số |
| nghiệm | thưa (sparse) | không thưa |
| số nghiệm | nhiều | một |
| chọn đặc trưng | có | không |
| bền với ngoại lệ? | có | không |
| mẫu hình phức tạp? | không | có |

| Đặc trưng | CHAS | NOX | RM |
|---|---|---|---|
| Ước lượng hệ số | 2.7 | -17.8 | 3.8 |
| Hệ số đã chuẩn hoá | 0 | 0 | 0.95 |
# Lasso estimator
sklearn.linear_model.Lasso
# Lasso estimator with cross-validation
sklearn.linear_model.LassoCV
# Ridge estimator
sklearn.linear_model.Ridge
# Ridge estimator with cross-validation
sklearn.linear_model.RidgeCV
# ElasticNet estimator
sklearn.linear_model.ElasticNet
# ElasticNet estimator with cross-validation
sklearn.linear_model.ElasticNetCV
# Train/test split
sklearn.model_selection.train_test_split
# Mean squared error
sklearn.metrics.mean_squared_error(y_test,
predict(X_test))
# Best regularization parameter
mod_cv.alpha_
# Array of log values
alphas=np.logspace(-6, 6, 13)
Luyện tập câu hỏi phỏng vấn Machine Learning bằng Python