SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Python with AI – 2
Session 3
Statistics of columns/features
Statistics of columns/features – how does it
help?
• Describes the range of different features
• Understand the range of feature the machine learning algorithm trained
with
• Variation within features
• Standard deviation indicates the variation of data within the range
Statistics of columns/features - visualize
Statistics of columns/features
Statistics of categorical values
Statistics of categorical values
Statistics of categorical values
Kaggle datasets
• Mobile price prediction
• Fish Weight Prediction
• Heights and Weights
• Student performance prediction
• Predict Airline Passenger Satisfaction
Pandas dataframe to dictionary conversion
• Upload the mood dataset file to your repl program. Link
Pandas dataframe to dictionary conversion
• Import a csv file and execute the code below
Pandas dataframe to dictionary conversion
• What is the datatype of records_array variable?
Pandas dataframe to dictionary conversion
• What is the datatype of each entry of the records_array
variable?
Exercise
• Retrieve the 10th row of the dataset mood_project_3.csv in the
dictionary format.
Requests module in python
• This module helps you to send HTTP requests in python
• What are HTTP requests?
Requests module in python
• This module helps you to send HTTP requests in python
• How to use HTTP requests to interact with an AI?
Requests module in python
• This module helps you to send HTTP requests in python
• How to use HTTP requests to interact with an AI?
url: The http url to send request to
data: String containing the payload (features in case of AI)
Requests module in python
• This module helps you to send HTTP requests in python
• How to use HTTP requests to interact with an AI?
Example:
data: {“Sentence”: “I am sad”}
Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
• Copy paste the code into your repl account
Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
• Copy paste the code into your repl account
Lets connect your AI with python
• Copy paste the code into your repl account
• Note that the code is a function, you have to call this function to get
the prediction
json.dumps() converts
dictionary to striing
Convert the output you
receive into readable format
JSON module
• JSON (JavaScript Object Notation)
• A very popular format to transmit and receive data over web
JSON module
• JSON (JavaScript Object Notation)
• A very popular format to transmit and receive data over web
• How does it work in python?
• A json is a string
JSON module
• JSON (JavaScript Object Notation)
• A very popular format to transmit and receive data over web
• What would the json dump of a dictionary be?
JSON module
• JSON (JavaScript Object Notation)
• A very popular format to transmit and receive data over web
• How does it work in python?
• Can any type of variable be dumped? Strings? Lists?
Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
• Copy paste the code into your repl account
• Upload the mood dataset into repl
Exercise
• Convert the mood dataset rows into dictionaries
• Trigger the AI service
• Calculate accuracy across all samples of the dataset
• Calculate the confusion matrix
Popular ML Metrics - Classification
• Precision
• Recall
• ROC curve
• How to do it when there are more than 2 classes?
http://aiclub.world

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (15)

APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBMAPIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
APIdays Helsinki 2019 - GraphQL API Management with Amit P. Acharya, IBM
 
Java 8
Java 8Java 8
Java 8
 
Pa1 session 4_slides
Pa1 session 4_slidesPa1 session 4_slides
Pa1 session 4_slides
 
GraphQL Search
GraphQL SearchGraphQL Search
GraphQL Search
 
Cracking web development
Cracking web developmentCracking web development
Cracking web development
 
An open source, scalable queuing solution on top of apache kafka 2019
An open source, scalable queuing solution on top of apache kafka 2019An open source, scalable queuing solution on top of apache kafka 2019
An open source, scalable queuing solution on top of apache kafka 2019
 
Introduction to GraphQL at API days
Introduction to GraphQL at API daysIntroduction to GraphQL at API days
Introduction to GraphQL at API days
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
 
This Week in Neo4j- 1st December 2018
This Week in Neo4j- 1st December 2018This Week in Neo4j- 1st December 2018
This Week in Neo4j- 1st December 2018
 
Understanding LINQ in C#
Understanding LINQ in C# Understanding LINQ in C#
Understanding LINQ in C#
 
Graph processing at scale using spark & graph frames
Graph processing at scale using spark & graph framesGraph processing at scale using spark & graph frames
Graph processing at scale using spark & graph frames
 
Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)
 
This Week in Neo4j - 24th November 2018
This Week in Neo4j - 24th November 2018This Week in Neo4j - 24th November 2018
This Week in Neo4j - 24th November 2018
 
Linq in C# 3.0: An Overview
Linq in C# 3.0: An OverviewLinq in C# 3.0: An Overview
Linq in C# 3.0: An Overview
 
An Introduction To Python - Problem Solving: Flowcharts & Test Cases, Boolean...
An Introduction To Python - Problem Solving: Flowcharts & Test Cases, Boolean...An Introduction To Python - Problem Solving: Flowcharts & Test Cases, Boolean...
An Introduction To Python - Problem Solving: Flowcharts & Test Cases, Boolean...
 

