Loading topic
.shape attribute, and pandas DataFrames. It also assumes you know what supervised learning is. The previous 6 min readX and a label vector y are, and have seen fit, predict, and score once. The goal is to separate the two main kinds of target and to see how the kind of y changes the estimator you pick, the metric `score5 min readX is, and know that estimators expect arrays of numbers. It covers how to tell numeric columns from categorical ones, why scikit-learn estimators need the difference made explicit, and how to encode each kind saf6 min readfit, predict and score do on an estimator. It covers why a model needs data it never trained on, how train_test_split produces that data, and which arguments change the result.5 min readX_train, X_test, y_train, and y_test. It covers what scikit-learn calls an estimator, what fit does, and the errors people hit most often when calling it.5 min readX and a label vector y, split them with train_test_split, and call fit on an estimator. It covers what happens after fitting: asking the model for predictions, reading probabilities, and measuring quality with score.4 min readpredict and score on held-out data. It also assumes you know that X is a 2D feature matrix and y is a 1D label vector. Every scikit-learn estimator keeps two kinds of state, and they have different owners. You, the programmer, choose the5 min readX and returns a new matrix, usually with the same number of rows. Scalers, encoders, imputers, and feature selectors are all transformers. This chapter covers the transformer interface, the rea6 min readtrain_test_split, the fit and transform methods of a transformer, and the basic shape 5 min readfit, transform, and predict methods, the difference between hyperparameters and fitted attributes (names ending in an underscore), and why a scaler must learn its statistics from training data only. It builds on those ideas to show how Pipeline enforces them5 min readPipeline chains steps, how a transformer's fit and transform differ, and how to index a pandas DataFrame by column name. The examples use scikit-learn 1.2 or newer.5 min readPipeline, how to read the output, and where it can mislead you.5 min readPipeline at a basic level. Here you will learn how scikit-learn exposes an estimator's config5 min readPipeline, you know that fit learns from training data and transform applies what was learned, and you are comfortable with Python classes. You will write transformers that follow scikit-learn's estimator conventions. Because they follow those conventions, the4 min read