ACCURACY

functionsupportedGovernance (policies, tags, data quality)Enterprise+

docs.snowflake.com ↗

Data metric functions

Returns the percentage of rows in which a predicted value is equal to the actual value. Use this function to measure the output of a classification model, such as a model that predicts a category, a label, or a yes-or-no outcome. This topic provides the syntax for calling the function directly. To learn how to associate the function with a table or view so it runs at regular intervals, see Associate a DMF. Data Quality Monitoring requires Enterprise Edition. To inquire about upgrading, please contact Snowflake Support.

Syntax

SNOWFLAKE.CORE.ACCURACY(<query>)

Parameters

NameRequiredDescription
queryrequiredSpecifies a SQL query that projects two columns. The first column contains the predicted values, and the second column contains the actual values.

Returns

The function returns a FLOAT value from 0 to 100. A value of 100 means that every prediction is equal to the actual value. The function returns NULL if no row has both a predicted and an actual value.

Usage notes

Allowed data types

The two columns projected by the query must have the same data type, which must be one of the following: - BOOLEAN - NUMBER - VARCHAR