snowflake-ml-python 1.2.1__py3-none-any.whl → 1.2.2__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/env_utils.py +16 -13
- snowflake/ml/_internal/exceptions/modeling_error_messages.py +5 -1
- snowflake/ml/feature_store/__init__.py +9 -0
- snowflake/ml/feature_store/entity.py +73 -0
- snowflake/ml/feature_store/feature_store.py +1657 -0
- snowflake/ml/feature_store/feature_view.py +459 -0
- snowflake/ml/model/_deploy_client/image_builds/server_image_builder.py +9 -1
- snowflake/ml/model/_deploy_client/snowservice/deploy.py +2 -0
- snowflake/ml/model/_deploy_client/snowservice/deploy_options.py +12 -2
- snowflake/ml/model/_deploy_client/utils/snowservice_client.py +7 -3
- snowflake/ml/model/model_signature.py +72 -16
- snowflake/ml/model/type_hints.py +9 -0
- snowflake/ml/modeling/_internal/estimator_protocols.py +1 -41
- snowflake/ml/modeling/_internal/model_trainer_builder.py +13 -9
- snowflake/ml/modeling/_internal/{distributed_hpo_trainer.py → snowpark_implementations/distributed_hpo_trainer.py} +3 -1
- snowflake/ml/modeling/_internal/{xgboost_external_memory_trainer.py → snowpark_implementations/xgboost_external_memory_trainer.py} +3 -1
- snowflake/ml/modeling/calibration/calibrated_classifier_cv.py +3 -3
- snowflake/ml/modeling/cluster/affinity_propagation.py +3 -3
- snowflake/ml/modeling/cluster/agglomerative_clustering.py +3 -3
- snowflake/ml/modeling/cluster/birch.py +3 -3
- snowflake/ml/modeling/cluster/bisecting_k_means.py +3 -3
- snowflake/ml/modeling/cluster/dbscan.py +3 -3
- snowflake/ml/modeling/cluster/feature_agglomeration.py +3 -3
- snowflake/ml/modeling/cluster/k_means.py +3 -3
- snowflake/ml/modeling/cluster/mean_shift.py +3 -3
- snowflake/ml/modeling/cluster/mini_batch_k_means.py +3 -3
- snowflake/ml/modeling/cluster/optics.py +3 -3
- snowflake/ml/modeling/cluster/spectral_biclustering.py +3 -3
- snowflake/ml/modeling/cluster/spectral_clustering.py +3 -3
- snowflake/ml/modeling/cluster/spectral_coclustering.py +3 -3
- snowflake/ml/modeling/compose/column_transformer.py +3 -3
- snowflake/ml/modeling/compose/transformed_target_regressor.py +3 -3
- snowflake/ml/modeling/covariance/elliptic_envelope.py +3 -3
- snowflake/ml/modeling/covariance/empirical_covariance.py +3 -3
- snowflake/ml/modeling/covariance/graphical_lasso.py +3 -3
- snowflake/ml/modeling/covariance/graphical_lasso_cv.py +3 -3
- snowflake/ml/modeling/covariance/ledoit_wolf.py +3 -3
- snowflake/ml/modeling/covariance/min_cov_det.py +3 -3
- snowflake/ml/modeling/covariance/oas.py +3 -3
- snowflake/ml/modeling/covariance/shrunk_covariance.py +3 -3
- snowflake/ml/modeling/decomposition/dictionary_learning.py +3 -3
- snowflake/ml/modeling/decomposition/factor_analysis.py +3 -3
- snowflake/ml/modeling/decomposition/fast_ica.py +3 -3
- snowflake/ml/modeling/decomposition/incremental_pca.py +3 -3
- snowflake/ml/modeling/decomposition/kernel_pca.py +3 -3
- snowflake/ml/modeling/decomposition/mini_batch_dictionary_learning.py +3 -3
- snowflake/ml/modeling/decomposition/mini_batch_sparse_pca.py +3 -3
- snowflake/ml/modeling/decomposition/pca.py +3 -3
- snowflake/ml/modeling/decomposition/sparse_pca.py +3 -3
- snowflake/ml/modeling/decomposition/truncated_svd.py +3 -3
- snowflake/ml/modeling/discriminant_analysis/linear_discriminant_analysis.py +3 -3
- snowflake/ml/modeling/discriminant_analysis/quadratic_discriminant_analysis.py +3 -3
- snowflake/ml/modeling/ensemble/ada_boost_classifier.py +3 -3
- snowflake/ml/modeling/ensemble/ada_boost_regressor.py +3 -3
- snowflake/ml/modeling/ensemble/bagging_classifier.py +3 -3
- snowflake/ml/modeling/ensemble/bagging_regressor.py +3 -3
- snowflake/ml/modeling/ensemble/extra_trees_classifier.py +3 -3
- snowflake/ml/modeling/ensemble/extra_trees_regressor.py +3 -3
- snowflake/ml/modeling/ensemble/gradient_boosting_classifier.py +3 -3
- snowflake/ml/modeling/ensemble/gradient_boosting_regressor.py +3 -3
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_classifier.py +3 -3
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_regressor.py +3 -3
- snowflake/ml/modeling/ensemble/isolation_forest.py +3 -3
- snowflake/ml/modeling/ensemble/random_forest_classifier.py +3 -3
- snowflake/ml/modeling/ensemble/random_forest_regressor.py +3 -3
- snowflake/ml/modeling/ensemble/stacking_regressor.py +3 -3
- snowflake/ml/modeling/ensemble/voting_classifier.py +3 -3
- snowflake/ml/modeling/ensemble/voting_regressor.py +3 -3
- snowflake/ml/modeling/feature_selection/generic_univariate_select.py +3 -3
- snowflake/ml/modeling/feature_selection/select_fdr.py +3 -3
- snowflake/ml/modeling/feature_selection/select_fpr.py +3 -3
- snowflake/ml/modeling/feature_selection/select_fwe.py +3 -3
- snowflake/ml/modeling/feature_selection/select_k_best.py +3 -3
- snowflake/ml/modeling/feature_selection/select_percentile.py +3 -3
- snowflake/ml/modeling/feature_selection/sequential_feature_selector.py +3 -3
- snowflake/ml/modeling/feature_selection/variance_threshold.py +3 -3
- snowflake/ml/modeling/gaussian_process/gaussian_process_classifier.py +3 -3
- snowflake/ml/modeling/gaussian_process/gaussian_process_regressor.py +3 -3
- snowflake/ml/modeling/impute/iterative_imputer.py +3 -3
- snowflake/ml/modeling/impute/knn_imputer.py +3 -3
- snowflake/ml/modeling/impute/missing_indicator.py +3 -3
- snowflake/ml/modeling/kernel_approximation/additive_chi2_sampler.py +3 -3
- snowflake/ml/modeling/kernel_approximation/nystroem.py +3 -3
- snowflake/ml/modeling/kernel_approximation/polynomial_count_sketch.py +3 -3
- snowflake/ml/modeling/kernel_approximation/rbf_sampler.py +3 -3
- snowflake/ml/modeling/kernel_approximation/skewed_chi2_sampler.py +3 -3
- snowflake/ml/modeling/kernel_ridge/kernel_ridge.py +3 -3
- snowflake/ml/modeling/lightgbm/lgbm_classifier.py +3 -3
- snowflake/ml/modeling/lightgbm/lgbm_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/ard_regression.py +3 -3
- snowflake/ml/modeling/linear_model/bayesian_ridge.py +3 -3
- snowflake/ml/modeling/linear_model/elastic_net.py +3 -3
- snowflake/ml/modeling/linear_model/elastic_net_cv.py +3 -3
- snowflake/ml/modeling/linear_model/gamma_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/huber_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/lars.py +3 -3
- snowflake/ml/modeling/linear_model/lars_cv.py +3 -3
- snowflake/ml/modeling/linear_model/lasso.py +3 -3
- snowflake/ml/modeling/linear_model/lasso_cv.py +3 -3
- snowflake/ml/modeling/linear_model/lasso_lars.py +3 -3
- snowflake/ml/modeling/linear_model/lasso_lars_cv.py +3 -3
- snowflake/ml/modeling/linear_model/lasso_lars_ic.py +3 -3
- snowflake/ml/modeling/linear_model/linear_regression.py +3 -3
- snowflake/ml/modeling/linear_model/logistic_regression.py +3 -3
- snowflake/ml/modeling/linear_model/logistic_regression_cv.py +3 -3
- snowflake/ml/modeling/linear_model/multi_task_elastic_net.py +3 -3
- snowflake/ml/modeling/linear_model/multi_task_elastic_net_cv.py +3 -3
- snowflake/ml/modeling/linear_model/multi_task_lasso.py +3 -3
- snowflake/ml/modeling/linear_model/multi_task_lasso_cv.py +3 -3
- snowflake/ml/modeling/linear_model/orthogonal_matching_pursuit.py +3 -3
- snowflake/ml/modeling/linear_model/passive_aggressive_classifier.py +3 -3
- snowflake/ml/modeling/linear_model/passive_aggressive_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/perceptron.py +3 -3
- snowflake/ml/modeling/linear_model/poisson_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/ransac_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/ridge.py +3 -3
- snowflake/ml/modeling/linear_model/ridge_classifier.py +3 -3
- snowflake/ml/modeling/linear_model/ridge_classifier_cv.py +3 -3
- snowflake/ml/modeling/linear_model/ridge_cv.py +3 -3
- snowflake/ml/modeling/linear_model/sgd_classifier.py +3 -3
- snowflake/ml/modeling/linear_model/sgd_one_class_svm.py +3 -3
- snowflake/ml/modeling/linear_model/sgd_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/theil_sen_regressor.py +3 -3
- snowflake/ml/modeling/linear_model/tweedie_regressor.py +3 -3
- snowflake/ml/modeling/manifold/isomap.py +3 -3
- snowflake/ml/modeling/manifold/mds.py +3 -3
- snowflake/ml/modeling/manifold/spectral_embedding.py +3 -3
- snowflake/ml/modeling/manifold/tsne.py +3 -3
- snowflake/ml/modeling/mixture/bayesian_gaussian_mixture.py +3 -3
- snowflake/ml/modeling/mixture/gaussian_mixture.py +3 -3
- snowflake/ml/modeling/model_selection/grid_search_cv.py +3 -13
- snowflake/ml/modeling/model_selection/randomized_search_cv.py +3 -13
- snowflake/ml/modeling/multiclass/one_vs_one_classifier.py +3 -3
- snowflake/ml/modeling/multiclass/one_vs_rest_classifier.py +3 -3
- snowflake/ml/modeling/multiclass/output_code_classifier.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/gaussian_nb.py +3 -3
- snowflake/ml/modeling/naive_bayes/multinomial_nb.py +3 -3
- snowflake/ml/modeling/neighbors/k_neighbors_classifier.py +3 -3
- snowflake/ml/modeling/neighbors/k_neighbors_regressor.py +3 -3
- snowflake/ml/modeling/neighbors/kernel_density.py +3 -3
- snowflake/ml/modeling/neighbors/local_outlier_factor.py +3 -3
- snowflake/ml/modeling/neighbors/nearest_centroid.py +3 -3
- snowflake/ml/modeling/neighbors/nearest_neighbors.py +3 -3
- snowflake/ml/modeling/neighbors/neighborhood_components_analysis.py +3 -3
- snowflake/ml/modeling/neighbors/radius_neighbors_classifier.py +3 -3
- snowflake/ml/modeling/neighbors/radius_neighbors_regressor.py +3 -3
- snowflake/ml/modeling/neural_network/bernoulli_rbm.py +3 -3
- snowflake/ml/modeling/neural_network/mlp_classifier.py +3 -3
- snowflake/ml/modeling/neural_network/mlp_regressor.py +3 -3
- snowflake/ml/modeling/preprocessing/polynomial_features.py +3 -3
- snowflake/ml/modeling/semi_supervised/label_propagation.py +3 -3
- snowflake/ml/modeling/semi_supervised/label_spreading.py +3 -3
- snowflake/ml/modeling/svm/linear_svc.py +3 -3
- snowflake/ml/modeling/svm/linear_svr.py +3 -3
- snowflake/ml/modeling/svm/nu_svc.py +3 -3
- snowflake/ml/modeling/svm/nu_svr.py +3 -3
- snowflake/ml/modeling/svm/svc.py +3 -3
- snowflake/ml/modeling/svm/svr.py +3 -3
- snowflake/ml/modeling/tree/decision_tree_classifier.py +3 -3
- snowflake/ml/modeling/tree/decision_tree_regressor.py +3 -3
- snowflake/ml/modeling/tree/extra_tree_classifier.py +3 -3
- snowflake/ml/modeling/tree/extra_tree_regressor.py +3 -3
- snowflake/ml/modeling/xgboost/xgb_classifier.py +3 -3
- snowflake/ml/modeling/xgboost/xgb_regressor.py +3 -3
- snowflake/ml/modeling/xgboost/xgbrf_classifier.py +3 -3
- snowflake/ml/modeling/xgboost/xgbrf_regressor.py +3 -3
- snowflake/ml/version.py +1 -1
- {snowflake_ml_python-1.2.1.dist-info → snowflake_ml_python-1.2.2.dist-info}/METADATA +16 -1
- {snowflake_ml_python-1.2.1.dist-info → snowflake_ml_python-1.2.2.dist-info}/RECORD +178 -174
- /snowflake/ml/modeling/_internal/{pandas_trainer.py → local_implementations/pandas_trainer.py} +0 -0
- /snowflake/ml/modeling/_internal/{snowpark_handlers.py → snowpark_implementations/snowpark_handlers.py} +0 -0
- /snowflake/ml/modeling/_internal/{snowpark_trainer.py → snowpark_implementations/snowpark_trainer.py} +0 -0
- {snowflake_ml_python-1.2.1.dist-info → snowflake_ml_python-1.2.2.dist-info}/LICENSE.txt +0 -0
- {snowflake_ml_python-1.2.1.dist-info → snowflake_ml_python-1.2.2.dist-info}/WHEEL +0 -0
- {snowflake_ml_python-1.2.1.dist-info → snowflake_ml_python-1.2.2.dist-info}/top_level.txt +0 -0
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -259,7 +259,7 @@ class RidgeClassifier(BaseTransformer):
|
|
259
259
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
260
260
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
261
261
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
262
|
-
self._handlers:
|
262
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=RidgeClassifier.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
263
263
|
self._autogenerated = True
|
264
264
|
|
265
265
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -210,7 +210,7 @@ class RidgeClassifierCV(BaseTransformer):
|
|
210
210
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
211
211
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
212
212
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
213
|
-
self._handlers:
|
213
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=RidgeClassifierCV.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
214
214
|
self._autogenerated = True
|
215
215
|
|
216
216
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -231,7 +231,7 @@ class RidgeCV(BaseTransformer):
|
|
231
231
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
232
232
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
233
233
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
234
|
-
self._handlers:
|
234
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=RidgeCV.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
235
235
|
self._autogenerated = True
|
236
236
|
|
237
237
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -350,7 +350,7 @@ class SGDClassifier(BaseTransformer):
|
|
350
350
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
351
351
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
352
352
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
353
|
-
self._handlers:
|
353
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=SGDClassifier.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
354
354
|
self._autogenerated = True
|
355
355
|
|
356
356
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -248,7 +248,7 @@ class SGDOneClassSVM(BaseTransformer):
|
|
248
248
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
249
249
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
250
250
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
251
|
-
self._handlers:
|
251
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=SGDOneClassSVM.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
252
252
|
self._autogenerated = True
|
253
253
|
|
254
254
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -316,7 +316,7 @@ class SGDRegressor(BaseTransformer):
|
|
316
316
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
317
317
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
318
318
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
319
|
-
self._handlers:
|
319
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=SGDRegressor.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
320
320
|
self._autogenerated = True
|
321
321
|
|
322
322
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -218,7 +218,7 @@ class TheilSenRegressor(BaseTransformer):
|
|
218
218
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
219
219
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
220
220
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
221
|
-
self._handlers:
|
221
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=TheilSenRegressor.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
222
222
|
self._autogenerated = True
|
223
223
|
|
224
224
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -244,7 +244,7 @@ class TweedieRegressor(BaseTransformer):
|
|
244
244
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
245
245
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
246
246
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
247
|
-
self._handlers:
|
247
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=TweedieRegressor.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
248
248
|
self._autogenerated = True
|
249
249
|
|
250
250
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -240,7 +240,7 @@ class Isomap(BaseTransformer):
|
|
240
240
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
241
241
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
242
242
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
243
|
-
self._handlers:
|
243
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=Isomap.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
244
244
|
self._autogenerated = True
|
245
245
|
|
246
246
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -223,7 +223,7 @@ class MDS(BaseTransformer):
|
|
223
223
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
224
224
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
225
225
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
226
|
-
self._handlers:
|
226
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=MDS.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
227
227
|
self._autogenerated = True
|
228
228
|
|
229
229
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -225,7 +225,7 @@ class SpectralEmbedding(BaseTransformer):
|
|
225
225
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
226
226
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
227
227
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
228
|
-
self._handlers:
|
228
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=SpectralEmbedding.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
229
229
|
self._autogenerated = True
|
230
230
|
|
231
231
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -284,7 +284,7 @@ class TSNE(BaseTransformer):
|
|
284
284
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
285
285
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
286
286
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
287
|
-
self._handlers:
|
287
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=TSNE.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
288
288
|
self._autogenerated = True
|
289
289
|
|
290
290
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -287,7 +287,7 @@ class BayesianGaussianMixture(BaseTransformer):
|
|
287
287
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
288
288
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
289
289
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
290
|
-
self._handlers:
|
290
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=BayesianGaussianMixture.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
291
291
|
self._autogenerated = True
|
292
292
|
|
293
293
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -260,7 +260,7 @@ class GaussianMixture(BaseTransformer):
|
|
260
260
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
261
261
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
262
262
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
263
|
-
self._handlers:
|
263
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=GaussianMixture.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
264
264
|
self._autogenerated = True
|
265
265
|
|
266
266
|
def _get_rand_id(self) -> str:
|
@@ -3,7 +3,6 @@
|
|
3
3
|
# Do not modify the auto-generated code(except automatic reformatting by precommit hooks).
|
4
4
|
#
|
5
5
|
from typing import Any, Dict, Iterable, List, Optional, Set, Union
|
6
|
-
from uuid import uuid4
|
7
6
|
|
8
7
|
import cloudpickle as cp
|
9
8
|
import numpy as np
|
@@ -22,7 +21,7 @@ from snowflake.ml.model.model_signature import (
|
|
22
21
|
ModelSignature,
|
23
22
|
_infer_signature,
|
24
23
|
)
|
25
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
24
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
26
25
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
27
26
|
gather_dependencies,
|
28
27
|
original_estimator_has_callable,
|
@@ -30,7 +29,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
30
29
|
validate_sklearn_args,
|
31
30
|
)
|
32
31
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
33
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import (
|
32
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import (
|
34
33
|
SnowparkHandlers as HandlersImpl,
|
35
34
|
)
|
36
35
|
from snowflake.ml.modeling.framework.base import BaseTransformer
|
@@ -266,20 +265,11 @@ class GridSearchCV(BaseTransformer):
|
|
266
265
|
self.set_drop_input_cols(drop_input_cols)
|
267
266
|
self.set_sample_weight_col(sample_weight_col)
|
268
267
|
self.set_passthrough_cols(passthrough_cols)
|
269
|
-
self._handlers:
|
268
|
+
self._handlers: TransformerHandlers = HandlersImpl(
|
270
269
|
class_name=self.__class__.__name__,
|
271
270
|
subproject=_SUBPROJECT,
|
272
271
|
)
|
273
272
|
|
274
|
-
def _get_rand_id(self) -> str:
|
275
|
-
"""
|
276
|
-
Generate random id to be used in sproc and stage names.
|
277
|
-
|
278
|
-
Returns:
|
279
|
-
Random id string usable in sproc, table, and stage names.
|
280
|
-
"""
|
281
|
-
return str(uuid4()).replace("-", "_").upper()
|
282
|
-
|
283
273
|
def _get_active_columns(self) -> List[str]:
|
284
274
|
""" "Get the list of columns that are relevant to the transformer."""
|
285
275
|
selected_cols = (
|
@@ -1,5 +1,4 @@
|
|
1
1
|
from typing import Any, Dict, Iterable, List, Optional, Set, Union
|
2
|
-
from uuid import uuid4
|
3
2
|
|
4
3
|
import cloudpickle as cp
|
5
4
|
import numpy as np
|
@@ -19,7 +18,7 @@ from snowflake.ml.model.model_signature import (
|
|
19
18
|
ModelSignature,
|
20
19
|
_infer_signature,
|
21
20
|
)
|
22
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
21
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
23
22
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
24
23
|
gather_dependencies,
|
25
24
|
original_estimator_has_callable,
|
@@ -27,7 +26,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
27
26
|
validate_sklearn_args,
|
28
27
|
)
|
29
28
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
30
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import (
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import (
|
31
30
|
SnowparkHandlers as HandlersImpl,
|
32
31
|
)
|
33
32
|
from snowflake.ml.modeling.framework.base import BaseTransformer
|
@@ -278,20 +277,11 @@ class RandomizedSearchCV(BaseTransformer):
|
|
278
277
|
self.set_drop_input_cols(drop_input_cols)
|
279
278
|
self.set_sample_weight_col(sample_weight_col)
|
280
279
|
self.set_passthrough_cols(passthrough_cols)
|
281
|
-
self._handlers:
|
280
|
+
self._handlers: TransformerHandlers = HandlersImpl(
|
282
281
|
class_name=self.__class__.__name__,
|
283
282
|
subproject=_SUBPROJECT,
|
284
283
|
)
|
285
284
|
|
286
|
-
def _get_rand_id(self) -> str:
|
287
|
-
"""
|
288
|
-
Generate random id to be used in sproc and stage names.
|
289
|
-
|
290
|
-
Returns:
|
291
|
-
Random id string usable in sproc, table, and stage names.
|
292
|
-
"""
|
293
|
-
return str(uuid4()).replace("-", "_").upper()
|
294
|
-
|
295
285
|
def _get_active_columns(self) -> List[str]:
|
296
286
|
""" "Get the list of columns that are relevant to the transformer."""
|
297
287
|
selected_cols = (
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -172,7 +172,7 @@ class OneVsOneClassifier(BaseTransformer):
|
|
172
172
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
173
173
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
174
174
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
175
|
-
self._handlers:
|
175
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=OneVsOneClassifier.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
176
176
|
self._autogenerated = True
|
177
177
|
|
178
178
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -181,7 +181,7 @@ class OneVsRestClassifier(BaseTransformer):
|
|
181
181
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
182
182
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
183
183
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
184
|
-
self._handlers:
|
184
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=OneVsRestClassifier.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
185
185
|
self._autogenerated = True
|
186
186
|
|
187
187
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -184,7 +184,7 @@ class OutputCodeClassifier(BaseTransformer):
|
|
184
184
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
185
185
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
186
186
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
187
|
-
self._handlers:
|
187
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=OutputCodeClassifier.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
188
188
|
self._autogenerated = True
|
189
189
|
|
190
190
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -184,7 +184,7 @@ class BernoulliNB(BaseTransformer):
|
|
184
184
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
185
185
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
186
186
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
187
|
-
self._handlers:
|
187
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=BernoulliNB.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
188
188
|
self._autogenerated = True
|
189
189
|
|
190
190
|
def _get_rand_id(self) -> str:
|
@@ -26,7 +26,7 @@ from snowflake.ml._internal.env_utils import SNOWML_SPROC_ENV
|
|
26
26
|
from snowflake.ml._internal.utils import pkg_version_utils, identifier
|
27
27
|
from snowflake.snowpark import DataFrame, Session
|
28
28
|
from snowflake.snowpark._internal.type_utils import convert_sp_to_sf_type
|
29
|
-
from snowflake.ml.modeling._internal.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
29
|
+
from snowflake.ml.modeling._internal.snowpark_implementations.snowpark_handlers import SnowparkHandlers as HandlersImpl
|
30
30
|
from snowflake.ml.modeling._internal.model_trainer_builder import ModelTrainerBuilder
|
31
31
|
from snowflake.ml.modeling._internal.model_trainer import ModelTrainer
|
32
32
|
from snowflake.ml.modeling._internal.estimator_utils import (
|
@@ -35,7 +35,7 @@ from snowflake.ml.modeling._internal.estimator_utils import (
|
|
35
35
|
transform_snowml_obj_to_sklearn_obj,
|
36
36
|
validate_sklearn_args,
|
37
37
|
)
|
38
|
-
from snowflake.ml.modeling._internal.estimator_protocols import
|
38
|
+
from snowflake.ml.modeling._internal.estimator_protocols import TransformerHandlers
|
39
39
|
|
40
40
|
from snowflake.ml.model.model_signature import (
|
41
41
|
DataType,
|
@@ -190,7 +190,7 @@ class CategoricalNB(BaseTransformer):
|
|
190
190
|
self._model_signature_dict: Optional[Dict[str, ModelSignature]] = None
|
191
191
|
# If user used snowpark dataframe during fit, here it stores the snowpark input_cols, otherwise the processed input_cols
|
192
192
|
self._snowpark_cols: Optional[List[str]] = self.input_cols
|
193
|
-
self._handlers:
|
193
|
+
self._handlers: TransformerHandlers = HandlersImpl(class_name=CategoricalNB.__class__.__name__, subproject=_SUBPROJECT, autogenerated=True)
|
194
194
|
self._autogenerated = True
|
195
195
|
|
196
196
|
def _get_rand_id(self) -> str:
|