ML 函数

这些强大的分析函数使用机器学习为您提供对数据的自动预测和洞察。Snowflake 为每个功能提供了适当类型的模型,即使您不是机器学习专家,也可充分利用它们。您所需要的只是数据。

时间序列功能

使用时间序列函数基于时间序列数据训练机器学习模型,以确定指定指标(例如销售额)随时间的变化情况,以及相对于数据的其他功能如何变化。然后,该模型根据数据中检测到的趋势提供见解或预测。

  • Forecasting predicts future metric values from past trends in time-series data.
  • Anomaly Detection flags metric values that differ from typical expectations.

其他分析函数

这些功能不需要时间序列数据。

  • Classification sort rows into two or more classes based on their most predictive features.
  • Top Insights helps you find dimensions and values that affect the metric in surprising ways.

成本注意事项

您在使用 ML 函数时,会产生存储和计算成本。这些成本根据所使用的功能以及训练和预测中使用的数据量而有所不同。

The storage costs you incur reflect storage of the ML model instances created during the training step. To view the objects associated with your model instance, navigate to your Account Usage views (ACCOUNT_USAGE.TABLES and ACCOUNT_USAGE.STAGES). These objects appear with null database and schema columns. The instance_id column, however, will be populated, indicating that these objects are contained in a model instance. These objects are fully managed by the model instance, and you cannot access or delete them separately. To reduce storage costs associated with your models, delete unused or obsolete models.

See Understanding compute cost for general information on Snowflake compute costs.

限制

Before you use ML functions, you must ensure AUTOCOMMIT is enabled in your session. AUTOCOMMIT is enabled by default when you start a new Snowflake session.

在 Snowpark 中使用 ML 函数

session.call is not yet compatible with models created by ML functions. To call such a model in Snowpark, use session.sql instead, as shown here.

session.sql('call my_model!FORECAST(...)').collect()