2

It affects anything optimized by a form of gradient descent, because it affects the relative scale of the dimensions of the input. If A is generally 1000x larger than B, then changing B's coefficient by some amount is in a sense a 1000x bigger move. In theory this won't matter but in practice it can cause the gradient descent to have trouble landing in the ...


1

You generally shouldn't apply resampling to the test set (although there are some differing opinions on whether to do so on various levels of validation data). imblearn has its own version of the pipeline to accomplish this; in particular, the pipeline docs say: The samplers are only applied during fit.


1

The error is self-explanatory. You provide the model with only 3 features whereas it needs 12 features. In model.py you select 3 features from the dataset, indeed. However, you apply one-hot encoding that creates new columns. Each new column describes only one category and contains values 0 and 1: whether this category is observed in a sample or not. And the ...


1

import numpy as np from xgboost import XGBRegressor x_train = np.array([[1], [2], [3], [4]]) y_train = np.array([[0], [0.25], [0.75], [1]]) model = XGBRegressor() model.fit(x_train, y_train) print(model.objective)


Only top voted, non community-wiki answers of a minimum length are eligible