Ähnlich wie Pa2 session 4

Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...
Simplilearn
 
Introduction to Python.pdf
Introduction to Python.pdfIntroduction to Python.pdf
Introduction to Python.pdf
Rahul Mogal
 
ppt 2.pptxandxikcicncmk0wufjepfc09eufcdc
ppt 2.pptxandxikcicncmk0wufjepfc09eufcdcppt 2.pptxandxikcicncmk0wufjepfc09eufcdc
ppt 2.pptxandxikcicncmk0wufjepfc09eufcdc
ashimavashisth001
 
100 Essential Web Development Tools
100 Essential Web Development Tools100 Essential Web Development Tools
100 Essential Web Development Tools
wensheng wei
 
Jaswanth-PPT.pptx
Jaswanth-PPT.pptxJaswanth-PPT.pptx
Jaswanth-PPT.pptx
reenarocky
 
Building A Product Assortment Recommendation Engine
Building A Product Assortment Recommendation EngineBuilding A Product Assortment Recommendation Engine
Building A Product Assortment Recommendation Engine
Databricks
 

Ähnlich wie Pa2 session 4 (20)

Pa2 session 3
Pa2 session 3Pa2 session 3
Pa2 session 3
 
Aia session2 (1)
Aia session2 (1)Aia session2 (1)
Aia session2 (1)
 
Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...
 
ProjectsSummary.pptx
ProjectsSummary.pptxProjectsSummary.pptx
ProjectsSummary.pptx
 
Solved Big Data and Data Science Projects pdf.pdf
Solved Big Data and Data Science Projects pdf.pdfSolved Big Data and Data Science Projects pdf.pdf
Solved Big Data and Data Science Projects pdf.pdf
 
Autonomous Machines with Project Bonsai
Autonomous Machines with Project BonsaiAutonomous Machines with Project Bonsai
Autonomous Machines with Project Bonsai
 
Unlocking the Potential of AI in Spring.pdf
Unlocking the Potential of AI in Spring.pdfUnlocking the Potential of AI in Spring.pdf
Unlocking the Potential of AI in Spring.pdf
 
Python ml
Python mlPython ml
Python ml
 
Introduction to Python.pdf
Introduction to Python.pdfIntroduction to Python.pdf
Introduction to Python.pdf
 
Olist Architecture v2.0
Olist Architecture v2.0Olist Architecture v2.0
Olist Architecture v2.0
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Portal and Intranets
Portal and Intranets Portal and Intranets
Portal and Intranets
 
Intro to Muon - How to build Polyglot Message and Event Microservices
Intro to Muon - How to build Polyglot Message and Event MicroservicesIntro to Muon - How to build Polyglot Message and Event Microservices
Intro to Muon - How to build Polyglot Message and Event Microservices
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
ppt 2.pptxandxikcicncmk0wufjepfc09eufcdc
ppt 2.pptxandxikcicncmk0wufjepfc09eufcdcppt 2.pptxandxikcicncmk0wufjepfc09eufcdc
ppt 2.pptxandxikcicncmk0wufjepfc09eufcdc
 
100 Essential Web Development Tools
100 Essential Web Development Tools100 Essential Web Development Tools
100 Essential Web Development Tools
 
ChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano FirtmanChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano Firtman
 
Jaswanth-PPT.pptx
Jaswanth-PPT.pptxJaswanth-PPT.pptx
Jaswanth-PPT.pptx
 
Building A Product Assortment Recommendation Engine
Building A Product Assortment Recommendation EngineBuilding A Product Assortment Recommendation Engine
Building A Product Assortment Recommendation Engine
 
Constrained Optimization with Genetic Algorithms and Project Bonsai
Constrained Optimization with Genetic Algorithms and Project BonsaiConstrained Optimization with Genetic Algorithms and Project Bonsai
Constrained Optimization with Genetic Algorithms and Project Bonsai
 

Mehr von aiclub_slides

Mehr von aiclub_slides (20)

Linear regression middleschool
Linear regression middleschoolLinear regression middleschool
Linear regression middleschool
 
Pa2 project template
Pa2 project templatePa2 project template
Pa2 project template
 
Knn intro advanced_middleschool
Knn intro advanced_middleschoolKnn intro advanced_middleschool
Knn intro advanced_middleschool
 
M1 regression metrics_middleschool
M1 regression metrics_middleschoolM1 regression metrics_middleschool
M1 regression metrics_middleschool
 
Mnist images
Mnist imagesMnist images
Mnist images
 
Mnist images
Mnist imagesMnist images
Mnist images
 
Ai in real life face detection
Ai in real life   face detectionAi in real life   face detection
Ai in real life face detection
 
Cnn
CnnCnn
Cnn
 
