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
The Artificial Intelligence Infrastructure Workshop

You're reading from   The Artificial Intelligence Infrastructure Workshop Build your own highly scalable and robust data storage systems that can support a variety of cutting-edge AI applications

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781800209848
Length 732 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (6):
Arrow left icon
Bas Geerdink Bas Geerdink
Author Profile Icon Bas Geerdink
Bas Geerdink
Chinmay Arankalle Chinmay Arankalle
Author Profile Icon Chinmay Arankalle
Chinmay Arankalle
Kunal Gera Kunal Gera
Author Profile Icon Kunal Gera
Kunal Gera
Kevin Liao Kevin Liao
Author Profile Icon Kevin Liao
Kevin Liao
Gareth Dwyer Gareth Dwyer
Author Profile Icon Gareth Dwyer
Gareth Dwyer
Anand N.S. Anand N.S.
Author Profile Icon Anand N.S.
Anand N.S.
+2 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface
1. Data Storage Fundamentals 2. Artificial Intelligence Storage Requirements FREE CHAPTER 3. Data Preparation 4. The Ethics of AI Data Storage 5. Data Stores: SQL and NoSQL Databases 6. Big Data File Formats 7. Introduction to Analytics Engine (Spark) for Big Data 8. Data System Design Examples 9. Workflow Management for AI 10. Introduction to Data Storage on Cloud Services (AWS) 11. Building an Artificial Intelligence Algorithm 12. Productionizing Your AI Applications Appendix

9. Workflow Management for AI

Activity 9.01: Creating a DAG in Airflow to Calculate the Ratio of Likes-Dislikes for Each Category

Solution

  1. Create an Activity09.01 directory in the Chapter09 directory to store the files for this activity.
  2. Open your Terminal (macOS or Linux) or Command Prompt (Windows), navigate to the Chapter09 directory, and type jupyter notebook. The Jupyter Notebook should resemble what you can see in the following screenshot:

    Figure 9.42: The Jupyter Notebook launched in the Chapter09 directory

  3. In the Jupyter Notebook, click the Activity09.01 directory, create a notebook file with the Python 3 kernel, and add the following code:
    import json
    import pandas as pd
    # read video data
    df_vids = pd.read_csv('../Data/USvideos.csv.zip',   compression='zip')
    # read category data
    data_cats = json.load(open('../Data/US_category_id.json', 'r'))
    df_cat = pd.DataFrame(data_cats)
    df_cat['category'] = df_cat[&apos...
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