Data-Driven Decisions: Easy ML Classification with Snowflake Cortex

Mastering Snowflake
5 min readJun 6, 2024

Here at Medium I regularly write about modern data platforms and technology trends. To read my future articles simply join my network here or click ‘Follow’. Also feel free to connect with me via YouTube.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

From predicting customer churn to detecting fraud, classification models provide invaluable insights that drive strategic decisions. In this blog post, we will explore what classification is, its practical uses, and how Snowflake Cortex simplifies the classification process.

What is Classification?

Classification is a type of machine learning that sorts data into predefined categories or classes. By analyzing patterns in training data, classification models can predict the category of new, unseen data. Classification can be either binary (two classes) or multi-class (more than two classes). Common examples include distinguishing between spam and non-spam emails or classifying transactions as fraudulent or legitimate.

Why is Classification Useful?

Classification is widely used across various industries to enhance decision-making processes. Here are a few common use cases:

  • Customer Churn Prediction: Identifying which customers are likely to leave a service, allowing businesses to take proactive measures.
  • Credit Card Fraud Detection: Spotting fraudulent transactions to protect customers and reduce financial losses.
  • Spam Detection: Filtering out unwanted emails to improve user experience and security.

By providing these insights, classification helps organizations improve customer retention, enhance security, and streamline operations.

Simplifying Classification with Snowflake Cortex

1. Creating a Classification Model:

  • Training Data: Start by preparing your historical data with a target column that indicates the class labels. For example, in customer churn prediction, the target column might indicate whether a customer churned or not.
  • Model Training: Use Snowflake Cortex to create a classification model object. This model is trained on your historical data, learning to recognize patterns associated with each class.

2. Using the Model for Predictions:

  • Classifying New Data: Once the model is trained, it can classify new data points. For example, classify new customers as likely to churn or not based on their behavior patterns.
  • Evaluating Model Accuracy: Snowflake Cortex provides evaluation APIs to assess the accuracy of your classification model, ensuring reliable predictions.

Practical Use Case: Lead Scoring

Imagine you are a data analyst on a marketing team aiming to prioritize high-potential sales leads. With Snowflake Cortex ML Classification, you can efficiently classify leads based on their likelihood to convert. Here’s how it works:

1. Training the Model: Use historical CRM data where leads have been labeled as “Converted” or “Not converted” to train the classification model.

2. Classifying Leads: Apply the trained model to classify new leads. The model predicts whether each lead is likely to convert, providing a probability score for each prediction.

This approach allows your marketing team to focus on leads with the highest likelihood of conversion, optimizing resource allocation and boosting sales.

ML Classification can be used for other use cases as well, such as churn prediction. For example, customers classified as having a high likelihood to churn can be targeted with special offers, personalized communication or other retention efforts.

The two problems we describe above — churn prediction and lead scoring — are binary classification problems, where the value we’re predicting takes on just two values. This classification function can also solve multi-class problems, where the value we’re predicting takes on three or more values.

For example, say your marketing team segments customers into three groups (Bronze, Silver, and Gold) based on their purchasing habits, demographic and psychographic characteristics. This classification function could help you bucket new customers and prospects into those three value-based segments with ease.

How do customers use ML Classification?

Faraday, a customer behavior prediction platform, has successfully leveraged Snowflake Cortex ML Classification during its private preview. By running complex ML models directly within Snowflake, Faraday accelerates the adoption of AI/ML for their customers without the need to move data.

“Snowflake Cortex ML Functions allow our data engineering team to run complex ML models where our customers’ data lives. This provides us out-of-the-box data science resources and means we don’t have to move our customers’ data to run this analysis,” said Seamus Abshere, Co-Founder and CTO at Faraday. “The public release of Cortex ML Classification is a big unlock; it disrupts a long tradition of separating data engineering and data science.”

Conclusion

Classification is a powerful tool for data-driven decision-making, and Snowflake Cortex makes it easier than ever to harness its potential. By abstracting the complexity of machine learning models, Snowflake Cortex democratizes ML, enabling data analysts, data engineers, and citizen data scientists to derive high-quality insights quickly and efficiently.

To stay up to date with the latest business and tech trends in data and analytics, make sure to subscribe to my newsletter, follow me on LinkedIn, and YouTube, and, if you’re interested in taking a deeper dive into Snowflake check out my books ‘Mastering Snowflake Solutions and SnowPro Core Certification Study Guide’.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

About Adam Morton

Adam Morton is an experienced data leader and author in the field of data and analytics with a passion for delivering tangible business value. Over the past two decades Adam has accumulated a wealth of valuable, real-world experiences designing and implementing enterprise-wide data strategies, advanced data and analytics solutions as well as building high-performing data teams across the UK, Europe, and Australia.

Adam’s continued commitment to the data and analytics community has seen him formally recognised as an international leader in his field when he was awarded a Global Talent Visa by the Australian Government in 2020.

Today, Adam is dedicated to helping his clients to overcome challenges with data while extracting the most value from their data and analytics implementations. You can find out more information by visiting his website here.

He has also developed a signature training program that includes an intensive online curriculum, weekly live consulting Q&A calls with Adam, and an exclusive mastermind of supportive data and analytics professionals helping you to become an expert in Snowflake. If you’re interested in finding out more, check out the latest Mastering Snowflake details.

--

--

Mastering Snowflake

Our mission is to help people trapped in a career dead end, working with on-premise, legacy technology break into cloud computing by using Snowflake.