snowflake-ml-python 1.3.1__py3-none-any.whl → 1.4.1__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 +11 -1
- snowflake/ml/_internal/human_readable_id/adjectives.txt +128 -0
- snowflake/ml/_internal/human_readable_id/animals.txt +128 -0
- snowflake/ml/_internal/human_readable_id/hrid_generator.py +40 -0
- snowflake/ml/_internal/human_readable_id/hrid_generator_base.py +135 -0
- snowflake/ml/_internal/utils/formatting.py +1 -1
- snowflake/ml/_internal/utils/identifier.py +3 -1
- snowflake/ml/_internal/utils/sql_identifier.py +2 -6
- snowflake/ml/feature_store/feature_store.py +166 -184
- snowflake/ml/feature_store/feature_view.py +12 -24
- snowflake/ml/fileset/sfcfs.py +56 -50
- snowflake/ml/fileset/stage_fs.py +48 -13
- snowflake/ml/model/_client/model/model_version_impl.py +6 -49
- snowflake/ml/model/_client/ops/model_ops.py +78 -29
- snowflake/ml/model/_client/sql/model.py +23 -2
- snowflake/ml/model/_client/sql/model_version.py +22 -1
- snowflake/ml/model/_deploy_client/image_builds/server_image_builder.py +1 -3
- snowflake/ml/model/_deploy_client/snowservice/deploy.py +5 -2
- snowflake/ml/model/_model_composer/model_composer.py +7 -5
- snowflake/ml/model/_model_composer/model_manifest/model_manifest.py +19 -54
- snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +8 -1
- snowflake/ml/model/_model_composer/model_method/infer_table_function.py_template +1 -1
- snowflake/ml/model/_model_composer/model_method/model_method.py +6 -10
- snowflake/ml/model/_packager/model_handlers/catboost.py +206 -0
- snowflake/ml/model/_packager/model_handlers/lightgbm.py +218 -0
- snowflake/ml/model/_packager/model_handlers/sklearn.py +3 -0
- snowflake/ml/model/_packager/model_handlers/snowmlmodel.py +13 -1
- snowflake/ml/model/_packager/model_handlers/xgboost.py +1 -1
- snowflake/ml/model/_packager/model_meta/_core_requirements.py +1 -1
- snowflake/ml/model/_packager/model_meta/model_meta.py +36 -6
- snowflake/ml/model/_packager/model_meta/model_meta_schema.py +20 -1
- snowflake/ml/model/_packager/model_meta_migrator/migrator_plans.py +3 -1
- snowflake/ml/model/_packager/model_packager.py +2 -2
- snowflake/ml/model/{_model_composer/model_runtime/_runtime_requirements.py → _packager/model_runtime/_snowml_inference_alternative_requirements.py} +1 -1
- snowflake/ml/model/_packager/model_runtime/model_runtime.py +137 -0
- snowflake/ml/model/custom_model.py +3 -1
- snowflake/ml/model/type_hints.py +21 -2
- snowflake/ml/modeling/_internal/estimator_utils.py +16 -11
- snowflake/ml/modeling/_internal/local_implementations/pandas_handlers.py +4 -1
- snowflake/ml/modeling/_internal/model_specifications.py +3 -1
- snowflake/ml/modeling/_internal/snowpark_implementations/distributed_hpo_trainer.py +545 -0
- snowflake/ml/modeling/_internal/snowpark_implementations/snowpark_handlers.py +8 -5
- snowflake/ml/modeling/calibration/calibrated_classifier_cv.py +195 -123
- snowflake/ml/modeling/cluster/affinity_propagation.py +195 -123
- snowflake/ml/modeling/cluster/agglomerative_clustering.py +195 -123
- snowflake/ml/modeling/cluster/birch.py +195 -123
- snowflake/ml/modeling/cluster/bisecting_k_means.py +195 -123
- snowflake/ml/modeling/cluster/dbscan.py +195 -123
- snowflake/ml/modeling/cluster/feature_agglomeration.py +195 -123
- snowflake/ml/modeling/cluster/k_means.py +195 -123
- snowflake/ml/modeling/cluster/mean_shift.py +195 -123
- snowflake/ml/modeling/cluster/mini_batch_k_means.py +195 -123
- snowflake/ml/modeling/cluster/optics.py +195 -123
- snowflake/ml/modeling/cluster/spectral_biclustering.py +195 -123
- snowflake/ml/modeling/cluster/spectral_clustering.py +195 -123
- snowflake/ml/modeling/cluster/spectral_coclustering.py +195 -123
- snowflake/ml/modeling/compose/column_transformer.py +195 -123
- snowflake/ml/modeling/compose/transformed_target_regressor.py +195 -123
- snowflake/ml/modeling/covariance/elliptic_envelope.py +195 -123
- snowflake/ml/modeling/covariance/empirical_covariance.py +195 -123
- snowflake/ml/modeling/covariance/graphical_lasso.py +195 -123
- snowflake/ml/modeling/covariance/graphical_lasso_cv.py +195 -123
- snowflake/ml/modeling/covariance/ledoit_wolf.py +195 -123
- snowflake/ml/modeling/covariance/min_cov_det.py +195 -123
- snowflake/ml/modeling/covariance/oas.py +195 -123
- snowflake/ml/modeling/covariance/shrunk_covariance.py +195 -123
- snowflake/ml/modeling/decomposition/dictionary_learning.py +195 -123
- snowflake/ml/modeling/decomposition/factor_analysis.py +195 -123
- snowflake/ml/modeling/decomposition/fast_ica.py +195 -123
- snowflake/ml/modeling/decomposition/incremental_pca.py +195 -123
- snowflake/ml/modeling/decomposition/kernel_pca.py +195 -123
- snowflake/ml/modeling/decomposition/mini_batch_dictionary_learning.py +195 -123
- snowflake/ml/modeling/decomposition/mini_batch_sparse_pca.py +195 -123
- snowflake/ml/modeling/decomposition/pca.py +195 -123
- snowflake/ml/modeling/decomposition/sparse_pca.py +195 -123
- snowflake/ml/modeling/decomposition/truncated_svd.py +195 -123
- snowflake/ml/modeling/discriminant_analysis/linear_discriminant_analysis.py +195 -123
- snowflake/ml/modeling/discriminant_analysis/quadratic_discriminant_analysis.py +195 -123
- snowflake/ml/modeling/ensemble/ada_boost_classifier.py +195 -123
- snowflake/ml/modeling/ensemble/ada_boost_regressor.py +195 -123
- snowflake/ml/modeling/ensemble/bagging_classifier.py +195 -123
- snowflake/ml/modeling/ensemble/bagging_regressor.py +195 -123
- snowflake/ml/modeling/ensemble/extra_trees_classifier.py +195 -123
- snowflake/ml/modeling/ensemble/extra_trees_regressor.py +195 -123
- snowflake/ml/modeling/ensemble/gradient_boosting_classifier.py +195 -123
- snowflake/ml/modeling/ensemble/gradient_boosting_regressor.py +195 -123
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_classifier.py +195 -123
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_regressor.py +195 -123
- snowflake/ml/modeling/ensemble/isolation_forest.py +195 -123
- snowflake/ml/modeling/ensemble/random_forest_classifier.py +195 -123
- snowflake/ml/modeling/ensemble/random_forest_regressor.py +195 -123
- snowflake/ml/modeling/ensemble/stacking_regressor.py +195 -123
- snowflake/ml/modeling/ensemble/voting_classifier.py +195 -123
- snowflake/ml/modeling/ensemble/voting_regressor.py +195 -123
- snowflake/ml/modeling/feature_selection/generic_univariate_select.py +195 -123
- snowflake/ml/modeling/feature_selection/select_fdr.py +195 -123
- snowflake/ml/modeling/feature_selection/select_fpr.py +195 -123
- snowflake/ml/modeling/feature_selection/select_fwe.py +195 -123
- snowflake/ml/modeling/feature_selection/select_k_best.py +195 -123
- snowflake/ml/modeling/feature_selection/select_percentile.py +195 -123
- snowflake/ml/modeling/feature_selection/sequential_feature_selector.py +195 -123
- snowflake/ml/modeling/feature_selection/variance_threshold.py +195 -123
- snowflake/ml/modeling/framework/_utils.py +8 -1
- snowflake/ml/modeling/framework/base.py +24 -6
- snowflake/ml/modeling/gaussian_process/gaussian_process_classifier.py +195 -123
- snowflake/ml/modeling/gaussian_process/gaussian_process_regressor.py +195 -123
- snowflake/ml/modeling/impute/iterative_imputer.py +195 -123
- snowflake/ml/modeling/impute/knn_imputer.py +195 -123
- snowflake/ml/modeling/impute/missing_indicator.py +195 -123
- snowflake/ml/modeling/impute/simple_imputer.py +4 -15
- snowflake/ml/modeling/kernel_approximation/additive_chi2_sampler.py +195 -123
- snowflake/ml/modeling/kernel_approximation/nystroem.py +195 -123
- snowflake/ml/modeling/kernel_approximation/polynomial_count_sketch.py +195 -123
- snowflake/ml/modeling/kernel_approximation/rbf_sampler.py +195 -123
- snowflake/ml/modeling/kernel_approximation/skewed_chi2_sampler.py +195 -123
- snowflake/ml/modeling/kernel_ridge/kernel_ridge.py +195 -123
- snowflake/ml/modeling/lightgbm/lgbm_classifier.py +198 -125
- snowflake/ml/modeling/lightgbm/lgbm_regressor.py +198 -125
- snowflake/ml/modeling/linear_model/ard_regression.py +195 -123
- snowflake/ml/modeling/linear_model/bayesian_ridge.py +195 -123
- snowflake/ml/modeling/linear_model/elastic_net.py +195 -123
- snowflake/ml/modeling/linear_model/elastic_net_cv.py +195 -123
- snowflake/ml/modeling/linear_model/gamma_regressor.py +195 -123
- snowflake/ml/modeling/linear_model/huber_regressor.py +195 -123
- snowflake/ml/modeling/linear_model/lars.py +195 -123
- snowflake/ml/modeling/linear_model/lars_cv.py +195 -123
- snowflake/ml/modeling/linear_model/lasso.py +195 -123
- snowflake/ml/modeling/linear_model/lasso_cv.py +195 -123
- snowflake/ml/modeling/linear_model/lasso_lars.py +195 -123
- snowflake/ml/modeling/linear_model/lasso_lars_cv.py +195 -123
- snowflake/ml/modeling/linear_model/lasso_lars_ic.py +195 -123
- snowflake/ml/modeling/linear_model/linear_regression.py +195 -123
- snowflake/ml/modeling/linear_model/logistic_regression.py +195 -123
- snowflake/ml/modeling/linear_model/logistic_regression_cv.py +195 -123
- snowflake/ml/modeling/linear_model/multi_task_elastic_net.py +195 -123
- snowflake/ml/modeling/linear_model/multi_task_elastic_net_cv.py +195 -123
- snowflake/ml/modeling/linear_model/multi_task_lasso.py +195 -123
- snowflake/ml/modeling/linear_model/multi_task_lasso_cv.py +195 -123
- snowflake/ml/modeling/linear_model/orthogonal_matching_pursuit.py +195 -123
- snowflake/ml/modeling/linear_model/passive_aggressive_classifier.py +195 -123
- snowflake/ml/modeling/linear_model/passive_aggressive_regressor.py +195 -123
- snowflake/ml/modeling/linear_model/perceptron.py +195 -123
- snowflake/ml/modeling/linear_model/poisson_regressor.py +195 -123
- snowflake/ml/modeling/linear_model/ransac_regressor.py +195 -123
- snowflake/ml/modeling/linear_model/ridge.py +195 -123
- snowflake/ml/modeling/linear_model/ridge_classifier.py +195 -123
- snowflake/ml/modeling/linear_model/ridge_classifier_cv.py +195 -123
- snowflake/ml/modeling/linear_model/ridge_cv.py +195 -123
- snowflake/ml/modeling/linear_model/sgd_classifier.py +195 -123
- snowflake/ml/modeling/linear_model/sgd_one_class_svm.py +195 -123
- snowflake/ml/modeling/linear_model/sgd_regressor.py +195 -123
- snowflake/ml/modeling/linear_model/theil_sen_regressor.py +195 -123
- snowflake/ml/modeling/linear_model/tweedie_regressor.py +195 -123
- snowflake/ml/modeling/manifold/isomap.py +195 -123
- snowflake/ml/modeling/manifold/mds.py +195 -123
- snowflake/ml/modeling/manifold/spectral_embedding.py +195 -123
- snowflake/ml/modeling/manifold/tsne.py +195 -123
- snowflake/ml/modeling/mixture/bayesian_gaussian_mixture.py +195 -123
- snowflake/ml/modeling/mixture/gaussian_mixture.py +195 -123
- snowflake/ml/modeling/model_selection/grid_search_cv.py +42 -18
- snowflake/ml/modeling/model_selection/randomized_search_cv.py +42 -18
- snowflake/ml/modeling/multiclass/one_vs_one_classifier.py +195 -123
- snowflake/ml/modeling/multiclass/one_vs_rest_classifier.py +195 -123
- snowflake/ml/modeling/multiclass/output_code_classifier.py +195 -123
- snowflake/ml/modeling/naive_bayes/bernoulli_nb.py +195 -123
- snowflake/ml/modeling/naive_bayes/categorical_nb.py +195 -123
- snowflake/ml/modeling/naive_bayes/complement_nb.py +195 -123
- snowflake/ml/modeling/naive_bayes/gaussian_nb.py +195 -123
- snowflake/ml/modeling/naive_bayes/multinomial_nb.py +195 -123
- snowflake/ml/modeling/neighbors/k_neighbors_classifier.py +195 -123
- snowflake/ml/modeling/neighbors/k_neighbors_regressor.py +195 -123
- snowflake/ml/modeling/neighbors/kernel_density.py +195 -123
- snowflake/ml/modeling/neighbors/local_outlier_factor.py +195 -123
- snowflake/ml/modeling/neighbors/nearest_centroid.py +195 -123
- snowflake/ml/modeling/neighbors/nearest_neighbors.py +195 -123
- snowflake/ml/modeling/neighbors/neighborhood_components_analysis.py +195 -123
- snowflake/ml/modeling/neighbors/radius_neighbors_classifier.py +195 -123
- snowflake/ml/modeling/neighbors/radius_neighbors_regressor.py +195 -123
- snowflake/ml/modeling/neural_network/bernoulli_rbm.py +195 -123
- snowflake/ml/modeling/neural_network/mlp_classifier.py +195 -123
- snowflake/ml/modeling/neural_network/mlp_regressor.py +195 -123
- snowflake/ml/modeling/pipeline/pipeline.py +4 -4
- snowflake/ml/modeling/preprocessing/binarizer.py +1 -5
- snowflake/ml/modeling/preprocessing/k_bins_discretizer.py +1 -5
- snowflake/ml/modeling/preprocessing/label_encoder.py +1 -5
- snowflake/ml/modeling/preprocessing/max_abs_scaler.py +1 -5
- snowflake/ml/modeling/preprocessing/min_max_scaler.py +10 -12
- snowflake/ml/modeling/preprocessing/normalizer.py +1 -5
- snowflake/ml/modeling/preprocessing/one_hot_encoder.py +1 -5
- snowflake/ml/modeling/preprocessing/ordinal_encoder.py +1 -5
- snowflake/ml/modeling/preprocessing/polynomial_features.py +195 -123
- snowflake/ml/modeling/preprocessing/robust_scaler.py +1 -5
- snowflake/ml/modeling/preprocessing/standard_scaler.py +11 -11
- snowflake/ml/modeling/semi_supervised/label_propagation.py +195 -123
- snowflake/ml/modeling/semi_supervised/label_spreading.py +195 -123
- snowflake/ml/modeling/svm/linear_svc.py +195 -123
- snowflake/ml/modeling/svm/linear_svr.py +195 -123
- snowflake/ml/modeling/svm/nu_svc.py +195 -123
- snowflake/ml/modeling/svm/nu_svr.py +195 -123
- snowflake/ml/modeling/svm/svc.py +195 -123
- snowflake/ml/modeling/svm/svr.py +195 -123
- snowflake/ml/modeling/tree/decision_tree_classifier.py +195 -123
- snowflake/ml/modeling/tree/decision_tree_regressor.py +195 -123
- snowflake/ml/modeling/tree/extra_tree_classifier.py +195 -123
- snowflake/ml/modeling/tree/extra_tree_regressor.py +195 -123
- snowflake/ml/modeling/xgboost/xgb_classifier.py +195 -123
- snowflake/ml/modeling/xgboost/xgb_regressor.py +195 -123
- snowflake/ml/modeling/xgboost/xgbrf_classifier.py +195 -123
- snowflake/ml/modeling/xgboost/xgbrf_regressor.py +195 -123
- snowflake/ml/registry/_manager/model_manager.py +5 -1
- snowflake/ml/registry/model_registry.py +99 -26
- snowflake/ml/registry/registry.py +3 -2
- snowflake/ml/version.py +1 -1
- {snowflake_ml_python-1.3.1.dist-info → snowflake_ml_python-1.4.1.dist-info}/METADATA +94 -55
- {snowflake_ml_python-1.3.1.dist-info → snowflake_ml_python-1.4.1.dist-info}/RECORD +218 -212
- snowflake/ml/model/_model_composer/model_runtime/model_runtime.py +0 -97
- {snowflake_ml_python-1.3.1.dist-info → snowflake_ml_python-1.4.1.dist-info}/LICENSE.txt +0 -0
- {snowflake_ml_python-1.3.1.dist-info → snowflake_ml_python-1.4.1.dist-info}/WHEEL +0 -0
- {snowflake_ml_python-1.3.1.dist-info → snowflake_ml_python-1.4.1.dist-info}/top_level.txt +0 -0
@@ -103,7 +103,10 @@ def _create_registry_database(
|
|
103
103
|
|
104
104
|
|
105
105
|
def _create_registry_schema(
|
106
|
-
session: snowpark.Session,
|
106
|
+
session: snowpark.Session,
|
107
|
+
database_name: str,
|
108
|
+
schema_name: str,
|
109
|
+
statement_params: Dict[str, Any],
|
107
110
|
) -> None:
|
108
111
|
"""Private helper to create the model registry schema.
|
109
112
|
|
@@ -161,7 +164,11 @@ def _create_registry_views(
|
|
161
164
|
|
162
165
|
# Create a view on active permanent deployments.
|
163
166
|
_create_active_permanent_deployment_view(
|
164
|
-
session,
|
167
|
+
session,
|
168
|
+
fully_qualified_schema_name,
|
169
|
+
registry_table_name,
|
170
|
+
deployment_table_name,
|
171
|
+
statement_params,
|
165
172
|
)
|
166
173
|
|
167
174
|
# Create views on most recent metadata items.
|
@@ -437,10 +444,12 @@ fully integrated into the new registry.
|
|
437
444
|
# Could do a multi-table insert here with some pros and cons:
|
438
445
|
# [PRO] Atomic insert across multiple tables.
|
439
446
|
# [CON] Code logic becomes messy depending on which fields are set.
|
440
|
-
# [CON] Harder to
|
447
|
+
# [CON] Harder to reuse existing methods like set_model_name.
|
441
448
|
# Context: https://docs.snowflake.com/en/sql-reference/sql/insert-multi-table.html
|
442
449
|
return table_manager.insert_table_entry(
|
443
|
-
self._session,
|
450
|
+
self._session,
|
451
|
+
table=self._fully_qualified_registry_table_name(),
|
452
|
+
columns=properties,
|
444
453
|
)
|
445
454
|
|
446
455
|
def _insert_metadata_entry(self, *, id: str, attribute: str, value: Any, operation: str) -> List[snowpark.Row]:
|
@@ -471,7 +480,9 @@ fully integrated into the new registry.
|
|
471
480
|
columns["VALUE"] = value
|
472
481
|
|
473
482
|
return table_manager.insert_table_entry(
|
474
|
-
self._session,
|
483
|
+
self._session,
|
484
|
+
table=self._fully_qualified_metadata_table_name(),
|
485
|
+
columns=columns,
|
475
486
|
)
|
476
487
|
|
477
488
|
def _insert_deployment_entry(
|
@@ -484,7 +495,10 @@ fully integrated into the new registry.
|
|
484
495
|
signature: Dict[str, Any],
|
485
496
|
target_method: str,
|
486
497
|
options: Optional[
|
487
|
-
Union[
|
498
|
+
Union[
|
499
|
+
model_types.WarehouseDeployOptions,
|
500
|
+
model_types.SnowparkContainerServiceDeployOptions,
|
501
|
+
]
|
488
502
|
] = None,
|
489
503
|
) -> List[snowpark.Row]:
|
490
504
|
"""Insert a new row into the model deployment table.
|
@@ -521,7 +535,9 @@ fully integrated into the new registry.
|
|
521
535
|
columns["OPTIONS"] = options
|
522
536
|
|
523
537
|
return table_manager.insert_table_entry(
|
524
|
-
self._session,
|
538
|
+
self._session,
|
539
|
+
table=self._fully_qualified_deployment_table_name(),
|
540
|
+
columns=columns,
|
525
541
|
)
|
526
542
|
|
527
543
|
def _prepare_deployment_stage(self) -> str:
|
@@ -596,7 +612,11 @@ fully integrated into the new registry.
|
|
596
612
|
return identifier.get_schema_level_object_identifier(db, schema, stage)
|
597
613
|
|
598
614
|
def _list_selected_models(
|
599
|
-
self,
|
615
|
+
self,
|
616
|
+
*,
|
617
|
+
id: Optional[str] = None,
|
618
|
+
model_name: Optional[str] = None,
|
619
|
+
model_version: Optional[str] = None,
|
600
620
|
) -> snowpark.DataFrame:
|
601
621
|
"""Retrieve the Snowpark dataframe of models matching the specified ID or (name and version).
|
602
622
|
|
@@ -724,7 +744,12 @@ fully integrated into the new registry.
|
|
724
744
|
assert id is not None
|
725
745
|
|
726
746
|
try:
|
727
|
-
self._insert_metadata_entry(
|
747
|
+
self._insert_metadata_entry(
|
748
|
+
id=id,
|
749
|
+
attribute=attribute,
|
750
|
+
value={attribute: value},
|
751
|
+
operation=operation,
|
752
|
+
)
|
728
753
|
except connector.DataError:
|
729
754
|
raise connector.DataError(f"Setting {attribute} for mode id {id} failed.")
|
730
755
|
|
@@ -760,7 +785,10 @@ fully integrated into the new registry.
|
|
760
785
|
return str(result)
|
761
786
|
|
762
787
|
def _get_model_path(
|
763
|
-
self,
|
788
|
+
self,
|
789
|
+
id: Optional[str] = None,
|
790
|
+
model_name: Optional[str] = None,
|
791
|
+
model_version: Optional[str] = None,
|
764
792
|
) -> str:
|
765
793
|
"""Get the stage path for the model with the given (model name + model version) or `id` from the registry.
|
766
794
|
|
@@ -889,10 +917,17 @@ fully integrated into the new registry.
|
|
889
917
|
value=new_model,
|
890
918
|
)
|
891
919
|
if description:
|
892
|
-
self.set_model_description(
|
920
|
+
self.set_model_description(
|
921
|
+
model_name=model_name,
|
922
|
+
model_version=model_version,
|
923
|
+
description=description,
|
924
|
+
)
|
893
925
|
if tags:
|
894
926
|
self._set_metadata_attribute(
|
895
|
-
_METADATA_ATTRIBUTE_TAGS,
|
927
|
+
_METADATA_ATTRIBUTE_TAGS,
|
928
|
+
value=tags,
|
929
|
+
model_name=model_name,
|
930
|
+
model_version=model_version,
|
896
931
|
)
|
897
932
|
else:
|
898
933
|
raise connector.DatabaseError("Failed to insert the model properties to the registry table.")
|
@@ -961,7 +996,10 @@ fully integrated into the new registry.
|
|
961
996
|
model_tags = self.get_tags(model_name=model_name, model_version=model_version)
|
962
997
|
model_tags[tag_name] = tag_value
|
963
998
|
self._set_metadata_attribute(
|
964
|
-
_METADATA_ATTRIBUTE_TAGS,
|
999
|
+
_METADATA_ATTRIBUTE_TAGS,
|
1000
|
+
model_tags,
|
1001
|
+
model_name=model_name,
|
1002
|
+
model_version=model_version,
|
965
1003
|
)
|
966
1004
|
|
967
1005
|
@telemetry.send_api_usage_telemetry(
|
@@ -991,7 +1029,10 @@ fully integrated into the new registry.
|
|
991
1029
|
)
|
992
1030
|
|
993
1031
|
self._set_metadata_attribute(
|
994
|
-
_METADATA_ATTRIBUTE_TAGS,
|
1032
|
+
_METADATA_ATTRIBUTE_TAGS,
|
1033
|
+
model_tags,
|
1034
|
+
model_name=model_name,
|
1035
|
+
model_version=model_version,
|
995
1036
|
)
|
996
1037
|
|
997
1038
|
@telemetry.send_api_usage_telemetry(
|
@@ -1089,7 +1130,9 @@ fully integrated into the new registry.
|
|
1089
1130
|
Description of the model or None.
|
1090
1131
|
"""
|
1091
1132
|
result = self._get_metadata_attribute(
|
1092
|
-
_METADATA_ATTRIBUTE_DESCRIPTION,
|
1133
|
+
_METADATA_ATTRIBUTE_DESCRIPTION,
|
1134
|
+
model_name=model_name,
|
1135
|
+
model_version=model_version,
|
1093
1136
|
)
|
1094
1137
|
return None if result is None else json.loads(result)
|
1095
1138
|
|
@@ -1112,7 +1155,10 @@ fully integrated into the new registry.
|
|
1112
1155
|
description: Desired new model description.
|
1113
1156
|
"""
|
1114
1157
|
self._set_metadata_attribute(
|
1115
|
-
_METADATA_ATTRIBUTE_DESCRIPTION,
|
1158
|
+
_METADATA_ATTRIBUTE_DESCRIPTION,
|
1159
|
+
description,
|
1160
|
+
model_name=model_name,
|
1161
|
+
model_version=model_version,
|
1116
1162
|
)
|
1117
1163
|
|
1118
1164
|
@telemetry.send_api_usage_telemetry(
|
@@ -1165,7 +1211,10 @@ fully integrated into the new registry.
|
|
1165
1211
|
snowpark.DataFrame with the history of the model.
|
1166
1212
|
"""
|
1167
1213
|
id = self._get_model_id(model_name=model_name, model_version=model_version)
|
1168
|
-
return cast(
|
1214
|
+
return cast(
|
1215
|
+
snowpark.DataFrame,
|
1216
|
+
self.get_history().filter(snowpark.Column("MODEL_ID") == id),
|
1217
|
+
)
|
1169
1218
|
|
1170
1219
|
@telemetry.send_api_usage_telemetry(
|
1171
1220
|
project=_TELEMETRY_PROJECT,
|
@@ -1194,7 +1243,10 @@ fully integrated into the new registry.
|
|
1194
1243
|
model_metrics = self.get_metrics(model_name=model_name, model_version=model_version)
|
1195
1244
|
model_metrics[metric_name] = metric_value
|
1196
1245
|
self._set_metadata_attribute(
|
1197
|
-
_METADATA_ATTRIBUTE_METRICS,
|
1246
|
+
_METADATA_ATTRIBUTE_METRICS,
|
1247
|
+
model_metrics,
|
1248
|
+
model_name=model_name,
|
1249
|
+
model_version=model_version,
|
1198
1250
|
)
|
1199
1251
|
|
1200
1252
|
@telemetry.send_api_usage_telemetry(
|
@@ -1230,7 +1282,10 @@ fully integrated into the new registry.
|
|
1230
1282
|
)
|
1231
1283
|
|
1232
1284
|
self._set_metadata_attribute(
|
1233
|
-
_METADATA_ATTRIBUTE_METRICS,
|
1285
|
+
_METADATA_ATTRIBUTE_METRICS,
|
1286
|
+
model_metrics,
|
1287
|
+
model_name=model_name,
|
1288
|
+
model_version=model_version,
|
1234
1289
|
)
|
1235
1290
|
|
1236
1291
|
@telemetry.send_api_usage_telemetry(
|
@@ -1290,7 +1345,9 @@ fully integrated into the new registry.
|
|
1290
1345
|
# Snowpark snowpark.dataframe returns dictionary objects as strings. We need to convert it back to a dictionary
|
1291
1346
|
# here.
|
1292
1347
|
result = self._get_metadata_attribute(
|
1293
|
-
_METADATA_ATTRIBUTE_METRICS,
|
1348
|
+
_METADATA_ATTRIBUTE_METRICS,
|
1349
|
+
model_name=model_name,
|
1350
|
+
model_version=model_version,
|
1294
1351
|
)
|
1295
1352
|
|
1296
1353
|
if result:
|
@@ -1507,7 +1564,10 @@ fully integrated into the new registry.
|
|
1507
1564
|
permanent: bool = False,
|
1508
1565
|
platform: deploy_platforms.TargetPlatform = deploy_platforms.TargetPlatform.WAREHOUSE,
|
1509
1566
|
options: Optional[
|
1510
|
-
Union[
|
1567
|
+
Union[
|
1568
|
+
model_types.WarehouseDeployOptions,
|
1569
|
+
model_types.SnowparkContainerServiceDeployOptions,
|
1570
|
+
]
|
1511
1571
|
] = None,
|
1512
1572
|
) -> model_types.Deployment:
|
1513
1573
|
"""Deploy the model with the given deployment name.
|
@@ -1772,7 +1832,9 @@ fully integrated into the new registry.
|
|
1772
1832
|
|
1773
1833
|
"""
|
1774
1834
|
deployment = self._get_deployment(
|
1775
|
-
model_name=model_name,
|
1835
|
+
model_name=model_name,
|
1836
|
+
model_version=model_version,
|
1837
|
+
deployment_name=deployment_name,
|
1776
1838
|
)
|
1777
1839
|
|
1778
1840
|
# TODO(SNOW-759526): The following sequence should be a transaction.
|
@@ -1845,7 +1907,8 @@ fully integrated into the new registry.
|
|
1845
1907
|
|
1846
1908
|
# Step 1/3: Delete the registry entry.
|
1847
1909
|
query_result_checker.SqlResultValidator(
|
1848
|
-
self._session,
|
1910
|
+
self._session,
|
1911
|
+
f"DELETE FROM {self._fully_qualified_registry_table_name()} WHERE ID='{id}'",
|
1849
1912
|
).deletion_success(expected_num_rows=1).validate()
|
1850
1913
|
|
1851
1914
|
# Step 2/3: Delete the artifact (if desired).
|
@@ -1966,7 +2029,11 @@ class ModelReference:
|
|
1966
2029
|
|
1967
2030
|
def build_method(m: Callable[..., Any]) -> Callable[..., Any]:
|
1968
2031
|
return lambda self, *args, **kwargs: m(
|
1969
|
-
self._registry,
|
2032
|
+
self._registry,
|
2033
|
+
self._model_name,
|
2034
|
+
self._model_version,
|
2035
|
+
*args,
|
2036
|
+
**kwargs,
|
1970
2037
|
)
|
1971
2038
|
|
1972
2039
|
method = build_method(m=obj)
|
@@ -2027,7 +2094,10 @@ class ModelReference:
|
|
2027
2094
|
|
2028
2095
|
if di:
|
2029
2096
|
return model_api.predict(
|
2030
|
-
session=self._registry._session,
|
2097
|
+
session=self._registry._session,
|
2098
|
+
deployment=di,
|
2099
|
+
X=data,
|
2100
|
+
statement_params=statement_params,
|
2031
2101
|
)
|
2032
2102
|
|
2033
2103
|
# Mypy enforce to refer to the registry for calling the function
|
@@ -2059,7 +2129,10 @@ class ModelReference:
|
|
2059
2129
|
options=options,
|
2060
2130
|
)
|
2061
2131
|
return model_api.predict(
|
2062
|
-
session=self._registry._session,
|
2132
|
+
session=self._registry._session,
|
2133
|
+
deployment=di,
|
2134
|
+
X=data,
|
2135
|
+
statement_params=statement_params,
|
2063
2136
|
)
|
2064
2137
|
|
2065
2138
|
|
@@ -77,7 +77,7 @@ class Registry:
|
|
77
77
|
model: model_types.SupportedModelType,
|
78
78
|
*,
|
79
79
|
model_name: str,
|
80
|
-
version_name: str,
|
80
|
+
version_name: Optional[str] = None,
|
81
81
|
comment: Optional[str] = None,
|
82
82
|
metrics: Optional[Dict[str, Any]] = None,
|
83
83
|
conda_dependencies: Optional[List[str]] = None,
|
@@ -93,11 +93,12 @@ class Registry:
|
|
93
93
|
Log a model with various parameters and metadata.
|
94
94
|
|
95
95
|
Args:
|
96
|
-
model: Model object of supported types such as Scikit-learn, XGBoost, Snowpark ML,
|
96
|
+
model: Model object of supported types such as Scikit-learn, XGBoost, LightGBM, Snowpark ML,
|
97
97
|
PyTorch, TorchScript, Tensorflow, Tensorflow Keras, MLFlow, HuggingFace Pipeline,
|
98
98
|
Sentence Transformers, Peft-finetuned LLM, or Custom Model.
|
99
99
|
model_name: Name to identify the model.
|
100
100
|
version_name: Version identifier for the model. Combination of model_name and version_name must be unique.
|
101
|
+
If not specified, a random name will be generated.
|
101
102
|
comment: Comment associated with the model version. Defaults to None.
|
102
103
|
metrics: A JSON serializable dictionary containing metrics linked to the model version. Defaults to None.
|
103
104
|
signatures: Model data signatures for inputs and outputs for various target methods. If it is None,
|
snowflake/ml/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION="1.
|
1
|
+
VERSION="1.4.1"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: snowflake-ml-python
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.4.1
|
4
4
|
Summary: The machine learning client library that is used for interacting with Snowflake to build machine learning solutions.
|
5
5
|
Author-email: "Snowflake, Inc" <support@snowflake.com>
|
6
6
|
License:
|
@@ -236,12 +236,13 @@ License-File: LICENSE.txt
|
|
236
236
|
Requires-Dist: absl-py <2,>=0.15
|
237
237
|
Requires-Dist: anyio <4,>=3.5.0
|
238
238
|
Requires-Dist: cachetools <6,>=3.1.1
|
239
|
+
Requires-Dist: catboost <1.3,>=1.2.0
|
239
240
|
Requires-Dist: cloudpickle >=2.0.0
|
240
241
|
Requires-Dist: fsspec[http] <2024,>=2022.11
|
241
242
|
Requires-Dist: importlib-resources <7,>=6.1.1
|
242
243
|
Requires-Dist: numpy <2,>=1.23
|
243
244
|
Requires-Dist: packaging <24,>=20.9
|
244
|
-
Requires-Dist: pandas <
|
245
|
+
Requires-Dist: pandas <3,>=1.0.0
|
245
246
|
Requires-Dist: pyarrow
|
246
247
|
Requires-Dist: pytimeparse <2,>=1.1.8
|
247
248
|
Requires-Dist: pyyaml <7,>=6.0
|
@@ -255,7 +256,7 @@ Requires-Dist: sqlparse <1,>=0.4
|
|
255
256
|
Requires-Dist: typing-extensions <5,>=4.1.0
|
256
257
|
Requires-Dist: xgboost <2,>=1.7.3
|
257
258
|
Provides-Extra: all
|
258
|
-
Requires-Dist: lightgbm
|
259
|
+
Requires-Dist: lightgbm <4.2,>=3.3.5 ; extra == 'all'
|
259
260
|
Requires-Dist: mlflow <2.4,>=2.1.0 ; extra == 'all'
|
260
261
|
Requires-Dist: peft <1,>=0.5.0 ; extra == 'all'
|
261
262
|
Requires-Dist: sentence-transformers <3,>=2.2.2 ; extra == 'all'
|
@@ -263,11 +264,11 @@ Requires-Dist: sentencepiece <0.2,>=0.1.95 ; extra == 'all'
|
|
263
264
|
Requires-Dist: shap ==0.42.1 ; extra == 'all'
|
264
265
|
Requires-Dist: tensorflow <3,>=2.10 ; extra == 'all'
|
265
266
|
Requires-Dist: tokenizers <1,>=0.10 ; extra == 'all'
|
267
|
+
Requires-Dist: torch <3,>=2.0.1 ; extra == 'all'
|
266
268
|
Requires-Dist: torchdata <1,>=0.4 ; extra == 'all'
|
267
269
|
Requires-Dist: transformers <5,>=4.32.1 ; extra == 'all'
|
268
|
-
Requires-Dist: torch <2.1.0,>=2.0.1 ; (platform_system == "Windows") and extra == 'all'
|
269
270
|
Provides-Extra: lightgbm
|
270
|
-
Requires-Dist: lightgbm
|
271
|
+
Requires-Dist: lightgbm <4.2,>=3.3.5 ; extra == 'lightgbm'
|
271
272
|
Provides-Extra: llm
|
272
273
|
Requires-Dist: peft <1,>=0.5.0 ; extra == 'llm'
|
273
274
|
Provides-Extra: mlflow
|
@@ -277,8 +278,8 @@ Requires-Dist: shap ==0.42.1 ; extra == 'shap'
|
|
277
278
|
Provides-Extra: tensorflow
|
278
279
|
Requires-Dist: tensorflow <3,>=2.10 ; extra == 'tensorflow'
|
279
280
|
Provides-Extra: torch
|
281
|
+
Requires-Dist: torch <3,>=2.0.1 ; extra == 'torch'
|
280
282
|
Requires-Dist: torchdata <1,>=0.4 ; extra == 'torch'
|
281
|
-
Requires-Dist: torch <2.1.0,>=2.0.1 ; (platform_system == "Windows") and extra == 'torch'
|
282
283
|
Provides-Extra: transformers
|
283
284
|
Requires-Dist: sentence-transformers <3,>=2.2.2 ; extra == 'transformers'
|
284
285
|
Requires-Dist: sentencepiece <0.2,>=0.1.95 ; extra == 'transformers'
|
@@ -370,13 +371,52 @@ be compatibility issues. Server-side functionality that `snowflake-ml-python` de
|
|
370
371
|
|
371
372
|
# Release History
|
372
373
|
|
373
|
-
## 1.
|
374
|
+
## 1.4.1
|
375
|
+
|
376
|
+
### New Features
|
377
|
+
|
378
|
+
- Registry: Add support for `catboost` model (`catboost.CatBoostClassifier`, `catboost.CatBoostRegressor`).
|
379
|
+
- Registry: Add support for `lightgbm` model (`lightgbm.Booster`, `lightgbm.LightGBMClassifier`, `lightgbm.LightGBMRegressor`).
|
380
|
+
|
381
|
+
### Bug Fixes
|
382
|
+
|
383
|
+
- Registry: Fix a bug that leads to relax_version option is not working.
|
384
|
+
|
385
|
+
## 1.4.0 (2024-04-08)
|
386
|
+
|
387
|
+
### Bug Fixes
|
388
|
+
|
389
|
+
- Registry: Fix a bug when multiple models are being called from the same query, models other than the first one will
|
390
|
+
have incorrect result. This fix only works for newly logged model.
|
391
|
+
- Modeling: When registering a model, only method(s) that is mentioned in `save_model` would be added to model signature
|
392
|
+
in SnowML models.
|
393
|
+
- Modeling: Fix a bug that when n_jobs is not 1, model cannot execute methods such as
|
394
|
+
predict, predict_log_proba, and other batch inference methods. The n_jobs would automatically
|
395
|
+
set to 1 because vectorized udf currently doesn't support joblib parallel backend.
|
396
|
+
- Modeling: Fix a bug that batch inference methods cannot infer the datatype when the first row of data contains NULL.
|
397
|
+
- Modeling: Matches Distributed HPO output column names with the snowflake identifier.
|
398
|
+
- Modeling: Relax package versions for all Distributed HPO methods if the installed version
|
399
|
+
is not available in the Snowflake conda channel
|
400
|
+
- Modeling: Add sklearn as required dependency for LightGBM package.
|
401
|
+
|
402
|
+
### Behavior Changes
|
403
|
+
|
404
|
+
- Registry: `apply` method is no longer by default logged when logging a xgboost model. If that is required, it could
|
405
|
+
be specified manually when logging the model by `log_model(..., options={"target_methods": ["apply", ...]})`.
|
406
|
+
|
407
|
+
### New Features
|
408
|
+
|
409
|
+
- Registry: Add support for `sentence-transformers` model (`sentence_transformers.SentenceTransformer`).
|
410
|
+
- Registry: Now version name is no longer required when logging a model. If not provided, a random human readable ID
|
411
|
+
will be generated.
|
412
|
+
|
413
|
+
## 1.3.1 (2024-03-21)
|
374
414
|
|
375
415
|
### New Features
|
376
416
|
|
377
417
|
- FileSet: `snowflake.ml.fileset.sfcfs.SFFileSystem` can now be used in UDFs and stored procedures.
|
378
418
|
|
379
|
-
## 1.3.0
|
419
|
+
## 1.3.0 (2024-03-12)
|
380
420
|
|
381
421
|
### Bug Fixes
|
382
422
|
|
@@ -412,8 +452,7 @@ be compatibility issues. Server-side functionality that `snowflake-ml-python` de
|
|
412
452
|
- Registry: Improve the error message when specifying currently unsupported `pip_requirements` argument.
|
413
453
|
- Model Development: Fix precision_recall_fscore_support incorrect results when `average="samples"`.
|
414
454
|
- Model Registry: Fix an issue that leads to description, metrics or tags are not correctly returned in newly created
|
415
|
-
Model Registry (PrPr) due to Snowflake BCR [2024_01](
|
416
|
-
https://docs.snowflake.com/en/release-notes/bcr-bundles/2024_01/bcr-1483)
|
455
|
+
Model Registry (PrPr) due to Snowflake BCR [2024_01](https://docs.snowflake.com/en/release-notes/bcr-bundles/2024_01/bcr-1483)
|
417
456
|
|
418
457
|
### Behavior Changes
|
419
458
|
|
@@ -465,9 +504,9 @@ be compatibility issues. Server-side functionality that `snowflake-ml-python` de
|
|
465
504
|
### Additional Notes
|
466
505
|
|
467
506
|
- Model Registry: The `snowflake.ml.registry.model_registry.ModelRegistry` has been deprecated starting from version
|
468
|
-
1.2.0. It will stay in the Private Preview phase. For future implementations, kindly utilize
|
469
|
-
`snowflake.ml.registry.Registry`, except when specifically required. The old model registry will be removed once all
|
470
|
-
its primary functionalities are fully integrated into the new registry.
|
507
|
+
1.2.0. It will stay in the Private Preview phase. For future implementations, kindly utilize
|
508
|
+
`snowflake.ml.registry.Registry`, except when specifically required. The old model registry will be removed once all
|
509
|
+
its primary functionalities are fully integrated into the new registry.
|
471
510
|
|
472
511
|
## 1.1.2 (2023-12-18)
|
473
512
|
|
@@ -522,7 +561,7 @@ its primary functionalities are fully integrated into the new registry.
|
|
522
561
|
- Model Registry: Fix regression issue that container logging is not shown during model deployment to SPCS.
|
523
562
|
- Model Development: Enhance the column capacity of OrdinalEncoder.
|
524
563
|
- Model Registry: Fix unbound `batch_size` error when deploying a model other than Hugging Face Pipeline
|
525
|
-
|
564
|
+
and LLM with GPU on SPCS.
|
526
565
|
|
527
566
|
### Behavior Changes
|
528
567
|
|
@@ -564,7 +603,7 @@ its primary functionalities are fully integrated into the new registry.
|
|
564
603
|
### Behavior Changes
|
565
604
|
|
566
605
|
- Model Development: precision_score, recall_score, f1_score, fbeta_score, precision_recall_fscore_support,
|
567
|
-
mean_absolute_error, mean_squared_error, and mean_absolute_percentage_error metric calculations are now distributed.
|
606
|
+
mean_absolute_error, mean_squared_error, and mean_absolute_percentage_error metric calculations are now distributed.
|
568
607
|
- Model Registry: `deploy` will now return `Deployment` for deployment information.
|
569
608
|
|
570
609
|
### New Features
|
@@ -578,7 +617,7 @@ mean_absolute_error, mean_squared_error, and mean_absolute_percentage_error metr
|
|
578
617
|
- Model Development: Fix an issue that alias definitions cause `SnowparkSQLUnexpectedAliasException` in inference.
|
579
618
|
- Model Registry: Fix an issue that signature inference could be incorrect when using Snowpark DataFrame as sample input.
|
580
619
|
- Model Registry: Fix too strict data type validation when predicting. Now, for example, if you have a INT8
|
581
|
-
|
620
|
+
type feature in the signature, if providing a INT64 dataframe but all values are within the range, it would not fail.
|
582
621
|
|
583
622
|
## 1.0.9 (2023-09-28)
|
584
623
|
|
@@ -601,7 +640,7 @@ mean_absolute_error, mean_squared_error, and mean_absolute_percentage_error metr
|
|
601
640
|
- Model Development: Fix an issue when the sklearn default value is `np.nan`.
|
602
641
|
- Model Registry: Fix an issue that incorrect docker executable is used when building images.
|
603
642
|
- Model Registry: Fix an issue that specifying `token` argument when using
|
604
|
-
`snowflake.ml.model.models.huggingface_pipeline.HuggingFacePipelineModel` with `transformers < 4.32.0` is not effective.
|
643
|
+
`snowflake.ml.model.models.huggingface_pipeline.HuggingFacePipelineModel` with `transformers < 4.32.0` is not effective.
|
605
644
|
- Model Registry: Fix an issue that incorrect system function call is used when deploying to SPCS.
|
606
645
|
- Model Registry: Fix an issue when using a `transformers.pipeline` that does not have a `tokenizer`.
|
607
646
|
- Model Registry: Fix incorrectly-inferred image repository name during model deployment to SPCS.
|
@@ -621,17 +660,17 @@ mean_absolute_error, mean_squared_error, and mean_absolute_percentage_error metr
|
|
621
660
|
- Model Registry: add `create_if_not_exists` parameter in constructor.
|
622
661
|
- Model Registry: Added get_or_create_model_registry API.
|
623
662
|
- Model Registry: Added support for using GPU inference when deploying XGBoost (`xgboost.XGBModel` and `xgboost.Booster`
|
624
|
-
), PyTorch (`torch.nn.Module` and `torch.jit.ScriptModule`) and TensorFlow (`tensorflow.Module` and
|
625
|
-
`tensorflow.keras.Model`) models to Snowpark Container Services.
|
663
|
+
), PyTorch (`torch.nn.Module` and `torch.jit.ScriptModule`) and TensorFlow (`tensorflow.Module` and
|
664
|
+
`tensorflow.keras.Model`) models to Snowpark Container Services.
|
626
665
|
- Model Registry: When inferring model signature, `Sequence` of built-in types, `Sequence` of `numpy.ndarray`,
|
627
|
-
`Sequence` of `torch.Tensor`, `Sequence` of `tensorflow.Tensor` and `Sequence` of `tensorflow.Tensor` can be used
|
628
|
-
|
666
|
+
`Sequence` of `torch.Tensor`, `Sequence` of `tensorflow.Tensor` and `Sequence` of `tensorflow.Tensor` can be used
|
667
|
+
instead of only `List` of them.
|
629
668
|
- Model Registry: Added `get_training_dataset` API.
|
630
669
|
- Model Development: Size of metrics result can exceed previous 8MB limit.
|
631
670
|
- Model Registry: Added support save/load/deploy HuggingFace pipeline object (`transformers.Pipeline`) and our wrapper
|
632
|
-
(`snowflake.ml.model.models.huggingface_pipeline.HuggingFacePipelineModel`) to it. Using the wrapper to specify
|
633
|
-
configurations and the model for the pipeline will be loaded dynamically when deploying. Currently, following tasks
|
634
|
-
are supported to log without manually specifying model signatures:
|
671
|
+
(`snowflake.ml.model.models.huggingface_pipeline.HuggingFacePipelineModel`) to it. Using the wrapper to specify
|
672
|
+
configurations and the model for the pipeline will be loaded dynamically when deploying. Currently, following tasks
|
673
|
+
are supported to log without manually specifying model signatures:
|
635
674
|
- "conversational"
|
636
675
|
- "fill-mask"
|
637
676
|
- "question-answering"
|
@@ -655,18 +694,18 @@ are supported to log without manually specifying model signatures:
|
|
655
694
|
- Model Registry: `log_model()` now return a `ModelReference` object instead of a model ID.
|
656
695
|
- Model Registry: When deploying a model with 1 `target method` only, the `target_method` argument can be omitted.
|
657
696
|
- Model Registry: When using the snowflake-ml-python with version newer than what is available in Snowflake Anaconda
|
658
|
-
Channel, `embed_local_ml_library` option will be set as `True` automatically if not.
|
697
|
+
Channel, `embed_local_ml_library` option will be set as `True` automatically if not.
|
659
698
|
- Model Registry: When deploying a model to Snowpark Container Services and using GPU, the default value of num_workers
|
660
|
-
will be 1.
|
699
|
+
will be 1.
|
661
700
|
- Model Registry: `keep_order` and `output_with_input_features` in the deploy options have been removed. Now the
|
662
|
-
behavior is controlled by the type of the input when calling `model.predict()`. If the input is a `pandas.DataFrame`,
|
663
|
-
the behavior will be the same as `keep_order=True` and `output_with_input_features=False` before. If the input is a
|
664
|
-
`snowpark.DataFrame`, the behavior will be the same as `keep_order=False` and `output_with_input_features=True` before.
|
701
|
+
behavior is controlled by the type of the input when calling `model.predict()`. If the input is a `pandas.DataFrame`,
|
702
|
+
the behavior will be the same as `keep_order=True` and `output_with_input_features=False` before. If the input is a
|
703
|
+
`snowpark.DataFrame`, the behavior will be the same as `keep_order=False` and `output_with_input_features=True` before.
|
665
704
|
- Model Registry: When logging and deploying PyTorch (`torch.nn.Module` and `torch.jit.ScriptModule`) and TensorFlow
|
666
|
-
(`tensorflow.Module` and `tensorflow.keras.Model`) models, we no longer accept models whose input is a list of tensor
|
667
|
-
and output is a list of tensors. Instead, now we accept models whose input is 1 or more tensors as positional arguments,
|
668
|
-
|
669
|
-
|
705
|
+
(`tensorflow.Module` and `tensorflow.keras.Model`) models, we no longer accept models whose input is a list of tensor
|
706
|
+
and output is a list of tensors. Instead, now we accept models whose input is 1 or more tensors as positional arguments,
|
707
|
+
and output is a tensor or a tuple of tensors. The input and output dataframe when predicting keep the same as before,
|
708
|
+
that is every column is an array feature and contains a tensor.
|
670
709
|
|
671
710
|
## 1.0.5 (2023-08-17)
|
672
711
|
|
@@ -679,7 +718,7 @@ and output is a list of tensors. Instead, now we accept models whose input is 1
|
|
679
718
|
|
680
719
|
- Model Registry: Restore the db/schema back to the session after `create_model_registry()`.
|
681
720
|
- Model Registry: Fixed an issue that the UDF name created when deploying a model is not identical to what is provided
|
682
|
-
and cannot be correctly dropped when deployment getting dropped.
|
721
|
+
and cannot be correctly dropped when deployment getting dropped.
|
683
722
|
- connection_params.SnowflakeLoginOptions(): Added support for `private_key_path`.
|
684
723
|
|
685
724
|
## 1.0.4 (2023-07-28)
|
@@ -700,7 +739,7 @@ and cannot be correctly dropped when deployment getting dropped.
|
|
700
739
|
### Behavior Changes
|
701
740
|
|
702
741
|
- Model Registry: When predicting a model whose output is a list of NumPy ndarray, the output would not be flattened,
|
703
|
-
instead, every ndarray will act as a feature(column) in the output.
|
742
|
+
instead, every ndarray will act as a feature(column) in the output.
|
704
743
|
|
705
744
|
### New Features
|
706
745
|
|
@@ -709,18 +748,18 @@ instead, every ndarray will act as a feature(column) in the output.
|
|
709
748
|
### Bug Fixes
|
710
749
|
|
711
750
|
- Model Registry: Fix an issue that when database or schema name provided to `create_model_registry` contains special
|
712
|
-
characters, the model registry cannot be created.
|
751
|
+
characters, the model registry cannot be created.
|
713
752
|
- Model Registry: Fix an issue that `get_model_description` returns with additional quotes.
|
714
753
|
- Model Registry: Fix incorrect error message when attempting to remove a unset tag of a model.
|
715
754
|
- Model Registry: Fix a typo in the default deployment table name.
|
716
755
|
- Model Registry: Snowpark dataframe for sample input or input for `predict` method that contains a column with
|
717
|
-
Snowflake `NUMBER(precision, scale)` data type where `scale = 0` will not lead to error, and will now correctly
|
718
|
-
recognized as `INT64` data type in model signature.
|
756
|
+
Snowflake `NUMBER(precision, scale)` data type where `scale = 0` will not lead to error, and will now correctly
|
757
|
+
recognized as `INT64` data type in model signature.
|
719
758
|
- Model Registry: Fix an issue that prevent model logged in the system whose default encoding is not UTF-8 compatible
|
720
|
-
from deploying.
|
759
|
+
from deploying.
|
721
760
|
- Model Registry: Added earlier and better error message when any file name in the model or the file name of model
|
722
|
-
itself contains characters that are unable to be encoded using ASCII. It is currently not supported to deploy such a
|
723
|
-
model.
|
761
|
+
itself contains characters that are unable to be encoded using ASCII. It is currently not supported to deploy such a
|
762
|
+
model.
|
724
763
|
|
725
764
|
## 1.0.2 (2023-06-22)
|
726
765
|
|
@@ -729,16 +768,16 @@ model.
|
|
729
768
|
- Model Registry: Prohibit non-snowflake-native models from being logged.
|
730
769
|
- Model Registry: `_use_local_snowml` parameter in options of `deploy()` has been removed.
|
731
770
|
- Model Registry: A default `False` `embed_local_ml_library` parameter has been added to the options of `log_model()`.
|
732
|
-
With this set to `False` (default), the version of the local snowflake-ml-python library will be recorded and used when
|
733
|
-
deploying the model. With this set to `True`, local snowflake-ml-python library will be embedded into the logged model,
|
734
|
-
and will be used when you load or deploy the model.
|
771
|
+
With this set to `False` (default), the version of the local snowflake-ml-python library will be recorded and used when
|
772
|
+
deploying the model. With this set to `True`, local snowflake-ml-python library will be embedded into the logged model,
|
773
|
+
and will be used when you load or deploy the model.
|
735
774
|
|
736
775
|
### New Features
|
737
776
|
|
738
777
|
- Model Registry: A new optional argument named `code_paths` has been added to the arguments of `log_model()` for users
|
739
|
-
to specify additional code paths to be imported when loading and deploying the model.
|
778
|
+
to specify additional code paths to be imported when loading and deploying the model.
|
740
779
|
- Model Registry: A new optional argument named `options` has been added to the arguments of `log_model()` to specify
|
741
|
-
any additional options when saving the model.
|
780
|
+
any additional options when saving the model.
|
742
781
|
- Model Development: Added metrics:
|
743
782
|
- d2_absolute_error_score
|
744
783
|
- d2_pinball_score
|
@@ -757,14 +796,14 @@ any additional options when saving the model.
|
|
757
796
|
|
758
797
|
- Model Development: Changed Metrics APIs to imitate sklearn metrics modules:
|
759
798
|
- `accuracy_score()`, `confusion_matrix()`, `precision_recall_fscore_support()`, `precision_score()` methods move from
|
760
|
-
|
799
|
+
respective modules to `metrics.classification`.
|
761
800
|
- Model Registry: The default table/stage created by the Registry now uses "_SYSTEM_" as a prefix.
|
762
801
|
- Model Registry: `get_model_history()` method as been enhanced to include the history of model deployment.
|
763
802
|
|
764
803
|
### New Features
|
765
804
|
|
766
805
|
- Model Registry: A default `False` flag named `replace_udf` has been added to the options of `deploy()`. Setting this
|
767
|
-
to `True` will allow overwrite existing UDF with the same name when deploying.
|
806
|
+
to `True` will allow overwrite existing UDF with the same name when deploying.
|
768
807
|
- Model Development: Added metrics:
|
769
808
|
- f1_score
|
770
809
|
- fbeta_score
|
@@ -774,9 +813,9 @@ to `True` will allow overwrite existing UDF with the same name when deploying.
|
|
774
813
|
- log_loss
|
775
814
|
- precision_recall_curve
|
776
815
|
- Model Registry: A new argument named `permanent` has been added to the argument of `deploy()`. Setting this to `True`
|
777
|
-
allows the creation of a permanent deployment without needing to specify the UDF location.
|
816
|
+
allows the creation of a permanent deployment without needing to specify the UDF location.
|
778
817
|
- Model Registry: A new method `list_deployments()` has been added to enumerate all permanent deployments originating
|
779
|
-
from a specific model.
|
818
|
+
from a specific model.
|
780
819
|
- Model Registry: A new method `get_deployment()` has been added to fetch a deployment by its deployment name.
|
781
820
|
- Model Registry: A new method `delete_deployment()` has been added to remove an existing permanent deployment.
|
782
821
|
|
@@ -786,13 +825,13 @@ from a specific model.
|
|
786
825
|
|
787
826
|
- Model Registry: `predict()` method moves from Registry to ModelReference.
|
788
827
|
- Model Registry: `_snowml_wheel_path` parameter in options of `deploy()`, is replaced with `_use_local_snowml` with
|
789
|
-
default value of `False`. Setting this to `True` will have the same effect of uploading local SnowML code when executing
|
790
|
-
model in the warehouse.
|
828
|
+
default value of `False`. Setting this to `True` will have the same effect of uploading local SnowML code when executing
|
829
|
+
model in the warehouse.
|
791
830
|
- Model Registry: Removed `id` field from `ModelReference` constructor.
|
792
831
|
- Model Development: Preprocessing and Metrics move to the modeling package: `snowflake.ml.modeling.preprocessing` and
|
793
|
-
`snowflake.ml.modeling.metrics`.
|
832
|
+
`snowflake.ml.modeling.metrics`.
|
794
833
|
- Model Development: `get_sklearn_object()` method is renamed to `to_sklearn()`, `to_xgboost()`, and `to_lightgbm()` for
|
795
|
-
respective native models.
|
834
|
+
respective native models.
|
796
835
|
|
797
836
|
### New Features
|
798
837
|
|
@@ -854,7 +893,7 @@ respective native models.
|
|
854
893
|
### New Features
|
855
894
|
|
856
895
|
- Model Registry: Added support for delete_model. Use delete_artifact = False to not delete the underlying model data
|
857
|
-
but just unregister.
|
896
|
+
but just unregister.
|
858
897
|
|
859
898
|
## 0.2.2 (2023-04-11)
|
860
899
|
|