From Complexity to Clarity: How Snowflake Notebooks Transforms Optimization Workflows

Table of contents
Partner with
Aimpoint Digital
Meet an Expert

Snowflake Notebooks redefines how teams approach optimization challenges, combining live data access, interactive modeling, and seamless collaboration into one intuitive platform. Whether tackling large-scale projects or refining daily operations, this tool offers an accessible solution for decision-making.

The Problem: Choosing the Right Locations, Smarter

Imagine you're helping a team plan support centers for municipal EV and hydrogen fuel stations across Greater Los Angeles. The team has decided to leverage existing police stations as maintenance centers. With their expertise in managing fleet vehicles, police facilities are uniquely positioned to extend their capabilities to maintain nearby clean transportation infrastructure-seamlessly integrating EV and hydrogen station upkeep into their operations. This approach capitalizes on established resources, combining fleet management know-how with the growing demand for emission-free transit support.

But there’s a challenge: with limited budget and resources, how do you decide which police stations should host these centers? The goal is to make sure every EV or hydrogen station in the region has at least one support center close by – without overextending your resources.

Please note that this example is illustrative and not indicative of any operational choices made by California or Los Angeles authorities.

As an analytics professional, you have likely encountered the following inefficiencies in many projects:

  • Data Movement Overhead: Data scientists often rely on Excel exports, which quickly become outdated and create versioning issues. Exporting and syncing data manually is not only time-consuming but also prone to errors, leading to misalignment in decision-making.
  • Tool Fragmentation: Constantly switching between SQL, Python, and visualization tools disrupts your workflow and increases cognitive load, making analysis more cumbersome.
  • Challenges in Implementing and Deploying Optimization Models: When implementing optimization models, it is important to recognize that the process often involves extensive coding. Additionally, executing and deploying these models at scale typically necessitates external tools or infrastructure, which, while effective, introduces complexities that are rarely straightforward or seamless.
  • Limited Scalability: Working with large datasets on a local machine is slow and resource-intensive. The lack of cloud integration makes scaling difficult, leading to delays in processing and analysis.

The result? Insights take weeks to produce and are already outdated by the time they're shared. It’s frustrating, but what if there was a way to change this?

The Solution: Interactive Optimization with Snowflake Notebooks

Snowflake Notebooks reimagines the optimization workflow by integrating data preparation, model building, and visualization—all in a single environment.

Before and After: A Workflow Comparison

Traditional Workflow
Snowflake Notebook Workflow
Export raw data to CSV
Query live data directly in Snowflake, ensuring no local copies are needed
Preprocess data in Python locally
Use SQL and Python seamlessly in one tool
Build model locally
Build models interactively in the notebook with compute happening in Snowflake
Static, manual result sharing
Static, manual result sharing
Iterative updates are slow
Immediate feedback on constraints or inputs through a Jupyter Notebook-like environment
No built-in version control
Integrated Git support for tracking changes and collaboration
Manual execution of workflows
Snowflake Notebooks can be scheduled within Snowflake Tasks for automated execution

This approach is just one way to build and run optimization models in Snowflake. Other methods include deploying optimization as a service within Snowpark Container Services and running models directly through Snowsight. More details on these approaches can be found in the following blogs: Next-Level Data Science: Enabling Optimization with Gurobi in Snowflake: Part One and Using Snowsight: Streamlining Gurobi Powered Decision-Making in Snowflake Part Two.

A Real Transformation: Optimizing Support Stations in Snowflake Notebooks

Let’s step into the transformation journey as if you’re leading the charge in solving the alternative fuel support station challenge.

Seamless Integration of SQL and Python

With Snowflake Notebooks, you can query data directly from Snowflake using SQL and immediately analyze it using Python—all within the same environment. This eliminates the need for exporting data or switching between tools, reducing errors and saving time.

For example, you can query raw data on alternative fuel station locations and demand:

As seen from the image above, variables and result sets can be shared between Python and SQL cells, making it easier to transition between different types of analyses within a single workflow.

Once the data is retrieved, you can use Python to visualize the location distribution:

This allows you to quickly identify patterns and outliers in your data, setting the stage for more informed decision-making.

Interactive Model Building

Instead of relying on external tools to build optimization models, Snowflake Notebooks enables you to do it all in one place. Using Python libraries like Gurobipy, you can formulate and solve optimization problems interactively.

For the EV support station challenge, you can define an optimization model to minimize costs while ensuring adequate coverage:

The results are immediately available for analysis, enabling you to iterate quickly on your model.

Real-Time Collaboration and Visualization

Snowflake Notebooks makes it easy to visualize and share optimization results, fostering collaboration across teams. For instance, you can use Python to create an interactive visualization of the optimal assignments:

You can share this notebook directly with business stakeholders, who can tweak inputs, re-run cells, and see updates in real-time. Integrated Git support ensures that all changes are tracked, making it easier to collaborate and maintain version control across team members. This reduces the time spent on back-and-forth communication and static reporting. Run the Snowflake Notebook yourself by downloading the materials here!

The Impact: Real-Time, Scalable Optimization

Snowflake Notebooks doesn't just improve workflows; they redefine how teams approach complex projects like the EV support station optimization. By integrating live data, interactive modeling, and real-time collaboration, they address key pain points and deliver tangible results:

  • Live Data Access: Teams can directly query and analyze real-time data from Snowflake, ensuring decisions are based on the most up-to-date information.
  • Integrated Environment: SQL, Python, and native notebook visualizations – including built-in support for Streamlit – work seamlessly in one platform.
  • Scalable Infrastructure: Snowflake’s cloud capabilities allow users to process and optimize massive datasets, ensuring scalability for growing projects.
  • Collaborative Innovation: Stakeholders can interact directly with notebooks, adjusting parameters and re-running models, fostering a more dynamic and transparent decision-making process.

Empowering Seamless Decision Making

The net result of live data access, integration environments and collaboration powered by scalable infrastructure – faster and more informed actions. For initiatives like the California Clean Transportation Program, Snowflake Notebooks speeds up the iterative process of building models, analyzing results and incorporating stakeholder feedback. As a data scientist, this allows you to focus more time on designing and solving decision-support models that address complex, real-world challenges.

Ready to transform your workflows? Dive into Snowflake Notebooks, and see how Snowflake Notebooks offers a streamlined, efficient approach to optimization workflows. Our award-winning teams specializing in Gurobi and Snowflake are here to help you unlock the full potential of these platforms. Whether you're optimizing complex decision models or scaling data-driven workflows, we provide the expertise to streamline decision-making across your organization. Get in touch with us to learn more.

Author
William Wirono
William Wirono
Senior Data Scientist
Read Bio

Let’s talk data.
We’ll bring the solutions.

Whether you need advanced AI solutions, strategic data expertise, or tailored insights, our team is here to help.

Meet an Expert