snowflake-ml-python 1.6.3__py3-none-any.whl → 1.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- snowflake/ml/_internal/telemetry.py +4 -2
- snowflake/ml/_internal/utils/import_utils.py +31 -0
- snowflake/ml/_internal/utils/snowpark_dataframe_utils.py +13 -0
- snowflake/ml/data/_internal/arrow_ingestor.py +8 -0
- snowflake/ml/data/data_connector.py +1 -1
- snowflake/ml/data/torch_utils.py +33 -14
- snowflake/ml/feature_store/examples/airline_features/features/plane_features.py +5 -3
- snowflake/ml/feature_store/examples/airline_features/features/weather_features.py +7 -5
- snowflake/ml/feature_store/examples/citibike_trip_features/features/station_feature.py +4 -2
- snowflake/ml/feature_store/examples/citibike_trip_features/features/trip_feature.py +3 -1
- snowflake/ml/feature_store/examples/example_helper.py +6 -3
- snowflake/ml/feature_store/examples/new_york_taxi_features/features/location_features.py +4 -2
- snowflake/ml/feature_store/examples/new_york_taxi_features/features/trip_features.py +4 -2
- snowflake/ml/feature_store/examples/wine_quality_features/features/managed_wine_features.py +3 -1
- snowflake/ml/feature_store/examples/wine_quality_features/features/static_wine_features.py +3 -1
- snowflake/ml/feature_store/feature_store.py +1 -2
- snowflake/ml/feature_store/feature_view.py +5 -1
- snowflake/ml/model/_client/model/model_version_impl.py +144 -10
- snowflake/ml/model/_client/ops/model_ops.py +25 -6
- snowflake/ml/model/_client/ops/service_ops.py +33 -28
- snowflake/ml/model/_client/service/model_deployment_spec.py +19 -8
- snowflake/ml/model/_client/service/model_deployment_spec_schema.py +3 -1
- snowflake/ml/model/_client/sql/model.py +14 -0
- snowflake/ml/model/_client/sql/service.py +6 -18
- snowflake/ml/model/_model_composer/model_composer.py +2 -0
- snowflake/ml/model/_model_composer/model_manifest/model_manifest.py +4 -0
- snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +1 -0
- snowflake/ml/model/_model_composer/model_method/model_method.py +1 -1
- snowflake/ml/model/_packager/model_handlers/_utils.py +5 -1
- snowflake/ml/model/_packager/model_handlers/catboost.py +3 -6
- snowflake/ml/model/_packager/model_handlers/custom.py +2 -0
- snowflake/ml/model/_packager/model_handlers/huggingface_pipeline.py +10 -1
- snowflake/ml/model/_packager/model_handlers/lightgbm.py +3 -6
- snowflake/ml/model/_packager/model_handlers/sentence_transformers.py +8 -1
- snowflake/ml/model/_packager/model_handlers/sklearn.py +3 -6
- snowflake/ml/model/_packager/model_handlers/snowmlmodel.py +7 -65
- snowflake/ml/model/_packager/model_handlers/xgboost.py +10 -40
- snowflake/ml/model/_packager/model_packager.py +0 -11
- snowflake/ml/model/_packager/{model_handlers/model_objective_utils.py → model_task/model_task_utils.py} +13 -25
- snowflake/ml/model/_signatures/pandas_handler.py +16 -0
- snowflake/ml/model/custom_model.py +47 -7
- snowflake/ml/model/model_signature.py +2 -0
- snowflake/ml/model/type_hints.py +8 -0
- snowflake/ml/modeling/_internal/estimator_utils.py +13 -0
- snowflake/ml/modeling/_internal/local_implementations/pandas_handlers.py +7 -2
- snowflake/ml/modeling/_internal/snowpark_implementations/distributed_hpo_trainer.py +16 -5
- snowflake/ml/modeling/_internal/snowpark_implementations/snowpark_handlers.py +8 -2
- snowflake/ml/modeling/_internal/snowpark_implementations/snowpark_trainer.py +9 -3
- snowflake/ml/modeling/calibration/calibrated_classifier_cv.py +1 -8
- snowflake/ml/modeling/cluster/agglomerative_clustering.py +17 -19
- snowflake/ml/modeling/cluster/dbscan.py +5 -2
- snowflake/ml/modeling/cluster/feature_agglomeration.py +7 -19
- snowflake/ml/modeling/cluster/k_means.py +14 -19
- snowflake/ml/modeling/cluster/mini_batch_k_means.py +3 -3
- snowflake/ml/modeling/cluster/optics.py +6 -6
- snowflake/ml/modeling/cluster/spectral_clustering.py +4 -3
- snowflake/ml/modeling/compose/column_transformer.py +15 -5
- snowflake/ml/modeling/compose/transformed_target_regressor.py +7 -6
- snowflake/ml/modeling/covariance/elliptic_envelope.py +1 -1
- snowflake/ml/modeling/covariance/graphical_lasso_cv.py +1 -1
- snowflake/ml/modeling/covariance/min_cov_det.py +2 -2
- snowflake/ml/modeling/covariance/oas.py +1 -1
- snowflake/ml/modeling/decomposition/kernel_pca.py +2 -2
- snowflake/ml/modeling/decomposition/mini_batch_dictionary_learning.py +5 -12
- snowflake/ml/modeling/decomposition/mini_batch_sparse_pca.py +5 -12
- snowflake/ml/modeling/decomposition/pca.py +28 -15
- snowflake/ml/modeling/discriminant_analysis/linear_discriminant_analysis.py +6 -0
- snowflake/ml/modeling/ensemble/ada_boost_classifier.py +1 -12
- snowflake/ml/modeling/ensemble/ada_boost_regressor.py +1 -11
- snowflake/ml/modeling/ensemble/bagging_classifier.py +1 -8
- snowflake/ml/modeling/ensemble/bagging_regressor.py +1 -8
- snowflake/ml/modeling/ensemble/extra_trees_classifier.py +21 -2
- snowflake/ml/modeling/ensemble/extra_trees_regressor.py +18 -2
- snowflake/ml/modeling/ensemble/gradient_boosting_classifier.py +2 -0
- snowflake/ml/modeling/ensemble/gradient_boosting_regressor.py +2 -0
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_classifier.py +21 -8
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_regressor.py +21 -11
- snowflake/ml/modeling/ensemble/random_forest_classifier.py +21 -2
- snowflake/ml/modeling/ensemble/random_forest_regressor.py +18 -2
- snowflake/ml/modeling/feature_selection/generic_univariate_select.py +2 -1
- snowflake/ml/modeling/feature_selection/sequential_feature_selector.py +5 -3
- snowflake/ml/modeling/kernel_ridge/kernel_ridge.py +2 -2
- snowflake/ml/modeling/linear_model/ard_regression.py +5 -10
- snowflake/ml/modeling/linear_model/bayesian_ridge.py +5 -11
- snowflake/ml/modeling/linear_model/elastic_net.py +3 -0
- snowflake/ml/modeling/linear_model/elastic_net_cv.py +1 -1
- snowflake/ml/modeling/linear_model/lars.py +0 -10
- snowflake/ml/modeling/linear_model/lars_cv.py +1 -11
- snowflake/ml/modeling/linear_model/lasso_cv.py +1 -1
- snowflake/ml/modeling/linear_model/lasso_lars.py +0 -10
- snowflake/ml/modeling/linear_model/lasso_lars_cv.py +1 -11
- snowflake/ml/modeling/linear_model/lasso_lars_ic.py +0 -10
- snowflake/ml/modeling/linear_model/logistic_regression.py +28 -22
- snowflake/ml/modeling/linear_model/logistic_regression_cv.py +30 -24
- snowflake/ml/modeling/linear_model/multi_task_elastic_net_cv.py +1 -1
- snowflake/ml/modeling/linear_model/multi_task_lasso_cv.py +1 -1
- snowflake/ml/modeling/linear_model/orthogonal_matching_pursuit.py +4 -13
- snowflake/ml/modeling/linear_model/passive_aggressive_classifier.py +4 -4
- snowflake/ml/modeling/linear_model/passive_aggressive_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/perceptron.py +3 -3
- snowflake/ml/modeling/linear_model/ransac_regressor.py +3 -2
- snowflake/ml/modeling/linear_model/ridge_classifier_cv.py +14 -6
- snowflake/ml/modeling/linear_model/ridge_cv.py +17 -11
- snowflake/ml/modeling/linear_model/sgd_classifier.py +2 -2
- snowflake/ml/modeling/linear_model/sgd_one_class_svm.py +5 -1
- snowflake/ml/modeling/linear_model/sgd_regressor.py +12 -3
- snowflake/ml/modeling/manifold/isomap.py +1 -1
- snowflake/ml/modeling/manifold/mds.py +3 -3
- snowflake/ml/modeling/manifold/tsne.py +10 -4
- snowflake/ml/modeling/metrics/classification.py +12 -16
- snowflake/ml/modeling/metrics/ranking.py +3 -3
- snowflake/ml/modeling/metrics/regression.py +3 -3
- snowflake/ml/modeling/naive_bayes/bernoulli_nb.py +3 -3
- snowflake/ml/modeling/naive_bayes/categorical_nb.py +3 -3
- snowflake/ml/modeling/naive_bayes/complement_nb.py +3 -3
- snowflake/ml/modeling/naive_bayes/multinomial_nb.py +3 -3
- snowflake/ml/modeling/neighbors/k_neighbors_classifier.py +10 -4
- snowflake/ml/modeling/neighbors/k_neighbors_regressor.py +5 -2
- snowflake/ml/modeling/neighbors/local_outlier_factor.py +2 -2
- snowflake/ml/modeling/neighbors/nearest_centroid.py +7 -14
- snowflake/ml/modeling/neighbors/nearest_neighbors.py +1 -1
- snowflake/ml/modeling/neighbors/radius_neighbors_classifier.py +6 -1
- snowflake/ml/modeling/neighbors/radius_neighbors_regressor.py +1 -1
- snowflake/ml/modeling/neural_network/mlp_classifier.py +7 -1
- snowflake/ml/modeling/neural_network/mlp_regressor.py +3 -0
- snowflake/ml/modeling/pipeline/pipeline.py +16 -14
- snowflake/ml/modeling/preprocessing/one_hot_encoder.py +8 -4
- snowflake/ml/modeling/preprocessing/ordinal_encoder.py +9 -7
- snowflake/ml/modeling/svm/linear_svc.py +25 -16
- snowflake/ml/modeling/svm/linear_svr.py +23 -17
- snowflake/ml/modeling/svm/nu_svc.py +5 -3
- snowflake/ml/modeling/svm/nu_svr.py +3 -1
- snowflake/ml/modeling/svm/svc.py +9 -5
- snowflake/ml/modeling/svm/svr.py +3 -1
- snowflake/ml/modeling/tree/decision_tree_classifier.py +21 -2
- snowflake/ml/modeling/tree/decision_tree_regressor.py +18 -2
- snowflake/ml/modeling/tree/extra_tree_classifier.py +28 -9
- snowflake/ml/modeling/tree/extra_tree_regressor.py +18 -2
- snowflake/ml/monitoring/_client/{monitor_sql_client.py → model_monitor_sql_client.py} +1 -1
- snowflake/ml/monitoring/{_client → _manager}/model_monitor_manager.py +9 -8
- snowflake/ml/monitoring/{_client/model_monitor.py → model_monitor.py} +3 -3
- snowflake/ml/registry/_manager/model_manager.py +15 -1
- snowflake/ml/registry/registry.py +15 -8
- snowflake/ml/version.py +1 -1
- {snowflake_ml_python-1.6.3.dist-info → snowflake_ml_python-1.7.0.dist-info}/METADATA +81 -9
- {snowflake_ml_python-1.6.3.dist-info → snowflake_ml_python-1.7.0.dist-info}/RECORD +150 -150
- {snowflake_ml_python-1.6.3.dist-info → snowflake_ml_python-1.7.0.dist-info}/WHEEL +1 -1
- /snowflake/ml/monitoring/{_client/model_monitor_version.py → model_monitor_version.py} +0 -0
- {snowflake_ml_python-1.6.3.dist-info → snowflake_ml_python-1.7.0.dist-info}/LICENSE.txt +0 -0
- {snowflake_ml_python-1.6.3.dist-info → snowflake_ml_python-1.7.0.dist-info}/top_level.txt +0 -0
@@ -124,14 +124,6 @@ class LassoLars(BaseTransformer):
|
|
124
124
|
verbose: bool or int, default=False
|
125
125
|
Sets the verbosity amount.
|
126
126
|
|
127
|
-
normalize: bool, default=False
|
128
|
-
This parameter is ignored when ``fit_intercept`` is set to False.
|
129
|
-
If True, the regressors X will be normalized before regression by
|
130
|
-
subtracting the mean and dividing by the l2-norm.
|
131
|
-
If you wish to standardize, please use
|
132
|
-
:class:`~sklearn.preprocessing.StandardScaler` before calling ``fit``
|
133
|
-
on an estimator with ``normalize=False``.
|
134
|
-
|
135
127
|
precompute: bool, 'auto' or array-like, default='auto'
|
136
128
|
Whether to use a precomputed Gram matrix to speed up
|
137
129
|
calculations. If set to ``'auto'`` let us decide. The Gram
|
@@ -183,7 +175,6 @@ class LassoLars(BaseTransformer):
|
|
183
175
|
alpha=1.0,
|
184
176
|
fit_intercept=True,
|
185
177
|
verbose=False,
|
186
|
-
normalize="deprecated",
|
187
178
|
precompute="auto",
|
188
179
|
max_iter=500,
|
189
180
|
eps=2.220446049250313e-16,
|
@@ -216,7 +207,6 @@ class LassoLars(BaseTransformer):
|
|
216
207
|
init_args = {'alpha':(alpha, 1.0, False),
|
217
208
|
'fit_intercept':(fit_intercept, True, False),
|
218
209
|
'verbose':(verbose, False, False),
|
219
|
-
'normalize':(normalize, "deprecated", False),
|
220
210
|
'precompute':(precompute, "auto", False),
|
221
211
|
'max_iter':(max_iter, 500, False),
|
222
212
|
'eps':(eps, 2.220446049250313e-16, False),
|
@@ -120,14 +120,6 @@ class LassoLarsCV(BaseTransformer):
|
|
120
120
|
max_iter: int, default=500
|
121
121
|
Maximum number of iterations to perform.
|
122
122
|
|
123
|
-
normalize: bool, default=False
|
124
|
-
This parameter is ignored when ``fit_intercept`` is set to False.
|
125
|
-
If True, the regressors X will be normalized before regression by
|
126
|
-
subtracting the mean and dividing by the l2-norm.
|
127
|
-
If you wish to standardize, please use
|
128
|
-
:class:`~sklearn.preprocessing.StandardScaler` before calling ``fit``
|
129
|
-
on an estimator with ``normalize=False``.
|
130
|
-
|
131
123
|
precompute: bool or 'auto' , default='auto'
|
132
124
|
Whether to use a precomputed Gram matrix to speed up
|
133
125
|
calculations. If set to ``'auto'`` let us decide. The Gram matrix
|
@@ -142,7 +134,7 @@ class LassoLarsCV(BaseTransformer):
|
|
142
134
|
- :term:`CV splitter`,
|
143
135
|
- An iterable yielding (train, test) splits as arrays of indices.
|
144
136
|
|
145
|
-
For integer/None inputs, :class
|
137
|
+
For integer/None inputs, :class:`~sklearn.model_selection.KFold` is used.
|
146
138
|
|
147
139
|
Refer :ref:`User Guide <cross_validation>` for the various
|
148
140
|
cross-validation strategies that can be used here.
|
@@ -186,7 +178,6 @@ class LassoLarsCV(BaseTransformer):
|
|
186
178
|
fit_intercept=True,
|
187
179
|
verbose=False,
|
188
180
|
max_iter=500,
|
189
|
-
normalize="deprecated",
|
190
181
|
precompute="auto",
|
191
182
|
cv=None,
|
192
183
|
max_n_alphas=1000,
|
@@ -218,7 +209,6 @@ class LassoLarsCV(BaseTransformer):
|
|
218
209
|
init_args = {'fit_intercept':(fit_intercept, True, False),
|
219
210
|
'verbose':(verbose, False, False),
|
220
211
|
'max_iter':(max_iter, 500, False),
|
221
|
-
'normalize':(normalize, "deprecated", False),
|
222
212
|
'precompute':(precompute, "auto", False),
|
223
213
|
'cv':(cv, None, False),
|
224
214
|
'max_n_alphas':(max_n_alphas, 1000, False),
|
@@ -120,14 +120,6 @@ class LassoLarsIC(BaseTransformer):
|
|
120
120
|
verbose: bool or int, default=False
|
121
121
|
Sets the verbosity amount.
|
122
122
|
|
123
|
-
normalize: bool, default=False
|
124
|
-
This parameter is ignored when ``fit_intercept`` is set to False.
|
125
|
-
If True, the regressors X will be normalized before regression by
|
126
|
-
subtracting the mean and dividing by the l2-norm.
|
127
|
-
If you wish to standardize, please use
|
128
|
-
:class:`~sklearn.preprocessing.StandardScaler` before calling ``fit``
|
129
|
-
on an estimator with ``normalize=False``.
|
130
|
-
|
131
123
|
precompute: bool, 'auto' or array-like, default='auto'
|
132
124
|
Whether to use a precomputed Gram matrix to speed up
|
133
125
|
calculations. If set to ``'auto'`` let us decide. The Gram
|
@@ -171,7 +163,6 @@ class LassoLarsIC(BaseTransformer):
|
|
171
163
|
criterion="aic",
|
172
164
|
fit_intercept=True,
|
173
165
|
verbose=False,
|
174
|
-
normalize="deprecated",
|
175
166
|
precompute="auto",
|
176
167
|
max_iter=500,
|
177
168
|
eps=2.220446049250313e-16,
|
@@ -202,7 +193,6 @@ class LassoLarsIC(BaseTransformer):
|
|
202
193
|
init_args = {'criterion':(criterion, "aic", False),
|
203
194
|
'fit_intercept':(fit_intercept, True, False),
|
204
195
|
'verbose':(verbose, False, False),
|
205
|
-
'normalize':(normalize, "deprecated", False),
|
206
196
|
'precompute':(precompute, "auto", False),
|
207
197
|
'max_iter':(max_iter, 500, False),
|
208
198
|
'eps':(eps, 2.220446049250313e-16, False),
|
@@ -118,8 +118,9 @@ class LogisticRegression(BaseTransformer):
|
|
118
118
|
- `'elasticnet'`: both L1 and L2 penalty terms are added.
|
119
119
|
|
120
120
|
dual: bool, default=False
|
121
|
-
Dual or primal
|
122
|
-
|
121
|
+
Dual (constrained) or primal (regularized, see also
|
122
|
+
:ref:`this equation <regularized-logistic-loss>`) formulation. Dual formulation
|
123
|
+
is only implemented for l2 penalty with liblinear solver. Prefer dual=False when
|
123
124
|
n_samples > n_features.
|
124
125
|
|
125
126
|
tol: float, default=1e-4
|
@@ -167,24 +168,29 @@ class LogisticRegression(BaseTransformer):
|
|
167
168
|
Algorithm to use in the optimization problem. Default is 'lbfgs'.
|
168
169
|
To choose a solver, you might want to consider the following aspects:
|
169
170
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
171
|
+
- For small datasets, 'liblinear' is a good choice, whereas 'sag'
|
172
|
+
and 'saga' are faster for large ones;
|
173
|
+
- For multiclass problems, only 'newton-cg', 'sag', 'saga' and
|
174
|
+
'lbfgs' handle multinomial loss;
|
175
|
+
- 'liblinear' and 'newton-cholesky' can only handle binary classification
|
176
|
+
by default. To apply a one-versus-rest scheme for the multiclass setting
|
177
|
+
one can wrapt it with the `OneVsRestClassifier`.
|
178
|
+
- 'newton-cholesky' is a good choice for `n_samples` >> `n_features`,
|
179
|
+
especially with one-hot encoded categorical features with rare
|
180
|
+
categories. Be aware that the memory usage of this solver has a quadratic
|
181
|
+
dependency on `n_features` because it explicitly computes the Hessian
|
182
|
+
matrix.
|
183
|
+
|
184
|
+
================= ============================== ======================
|
185
|
+
solver penalty multinomial multiclass
|
186
|
+
================= ============================== ======================
|
187
|
+
'lbfgs' 'l2', None yes
|
188
|
+
'liblinear' 'l1', 'l2' no
|
189
|
+
'newton-cg' 'l2', None yes
|
190
|
+
'newton-cholesky' 'l2', None no
|
191
|
+
'sag' 'l2', None yes
|
192
|
+
'saga' 'elasticnet', 'l1', 'l2', None yes
|
193
|
+
================= ============================== ======================
|
188
194
|
|
189
195
|
max_iter: int, default=100
|
190
196
|
Maximum number of iterations taken for the solvers to converge.
|
@@ -235,7 +241,7 @@ class LogisticRegression(BaseTransformer):
|
|
235
241
|
random_state=None,
|
236
242
|
solver="lbfgs",
|
237
243
|
max_iter=100,
|
238
|
-
multi_class="
|
244
|
+
multi_class="deprecated",
|
239
245
|
verbose=0,
|
240
246
|
warm_start=False,
|
241
247
|
n_jobs=None,
|
@@ -271,7 +277,7 @@ class LogisticRegression(BaseTransformer):
|
|
271
277
|
'random_state':(random_state, None, False),
|
272
278
|
'solver':(solver, "lbfgs", False),
|
273
279
|
'max_iter':(max_iter, 100, False),
|
274
|
-
'multi_class':(multi_class, "
|
280
|
+
'multi_class':(multi_class, "deprecated", False),
|
275
281
|
'verbose':(verbose, 0, False),
|
276
282
|
'warm_start':(warm_start, False, False),
|
277
283
|
'n_jobs':(n_jobs, None, False),
|
@@ -127,8 +127,9 @@ class LogisticRegressionCV(BaseTransformer):
|
|
127
127
|
list of possible cross-validation objects.
|
128
128
|
|
129
129
|
dual: bool, default=False
|
130
|
-
Dual or primal
|
131
|
-
|
130
|
+
Dual (constrained) or primal (regularized, see also
|
131
|
+
:ref:`this equation <regularized-logistic-loss>`) formulation. Dual formulation
|
132
|
+
is only implemented for l2 penalty with liblinear solver. Prefer dual=False when
|
132
133
|
n_samples > n_features.
|
133
134
|
|
134
135
|
penalty: {'l1', 'l2', 'elasticnet'}, default='l2'
|
@@ -150,26 +151,31 @@ class LogisticRegressionCV(BaseTransformer):
|
|
150
151
|
Algorithm to use in the optimization problem. Default is 'lbfgs'.
|
151
152
|
To choose a solver, you might want to consider the following aspects:
|
152
153
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
154
|
+
- For small datasets, 'liblinear' is a good choice, whereas 'sag'
|
155
|
+
and 'saga' are faster for large ones;
|
156
|
+
- For multiclass problems, only 'newton-cg', 'sag', 'saga' and
|
157
|
+
'lbfgs' handle multinomial loss;
|
158
|
+
- 'liblinear' might be slower in :class:`LogisticRegressionCV`
|
159
|
+
because it does not handle warm-starting.
|
160
|
+
- 'liblinear' and 'newton-cholesky' can only handle binary classification
|
161
|
+
by default. To apply a one-versus-rest scheme for the multiclass setting
|
162
|
+
one can wrapt it with the `OneVsRestClassifier`.
|
163
|
+
- 'newton-cholesky' is a good choice for `n_samples` >> `n_features`,
|
164
|
+
especially with one-hot encoded categorical features with rare
|
165
|
+
categories. Be aware that the memory usage of this solver has a quadratic
|
166
|
+
dependency on `n_features` because it explicitly computes the Hessian
|
167
|
+
matrix.
|
168
|
+
|
169
|
+
================= ============================== ======================
|
170
|
+
solver penalty multinomial multiclass
|
171
|
+
================= ============================== ======================
|
172
|
+
'lbfgs' 'l2' yes
|
173
|
+
'liblinear' 'l1', 'l2' no
|
174
|
+
'newton-cg' 'l2' yes
|
175
|
+
'newton-cholesky' 'l2', no
|
176
|
+
'sag' 'l2', yes
|
177
|
+
'saga' 'elasticnet', 'l1', 'l2' yes
|
178
|
+
================= ============================== ======================
|
173
179
|
|
174
180
|
tol: float, default=1e-4
|
175
181
|
Tolerance for stopping criteria.
|
@@ -256,7 +262,7 @@ class LogisticRegressionCV(BaseTransformer):
|
|
256
262
|
verbose=0,
|
257
263
|
refit=True,
|
258
264
|
intercept_scaling=1.0,
|
259
|
-
multi_class="
|
265
|
+
multi_class="deprecated",
|
260
266
|
random_state=None,
|
261
267
|
l1_ratios=None,
|
262
268
|
input_cols: Optional[Union[str, Iterable[str]]] = None,
|
@@ -294,7 +300,7 @@ class LogisticRegressionCV(BaseTransformer):
|
|
294
300
|
'verbose':(verbose, 0, False),
|
295
301
|
'refit':(refit, True, False),
|
296
302
|
'intercept_scaling':(intercept_scaling, 1.0, False),
|
297
|
-
'multi_class':(multi_class, "
|
303
|
+
'multi_class':(multi_class, "deprecated", False),
|
298
304
|
'random_state':(random_state, None, False),
|
299
305
|
'l1_ratios':(l1_ratios, None, False),}
|
300
306
|
cleaned_up_init_args = validate_sklearn_args(
|
@@ -155,7 +155,7 @@ class MultiTaskElasticNetCV(BaseTransformer):
|
|
155
155
|
- :term:`CV splitter`,
|
156
156
|
- An iterable yielding (train, test) splits as arrays of indices.
|
157
157
|
|
158
|
-
For int/None inputs, :class
|
158
|
+
For int/None inputs, :class:`~sklearn.model_selection.KFold` is used.
|
159
159
|
|
160
160
|
Refer :ref:`User Guide <cross_validation>` for the various
|
161
161
|
cross-validation strategies that can be used here.
|
@@ -146,7 +146,7 @@ class MultiTaskLassoCV(BaseTransformer):
|
|
146
146
|
- :term:`CV splitter`,
|
147
147
|
- An iterable yielding (train, test) splits as arrays of indices.
|
148
148
|
|
149
|
-
For int/None inputs, :class
|
149
|
+
For int/None inputs, :class:`~sklearn.model_selection.KFold` is used.
|
150
150
|
|
151
151
|
Refer :ref:`User Guide <cross_validation>` for the various
|
152
152
|
cross-validation strategies that can be used here.
|
@@ -110,25 +110,18 @@ class OrthogonalMatchingPursuit(BaseTransformer):
|
|
110
110
|
If set, the response of predict(), transform() methods will not contain input columns.
|
111
111
|
|
112
112
|
n_nonzero_coefs: int, default=None
|
113
|
-
Desired number of non-zero entries in the solution.
|
114
|
-
|
113
|
+
Desired number of non-zero entries in the solution. Ignored if `tol` is set.
|
114
|
+
When `None` and `tol` is also `None`, this value is either set to 10% of
|
115
|
+
`n_features` or 1, whichever is greater.
|
115
116
|
|
116
117
|
tol: float, default=None
|
117
|
-
Maximum norm of the residual. If not None, overrides n_nonzero_coefs.
|
118
|
+
Maximum squared norm of the residual. If not None, overrides n_nonzero_coefs.
|
118
119
|
|
119
120
|
fit_intercept: bool, default=True
|
120
121
|
Whether to calculate the intercept for this model. If set
|
121
122
|
to false, no intercept will be used in calculations
|
122
123
|
(i.e. data is expected to be centered).
|
123
124
|
|
124
|
-
normalize: bool, default=False
|
125
|
-
This parameter is ignored when ``fit_intercept`` is set to False.
|
126
|
-
If True, the regressors X will be normalized before regression by
|
127
|
-
subtracting the mean and dividing by the l2-norm.
|
128
|
-
If you wish to standardize, please use
|
129
|
-
:class:`~sklearn.preprocessing.StandardScaler` before calling ``fit``
|
130
|
-
on an estimator with ``normalize=False``.
|
131
|
-
|
132
125
|
precompute: 'auto' or bool, default='auto'
|
133
126
|
Whether to use a precomputed Gram and Xy matrix to speed up
|
134
127
|
calculations. Improves performance when :term:`n_targets` or
|
@@ -142,7 +135,6 @@ class OrthogonalMatchingPursuit(BaseTransformer):
|
|
142
135
|
n_nonzero_coefs=None,
|
143
136
|
tol=None,
|
144
137
|
fit_intercept=True,
|
145
|
-
normalize="deprecated",
|
146
138
|
precompute="auto",
|
147
139
|
input_cols: Optional[Union[str, Iterable[str]]] = None,
|
148
140
|
output_cols: Optional[Union[str, Iterable[str]]] = None,
|
@@ -168,7 +160,6 @@ class OrthogonalMatchingPursuit(BaseTransformer):
|
|
168
160
|
init_args = {'n_nonzero_coefs':(n_nonzero_coefs, None, False),
|
169
161
|
'tol':(tol, None, False),
|
170
162
|
'fit_intercept':(fit_intercept, True, False),
|
171
|
-
'normalize':(normalize, "deprecated", False),
|
172
163
|
'precompute':(precompute, "auto", False),}
|
173
164
|
cleaned_up_init_args = validate_sklearn_args(
|
174
165
|
args=init_args,
|
@@ -119,18 +119,18 @@ class PassiveAggressiveClassifier(BaseTransformer):
|
|
119
119
|
max_iter: int, default=1000
|
120
120
|
The maximum number of passes over the training data (aka epochs).
|
121
121
|
It only impacts the behavior in the ``fit`` method, and not the
|
122
|
-
:meth
|
122
|
+
:meth:`~sklearn.linear_model.PassiveAggressiveClassifier.partial_fit` method.
|
123
123
|
|
124
124
|
tol: float or None, default=1e-3
|
125
125
|
The stopping criterion. If it is not None, the iterations will stop
|
126
126
|
when (loss > previous_loss - tol).
|
127
127
|
|
128
128
|
early_stopping: bool, default=False
|
129
|
-
Whether to use early stopping to terminate training when validation
|
129
|
+
Whether to use early stopping to terminate training when validation
|
130
130
|
score is not improving. If set to True, it will automatically set aside
|
131
131
|
a stratified fraction of training data as validation and terminate
|
132
|
-
training when validation score is not improving by at least tol for
|
133
|
-
n_iter_no_change consecutive epochs.
|
132
|
+
training when validation score is not improving by at least `tol` for
|
133
|
+
`n_iter_no_change` consecutive epochs.
|
134
134
|
|
135
135
|
validation_fraction: float, default=0.1
|
136
136
|
The proportion of training data to set aside as validation set for
|
@@ -119,7 +119,7 @@ class PassiveAggressiveRegressor(BaseTransformer):
|
|
119
119
|
max_iter: int, default=1000
|
120
120
|
The maximum number of passes over the training data (aka epochs).
|
121
121
|
It only impacts the behavior in the ``fit`` method, and not the
|
122
|
-
:meth
|
122
|
+
:meth:`~sklearn.linear_model.PassiveAggressiveRegressor.partial_fit` method.
|
123
123
|
|
124
124
|
tol: float or None, default=1e-3
|
125
125
|
The stopping criterion. If it is not None, the iterations will stop
|
@@ -157,11 +157,11 @@ class Perceptron(BaseTransformer):
|
|
157
157
|
See :term:`Glossary <random_state>`.
|
158
158
|
|
159
159
|
early_stopping: bool, default=False
|
160
|
-
Whether to use early stopping to terminate training when validation
|
160
|
+
Whether to use early stopping to terminate training when validation
|
161
161
|
score is not improving. If set to True, it will automatically set aside
|
162
162
|
a stratified fraction of training data as validation and terminate
|
163
|
-
training when validation score is not improving by at least tol for
|
164
|
-
n_iter_no_change consecutive epochs.
|
163
|
+
training when validation score is not improving by at least `tol` for
|
164
|
+
`n_iter_no_change` consecutive epochs.
|
165
165
|
|
166
166
|
validation_fraction: float, default=0.1
|
167
167
|
The proportion of training data to set aside as validation set for
|
@@ -133,10 +133,11 @@ class RANSACRegressor(BaseTransformer):
|
|
133
133
|
relative number `ceil(min_samples * X.shape[0])` for
|
134
134
|
`min_samples < 1`. This is typically chosen as the minimal number of
|
135
135
|
samples necessary to estimate the given `estimator`. By default a
|
136
|
-
|
136
|
+
:class:`~sklearn.linear_model.LinearRegression` estimator is assumed and
|
137
137
|
`min_samples` is chosen as ``X.shape[1] + 1``. This parameter is highly
|
138
138
|
dependent upon the model, so if a `estimator` other than
|
139
|
-
:class
|
139
|
+
:class:`~sklearn.linear_model.LinearRegression` is used, the user must
|
140
|
+
provide a value.
|
140
141
|
|
141
142
|
residual_threshold: float, default=None
|
142
143
|
Maximum residual for a data sample to be classified as an inlier.
|
@@ -117,6 +117,7 @@ class RidgeClassifierCV(BaseTransformer):
|
|
117
117
|
Alpha corresponds to ``1 / (2C)`` in other linear models such as
|
118
118
|
:class:`~sklearn.linear_model.LogisticRegression` or
|
119
119
|
:class:`~sklearn.svm.LinearSVC`.
|
120
|
+
If using Leave-One-Out cross-validation, alphas must be strictly positive.
|
120
121
|
|
121
122
|
fit_intercept: bool, default=True
|
122
123
|
Whether to calculate the intercept for this model. If set
|
@@ -124,9 +125,8 @@ class RidgeClassifierCV(BaseTransformer):
|
|
124
125
|
(i.e. data is expected to be centered).
|
125
126
|
|
126
127
|
scoring: str, callable, default=None
|
127
|
-
A string (see
|
128
|
-
|
129
|
-
``scorer(estimator, X, y)``.
|
128
|
+
A string (see :ref:`scoring_parameter`) or a scorer callable object /
|
129
|
+
function with signature ``scorer(estimator, X, y)``.
|
130
130
|
|
131
131
|
cv: int, cross-validation generator or an iterable, default=None
|
132
132
|
Determines the cross-validation splitting strategy.
|
@@ -148,7 +148,13 @@ class RidgeClassifierCV(BaseTransformer):
|
|
148
148
|
weights inversely proportional to class frequencies in the input data
|
149
149
|
as ``n_samples / (n_classes * np.bincount(y))``.
|
150
150
|
|
151
|
-
|
151
|
+
store_cv_results: bool, default=False
|
152
|
+
Flag indicating if the cross-validation results corresponding to
|
153
|
+
each alpha should be stored in the ``cv_results_`` attribute (see
|
154
|
+
below). This flag is only compatible with ``cv=None`` (i.e. using
|
155
|
+
Leave-One-Out Cross-Validation).
|
156
|
+
|
157
|
+
store_cv_values: bool
|
152
158
|
Flag indicating if the cross-validation values corresponding to
|
153
159
|
each alpha should be stored in the ``cv_values_`` attribute (see
|
154
160
|
below). This flag is only compatible with ``cv=None`` (i.e. using
|
@@ -163,7 +169,8 @@ class RidgeClassifierCV(BaseTransformer):
|
|
163
169
|
scoring=None,
|
164
170
|
cv=None,
|
165
171
|
class_weight=None,
|
166
|
-
|
172
|
+
store_cv_results=None,
|
173
|
+
store_cv_values="deprecated",
|
167
174
|
input_cols: Optional[Union[str, Iterable[str]]] = None,
|
168
175
|
output_cols: Optional[Union[str, Iterable[str]]] = None,
|
169
176
|
label_cols: Optional[Union[str, Iterable[str]]] = None,
|
@@ -190,7 +197,8 @@ class RidgeClassifierCV(BaseTransformer):
|
|
190
197
|
'scoring':(scoring, None, False),
|
191
198
|
'cv':(cv, None, False),
|
192
199
|
'class_weight':(class_weight, None, False),
|
193
|
-
'
|
200
|
+
'store_cv_results':(store_cv_results, None, False),
|
201
|
+
'store_cv_values':(store_cv_values, "deprecated", False),}
|
194
202
|
cleaned_up_init_args = validate_sklearn_args(
|
195
203
|
args=init_args,
|
196
204
|
klass=sklearn.linear_model.RidgeClassifierCV
|
@@ -117,7 +117,7 @@ class RidgeCV(BaseTransformer):
|
|
117
117
|
Alpha corresponds to ``1 / (2C)`` in other linear models such as
|
118
118
|
:class:`~sklearn.linear_model.LogisticRegression` or
|
119
119
|
:class:`~sklearn.svm.LinearSVC`.
|
120
|
-
If using Leave-One-Out cross-validation, alphas must be positive.
|
120
|
+
If using Leave-One-Out cross-validation, alphas must be strictly positive.
|
121
121
|
|
122
122
|
fit_intercept: bool, default=True
|
123
123
|
Whether to calculate the intercept for this model. If set
|
@@ -125,12 +125,10 @@ class RidgeCV(BaseTransformer):
|
|
125
125
|
(i.e. data is expected to be centered).
|
126
126
|
|
127
127
|
scoring: str, callable, default=None
|
128
|
-
A string (see
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
(i.e. when using leave-one-out cross-validation), and r2 score
|
133
|
-
otherwise.
|
128
|
+
A string (see :ref:`scoring_parameter`) or a scorer callable object /
|
129
|
+
function with signature ``scorer(estimator, X, y)``. If None, the
|
130
|
+
negative mean squared error if cv is 'auto' or None (i.e. when using
|
131
|
+
leave-one-out cross-validation), and r2 score otherwise.
|
134
132
|
|
135
133
|
cv: int, cross-validation generator or an iterable, default=None
|
136
134
|
Determines the cross-validation splitting strategy.
|
@@ -160,7 +158,7 @@ class RidgeCV(BaseTransformer):
|
|
160
158
|
The 'auto' mode is the default and is intended to pick the cheaper
|
161
159
|
option of the two depending on the shape of the training data.
|
162
160
|
|
163
|
-
|
161
|
+
store_cv_results: bool, default=False
|
164
162
|
Flag indicating if the cross-validation values corresponding to
|
165
163
|
each alpha should be stored in the ``cv_values_`` attribute (see
|
166
164
|
below). This flag is only compatible with ``cv=None`` (i.e. using
|
@@ -172,6 +170,12 @@ class RidgeCV(BaseTransformer):
|
|
172
170
|
settings: multiple prediction targets). When set to `True`, after
|
173
171
|
fitting, the `alpha_` attribute will contain a value for each target.
|
174
172
|
When set to `False`, a single alpha is used for all targets.
|
173
|
+
|
174
|
+
store_cv_values: bool
|
175
|
+
Flag indicating if the cross-validation values corresponding to
|
176
|
+
each alpha should be stored in the ``cv_values_`` attribute (see
|
177
|
+
below). This flag is only compatible with ``cv=None`` (i.e. using
|
178
|
+
Leave-One-Out Cross-Validation).
|
175
179
|
"""
|
176
180
|
|
177
181
|
def __init__( # type: ignore[no-untyped-def]
|
@@ -182,8 +186,9 @@ class RidgeCV(BaseTransformer):
|
|
182
186
|
scoring=None,
|
183
187
|
cv=None,
|
184
188
|
gcv_mode=None,
|
185
|
-
|
189
|
+
store_cv_results=None,
|
186
190
|
alpha_per_target=False,
|
191
|
+
store_cv_values="deprecated",
|
187
192
|
input_cols: Optional[Union[str, Iterable[str]]] = None,
|
188
193
|
output_cols: Optional[Union[str, Iterable[str]]] = None,
|
189
194
|
label_cols: Optional[Union[str, Iterable[str]]] = None,
|
@@ -210,8 +215,9 @@ class RidgeCV(BaseTransformer):
|
|
210
215
|
'scoring':(scoring, None, False),
|
211
216
|
'cv':(cv, None, False),
|
212
217
|
'gcv_mode':(gcv_mode, None, False),
|
213
|
-
'
|
214
|
-
'alpha_per_target':(alpha_per_target, False, False),
|
218
|
+
'store_cv_results':(store_cv_results, None, False),
|
219
|
+
'alpha_per_target':(alpha_per_target, False, False),
|
220
|
+
'store_cv_values':(store_cv_values, "deprecated", False),}
|
215
221
|
cleaned_up_init_args = validate_sklearn_args(
|
216
222
|
args=init_args,
|
217
223
|
klass=sklearn.linear_model.RidgeCV
|
@@ -207,10 +207,10 @@ class SGDClassifier(BaseTransformer):
|
|
207
207
|
The initial learning rate for the 'constant', 'invscaling' or
|
208
208
|
'adaptive' schedules. The default value is 0.0 as eta0 is not used by
|
209
209
|
the default schedule 'optimal'.
|
210
|
-
Values must be in the range `
|
210
|
+
Values must be in the range `[0.0, inf)`.
|
211
211
|
|
212
212
|
power_t: float, default=0.5
|
213
|
-
The exponent for inverse scaling learning rate
|
213
|
+
The exponent for inverse scaling learning rate.
|
214
214
|
Values must be in the range `(-inf, inf)`.
|
215
215
|
|
216
216
|
early_stopping: bool, default=False
|
@@ -122,10 +122,12 @@ class SGDOneClassSVM(BaseTransformer):
|
|
122
122
|
The maximum number of passes over the training data (aka epochs).
|
123
123
|
It only impacts the behavior in the ``fit`` method, and not the
|
124
124
|
`partial_fit`. Defaults to 1000.
|
125
|
+
Values must be in the range `[1, inf)`.
|
125
126
|
|
126
127
|
tol: float or None, default=1e-3
|
127
128
|
The stopping criterion. If it is not None, the iterations will stop
|
128
129
|
when (loss > previous_loss - tol). Defaults to 1e-3.
|
130
|
+
Values must be in the range `[0.0, inf)`.
|
129
131
|
|
130
132
|
shuffle: bool, default=True
|
131
133
|
Whether or not the training data should be shuffled after each epoch.
|
@@ -158,9 +160,11 @@ class SGDOneClassSVM(BaseTransformer):
|
|
158
160
|
The initial learning rate for the 'constant', 'invscaling' or
|
159
161
|
'adaptive' schedules. The default value is 0.0 as eta0 is not used by
|
160
162
|
the default schedule 'optimal'.
|
163
|
+
Values must be in the range `[0.0, inf)`.
|
161
164
|
|
162
165
|
power_t: float, default=0.5
|
163
|
-
The exponent for inverse scaling learning rate
|
166
|
+
The exponent for inverse scaling learning rate.
|
167
|
+
Values must be in the range `(-inf, inf)`.
|
164
168
|
|
165
169
|
warm_start: bool, default=False
|
166
170
|
When set to True, reuse the solution of the previous call to fit as
|
@@ -132,14 +132,15 @@ class SGDRegressor(BaseTransformer):
|
|
132
132
|
|
133
133
|
alpha: float, default=0.0001
|
134
134
|
Constant that multiplies the regularization term. The higher the
|
135
|
-
value, the stronger the regularization.
|
136
|
-
|
137
|
-
|
135
|
+
value, the stronger the regularization. Also used to compute the
|
136
|
+
learning rate when `learning_rate` is set to 'optimal'.
|
137
|
+
Values must be in the range `[0.0, inf)`.
|
138
138
|
|
139
139
|
l1_ratio: float, default=0.15
|
140
140
|
The Elastic Net mixing parameter, with 0 <= l1_ratio <= 1.
|
141
141
|
l1_ratio=0 corresponds to L2 penalty, l1_ratio=1 to L1.
|
142
142
|
Only used if `penalty` is 'elasticnet'.
|
143
|
+
Values must be in the range `[0.0, 1.0]`.
|
143
144
|
|
144
145
|
fit_intercept: bool, default=True
|
145
146
|
Whether the intercept should be estimated or not. If False, the
|
@@ -149,6 +150,7 @@ class SGDRegressor(BaseTransformer):
|
|
149
150
|
The maximum number of passes over the training data (aka epochs).
|
150
151
|
It only impacts the behavior in the ``fit`` method, and not the
|
151
152
|
:meth:`partial_fit` method.
|
153
|
+
Values must be in the range `[1, inf)`.
|
152
154
|
|
153
155
|
tol: float or None, default=1e-3
|
154
156
|
The stopping criterion. If it is not None, training will stop
|
@@ -156,12 +158,14 @@ class SGDRegressor(BaseTransformer):
|
|
156
158
|
epochs.
|
157
159
|
Convergence is checked against the training loss or the
|
158
160
|
validation loss depending on the `early_stopping` parameter.
|
161
|
+
Values must be in the range `[0.0, inf)`.
|
159
162
|
|
160
163
|
shuffle: bool, default=True
|
161
164
|
Whether or not the training data should be shuffled after each epoch.
|
162
165
|
|
163
166
|
verbose: int, default=0
|
164
167
|
The verbosity level.
|
168
|
+
Values must be in the range `[0, inf)`.
|
165
169
|
|
166
170
|
epsilon: float, default=0.1
|
167
171
|
Epsilon in the epsilon-insensitive loss functions; only if `loss` is
|
@@ -170,6 +174,7 @@ class SGDRegressor(BaseTransformer):
|
|
170
174
|
important to get the prediction exactly right.
|
171
175
|
For epsilon-insensitive, any differences between the current prediction
|
172
176
|
and the correct label are ignored if they are less than this threshold.
|
177
|
+
Values must be in the range `[0.0, inf)`.
|
173
178
|
|
174
179
|
random_state: int, RandomState instance, default=None
|
175
180
|
Used for shuffling the data, when ``shuffle`` is set to ``True``.
|
@@ -191,9 +196,11 @@ class SGDRegressor(BaseTransformer):
|
|
191
196
|
eta0: float, default=0.01
|
192
197
|
The initial learning rate for the 'constant', 'invscaling' or
|
193
198
|
'adaptive' schedules. The default value is 0.01.
|
199
|
+
Values must be in the range `[0.0, inf)`.
|
194
200
|
|
195
201
|
power_t: float, default=0.25
|
196
202
|
The exponent for inverse scaling learning rate.
|
203
|
+
Values must be in the range `(-inf, inf)`.
|
197
204
|
|
198
205
|
early_stopping: bool, default=False
|
199
206
|
Whether to use early stopping to terminate training when validation
|
@@ -207,12 +214,14 @@ class SGDRegressor(BaseTransformer):
|
|
207
214
|
The proportion of training data to set aside as validation set for
|
208
215
|
early stopping. Must be between 0 and 1.
|
209
216
|
Only used if `early_stopping` is True.
|
217
|
+
Values must be in the range `(0.0, 1.0)`.
|
210
218
|
|
211
219
|
n_iter_no_change: int, default=5
|
212
220
|
Number of iterations with no improvement to wait before stopping
|
213
221
|
fitting.
|
214
222
|
Convergence is checked against the training loss or the
|
215
223
|
validation loss depending on the `early_stopping` parameter.
|
224
|
+
Integer values must be in the range `[1, max_iter)`.
|
216
225
|
|
217
226
|
warm_start: bool, default=False
|
218
227
|
When set to True, reuse the solution of the previous call to fit as
|