Res net high level intro
Res net high level introRes net high level intro
Res net high level intro
 
Neural networks and flattened images
Neural networks and flattened imagesNeural networks and flattened images
Neural networks and flattened images
 
What is a_neural_network
What is a_neural_networkWhat is a_neural_network
What is a_neural_network
 
How neural networks learn part iii
How neural networks learn part iiiHow neural networks learn part iii
How neural networks learn part iii
 
Introduction to deep learning image classification
Introduction to deep learning   image classificationIntroduction to deep learning   image classification
Introduction to deep learning image classification
 
Accuracy middleschool
Accuracy middleschoolAccuracy middleschool
Accuracy middleschool
 
Introduction to classification_middleschool
Introduction to classification_middleschoolIntroduction to classification_middleschool
Introduction to classification_middleschool
 
Introduction to the cloud
Introduction to the cloudIntroduction to the cloud
Introduction to the cloud
 
Basics of data
Basics of dataBasics of data
Basics of data
 
Ai basics
Ai basicsAi basics
Ai basics
 
Ai lifecycle and navigator
Ai lifecycle and navigatorAi lifecycle and navigator
Ai lifecycle and navigator
 
How AIs are different from us level 1
How AIs are different from us   level 1How AIs are different from us   level 1
How AIs are different from us level 1
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 

Pa2 session 4

  • 1. Python with AI – 2 Session 3
  • 3. Statistics of columns/features – how does it help? • Describes the range of different features • Understand the range of feature the machine learning algorithm trained with • Variation within features • Standard deviation indicates the variation of data within the range
  • 9. Kaggle datasets • Mobile price prediction • Fish Weight Prediction • Heights and Weights • Student performance prediction • Predict Airline Passenger Satisfaction
  • 10. Pandas dataframe to dictionary conversion • Upload the mood dataset file to your repl program. Link
  • 11. Pandas dataframe to dictionary conversion • Import a csv file and execute the code below
  • 12. Pandas dataframe to dictionary conversion • What is the datatype of records_array variable?
  • 13. Pandas dataframe to dictionary conversion • What is the datatype of each entry of the records_array variable?
  • 14. Exercise • Retrieve the 10th row of the dataset mood_project_3.csv in the dictionary format.
  • 15. Requests module in python • This module helps you to send HTTP requests in python • What are HTTP requests?
  • 16. Requests module in python • This module helps you to send HTTP requests in python • How to use HTTP requests to interact with an AI?
  • 17. Requests module in python • This module helps you to send HTTP requests in python • How to use HTTP requests to interact with an AI? url: The http url to send request to data: String containing the payload (features in case of AI)
  • 18. Requests module in python • This module helps you to send HTTP requests in python • How to use HTTP requests to interact with an AI? Example: data: {“Sentence”: “I am sad”}
  • 19. Lets connect your AI with python • Login to your Navigator accounts and select the mood AI
  • 20. Lets connect your AI with python • Login to your Navigator accounts and select the mood AI • Click on the integration tab in the monitor tab
  • 21. Lets connect your AI with python • Login to your Navigator accounts and select the mood AI • Click on the integration tab in the monitor tab • Select python from the drop down for connectors
  • 22. Lets connect your AI with python • Login to your Navigator accounts and select the mood AI • Click on the integration tab in the monitor tab • Select python from the drop down for connectors • Copy paste the code into your repl account
  • 23. Lets connect your AI with python • Login to your Navigator accounts and select the mood AI • Click on the integration tab in the monitor tab • Select python from the drop down for connectors • Copy paste the code into your repl account
  • 24. Lets connect your AI with python • Copy paste the code into your repl account • Note that the code is a function, you have to call this function to get the prediction json.dumps() converts dictionary to striing Convert the output you receive into readable format
  • 25. JSON module • JSON (JavaScript Object Notation) • A very popular format to transmit and receive data over web
  • 26. JSON module • JSON (JavaScript Object Notation) • A very popular format to transmit and receive data over web • How does it work in python? • A json is a string
  • 27. JSON module • JSON (JavaScript Object Notation) • A very popular format to transmit and receive data over web • What would the json dump of a dictionary be?
  • 28. JSON module • JSON (JavaScript Object Notation) • A very popular format to transmit and receive data over web • How does it work in python? • Can any type of variable be dumped? Strings? Lists?
  • 29. Lets connect your AI with python • Login to your Navigator accounts and select the mood AI • Click on the integration tab in the monitor tab • Select python from the drop down for connectors • Copy paste the code into your repl account • Upload the mood dataset into repl
  • 30. Exercise • Convert the mood dataset rows into dictionaries • Trigger the AI service • Calculate accuracy across all samples of the dataset • Calculate the confusion matrix
  • 31. Popular ML Metrics - Classification • Precision • Recall • ROC curve • How to do it when there are more than 2 classes?