Loading topic
describe). It also assumes you have numpy, pandas, matplotlib and scikit-learn installed, and that you know what a feature and a target ar2 min readdescribe(). You also need matplotlib and a loaded copy of the California housing data from the previous chapter. The goal is to spot problems that will affect modeling decisions later. It is not to produce polished charts2 min readtrain_test_split. It also assumes you know what a feature and a target are.2 min readtrain_test_split, you know why a test set must stay untouched, and you have seen the idea of data leakage from the previous chapter. You should also be comfortable with pandas DataFrames and with calling fit and predict on a scikit-learn estimator.3 min readrandom_state=42, and measured a baseline MAE with DummyRegressor. It also assumes you know why scaling belongs inside a pipeline, which the pre3 min readrandom_state=42, and set a baseline. It also assumes you know how a scikit-learn pipeline works. If you skipped those steps, run the earlier chapters' code first so that X_train, y_train, and df ex2 min readX_train, y_train, X_test, y_test), a mean baseline, and a Ridge pipeline scored with 5-fold cross-validation. You should also know what MAE is. Here you add a second model and compare it to Ridge on equal terms.3 min readX_train, X_test, y_train, y_test), know how cross_val_score works, and have a gradient boosting score from cross-validation to compare against. The test set stays untouched here.2 min readHistGradientBoostingRegressor. Here you spend the test set for the first time.2 min readbest_model from the grid search, the X_test and y_test split, and a working knowledge of pandas and scikit-learn. After the final evaluation, a natural question follows: which inputs does the model actually rely on? Permutation importance answers it for a2 min readbest_model and the split data (X, X_test) already exist from the earlier chapters, and that you know how to call fit and predict.3 min read