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.

As you have learnt in previous section, to apply BaseModel to your specific business scenario, you need to fine-tune the foundation model to your objective. The two main tasks at this stage are:

  • Selecting the machine learning problem that best fits your business scenario and provides actionable outputs. For example, a single number interpretable as the probability of a customer lapsing, or an array of numbers where each item represents the likelihood of purchasing a different brand.

  • Defining the target function which the model will aim to approximate. This function should transform the events predicted by the model, returning the desired result (e.g., 1s for churning customers and 0s for retained customers).

Specifying these two correctly is key to successfully training a downstream model that will work well for your business scenario. Below, we will look at them in more detail.

Select the machine learning problem

Your business objective must be translated into one of standard ML problems. You can find the most typical use cases aligned with the problems currently supported by BaseModel:

Binary Classification
Use Cases
• Predict propensity to lapse, to nominate customers for anti-churn campaign,
• Predict the likelihood of no-show at a clinic, to better manage specialist's appointment capacity,
• Predict the likelihood of a reader subscribing into a premium plan,
• Intercept likely fraudulent behavior, to stop and validate the transaction.
BaseModel Class Task
BinaryClassificationTask
Output
A numpy array of a single number - 1 or 0, as float32 data type.

Multi-class Classification
Use Cases
• Predict a customer's favorite brand or promotion, to allocate them to the most relevant campaign,
• Predict a subscription plan with the highest likelihood of customer opt-in,
• Determine the trim level of the car the customer is most likely to buy, to make the most relevant offer.
BaseModel Class Task
MulticlassClassificationTask
Output
A numpy array with a float32 number for each class; they need to sum to 1.

Multi-label Classification
Use Cases
• Predict a customer's buying propensity of multiple products to personalize a campaign,
• Predict services a customer is likely to purchase, to construct an attractive bundle,
• Recommend multiple game genres a player might enjoy.
BaseModel Class Task
MultilabelClassificationTask
Output
A numpy array with either 1 or 0 for each class.

Regression
Use Cases
• Assess the customer's Life-Time Value,
• Predict the customer’s projected profitability in the next quarter,
• Predict how much data traffic will the telecom customer use this month.
BaseModel Class Task
RegressionTask
Output
A numpy array with a float32 number representing the desired continuous value.

Recommendation
Use Cases
• Select products for web page personalization,
• Select products for "your grocery favourites" section, for a quick start of shopping trip,
• Recommend new games based on a player's past behavior and preferences.
BaseModel Class Task
RecommendationTask
Output
A sketch (a special object specific to BaseModel - see Recommendations Target Function article.

Build the target function

The target function is a key component of the training module. Its purpose is to provide the model with a way to map the inputs (events) to the desired output (label, value, etc., specific to the problem):

  • As arguments, you receive events split into history and future (where you can access all data sources and columns used in the training), and main entity attributes.

  • If needed, you can also join other attributes present in the data.

  • You can then perform transformations on the data (such as grouping, summing, counting, etc.), with the objective of defining the training target; it does not have to be explicitly present in the data, which gives you modeling freedom.

  • The object your function returns should be aligned with the task and of the correct type (numpy array or sketch) - see the section above.

The image below summarizes the entire concept of target function.


To further your understanding, we have broken down the learning into several subpages explaining in detail:

  • The inputs to the functions: events, main entity attributes, and joined attributes.

  • The operations available to transform the inputs to the desired output.

  • Specific examples by the type of use case and task.

  • How to validate the function before training the model.

You are also welcome to explore our library of recipes for examples and in-depth explanations on creating target functions by use case.