---
title: Key Steps in Machine Learning Model Development using AutoML
description: By leveraging AutoML and Google Cloud services, the solution provides a robust framework for addressing fraud detection, ultimately helping companies safeguard their financial interests.
image: https://blog.avenuecode.com/hubfs/AI-Generated%20Media/Images/Machine%20learning.jpeg
---

[AvenueCode.com](https://avenuecode.com) [News](https://avenuecode.com/news) [Contact](https://avenuecode.com/contact)

[![Avenue Code Snippets Logo](https://blog.avenuecode.com/hubfs/Avenue%20Code%20New%20Logos%20-%202023/AC-Snippets---Black.png)](https://blog.avenuecode.com/?hsLang=en-us) *menu*

- Technology
  
  [Cloud](https://blog.avenuecode.com/blog/topic/cloud?hsLang=en-us) [Delivery Infrastructure](https://blog.avenuecode.com/blog/topic/delivery-infrastructure?hsLang=en-us) [Web Experience](https://blog.avenuecode.com/blog/topic/web-experience?hsLang=en-us) [Agile Mindset](https://blog.avenuecode.com/blog/topic/agile-mindset?hsLang=en-us) [Quality First](https://blog.avenuecode.com/blog/topic/quality-first?hsLang=en-us)
  
  [Design](https://blog.avenuecode.com/blog/topic/design?hsLang=en-us) [Solution Architecture](https://blog.avenuecode.com/blog/topic/solution-architecture?hsLang=en-us) [Data & ML](https://blog.avenuecode.com/blog/topic/data-and-machine-learning?hsLang=en-us) [Mobile Experience](https://blog.avenuecode.com/blog/topic/mobile-experience?hsLang=en-us)
- [Whitepapers](https://blog.avenuecode.com/blog/topic/whitepapers?hsLang=en-us)
- [Spotlight](https://blog.avenuecode.com/blog/topic/spotlight?hsLang=en-us)
- [Extraordinary Women in Tech](https://blog.avenuecode.com/blog/topic/extraordinary-women-in-tech?hsLang=en-us)
- [Avenue Code Culture](https://blog.avenuecode.com/blog/topic/avenue-code-culture?hsLang=en-us)

- [Cloud](https://blog.avenuecode.com/blog/topic/cloud?hsLang=en-us)
- [Design](https://blog.avenuecode.com/blog/topic/design?hsLang=en-us)
- [Delivery Infrastructure](https://blog.avenuecode.com/blog/topic/delivery-infrastructure?hsLang=en-us)
- [Solution Architecture](https://blog.avenuecode.com/blog/topic/solution-architecture?hsLang=en-us)
- [Web Experience](https://blog.avenuecode.com/blog/topic/web-experience?hsLang=en-us)
- [Data & ML](https://blog.avenuecode.com/blog/topic/data-and-machine-learning?hsLang=en-us)
- [Agile Mindset](https://blog.avenuecode.com/blog/topic/agile-mindset?hsLang=en-us)
- [Mobile Experience](https://blog.avenuecode.com/blog/topic/mobile-experience?hsLang=en-us)
- [Quality First](https://blog.avenuecode.com/blog/topic/quality-first?hsLang=en-us)
- [Whitepapers](https://blog.avenuecode.com/blog/topic/whitepapers?hsLang=en-us)
- [Spotlight](https://blog.avenuecode.com/blog/topic/spotlight?hsLang=en-us)
- [Extraordinary Women in Tech](https://blog.avenuecode.com/blog/topic/extraordinary-women-in-tech?hsLang=en-us)
- [Avenue Code Culture](https://blog.avenuecode.com/blog/topic/avenue-code-culture?hsLang=en-us)

# [Key Steps in Machine Learning Model Development using AutoML](https://blog.avenuecode.com/key-steps-in-machine-learning-model-development-using-automl)

- [Tweet](https://twitter.com/share)

*perm\_identity* [Alfredo Passos](https://blog.avenuecode.com/key-steps-in-machine-learning-model-development-using-automl/author/alfredo-passos?hsLang=en-us)

*schedule* 8/1/24 2:51 PM

Important note: this blog contains a brief summary of the developments of the Machine Learning Model Development using AutoML use case. For more details and information, please access the complete [official document of this work.](https://blog.avenuecode.com/hubfs/Snippets%20Downloads/demo_3_detailed_documentation.pdf?hsLang=en-us)

 

This blog outlines the development and deployment of a machine-learning solution aimed at predicting credit card fraud. By leveraging AutoML and Google Cloud services, the solution provides a robust framework for addressing fraud detection, ultimately helping companies safeguard their financial interests.

## **Business Goal and Machine Learning Solution: Identifying the Business Question/Goal**

In this section, we address the business question of predicting credit card fraud cases from a set of features. This allows companies (such as credit card or insurance companies) to anticipate fraud cases and take preventive actions. By deploying a machine learning model to predict fraud cases, the company can enhance its fraud detection capabilities and improve financial outcomes.

In this blog, we address the critical business need of predicting credit card fraud. This is vital for companies like credit card and insurance companies to proactively identify and mitigate fraud cases, ensuring financial stability and security.

## **Machine Learning Use Case**

The focus is to develop a machine-learning solution that accurately predicts credit card fraud. This involves presenting a complete machine learning workflow, from data exploration to model deployment. The goal is to provide a predictive classifier model that can forecast credit card transaction outcomes (fraud or not fraud) based on a given set of features.

## **How the Machine Learning Solution Addresses the Business Goal**

The proposed solution is a predictive classifier model, trained using AutoML and deployed on the Google Cloud Model Repository. This model will receive requests and provide forecasts for credit card transaction outcomes, enabling the company to act swiftly on predicted fraud cases and enhance their financial results.

 

## **Implementation Details**

### **Data Used**

The data for this demo consists of two datasets:

1. Training Dataset: Contains balanced cases of fraud and non-fraud.
2. Test Dataset: Used to validate the model.

Both datasets were built from the original Raw creditcard.csv file provided by Kaggle.

 

### **Workflow and Model Development**

The workflow includes:

1. Data Exploration: Analyzing the dataset to identify relevant features and necessary transformations.
2. Model Training: Using AutoML to train a predictive classifier model.
3. Model Deployment: Deploying the trained model to Google Cloud Model Repository.

The objective is to illustrate the implementation of a complete machine-learning workflow to achieve accurate predictions.

 

### **Steps in Machine Learning Model Development**

The use case involves presenting a complete machine learning workflow, from data exploration to model deployment, to predict the outcome of credit card transactions (fraud or not fraud). A predictive classifier model, trained using AutoML, is deployed on the Google Cloud Model Repository to an endpoint for making online or batch predictions.

### **Expected Impact on Business Goal**

By implementing a machine learning solution to predict credit card fraud, companies can proactively address fraud cases, thus safeguarding financial assets and improving overall financial health.

 

## **Data Exploration**

### **Data Exploration Overview**

For effective data exploration, partners should:

- Describe the data exploration performed
- Explain how modeling decisions were influenced by this exploration

 

### **Key Steps in Data Exploration**

1. Identify Variables: Determine each variable in the datasets (train and test).
2. Data Types: Check and adjust data types if necessary.
3. Column Elimination: Identify and discard irrelevant columns.
4. Transformations: Apply necessary transformations to variables.
5. Correlation Analysis: Analyze correlations to decide which variables to keep.
6. Missing Values: Identify and address missing values.

 

### **Data Exploration Process**

- The original creditcard.csv dataset was copied to a Cloud Storage bucket.
- Data types were checked and found suitable.
- The distinct values of each column were analyzed, with no missing data identified.
- Notable skewness was found in the response variable (Class), which had very few fraud cases.
- Feature V2 was discarded due to its significant correlation with the amount variable.

Key Findings

- **Correlation:** A significant correlation between V2 and the amount led to V2 being discarded.
- **Missing Values:** No missing values were found in the dataset.

 

CODE SNIPPET:![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXddygoU0ANqUqjO6lOVyFQ1sgH2jOUS7b43v_MasxD_H2bD2mSrID5JOZlG10uDO6j0YEuPPjNWWXazPYVOHk8IpczJE8GF9TD_tICIRsrBu3dZ8Puhbv8th5RBfwbiJzbtBqQOKl4mnexHnF2BBZFM0n2c?key=aqmXvpNG-1-S99scPn3m3A)

- **Class Distribution:** The response variable (Class) distribution was highly unbalanced, with rare fraud cases.

CODE SNIPPET:

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdnUcKigwg-HW74i6pZxUFyiG3Hl8FglBZsO6Q9cD1PVv9VL0CcCibikU4JzZtbtk-6g-m0MFIANMxpuJFN_YDFutlsLxvc-vhcL4eqGK_hFOCHUL3aIZ1qb5A68nYk7aX4VRdgR2SBNhXuIzcytRA4xA1y?key=aqmXvpNG-1-S99scPn3m3A) 

 ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd8ZqdXWNp1b-3F2fk8pSXboN-mK8OnGSicPti3Jv05N3QRoLCLeK7WtG5CAZJzJsfBaxGm8b98_pJpwBoCG7Lm5rnk6EzBRrJAMUCljjEN5muDzsz7aD2veMZhfe8HHs5Vj1yrw2sOddpmhpAm8agYE477?key=aqmXvpNG-1-S99scPn3m3A)

 

Figure 1: Countplot of response Class variable

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXczD-No9ep3N7DBGfueCtZQKDRfNRhTtAILz_MdzPqsoE9INbf3M1YpLWto8-P4r5dU_ZMJcyF1Cln-R7OG6lAbOHeorUgA5njoZkUJqZmq3JAHuLn8KITrt8sIrDIHArlPTYmq1YvD5E-4m33nZFwvkws?key=aqmXvpNG-1-S99scPn3m3A)

 

## **Feature Engineering**

### **Feature Engineering Overview**

**Feature Engineering Steps**

1. **Eliminate Feature V2:** Remove V2 from train and test datasets.
2. **Train-Test Split:** Create a balanced training dataset (90% of fraud cases retained) and an unbalanced test dataset (10% of original data).

**Feature Engineering Details**

- The training dataset was balanced with 1100 rows, ensuring a balanced class variable.
- The test dataset consisted of 10% of the original unbalanced data.

 

CODE SNIPPET:

 

 ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe0O3hyJl-cJjhuM3Pk3JVT2g22hfLp-negBOTh263TY07x-_gfPy9LOxwGu2V4oJBV5IsUTsV2NGKrv2pkVQofCd54G4ql5J-QRQKUVgfVyHiKScCW9PIqFzOn353hMA_vyxq0Lj9SB_OF0T1O0_XU4Hu6?key=aqmXvpNG-1-S99scPn3m3A)

 

 ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcQKvLZXfrLFQWWEFl7hD2Z5lMNIN31C8NbwtFqjoEyfvJIY5lV5hLMBa5ucL1V8vUpj4s_Y_t8ZADl4eE-W05o1Aprlemh4KA4MTPBZlwu2zOFwzQ8Vdu7nHb9ZEY7czBKpPGAt4FypiEG4Cdlit1S-Gc?key=aqmXvpNG-1-S99scPn3m3A)

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXftiqMjYnt2NYmUn_glEzt7dG3MtC82eKBh5i9DuWNB_EFdbUxK61ogUiHC8lky87ZuJDHoLJynezT9IOzhy0XHYli0LuHyKdY_oVxIBr2PRn9T1pmHnAYWn28fjkqMdFQG_ladpmotYshGlsUiwWsi7vUK?key=aqmXvpNG-1-S99scPn3m3A)

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcYYq4OmXyXzOpTiR4OiURUOxepRfxIMbb6Vc27t0fbfJ7rnBILS6IrJ1do8SxMFlSq7JIBzBBVsXSbEeQELyJGpRIALpn9VneGj_oZzrw5PLoXVFxa2frBGh9Qw6akZkYBAbjkM7IohU8r0qGAvr_Vk-6S?key=aqmXvpNG-1-S99scPn3m3A) 

## **Data Security and Privacy in Cloud Storage**

### **Data Security and Privacy Measures**

- The dataset resides in a Cloud Storage Bucket within a specific project linked to a specific service account.
- Only individuals with proper IAM credentials can access the project and dataset.
- The dataset is public and contains no sensitive information, so no data encryption was necessary.

 

## **Data Preprocessing and Final Data Strategy**

### **Preprocessing Steps**

All preprocessing steps were aligned with the feature engineering steps previously mentioned.

 

## **Machine Learning Model Design and Selection**

### **Model Selection**

For Demo 3, a predictive classifier was trained using AutoML, with default options ensuring automatic model training and selection.

### **Used Libraries**

No specific libraries were used for model training and selection, as AutoML handled these processes.

### **Model Selection Process**

AutoML handled all aspects of model training, validation, and selection automatically.

Figure 2: Steps in training classifier model in Auto ML

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXePVnRpJc08NkwFeuQA42EIS0sn6C0CQUAECEUx2WBp_FKTV5j2EpHZIDexTuKt1w5OUrqhsh80pc_mKgiv_fAyVeAllwj2QJJiSP81unEjHG8mnktpVD0SpPkbFTnu99hw6ayTD27qLooLPNDwMvNKGhM4?key=aqmXvpNG-1-S99scPn3m3A) 

 

In the figure above, we chose the Other option.

 

Figure 3: Steps in training classifier model in Auto ML

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcDlh7kFm2lTShF7f48SWdxJ9Ga6GDXyVZatH-2Ikf4csPSCjQk1gesq58WPeb2RaVimORzKuLsCfVb1pl6ZM9KA0DEwvy_4lCYFGMJnYVDqKOGfrc0iNEQwWgAvEBk5jmyUkA6b92Nm1dpi_jtBKemfPYa?key=aqmXvpNG-1-S99scPn3m3A) 

 

Figure 4: Steps in training classifier model in Auto ML

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdsVXzSoxUpr_VFdGs9-jioNrFNCyA-u3A5SOeQpjIhYXOx4oNs6HRIEbRDRghBeY5fiChG_Y5jJ2llAphJ3wocjXptBkHZjKtmfZYD7uGXYzswYmeKI5qTSHhMzoSRmT_nzriocHHwTBRk8emEVVkPMFr_?key=aqmXvpNG-1-S99scPn3m3A) 

 

## **Machine Learning Model Training and Development**

### **Dataset Sampling and Training Configuration**

The train-test split was designed to balance the training dataset while leaving the test dataset unbalanced.

### **Adherence to Google’s Machine Learning Best Practices**

The development followed Google's ML Best Practices, utilizing recommended products and tools:

- ML Environment Configuration: Used AutoML.
- ML Development: Utilized Cloud Storage and AutoML for model development.
- Data Processing: Used Pandas DataFrames in Vertex Workbench instances.
- Operational Training: AutoML managed all model training and deployment.
- Artifacts Organization: Stored resources in Cloud Storage within a specific project.
- ML Environments: Utilized AutoML functionalities in the Vertex AI environment.

 

## **Machine Learning Model Evaluation and Performance Assessment**

### **Model Evaluation Metrics**

AutoML provides a comprehensive set of metrics and performance indicators. For the final model in the training dataset, the recommended metric is the Area Under the ROC curve due to the slightly unbalanced nature of the training data.

 

### **Model Performance**

The final classification model achieved the following:

- Accuracy: Correctly predicted all non-fraud cases and 91% of fraud cases in the training set.
- Feature Importance: Feature V14 was the most significant in explaining the response variable (Class).
- Performance Metrics: Included precision-recall, ROC, and precision-recall by threshold curves.

Overall, the machine learning workflow demonstrated how to implement a comprehensive solution to predict credit card fraud, adhering to best practices and optimizing model performance.

Figure 5: Final classification model performance on training set

 

 ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfuN4DKHk4oUS8St7QCp4hO6S4RNjoGT3HGKNa-6Fj0vInl1zkZwnBc5PAFyBHY9LBuC_CAaKnc0Mk9xAaIxDh_0Vd1CnJijl_5RDQ54KcGVBOGJqg6MBrJeuaHSNL9LXdAQwbEg8NEB4pNkUSWOjpSPEc?key=aqmXvpNG-1-S99scPn3m3A)

 

Figure 6: Final model Confusion matrix

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdjeo2Vjj8_qSiVY1empc49qm_V5-jP9ugw5xUea903u2GYpFt7_nuDZVIXY7Q5koURdkjlWDW0Fy4xUzBdht3Ax32AyjipSZVXyMWtvMs8rpWBpSr7E9B50APIUDlCBdLvWrOYCUg6ahpIo360P4afx_oA?key=aqmXvpNG-1-S99scPn3m3A)

 

We see by the presented confusion matrix that the final model (provided by AutoML) predicted correctly all non-fraud cases and 91 % of the fraud cases in the train set. This is a classic symptom of overfitting the data.

 

Figure 7: Final Model Feature Importances

 

 

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe2SY8ykDli52KD3O3IvOM9S67nIfbcH4m2gH_LCOKkrzI-1sW8v18F8KkDHr_6TYWOFfG7VYVGZADnOe6M5N4paJ-K0X0r6AkhJDTNi0kamXKAYTQQCbXfgVEyErLcosPbjfSvidN7IdKqf86OCMmA5UM?key=aqmXvpNG-1-S99scPn3m3A)  

From the figure above we see that feature V14 was the most important feature in the explanation of response variable Class.

Figure 8: Final model Precision-recall, ROC, and Precision-recall by threshold curves.

 ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcSlM8ngEFgmI9NFL2Ggjp4TDox1BJnL9Uk0qCHy-nAg5UwezbDcICE5XtLMbINyIYjjdh5CnwpEC2LnUSS3emoBxnt9r2X8vGMqIsxfy9kflCDiB3OAay9Rpy88-4zZKC4WL2yez-C6HZM53KBl6ZgoFA?key=aqmXvpNG-1-S99scPn3m3A)

---

### Author

# Alfredo Passos

 Professional with solid experience in Operations Research, Advanced Analytics, Big Data, Machine Learning, Predictive Analytics, and quantitative methods to support decision-making in companies of all sizes. Experienced in applications across Financial, Actuarial, Fraud, Commercial, Retail, Telecom, Food, Livestock, and other fields.

---

### Related Posts

### Key Steps in Machine Learning Model Development | Black Friday DataSet

[READ MORE](https://blog.avenuecode.com/key-steps-in-machine-learning-model-development-black-friday-dataset?hsLang=en-us)

### Adapting to the Future of Work: The Importance of AI

[READ MORE](https://blog.avenuecode.com/the-importance-of-ai?hsLang=en-us)

### The Risks of Blindly Trusting Code Generated by Artificial Intelligence

[READ MORE](https://blog.avenuecode.com/blindly-trusting-code-generated-by-artificial-intelligence?hsLang=en-us)

### Leave a Comment!

### Avenue Code Social

[![Facebook Icon](https://blog.avenuecode.com/hubfs/Images/Blog/facebook.png?t=1486470796564)](https://www.facebook.com/avenuecode)

[![Twitter Icon](https://blog.avenuecode.com/hubfs/Images/Blog/twitter.png?t=1486470796842)](https://twitter.com/AvenueCode)

[![LinkedIn Icon](https://blog.avenuecode.com/hubfs/Images/Blog/linkedin.png?t=1486470796556)](https://www.linkedin.com/company/avenuecode/)

### Newsletter

Want to stay on top of all tips and news from Avenue Code?

### Popular Snippets

![Avenue Code-primary versions_logo white avenue code endorsement 2](https://blog.avenuecode.com/hs-fs/hubfs/Avenue%20Code%20New%20Logos%20-%202023/Avenue%20Code-primary%20versions_logo%20white%20avenue%20code%20endorsement%202.png?width=1180&name=Avenue%20Code-primary%20versions_logo%20white%20avenue%20code%20endorsement%202.png "Avenue Code-primary versions_logo white avenue code endorsement 2")

### About Us

- [Who We Are](https://www.avenuecode.com/who-we-are)
- [What We Do](https://www.avenuecode.com/what-we-do)
- [Portfolio](https://www.avenuecode.com/portfolio)
- [Partners](https://www.avenuecode.com/partners)
- [News](https://www.avenuecode.com/news)
- [Events](https://www.avenuecode.com/events)
- [Blog](https://blog.avenuecode.com/)
- [Contact](https://www.avenuecode.com/contact)

### Our Offices

San Francisco

[+1 415 766 4178](tel:+553125161448) [ac.inquiries@avenuecode.com](mailto:brazil.info@avenuecode.com)

Belo Horizonte

[+55 31 2516 1448](tel:+553125161448) [brazil.info@avenuecode.com](mailto:brazil.info@avenuecode.com)

São Paulo

[+55 11 3205 3232](tel:+553125161448) [brazil.info@avenuecode.com](mailto:brazil.info@avenuecode.com)

### We're Hiring!

- [Belo Horizonte](https://www.avenuecode.com/who-we-are)
- [New York](https://www.avenuecode.com/what-we-do)
- [San Francisco](https://www.avenuecode.com/portfolio)
- [São Paulo](https://www.avenuecode.com/partners)

---

©2015 - 2017 Avenue Code

[![Facebook Icon](https://blog.avenuecode.com/hubfs/Images/Icons/facebook-2.png)](https://www.facebook.com/avenuecode) [![Twitter Icon](https://blog.avenuecode.com/hubfs/Images/Icons/twitter-2.png)](https://twitter.com/AvenueCode) [![LinkedIn Icon](https://blog.avenuecode.com/hubfs/Images/Icons/linkedin-2.png)](https://www.linkedin.com/company/avenue-code) [![Glassdoor Icon](https://blog.avenuecode.com/hubfs/Images/Icons/glassdoor-icon-1.png)](https://www.glassdoor.com/Overview/Working-at-Avenue-Code-EI_IE456173.11,22.htm) [![YouTube Icon](https://blog.avenuecode.com/hubfs/Images/Icons/youtube-2.png)](https://www.youtube.com/user/AvenueCodePlay)

Please enable JavaScript to view the [comments powered by Disqus.](http://disqus.com/?ref_noscript)

© 2026 Avenue Code

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Alfredo Passos",
    "url" : "https://blog.avenuecode.com/author/alfredo-passos"
  },
  "dateModified" : "2024-08-23T21:56:34.053Z",
  "datePublished" : "2024-08-01T17:51:38.000Z",
  "headline" : "Key Steps in Machine Learning Model Development using AutoML",
  "image" : [ "https://blog.avenuecode.com/hubfs/AI-Generated%20Media/Images/Machine%20learning.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.avenuecode.com/key-steps-in-machine-learning-model-development-using-automl",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.avenuecode.com/hubfs/Avenue%20Code%20New%20Logos%20-%202023/Avenue%20Code-primary%20versions_LOGO%20HORIZONTAL%20group%201-7.png"
    },
    "name" : "Avenue Code"
  }
}
```