待翻译:Build a no-code ML workflow with Snowflake, Amazon SageMaker Canvas and Amazon Quick – Part 1: Setting up your Snowflake environment
AI 服务暂时不可用,以下为来源摘要,待恢复后补全翻译:Healthcare, retail, and life sciences teams store large volumes of operational data in Snowflake, but turning it into predictions is hard. In Part 1 of this series, you set up your AWS account and Snowflake environment for a no-code ML workflow with Amazon SageMaker Canvas, laying the foundation for building a fraud detection model without writing code.
AI 服务暂时不可用,以下为来源正文,待恢复后补全翻译。
Healthcare, retail, and life sciences organizations generate massive quantities of operational data in cloud data warehouses like Snowflake. While these systems store and scale information efficiently, transforming that data into meaningful predictions remains a challenge. Traditional machine learning (ML) approaches require specialized teams, long development cycles, and heavy engineering support, creating delays and limiting experimentation for the business users who understand the data best. A no-code ML workflow changes that dynamic. With Amazon SageMaker Canvas, you can explore datasets, prepare features, build predictive models, and generate insights visually without writing code and without depending on data science resources. Business analysts, product owners, and operational teams can accelerate decision-making while maintaining enterprise security and governance. This is Part 1 of a three-part series. Part 1 covers setting up your AWS account and Snowflake environment. Part 2 connects Amazon SageMaker Canvas to Snowflake to prepare data and build a fraud detection model. Part 3 sends predictions to Amazon Quick to create interactive dashboards and share insights with stakeholders. Business challenge This solution was inspired by a real healthcare organization that had accumulated years of operational data in Snowflake including sales transactions, product movement, patient interactions, and regional performance metrics. While the data foundation was robust, turning that data into predictive insights remained a challenge. Business teams wanted to forecast demand across multiple product categories, understand seasonal and regional consumption patterns, and surface ML-driven insights directly within business intelligence (BI) dashboards to support faster decisions. However, the organization lacked sufficient data science capacity to support these needs. Every new forecasting or analytics request required engineering or ML specialists, resulting in long development cycles and limited experimentation. This created a clear gap: business users understood the questions and the data but didn’t have a practical way to build and iterate on predictive models themselves. Additionally, after predictions were generated, organizations needed a way to visualize and share these insights with stakeholders through interactive dashboards. Rather than introducing yet another complex ML pipeline, the organization needed an approach that could bring machine learning closer to business teams. That approach had to work natively with existing Snowflake data, visualize predictions through familiar BI tools, and reduce dependency on specialized resources without compromising governance or security. These requirements naturally pointed toward a no-code machine learning approach integrated with visualization capabilities as the next step. Solution overview To bridge the gap between data-rich environments and insight-starved business teams, this post walks you through a no-code ML workflow built on Amazon SageMaker Canvas. Rather than replacing your existing data infrastructure, this approach extends the value of your Snowflake investments by making machine learning accessible to non-technical users and connecting predictions directly to visualization tools. Amazon SageMaker Canvas provides an intuitive, visual interface that connects directly to Snowflake, so you can prepare data, build machine learning models, and generate forecasts. After you train your model, deploy it to Amazon SageMaker Endpoint directly from the Canvas model details page, with no infrastructure configuration required. When the endpoint status shows In service, generate predictions on your Snowflake transaction data. To visualize results in Amazon Quick, use batch predictions in Canvas to output the scored dataset to Amazon Simple Storage Service (Amazon S3). Amazon Quick visualizes these insights through interactive dashboards, making ML-driven forecasts accessible to stakeholders across your organization without custom pipelines or data-science intervention. Figure 1: End-to-end architecture showing data flow from Snowflake through Amazon SageMaker Canvas to Amazon Quick Sight dashboards This architecture delivers key benefits: Democratized access to ML through self-service model building without coding expertise. Simplified data preparation with over 300 visual transformations powered by Data Wrangler while maintaining enterprise governance. Accelerated time-to-insight by reducing model development from months to hours. Training on the managed infrastructure of Amazon SageMaker. Interactive visualization of predictions through Amazon Quick Sight dashboards. Support for multiple ML problem types including regression, classification, and time-series forecasting to address diverse business questions from a single solution. Technical implementation This section walks through the hands-on steps to configure your Snowflake environment with sample fraud detection data. Prerequisites Make sure that you have the following prerequisites. An AWS account. Snowflake account. For steps to create a Snowflake account, refer to Create a Snowflake Free Trial Account. Snowflake database setup To create a Snowflake database, in the left-side panel of the Snowflake console, choose the plus sign (+), and then choose SQL worksheet. A blank SQL file opens. Copy and paste the following SQL commands into the worksheet and choose Run. -- Create database and warehouse USE ROLE accountadmin; CREATE OR REPLACE WAREHOUSE HOL_WH WITH WAREHOUSE_SIZE='X-SMALL'; CREATE OR REPLACE DATABASE FRAUD; -- Use the database USE DATABASE FRAUD; -- Create the final fraud table with proper data types CREATE OR REPLACE TABLE FRAUD.PUBLIC.FRAUD_TABLE ( id NUMBER, trans_date_trans_time TIMESTAMP_NTZ(9), cc_num NUMBER, merchant VARCHAR, category VARCHAR, amt NUMBER(38,2), first VARCHAR, last VARCHAR, gender VARCHAR, street VARCHAR, city VARCHAR, state VARCHAR, zip NUMBER, lat NUMBER(38,15), long NUMBER(38,14), city_pop NUMBER(38,0), job VARCHAR, dob DATE, trans_num VARCHAR, unix_time NUMBER, merch_lat NUMBER(38,15), merch_long NUMBER(38,14), is_fraud NUMBER ); -- Generate sample fraud detection data for 2020 INSERT INTO FRAUD.PUBLIC.FRAUD_TABLE WITH raw_data AS ( SELECT ROW_NUMBER() OVER (ORDER BY SEQ4()) as id, DATEADD(minute, UNIFORM(0, 525600, RANDOM()), '2020-01-01 00:00:00'::TIMESTAMP_NTZ) as trans_date_trans_time, UNIFORM(1, 1000, RANDOM()) as cc_num, CONCAT('merchant_', UNIFORM(1, 500, RANDOM())) as merchant, CASE UNIFORM(1, 14, RANDOM()) WHEN 1 THEN 'grocery_pos' WHEN 2 THEN 'gas_transport' WHEN 3 THEN 'shopping_net' WHEN 4 THEN 'shopping_pos' WHEN 5 THEN 'food_dining' WHEN 6 THEN 'entertainment' WHEN 7 THEN 'personal_care' WHEN 8 THEN 'health_fitness' WHEN 9 THEN 'travel' WHEN 10 THEN 'kids_pets' WHEN 11 THEN 'home' WHEN 12 THEN 'misc_net' WHEN 13 THEN 'misc_pos' ELSE 'other' END as category, ROUND(UNIFORM(1, 1000, RANDOM()) + UNIFORM(0, 99, RANDOM())/100, 2) as amt, CONCAT('FirstName', UNIFORM(1, 1000, RANDOM())) as first, CONCAT('LastName', UNIFORM(1, 1000, RANDOM())) as last, CASE UNIFORM(0, 1, RANDOM()) WHEN 0 THEN 'M' ELSE 'F' END as gender, CONCAT(UNIFORM(1, 9999, RANDOM()), ' Main St') as street, CASE UNIFORM(1, 10, RANDOM()) WHEN 1 THEN 'New York' WHEN 2 THEN 'Los Angeles' WHEN 3 THEN 'Chicago' WHEN 4 THEN 'Houston' WHEN 5 THEN 'Phoenix' WHEN 6 THEN 'Philadelphia' WHEN 7 THEN 'San Antonio' WHEN 8 THEN 'San Diego' WHEN 9 THEN 'Dallas' ELSE 'San Jose' END as city, CASE UNIFORM(1, 10, RANDOM()) WHEN 1 THEN 'NY' WHEN 2 THEN 'CA' WHEN 3 THEN 'IL' WHEN 4 THEN 'TX' WHEN 5 THEN 'AZ' WHEN 6 THEN 'PA' WHEN 7 THEN 'TX' WHEN 8 THEN 'CA' WHEN 9 THEN 'TX' ELSE 'CA' END as state, UNIFORM(10000, 99999, RANDOM()) as zip, ROUND(UNIFORM(25.0, 49.0, RANDOM()) + UNIFORM(0, 999999, RANDOM())/1000000, 15) as lat, ROUND(UNIFORM(-125.0, -65.0, RANDOM()) + UNIFORM(0, 99999999999999, RANDOM())/100000000000000, 14) as "LONG", UNIFORM(10000, 5000000, RANDOM()) as city_pop, CONCAT('Job_Title_', UNIFORM(1, 100, RANDOM())) as job, DATEADD(year, -UNIFORM(18, 80, RANDOM()), '2020-12-01'::DATE) as dob, CONCAT('trans_', LPAD(ROW_NUMBER() OVER (ORDER BY SEQ4()), 10, '0')) as trans_num, DATEDIFF(second, '1970-01-01', DATEADD(minute, UNIFORM(0, 44640, RANDOM()), '2020-12-01 00:00:00'::TIMESTAMP_NTZ)) as unix_time, ROUND(UNIFORM(25.0, 49.0, RANDOM()) + UNIFORM(0, 999999, RANDOM())/1000000, 15) as merch_lat, ROUND(UNIFORM(-125.0, -65.0, RANDOM()) + UNIFORM(0, 99999999999999, RANDOM())/100000000000000, 14) as merch_long FROM TABLE(GENERATOR(ROWCOUNT => 139538)) ) SELECT id, trans_date_trans_time, cc_num, merchant, category, amt, first, last, gender, street, city, state, zip, lat, "LONG", city_pop, job, dob, trans_num, unix_time, merch_lat, merch_long, CASE WHEN category IN ('shopping_net', 'misc_net') AND amt > 700 AND UNIFORM(0, 100, RANDOM()) 800 AND UNIFORM(0, 100, RANDOM()) 900 AND EXTRACT(HOUR FROM trans_date_trans_time) BETWEEN 0 AND 4 AND UNIFORM(0, 100, RANDOM()) 400 AND amt <= 700 AND UNIFORM(0, 100, RANDOM()) < 12 THEN 1 WHEN EXTRACT(HOUR FROM trans_date_trans_time) BETWEEN 0 AND 3 AND UNIFORM(0, 100, RANDOM()) < 3 THEN 1 ELSE 0 END as is_fraud FROM raw_data; Then select each subsection separately and run them one by one by choosing Run. After the queries run successfully, confirm the setup by running the following verification queries. SELECT COUNT(*) as total_records FROM FRAUD_TABLE; SELECT TOP 10 * FROM FRAUD_TABLE; SELECT is_fraud, COUNT(*) as count FROM FRAUD_TABLE GROUP BY is_fraud; Gather the information needed to connect from Snowflake to Amazon SageMaker Canvas. The connection requires the Snowflake organization account name, which combines the Snowflake organization name and account name with a hyphen. Run the SQL query in the worksheet to determine the organization account name. SELECT CURRENT_ORGANIZATION_NAME()||'-'||CURRENT_ACCOUNT_NAME() AS organizaton_account_name; Conclusion In this first part of the three-part series, you explored the business challenge facing organizations with data-rich Snowflake environments and introduced a no-code ML workflow. You created a Snowflake database, loaded sample fraud detection data, and retrieved the connection details needed for the next steps. In Part 2, you connect Amazon SageMaker Canvas to Snowflake data, prepare and transform the dataset using visual tools, and build a fraud detection model. References Part 2 – Build a no-code ML workflow with Snowflake, Amazon SageMaker Canvas and Amazon Quick – Part 2: Data preparation and model building with Amazon SageMaker Canvas Part 3 – Build a no-code ML workflow with Snowflake, Amazon SageMaker Canvas and Amazon Quick – Part 3: Visualizing insights with Amazon Quick Sight About the authors