Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Journey to Become a Google Cloud Machine Learning Engineer

You're reading from   Journey to Become a Google Cloud Machine Learning Engineer Build the mind and hand of a Google Certified ML professional

Arrow left icon
Product type Paperback
Published in Sep 2022
Publisher Packt
ISBN-13 9781803233727
Length 330 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dr. Logan Song Dr. Logan Song
Author Profile Icon Dr. Logan Song
Dr. Logan Song
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part 1: Starting with GCP and Python
2. Chapter 1: Comprehending Google Cloud Services FREE CHAPTER 3. Chapter 2: Mastering Python Programming 4. Part 2: Introducing Machine Learning
5. Chapter 3: Preparing for ML Development 6. Chapter 4: Developing and Deploying ML Models 7. Chapter 5: Understanding Neural Networks and Deep Learning 8. Part 3: Mastering ML in GCP
9. Chapter 6: Learning BQ/BQML, TensorFlow, and Keras 10. Chapter 7: Exploring Google Cloud Vertex AI 11. Chapter 8: Discovering Google Cloud ML API 12. Chapter 9: Using Google Cloud ML Best Practices 13. Part 4: Accomplishing GCP ML Certification
14. Chapter 10: Achieving the GCP ML Certification 15. Part 5: Appendices
16. Index 17. Other Books You May Enjoy Appendix 1: Practicing with Basic GCP Services 1. Appendix 2: Practicing Using the Python Data Libraries 2. Appendix 3: Practicing with Scikit-Learn 3. Appendix 4: Practicing with Google Vertex AI 4. Appendix 5: Practicing with Google Cloud ML API

Data preparation

In the previous chapters, we discussed Python libraries such as NumPy, Pandas, Matplotlib, and Seaborn for processing and visualizing data. Let’s start with simply importing the libraries:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

We will use a simple dataset that has only 4 columns and 10 rows.

Notice that some of the columns are categorical and others are numerical, and some of them have missing values that we need to fix. The dataset .csv file is uploaded to Google Colab.

Using the pandas library and the read_csv function, we read the data and save it to a variable dataset, assign the first three columns (Country, Age, and Salary) as features, assign the feature dataset to X, and assign the last column dataset to y, as the prediction:

dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:,:-1].values
y = dataset.iloc[:, -1].values
print(X)
[['France...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image