Defining the Task and Target of the Model
How to set the objective for your model?
Check This First!This article refers to BaseModel accessed via Docker container. Please refer to Snowflake Native App section if you are using BaseModel as SF GUI application.
To fine-tune the foundation model for your specific business scenario, you need to:
- Select the machine learning problem that best fits your business scenario and produces actionable outputsโfor example, a single probability value indicating customer churn, or an array of scores indicating a user's likelihood to choose various brands.
- Define the target function that the model will aim to approximate. This function transforms the predicted events into the desired output (e.g., binary labels, continuous values, or sketches representing entity recommendations).
Specifying these two components correctly is essential for training a downstream model that effectively addresses your business goals.
Select the machine learning problem
Below are typical business use cases translated into ML problems supported by BaseModel Class Tasks, each with clarified Output formats:
Binary Classification
Use Cases
- Predict propensity to churn for retention campaigns
- Estimate no-show likelihood at clinics
- Forecast user interest to prompt subscription
- Detect fraudulent transactions
BaseModel Class Task
BinaryClassificationTask
Output
A np.array
with a single float32 value (0 or 1)
Multi-class Classification
Use Cases
- Predict a customer's favorite brand for targeting
- Recommend a subscription plan
- Determine likely vehicle trim level for relevant offers
BaseModel Class Task
MulticlassClassificationTask
Parameters
- class_names: list[str]
The values of the target feature that will be used as class labels for multiclass classification.
Output
A np.array
of float32 valuesโone per class, summing to 1
Multi-label Classification
Use Cases
- Predict multiple products a customer may buy for personalization
- Recommend services for cross-selling
- Suggest game genres a player might enjoy
BaseModel Class Task
MultilabelClassificationTask
Parameters
- class_names: list[str]
The values of the target feature that will be used as class labels for multi-label classification.
Output
A np.array
of float32 values (0 or 1) per class
Regression
Use Cases
- Estimate customer lifetime value (LTV)
- Forecast customer profitability
- Predict telecom data usage volumes
BaseModel Class Task
RegressionTask
Parameters
- num_targets: int
Number of numercial targets to predict. - max_value: float
Upper bound for the values predicted by the model.
Output
A np.array
of float32 continuous value(s)
Recommendation
Use Cases
- Select products for personalized web pages
- Populate a โYour grocery favoritesโ section
- Recommend new games based on user behavior
- Recommend a customerโs favorite brands
- Recommend relevant services for a customerโs needs
BaseModel Class Task
RecommendationTask
โ suitable for high-cardinality entity spaces (e.g., large product catalogs, marketplaces, movies)OneHotRecommendationTask
โ ideal for low-cardinality cases (e.g., limited SKUs, service catalogs, brand-level recommendations)
Output
A sketchโa specialized, efficient BaseModel representation for entity behavior
Build the Target Function
The target function offers a streamlined view of the modelโs training logic. It maps input data (history and future events, entity attributes, context) to the required problem-specific output (label, value, etc.)
-
Inputs You receive events split into history and future, along with entity attributes and context.
-
Define time windows & intervals Establish precise intervals to consider in both history and future datasets.
-
Transformations Within these intervals, you perform necessary operationsโsuch as aggregations (e.g., sum, count, mean), filtering or grouping events.
-
Output Return outputs aligned with the chosen taskโs format:
- For classification or regression tasks, return a
np.ndarray
withdtype=np.float32
- For recommendation tasks, return a sketch
- For classification or regression tasks, return a
The image below summarizes the entire concept of target function.

To further your understanding, we have broken down the learning into several detailed subpages:
-
Explore how functions receive inputs like events, main entity attributes, and joined attributes.
-
Target Function: Time Window and Operations on Events
Learn how to define time windows, apply transformations and generate the outputs.
-
Discover use-caseโspecific examples for each task type (e.g. binary classification, recommendation).
-
Validating the Target Function
Understand how to validate your target function using
verify_target()
before training the model.
Youโre also welcome to explore our Recipes โ a collection of in-depth examples and guides covering target function creation by use case.
Updated 13 days ago