Loading topic
fit, transform and predict on built-in scikit-learn estimators. It covers which base classes to inherit from, what each one gives you, and what you still have to write yourself.2 min readfit, transform and GridSearchCV with built-in estimators. It covers the rules for __init__ in a custom estimator and the reasons behind them.2 min read__init__ only stores its arguments.2 min readfit and transform work and why learned attributes end with an underscore. It covers the checks an estimator should run before it computes anything.2 min readfit/transform pattern from built-in scikit-learn transformers. It also assumes you have read the earlier chapters on BaseEstimator, constructor rules, and learned attributes. Here you put those rules together in one working 2 min readPipeline, and that you have seen the fit and transform contract. It also assumes you can write a small Python function. You do not need to have written a custom class yet.2 min readfit/predict pattern. It also assumes you have seen BaseEstimator and the constructor rules from earlier chapters. Here you build a small classifier that works with score, cross_val_score, and pipelines.2 min readBaseEstimator and TransformerMixin. It also assumes you know the fit, transform and predict methods, and that you have used Pipeline before. Here you will plug the QuantileClipper from the previous chapters into both containers.2 min readBaseEstimator, and that you know what Pipeline and cross-validation do. Here you will see why the constructor rules matter. Grid search relies on them completely.2 min readBaseEstimator and TransformerMixin, and that you have used a Pipeline and ColumnTransformer. It shows how to make your transformer report column names and return a pandas DataFrame on request.2 min readBaseEstimator and TransformerMixin. It also assumes you know the constructor rule (store arguments unchanged) and the trailing-underscore rule for learned attributes. Here you will test those conventions automatically instead of by eye2 min readBaseEstimator and TransformerMixin. It also assumes you know check_estimator and how Pipeline passes data between steps. The code targets scikit-learn 1.6 or later.2 min readBaseEstimator and TransformerMixin. It also assumes you know how Pipeline and GridSearchCV clone and fit estimators. Most bugs in custom estimators come from breaking a convention that those tools rely on. The errors often appea2 min read