snowflake-ml-python 1.11.0__py3-none-any.whl → 1.12.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- snowflake/cortex/_complete.py +3 -2
- snowflake/ml/_internal/utils/service_logger.py +26 -1
- snowflake/ml/experiment/_client/artifact.py +76 -0
- snowflake/ml/experiment/_client/experiment_tracking_sql_client.py +64 -1
- snowflake/ml/experiment/experiment_tracking.py +89 -4
- snowflake/ml/feature_store/feature_store.py +1150 -131
- snowflake/ml/feature_store/feature_view.py +122 -0
- snowflake/ml/jobs/_utils/constants.py +8 -16
- snowflake/ml/jobs/_utils/feature_flags.py +16 -0
- snowflake/ml/jobs/_utils/payload_utils.py +19 -5
- snowflake/ml/jobs/_utils/scripts/get_instance_ip.py +18 -7
- snowflake/ml/jobs/_utils/scripts/mljob_launcher.py +12 -4
- snowflake/ml/jobs/_utils/spec_utils.py +4 -6
- snowflake/ml/jobs/_utils/types.py +2 -1
- snowflake/ml/jobs/job.py +33 -17
- snowflake/ml/jobs/manager.py +107 -12
- snowflake/ml/model/__init__.py +6 -1
- snowflake/ml/model/_client/model/batch_inference_specs.py +27 -0
- snowflake/ml/model/_client/model/model_version_impl.py +61 -65
- snowflake/ml/model/_client/ops/service_ops.py +73 -154
- snowflake/ml/model/_client/service/model_deployment_spec.py +20 -37
- snowflake/ml/model/_client/service/model_deployment_spec_schema.py +14 -4
- snowflake/ml/model/_packager/model_handlers/huggingface_pipeline.py +207 -2
- snowflake/ml/model/_packager/model_handlers/sklearn.py +3 -1
- snowflake/ml/model/_packager/model_runtime/_snowml_inference_alternative_requirements.py +3 -3
- snowflake/ml/model/_signatures/snowpark_handler.py +1 -1
- snowflake/ml/model/_signatures/utils.py +4 -2
- snowflake/ml/model/openai_signatures.py +57 -0
- snowflake/ml/modeling/_internal/estimator_utils.py +43 -1
- snowflake/ml/modeling/_internal/local_implementations/pandas_trainer.py +14 -3
- snowflake/ml/modeling/_internal/snowpark_implementations/snowpark_trainer.py +17 -6
- snowflake/ml/modeling/calibration/calibrated_classifier_cv.py +1 -1
- snowflake/ml/modeling/cluster/affinity_propagation.py +1 -1
- snowflake/ml/modeling/cluster/agglomerative_clustering.py +1 -1
- snowflake/ml/modeling/cluster/birch.py +1 -1
- snowflake/ml/modeling/cluster/bisecting_k_means.py +1 -1
- snowflake/ml/modeling/cluster/dbscan.py +1 -1
- snowflake/ml/modeling/cluster/feature_agglomeration.py +1 -1
- snowflake/ml/modeling/cluster/k_means.py +1 -1
- snowflake/ml/modeling/cluster/mean_shift.py +1 -1
- snowflake/ml/modeling/cluster/mini_batch_k_means.py +1 -1
- snowflake/ml/modeling/cluster/optics.py +1 -1
- snowflake/ml/modeling/cluster/spectral_biclustering.py +1 -1
- snowflake/ml/modeling/cluster/spectral_clustering.py +1 -1
- snowflake/ml/modeling/cluster/spectral_coclustering.py +1 -1
- snowflake/ml/modeling/compose/column_transformer.py +1 -1
- snowflake/ml/modeling/compose/transformed_target_regressor.py +1 -1
- snowflake/ml/modeling/covariance/elliptic_envelope.py +1 -1
- snowflake/ml/modeling/covariance/empirical_covariance.py +1 -1
- snowflake/ml/modeling/covariance/graphical_lasso.py +1 -1
- snowflake/ml/modeling/covariance/graphical_lasso_cv.py +1 -1
- snowflake/ml/modeling/covariance/ledoit_wolf.py +1 -1
- snowflake/ml/modeling/covariance/min_cov_det.py +1 -1
- snowflake/ml/modeling/covariance/oas.py +1 -1
- snowflake/ml/modeling/covariance/shrunk_covariance.py +1 -1
- snowflake/ml/modeling/decomposition/dictionary_learning.py +1 -1
- snowflake/ml/modeling/decomposition/factor_analysis.py +1 -1
- snowflake/ml/modeling/decomposition/fast_ica.py +1 -1
- snowflake/ml/modeling/decomposition/incremental_pca.py +1 -1
- snowflake/ml/modeling/decomposition/kernel_pca.py +1 -1
- snowflake/ml/modeling/decomposition/mini_batch_dictionary_learning.py +1 -1
- snowflake/ml/modeling/decomposition/mini_batch_sparse_pca.py +1 -1
- snowflake/ml/modeling/decomposition/pca.py +1 -1
- snowflake/ml/modeling/decomposition/sparse_pca.py +1 -1
- snowflake/ml/modeling/decomposition/truncated_svd.py +1 -1
- snowflake/ml/modeling/discriminant_analysis/linear_discriminant_analysis.py +1 -1
- snowflake/ml/modeling/discriminant_analysis/quadratic_discriminant_analysis.py +1 -1
- snowflake/ml/modeling/ensemble/ada_boost_classifier.py +1 -1
- snowflake/ml/modeling/ensemble/ada_boost_regressor.py +1 -1
- snowflake/ml/modeling/ensemble/bagging_classifier.py +1 -1
- snowflake/ml/modeling/ensemble/bagging_regressor.py +1 -1
- snowflake/ml/modeling/ensemble/extra_trees_classifier.py +1 -1
- snowflake/ml/modeling/ensemble/extra_trees_regressor.py +1 -1
- snowflake/ml/modeling/ensemble/gradient_boosting_classifier.py +1 -1
- snowflake/ml/modeling/ensemble/gradient_boosting_regressor.py +1 -1
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_classifier.py +1 -1
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_regressor.py +1 -1
- snowflake/ml/modeling/ensemble/isolation_forest.py +1 -1
- snowflake/ml/modeling/ensemble/random_forest_classifier.py +1 -1
- snowflake/ml/modeling/ensemble/random_forest_regressor.py +1 -1
- snowflake/ml/modeling/ensemble/stacking_regressor.py +1 -1
- snowflake/ml/modeling/ensemble/voting_classifier.py +1 -1
- snowflake/ml/modeling/ensemble/voting_regressor.py +1 -1
- snowflake/ml/modeling/feature_selection/generic_univariate_select.py +1 -1
- snowflake/ml/modeling/feature_selection/select_fdr.py +1 -1
- snowflake/ml/modeling/feature_selection/select_fpr.py +1 -1
- snowflake/ml/modeling/feature_selection/select_fwe.py +1 -1
- snowflake/ml/modeling/feature_selection/select_k_best.py +1 -1
- snowflake/ml/modeling/feature_selection/select_percentile.py +1 -1
- snowflake/ml/modeling/feature_selection/sequential_feature_selector.py +1 -1
- snowflake/ml/modeling/feature_selection/variance_threshold.py +1 -1
- snowflake/ml/modeling/gaussian_process/gaussian_process_classifier.py +1 -1
- snowflake/ml/modeling/gaussian_process/gaussian_process_regressor.py +1 -1
- snowflake/ml/modeling/impute/iterative_imputer.py +1 -1
- snowflake/ml/modeling/impute/knn_imputer.py +1 -1
- snowflake/ml/modeling/impute/missing_indicator.py +1 -1
- snowflake/ml/modeling/kernel_approximation/additive_chi2_sampler.py +1 -1
- snowflake/ml/modeling/kernel_approximation/nystroem.py +1 -1
- snowflake/ml/modeling/kernel_approximation/polynomial_count_sketch.py +1 -1
- snowflake/ml/modeling/kernel_approximation/rbf_sampler.py +1 -1
- snowflake/ml/modeling/kernel_approximation/skewed_chi2_sampler.py +1 -1
- snowflake/ml/modeling/kernel_ridge/kernel_ridge.py +1 -1
- snowflake/ml/modeling/lightgbm/lgbm_classifier.py +1 -1
- snowflake/ml/modeling/lightgbm/lgbm_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/ard_regression.py +1 -1
- snowflake/ml/modeling/linear_model/bayesian_ridge.py +1 -1
- snowflake/ml/modeling/linear_model/elastic_net.py +1 -1
- snowflake/ml/modeling/linear_model/elastic_net_cv.py +1 -1
- snowflake/ml/modeling/linear_model/gamma_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/huber_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/lars.py +1 -1
- snowflake/ml/modeling/linear_model/lars_cv.py +1 -1
- snowflake/ml/modeling/linear_model/lasso.py +1 -1
- snowflake/ml/modeling/linear_model/lasso_cv.py +1 -1
- snowflake/ml/modeling/linear_model/lasso_lars.py +1 -1
- snowflake/ml/modeling/linear_model/lasso_lars_cv.py +1 -1
- snowflake/ml/modeling/linear_model/lasso_lars_ic.py +1 -1
- snowflake/ml/modeling/linear_model/linear_regression.py +1 -1
- snowflake/ml/modeling/linear_model/logistic_regression.py +1 -1
- snowflake/ml/modeling/linear_model/logistic_regression_cv.py +1 -1
- snowflake/ml/modeling/linear_model/multi_task_elastic_net.py +1 -1
- snowflake/ml/modeling/linear_model/multi_task_elastic_net_cv.py +1 -1
- snowflake/ml/modeling/linear_model/multi_task_lasso.py +1 -1
- snowflake/ml/modeling/linear_model/multi_task_lasso_cv.py +1 -1
- snowflake/ml/modeling/linear_model/orthogonal_matching_pursuit.py +1 -1
- snowflake/ml/modeling/linear_model/passive_aggressive_classifier.py +1 -1
- snowflake/ml/modeling/linear_model/passive_aggressive_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/perceptron.py +1 -1
- snowflake/ml/modeling/linear_model/poisson_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/ransac_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/ridge.py +1 -1
- snowflake/ml/modeling/linear_model/ridge_classifier.py +1 -1
- snowflake/ml/modeling/linear_model/ridge_classifier_cv.py +1 -1
- snowflake/ml/modeling/linear_model/ridge_cv.py +1 -1
- snowflake/ml/modeling/linear_model/sgd_classifier.py +1 -1
- snowflake/ml/modeling/linear_model/sgd_one_class_svm.py +1 -1
- snowflake/ml/modeling/linear_model/sgd_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/theil_sen_regressor.py +1 -1
- snowflake/ml/modeling/linear_model/tweedie_regressor.py +1 -1
- snowflake/ml/modeling/manifold/isomap.py +1 -1
- snowflake/ml/modeling/manifold/mds.py +1 -1
- snowflake/ml/modeling/manifold/spectral_embedding.py +1 -1
- snowflake/ml/modeling/manifold/tsne.py +1 -1
- snowflake/ml/modeling/mixture/bayesian_gaussian_mixture.py +1 -1
- snowflake/ml/modeling/mixture/gaussian_mixture.py +1 -1
- snowflake/ml/modeling/multiclass/one_vs_one_classifier.py +1 -1
- snowflake/ml/modeling/multiclass/one_vs_rest_classifier.py +1 -1
- snowflake/ml/modeling/multiclass/output_code_classifier.py +1 -1
- snowflake/ml/modeling/naive_bayes/bernoulli_nb.py +1 -1
- snowflake/ml/modeling/naive_bayes/categorical_nb.py +1 -1
- snowflake/ml/modeling/naive_bayes/complement_nb.py +1 -1
- snowflake/ml/modeling/naive_bayes/gaussian_nb.py +1 -1
- snowflake/ml/modeling/naive_bayes/multinomial_nb.py +1 -1
- snowflake/ml/modeling/neighbors/k_neighbors_classifier.py +1 -1
- snowflake/ml/modeling/neighbors/k_neighbors_regressor.py +1 -1
- snowflake/ml/modeling/neighbors/kernel_density.py +1 -1
- snowflake/ml/modeling/neighbors/local_outlier_factor.py +1 -1
- snowflake/ml/modeling/neighbors/nearest_centroid.py +1 -1
- snowflake/ml/modeling/neighbors/nearest_neighbors.py +1 -1
- snowflake/ml/modeling/neighbors/neighborhood_components_analysis.py +1 -1
- snowflake/ml/modeling/neighbors/radius_neighbors_classifier.py +1 -1
- snowflake/ml/modeling/neighbors/radius_neighbors_regressor.py +1 -1
- snowflake/ml/modeling/neural_network/bernoulli_rbm.py +1 -1
- snowflake/ml/modeling/neural_network/mlp_classifier.py +1 -1
- snowflake/ml/modeling/neural_network/mlp_regressor.py +1 -1
- snowflake/ml/modeling/preprocessing/polynomial_features.py +1 -1
- snowflake/ml/modeling/semi_supervised/label_propagation.py +1 -1
- snowflake/ml/modeling/semi_supervised/label_spreading.py +1 -1
- snowflake/ml/modeling/svm/linear_svc.py +1 -1
- snowflake/ml/modeling/svm/linear_svr.py +1 -1
- snowflake/ml/modeling/svm/nu_svc.py +1 -1
- snowflake/ml/modeling/svm/nu_svr.py +1 -1
- snowflake/ml/modeling/svm/svc.py +1 -1
- snowflake/ml/modeling/svm/svr.py +1 -1
- snowflake/ml/modeling/tree/decision_tree_classifier.py +1 -1
- snowflake/ml/modeling/tree/decision_tree_regressor.py +1 -1
- snowflake/ml/modeling/tree/extra_tree_classifier.py +1 -1
- snowflake/ml/modeling/tree/extra_tree_regressor.py +1 -1
- snowflake/ml/modeling/xgboost/xgb_classifier.py +1 -1
- snowflake/ml/modeling/xgboost/xgb_regressor.py +1 -1
- snowflake/ml/modeling/xgboost/xgbrf_classifier.py +1 -1
- snowflake/ml/modeling/xgboost/xgbrf_regressor.py +1 -1
- snowflake/ml/monitoring/_client/model_monitor_sql_client.py +91 -6
- snowflake/ml/monitoring/_manager/model_monitor_manager.py +3 -0
- snowflake/ml/monitoring/entities/model_monitor_config.py +3 -0
- snowflake/ml/monitoring/model_monitor.py +26 -0
- snowflake/ml/version.py +1 -1
- {snowflake_ml_python-1.11.0.dist-info → snowflake_ml_python-1.12.0.dist-info}/METADATA +66 -5
- {snowflake_ml_python-1.11.0.dist-info → snowflake_ml_python-1.12.0.dist-info}/RECORD +192 -188
- {snowflake_ml_python-1.11.0.dist-info → snowflake_ml_python-1.12.0.dist-info}/WHEEL +0 -0
- {snowflake_ml_python-1.11.0.dist-info → snowflake_ml_python-1.12.0.dist-info}/licenses/LICENSE.txt +0 -0
- {snowflake_ml_python-1.11.0.dist-info → snowflake_ml_python-1.12.0.dist-info}/top_level.txt +0 -0
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
snowflake/ml/modeling/svm/svc.py
CHANGED
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
snowflake/ml/modeling/svm/svr.py
CHANGED
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
|
|
|
60
60
|
|
|
61
61
|
INFER_SIGNATURE_MAX_ROWS = 100
|
|
62
62
|
|
|
63
|
-
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.
|
|
63
|
+
SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
|
|
64
64
|
# Modeling library estimators require a smaller sklearn version range.
|
|
65
65
|
if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
|
|
66
66
|
raise Exception(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from enum import Enum, auto
|
|
1
2
|
from typing import Any, Mapping, Optional
|
|
2
3
|
|
|
3
4
|
from snowflake import snowpark
|
|
@@ -15,6 +16,25 @@ MODEL_JSON_MODEL_NAME_FIELD = "model_name"
|
|
|
15
16
|
MODEL_JSON_VERSION_NAME_FIELD = "version_name"
|
|
16
17
|
|
|
17
18
|
|
|
19
|
+
class MonitorOperation(Enum):
|
|
20
|
+
SUSPEND = auto()
|
|
21
|
+
RESUME = auto()
|
|
22
|
+
ADD = auto()
|
|
23
|
+
DROP = auto()
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def supported_target_properties(self) -> frozenset[str]:
|
|
27
|
+
return _OPERATION_SUPPORTED_PROPS[self]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
_OPERATION_SUPPORTED_PROPS: dict[MonitorOperation, frozenset[str]] = {
|
|
31
|
+
MonitorOperation.SUSPEND: frozenset(),
|
|
32
|
+
MonitorOperation.RESUME: frozenset(),
|
|
33
|
+
MonitorOperation.ADD: frozenset({"SEGMENT_COLUMN"}),
|
|
34
|
+
MonitorOperation.DROP: frozenset({"SEGMENT_COLUMN"}),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
18
38
|
def _build_sql_list_from_columns(columns: list[sql_identifier.SqlIdentifier]) -> str:
|
|
19
39
|
sql_list = ", ".join([f"'{column}'" for column in columns])
|
|
20
40
|
return f"({sql_list})"
|
|
@@ -70,11 +90,17 @@ class ModelMonitorSQLClient:
|
|
|
70
90
|
baseline_database: Optional[sql_identifier.SqlIdentifier] = None,
|
|
71
91
|
baseline_schema: Optional[sql_identifier.SqlIdentifier] = None,
|
|
72
92
|
baseline: Optional[sql_identifier.SqlIdentifier] = None,
|
|
93
|
+
segment_columns: Optional[list[sql_identifier.SqlIdentifier]] = None,
|
|
73
94
|
statement_params: Optional[dict[str, Any]] = None,
|
|
74
95
|
) -> None:
|
|
75
96
|
baseline_sql = ""
|
|
76
97
|
if baseline:
|
|
77
98
|
baseline_sql = f"""BASELINE={self._infer_qualified_schema(baseline_database, baseline_schema)}.{baseline}"""
|
|
99
|
+
|
|
100
|
+
segment_columns_sql = ""
|
|
101
|
+
if segment_columns:
|
|
102
|
+
segment_columns_sql = f"SEGMENT_COLUMNS={_build_sql_list_from_columns(segment_columns)}"
|
|
103
|
+
|
|
78
104
|
query_result_checker.SqlResultValidator(
|
|
79
105
|
self._sql_client._session,
|
|
80
106
|
f"""
|
|
@@ -93,6 +119,7 @@ class ModelMonitorSQLClient:
|
|
|
93
119
|
TIMESTAMP_COLUMN='{timestamp_column}'
|
|
94
120
|
REFRESH_INTERVAL='{refresh_interval}'
|
|
95
121
|
AGGREGATION_WINDOW='{aggregation_window}'
|
|
122
|
+
{segment_columns_sql}
|
|
96
123
|
{baseline_sql}""",
|
|
97
124
|
statement_params=statement_params,
|
|
98
125
|
).has_column("status").has_dimensions(1, 1).validate()
|
|
@@ -182,6 +209,7 @@ class ModelMonitorSQLClient:
|
|
|
182
209
|
actual_score_columns: list[sql_identifier.SqlIdentifier],
|
|
183
210
|
actual_class_columns: list[sql_identifier.SqlIdentifier],
|
|
184
211
|
id_columns: list[sql_identifier.SqlIdentifier],
|
|
212
|
+
segment_columns: Optional[list[sql_identifier.SqlIdentifier]] = None,
|
|
185
213
|
) -> None:
|
|
186
214
|
"""Ensures all columns exist in the source table.
|
|
187
215
|
|
|
@@ -193,11 +221,14 @@ class ModelMonitorSQLClient:
|
|
|
193
221
|
actual_score_columns: List of actual score column names.
|
|
194
222
|
actual_class_columns: List of actual class column names.
|
|
195
223
|
id_columns: List of id column names.
|
|
224
|
+
segment_columns: List of segment column names.
|
|
196
225
|
|
|
197
226
|
Raises:
|
|
198
227
|
ValueError: If any of the columns do not exist in the source.
|
|
199
228
|
"""
|
|
200
229
|
|
|
230
|
+
segment_columns = [] if segment_columns is None else segment_columns
|
|
231
|
+
|
|
201
232
|
if timestamp_column not in source_column_schema:
|
|
202
233
|
raise ValueError(f"Timestamp column {timestamp_column} does not exist in source.")
|
|
203
234
|
|
|
@@ -214,6 +245,9 @@ class ModelMonitorSQLClient:
|
|
|
214
245
|
if not all([column_name in source_column_schema for column_name in id_columns]):
|
|
215
246
|
raise ValueError(f"ID column(s): {id_columns} do not exist in source.")
|
|
216
247
|
|
|
248
|
+
if not all([column_name in source_column_schema for column_name in segment_columns]):
|
|
249
|
+
raise ValueError(f"Segment column(s): {segment_columns} do not exist in source.")
|
|
250
|
+
|
|
217
251
|
def validate_source(
|
|
218
252
|
self,
|
|
219
253
|
*,
|
|
@@ -226,7 +260,9 @@ class ModelMonitorSQLClient:
|
|
|
226
260
|
actual_score_columns: list[sql_identifier.SqlIdentifier],
|
|
227
261
|
actual_class_columns: list[sql_identifier.SqlIdentifier],
|
|
228
262
|
id_columns: list[sql_identifier.SqlIdentifier],
|
|
263
|
+
segment_columns: Optional[list[sql_identifier.SqlIdentifier]] = None,
|
|
229
264
|
) -> None:
|
|
265
|
+
|
|
230
266
|
source_database = source_database or self._database_name
|
|
231
267
|
source_schema = source_schema or self._schema_name
|
|
232
268
|
# Get Schema of the source. Implicitly validates that the source exists.
|
|
@@ -244,19 +280,38 @@ class ModelMonitorSQLClient:
|
|
|
244
280
|
actual_score_columns=actual_score_columns,
|
|
245
281
|
actual_class_columns=actual_class_columns,
|
|
246
282
|
id_columns=id_columns,
|
|
283
|
+
segment_columns=segment_columns,
|
|
247
284
|
)
|
|
248
285
|
|
|
249
286
|
def _alter_monitor(
|
|
250
287
|
self,
|
|
251
|
-
operation:
|
|
288
|
+
operation: MonitorOperation,
|
|
252
289
|
monitor_name: sql_identifier.SqlIdentifier,
|
|
290
|
+
target_property: Optional[str] = None,
|
|
291
|
+
target_value: Optional[sql_identifier.SqlIdentifier] = None,
|
|
253
292
|
statement_params: Optional[dict[str, Any]] = None,
|
|
254
293
|
) -> None:
|
|
255
|
-
|
|
256
|
-
|
|
294
|
+
supported_target_properties = operation.supported_target_properties
|
|
295
|
+
|
|
296
|
+
if supported_target_properties:
|
|
297
|
+
if target_property is None or target_value is None:
|
|
298
|
+
raise ValueError(f"Target property and value must be provided for {operation.name} operation")
|
|
299
|
+
|
|
300
|
+
if target_property not in supported_target_properties:
|
|
301
|
+
raise ValueError(
|
|
302
|
+
f"Only {', '.join(supported_target_properties)} supported as target property "
|
|
303
|
+
f"for {operation.name} operation"
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
property_clause = f"{target_property}={target_value}" if target_property and target_value else ""
|
|
307
|
+
alter_momo_sql = (
|
|
308
|
+
f"""ALTER MODEL MONITOR {self._database_name}.{self._schema_name}.{monitor_name} """
|
|
309
|
+
f"""{operation.name} {property_clause}"""
|
|
310
|
+
)
|
|
311
|
+
|
|
257
312
|
query_result_checker.SqlResultValidator(
|
|
258
313
|
self._sql_client._session,
|
|
259
|
-
|
|
314
|
+
alter_momo_sql,
|
|
260
315
|
statement_params=statement_params,
|
|
261
316
|
).has_column("status").has_dimensions(1, 1).validate()
|
|
262
317
|
|
|
@@ -266,7 +321,7 @@ class ModelMonitorSQLClient:
|
|
|
266
321
|
statement_params: Optional[dict[str, Any]] = None,
|
|
267
322
|
) -> None:
|
|
268
323
|
self._alter_monitor(
|
|
269
|
-
operation=
|
|
324
|
+
operation=MonitorOperation.SUSPEND,
|
|
270
325
|
monitor_name=monitor_name,
|
|
271
326
|
statement_params=statement_params,
|
|
272
327
|
)
|
|
@@ -277,7 +332,37 @@ class ModelMonitorSQLClient:
|
|
|
277
332
|
statement_params: Optional[dict[str, Any]] = None,
|
|
278
333
|
) -> None:
|
|
279
334
|
self._alter_monitor(
|
|
280
|
-
operation=
|
|
335
|
+
operation=MonitorOperation.RESUME,
|
|
336
|
+
monitor_name=monitor_name,
|
|
337
|
+
statement_params=statement_params,
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
def add_segment_column(
|
|
341
|
+
self,
|
|
342
|
+
monitor_name: sql_identifier.SqlIdentifier,
|
|
343
|
+
segment_column: sql_identifier.SqlIdentifier,
|
|
344
|
+
statement_params: Optional[dict[str, Any]] = None,
|
|
345
|
+
) -> None:
|
|
346
|
+
"""Add a segment column to the Model Monitor"""
|
|
347
|
+
self._alter_monitor(
|
|
348
|
+
operation=MonitorOperation.ADD,
|
|
349
|
+
monitor_name=monitor_name,
|
|
350
|
+
target_property="SEGMENT_COLUMN",
|
|
351
|
+
target_value=segment_column,
|
|
352
|
+
statement_params=statement_params,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
def drop_segment_column(
|
|
356
|
+
self,
|
|
357
|
+
monitor_name: sql_identifier.SqlIdentifier,
|
|
358
|
+
segment_column: sql_identifier.SqlIdentifier,
|
|
359
|
+
statement_params: Optional[dict[str, Any]] = None,
|
|
360
|
+
) -> None:
|
|
361
|
+
"""Drop a segment column from the Model Monitor"""
|
|
362
|
+
self._alter_monitor(
|
|
363
|
+
operation=MonitorOperation.DROP,
|
|
281
364
|
monitor_name=monitor_name,
|
|
365
|
+
target_property="SEGMENT_COLUMN",
|
|
366
|
+
target_value=segment_column,
|
|
282
367
|
statement_params=statement_params,
|
|
283
368
|
)
|
|
@@ -108,6 +108,7 @@ class ModelMonitorManager:
|
|
|
108
108
|
prediction_class_columns = self._build_column_list_from_input(source_config.prediction_class_columns)
|
|
109
109
|
actual_score_columns = self._build_column_list_from_input(source_config.actual_score_columns)
|
|
110
110
|
actual_class_columns = self._build_column_list_from_input(source_config.actual_class_columns)
|
|
111
|
+
segment_columns = self._build_column_list_from_input(source_config.segment_columns)
|
|
111
112
|
|
|
112
113
|
id_columns = [sql_identifier.SqlIdentifier(column_name) for column_name in source_config.id_columns]
|
|
113
114
|
ts_column = sql_identifier.SqlIdentifier(source_config.timestamp_column)
|
|
@@ -123,6 +124,7 @@ class ModelMonitorManager:
|
|
|
123
124
|
actual_score_columns=actual_score_columns,
|
|
124
125
|
actual_class_columns=actual_class_columns,
|
|
125
126
|
id_columns=id_columns,
|
|
127
|
+
segment_columns=segment_columns,
|
|
126
128
|
)
|
|
127
129
|
|
|
128
130
|
self._model_monitor_client.create_model_monitor(
|
|
@@ -144,6 +146,7 @@ class ModelMonitorManager:
|
|
|
144
146
|
prediction_class_columns=prediction_class_columns,
|
|
145
147
|
actual_score_columns=actual_score_columns,
|
|
146
148
|
actual_class_columns=actual_class_columns,
|
|
149
|
+
segment_columns=segment_columns,
|
|
147
150
|
refresh_interval=model_monitor_config.refresh_interval,
|
|
148
151
|
aggregation_window=model_monitor_config.aggregation_window,
|
|
149
152
|
baseline_database=baseline_database_name_id,
|
|
@@ -33,6 +33,9 @@ class ModelMonitorSourceConfig:
|
|
|
33
33
|
baseline: Optional[str] = None
|
|
34
34
|
"""Name of table containing the baseline data."""
|
|
35
35
|
|
|
36
|
+
segment_columns: Optional[list[str]] = None
|
|
37
|
+
"""List of columns in the source containing segment information for grouped monitoring."""
|
|
38
|
+
|
|
36
39
|
|
|
37
40
|
@dataclass
|
|
38
41
|
class ModelMonitorConfig:
|
|
@@ -46,3 +46,29 @@ class ModelMonitor:
|
|
|
46
46
|
telemetry.TelemetrySubProject.MONITORING.value,
|
|
47
47
|
)
|
|
48
48
|
self._model_monitor_client.resume_monitor(self.name, statement_params=statement_params)
|
|
49
|
+
|
|
50
|
+
@telemetry.send_api_usage_telemetry(
|
|
51
|
+
project=telemetry.TelemetryProject.MLOPS.value,
|
|
52
|
+
subproject=telemetry.TelemetrySubProject.MONITORING.value,
|
|
53
|
+
)
|
|
54
|
+
def add_segment_column(self, segment_column: str) -> None:
|
|
55
|
+
"""Add a segment column to the Model Monitor"""
|
|
56
|
+
statement_params = telemetry.get_statement_params(
|
|
57
|
+
telemetry.TelemetryProject.MLOPS.value,
|
|
58
|
+
telemetry.TelemetrySubProject.MONITORING.value,
|
|
59
|
+
)
|
|
60
|
+
segment_column_id = sql_identifier.SqlIdentifier(segment_column)
|
|
61
|
+
self._model_monitor_client.add_segment_column(self.name, segment_column_id, statement_params=statement_params)
|
|
62
|
+
|
|
63
|
+
@telemetry.send_api_usage_telemetry(
|
|
64
|
+
project=telemetry.TelemetryProject.MLOPS.value,
|
|
65
|
+
subproject=telemetry.TelemetrySubProject.MONITORING.value,
|
|
66
|
+
)
|
|
67
|
+
def drop_segment_column(self, segment_column: str) -> None:
|
|
68
|
+
"""Drop a segment column from the Model Monitor"""
|
|
69
|
+
statement_params = telemetry.get_statement_params(
|
|
70
|
+
telemetry.TelemetryProject.MLOPS.value,
|
|
71
|
+
telemetry.TelemetrySubProject.MONITORING.value,
|
|
72
|
+
)
|
|
73
|
+
segment_column_id = sql_identifier.SqlIdentifier(segment_column)
|
|
74
|
+
self._model_monitor_client.drop_segment_column(self.name, segment_column_id, statement_params=statement_params)
|
snowflake/ml/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# This is parsed by regex in conda recipe meta file. Make sure not to break it.
|
|
2
|
-
VERSION = "1.
|
|
2
|
+
VERSION = "1.12.0"
|