SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Introduction to Google
Colaboratory
Yomna Hassan
Misr International University
Why this session?
This is session is to introduce you to cloud based IDE’s such as
Colab and Jupyter. This is to help in facilitating your coding
experience while minimizing the amount of setup effort
needed to run standard AI and machine learning based
projects using Python.
We are focused on python as it is one of the main languages
focused on machine learning applications.
Survey - What’s your knowledge
level?
1- Python
2-Machine Learning
3- Google Colab
Difference between Jupyter and
Colab
Jupyter is the open source project on which Colab is based.
Colab allows you to use and share Jupyter notebooks with
others without having to download, install, or run anything.
Google Colab
In this session, we will focus on Google Colab. Colab has
already installed many of the popular libraries you may need
to run your code. In addition to this you can access and run
your code from anywhere with an internet connection.
Google Colab also facilitates teamwork/sharing between
multiple programmers.
Colab Pros and Cons
Pros:
1. Fast with no hassle GPU support
2. Can be accessed from anywhere
3. Leaves you free to work on your computer without using resources
4. File can be saved out as Jupiter file
5. Most popular libraries are pre-installed
Colab Pros and Cons
Cons:
1. Can be hard to upload local file
2. Files need to be downloaded which may take time if your internet
is slow
Today’s Program
1- How to start a Google Colab Notebook (file is saved automatically on
your google drive)
2- Running basic code with a “Local” file
3- Uploading files to Google Drive and connecting files to the code
4- Python Libraries
5- Simple Classifications Tasks :
- What is Classification
- CSV Data Classification
- Image Classification
New notebook
https://colab.research.google.com/
- Notebooks Location
- Playground mode
- External Files
- Github and Colab: ex: continualai
- Revisions, Show Diff
- Cells
- Sharing
- Comments
Colab Runtime
- What is runtime?
- GPU versus TPU
- Resources
Note:
Colab offers optional accelerated compute environments, including GPU and TPU. Executing code in a GPU or
TPU runtime does not automatically mean that the GPU or TPU is being utilized. To avoid hitting your GPU
usage limits, we recommend switching to a standard runtime if you are not utilizing the GPU. Choose
Runtime > Change Runtime Type and set Hardware Accelerator to None.
Colab is able to provide free resources in part by having dynamic usage limits that sometimes fluctuate,
and by not providing guaranteed or unlimited resources. This means that overall usage limits as well as
idle timeout periods, maximum VM lifetime, GPU types available, and other factors vary over time. Colab
does not publish these limits, in part because they can (and sometimes do) vary quickly.
Runtime Accelerators
● CPU: Central Processing Unit. Manage all the functions of a
computer.
● GPU: Graphical Processing Unit. Enhance the graphical
performance of the computer.
● TPU: Tensor Processing Unit. Custom build ASIC to accelerate
TensorFlow projects.
Python
Python is an interpreted high-level general-purpose
programming language.
Its language constructs as well as its object-oriented approach
aim to help programmers write clear, logical code for small
and large-scale projects.
Let’s start Coding!
- Basic line of code/ Printing (Input/Output consoles)
- Files Location
- Google Drive
- from google.colab import drive
drive.mount('/content/gdrive'
)
Try:
with open('/content/gdrive/My Drive/foo.txt'
, 'w') as f:
f.write('Hello Google Drive!'
)
!cat /content/gdrive/My Drive/foo.txt
Note: Upload Zipped folder and extract on drive
Classification
Type of Data
- Images/ Videos
- Tables / Structures
Datasets
UCI Machine Learning repository
Kaggle
Google Dataset Search
Visual Data
Tensor Flow Catalog
https://data.mendeley.com/
Python Libraries
Numpy : Matrices and numbers
PIL: Images
os: file systems
Scikit-learn: Machine learning
TensorFlow: machine learning
Terminologies
Data Frame
Algorithms:knn, kmeans , DT
Tuning
Features
Training
Testing
Accuracy
Epoch
Neural networks
KNN
The k-Nearest Neighbor classifier is by far the most simple machine learning and image
classification algorithm. It doesn’t actually “learn” anything. Instead, this algorithm
directly relies on the distance between feature vectors (which in our case, are the raw
RGB pixel intensities of the images).
k-NN algorithm classifies unknown data points by finding the most common class among
the k closest examples. Each data point in the k closest data points casts a vote, and the
category with the highest number of votes wins. Or, in plain English: “Tell me who your
neighbors are, and I’ll tell you who you are”
Choosing K Value - Bias-Variance
Tradoff
● The bias error is an error from erroneous assumptions in the learning
algorithm. High bias can cause an algorithm to miss the relevant
relations between features and target outputs (underfitting).
● The variance is an error from sensitivity to small fluctuations in the
training set. High variance may result from an algorithm modeling the
random noise in the training data (overfitting).
Choosing K Value
Writing Code
#Import Libraries
#Import dataset
#Shape dataset into dataframe /struct
#Design model
#Fit data model
#Compute accuracy
--------
Extra Steps: pre and post processing
Task 1 - Heart Disease Classification
Dataset: https://www.kaggle.com/ronitf/heart-disease-uci
Code:
https://colab.research.google.com/drive/19XE4497Gh-Xth
U9YE12ucuOPw3jywVtL
Exercise
Dataset:
https://www.kaggle.com/uciml/iris/tasks?taskId=1732
Code???
Text Versus Images
Task 2 - Image Classification
Dataset:
https://www.kaggle.com/c/dogs-vs-cats
Code:
https://colab.research.google.com/drive/1ZdRYZIMtMcBelTn4lCzx
aT9_ZD5Foe0s?usp=sharing
Calculate Accuracy
Downloading Data from Link Directly
on Colab
!wget -cq
https://s3.amazonaws.com/content.udacity-data.com/courses/nd188/flo
wer_data.zip
!unzip -qq flower_data.zip
Running Colab Code Offline
Colaboratory lets you connect to a local runtime using Jupyter. This allows you to
execute code on your local hardware and have access to your local file system.
Instructions for setting up Jupyter for the local runtime available here :
https://research.google.com/colaboratory/local-runtimes.html
Where to go from there?
Reading papers related to your topic to identify the most suitable tools/ methods to use
If you want to extend your knowledge about machine learning using python:
https://cognitiveclass.ai/courses/machine-learning-with-python
https://www.youtube.com/watch?v=ihK_YRMMHQM
https://www.analyticsvidhya.com/blog/2021/06/how-to-learn-mathematics-for-machin
e-learning-what-concepts-do-you-need-to-master-in-data-science/?fbclid=IwAR0gsww
28F2sppZ95LVAmQFEG2N0ohhsDMigE3g7HTiNG5ly_QYk30PMsQ4
Questions

Weitere ähnliche Inhalte

Was ist angesagt?

Federated learning in brief
Federated learning in briefFederated learning in brief
Federated learning in briefShashi Perera
 
Deep Learning for Time Series Data
Deep Learning for Time Series DataDeep Learning for Time Series Data
Deep Learning for Time Series DataArun Kejariwal
 
Big Data Platforms: An Overview
Big Data Platforms: An OverviewBig Data Platforms: An Overview
Big Data Platforms: An OverviewC. Scyphers
 
MLOps - Build pipelines with Tensor Flow Extended & Kubeflow
MLOps - Build pipelines with Tensor Flow Extended & KubeflowMLOps - Build pipelines with Tensor Flow Extended & Kubeflow
MLOps - Build pipelines with Tensor Flow Extended & KubeflowJan Kirenz
 
Tools and techniques for data science
Tools and techniques for data scienceTools and techniques for data science
Tools and techniques for data scienceAjay Ohri
 
Streaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologiesStreaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologiesNatalino Busa
 
Deep learning with tensorflow
Deep learning with tensorflowDeep learning with tensorflow
Deep learning with tensorflowCharmi Chokshi
 
Introduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter NotebooksIntroduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter NotebooksEueung Mulyana
 
Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0Databricks
 
Natural language processing: feature extraction
Natural language processing: feature extractionNatural language processing: feature extraction
Natural language processing: feature extractionGabriel Hamilton
 
Tensorflow presentation
Tensorflow presentationTensorflow presentation
Tensorflow presentationAhmed rebai
 
Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18Cloudera, Inc.
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)Prashant Gupta
 
Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Alexander Hendorf
 
Feature selection
Feature selectionFeature selection
Feature selectionDong Guo
 

Was ist angesagt? (20)

Federated learning in brief
Federated learning in briefFederated learning in brief
Federated learning in brief
 
Python pandas Library
Python pandas LibraryPython pandas Library
Python pandas Library
 
Deep Learning for Time Series Data
Deep Learning for Time Series DataDeep Learning for Time Series Data
Deep Learning for Time Series Data
 
Big Data Platforms: An Overview
Big Data Platforms: An OverviewBig Data Platforms: An Overview
Big Data Platforms: An Overview
 
Python
PythonPython
Python
 
Federated Learning
Federated LearningFederated Learning
Federated Learning
 
MLOps - Build pipelines with Tensor Flow Extended & Kubeflow
MLOps - Build pipelines with Tensor Flow Extended & KubeflowMLOps - Build pipelines with Tensor Flow Extended & Kubeflow
MLOps - Build pipelines with Tensor Flow Extended & Kubeflow
 
Federated Learning
Federated LearningFederated Learning
Federated Learning
 
Tools and techniques for data science
Tools and techniques for data scienceTools and techniques for data science
Tools and techniques for data science
 
Streaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologiesStreaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologies
 
Deep learning with tensorflow
Deep learning with tensorflowDeep learning with tensorflow
Deep learning with tensorflow
 
Introduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter NotebooksIntroduction to IPython & Jupyter Notebooks
Introduction to IPython & Jupyter Notebooks
 
Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0Introduction to TensorFlow 2.0
Introduction to TensorFlow 2.0
 
Natural language processing: feature extraction
Natural language processing: feature extractionNatural language processing: feature extraction
Natural language processing: feature extraction
 
Tensorflow presentation
Tensorflow presentationTensorflow presentation
Tensorflow presentation
 
Data Analysis in Python
Data Analysis in PythonData Analysis in Python
Data Analysis in Python
 
Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
 
Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]
 
Feature selection
Feature selectionFeature selection
Feature selection
 

Ähnlich wie Introduction to Google Colaboratory and Machine Learning

Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligenceCarlos Toxtli
 
Intro - End to end ML with Kubeflow @ SignalConf 2018
Intro - End to end ML with Kubeflow @ SignalConf 2018Intro - End to end ML with Kubeflow @ SignalConf 2018
Intro - End to end ML with Kubeflow @ SignalConf 2018Holden Karau
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Runwesley chun
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIYoni Davidson
 
Colab workshop (for Computer vision Students)
Colab workshop (for Computer vision Students)Colab workshop (for Computer vision Students)
Colab workshop (for Computer vision Students)Asim Hameed Khan
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
1_International_Google_CoLab_20220307.pptx
1_International_Google_CoLab_20220307.pptx1_International_Google_CoLab_20220307.pptx
1_International_Google_CoLab_20220307.pptxFEG
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning processDenis Dus
 
Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)DoiT International
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksKaty Slemon
 
LCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience ReportLCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience ReportLinaro
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGDSCNiT
 
Bacalhau: Stable Diffusion on a GPU
Bacalhau: Stable Diffusion on a GPUBacalhau: Stable Diffusion on a GPU
Bacalhau: Stable Diffusion on a GPUAlly339821
 
Google Platform Overview (April 2014)
Google Platform Overview (April 2014)Google Platform Overview (April 2014)
Google Platform Overview (April 2014)Ido Green
 
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Luciano Resende
 
Customize and Secure the Runtime and Dependencies of Your Procedural Language...
Customize and Secure the Runtime and Dependencies of Your Procedural Language...Customize and Secure the Runtime and Dependencies of Your Procedural Language...
Customize and Secure the Runtime and Dependencies of Your Procedural Language...VMware Tanzu
 
Exploring and Using the Python Ecosystem
Exploring and Using the Python EcosystemExploring and Using the Python Ecosystem
Exploring and Using the Python EcosystemAdam Cook
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 

Ähnlich wie Introduction to Google Colaboratory and Machine Learning (20)

Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligence
 
Intro - End to end ML with Kubeflow @ SignalConf 2018
Intro - End to end ML with Kubeflow @ SignalConf 2018Intro - End to end ML with Kubeflow @ SignalConf 2018
Intro - End to end ML with Kubeflow @ SignalConf 2018
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 
Colab workshop (for Computer vision Students)
Colab workshop (for Computer vision Students)Colab workshop (for Computer vision Students)
Colab workshop (for Computer vision Students)
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
1_International_Google_CoLab_20220307.pptx
1_International_Google_CoLab_20220307.pptx1_International_Google_CoLab_20220307.pptx
1_International_Google_CoLab_20220307.pptx
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning process
 
Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworks
 
LCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience ReportLCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience Report
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptx
 
Bacalhau: Stable Diffusion on a GPU
Bacalhau: Stable Diffusion on a GPUBacalhau: Stable Diffusion on a GPU
Bacalhau: Stable Diffusion on a GPU
 
Google Platform Overview (April 2014)
Google Platform Overview (April 2014)Google Platform Overview (April 2014)
Google Platform Overview (April 2014)
 
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
Elyra - a set of AI-centric extensions to JupyterLab Notebooks.
 
Customize and Secure the Runtime and Dependencies of Your Procedural Language...
Customize and Secure the Runtime and Dependencies of Your Procedural Language...Customize and Secure the Runtime and Dependencies of Your Procedural Language...
Customize and Secure the Runtime and Dependencies of Your Procedural Language...
 
Why Go Lang?
Why Go Lang?Why Go Lang?
Why Go Lang?
 
Exploring and Using the Python Ecosystem
Exploring and Using the Python EcosystemExploring and Using the Python Ecosystem
Exploring and Using the Python Ecosystem
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 

Mehr von Yomna Mahmoud Ibrahim Hassan

1Computer Graphics new-L1-Introduction to Computer Graphics.pdf
1Computer Graphics new-L1-Introduction to Computer Graphics.pdf1Computer Graphics new-L1-Introduction to Computer Graphics.pdf
1Computer Graphics new-L1-Introduction to Computer Graphics.pdfYomna Mahmoud Ibrahim Hassan
 
Human Computer Interaction-fall2021 - CSC341-L1.pptx.pdf
Human Computer Interaction-fall2021 - CSC341-L1.pptx.pdfHuman Computer Interaction-fall2021 - CSC341-L1.pptx.pdf
Human Computer Interaction-fall2021 - CSC341-L1.pptx.pdfYomna Mahmoud Ibrahim Hassan
 
Word Tagging using Max Entropy Model and Feature selection
Word Tagging using Max Entropy Model and Feature selection Word Tagging using Max Entropy Model and Feature selection
Word Tagging using Max Entropy Model and Feature selection Yomna Mahmoud Ibrahim Hassan
 
Report on Knowledge Modeling in Various applications in Traffic Systems
Report on Knowledge Modeling in Various applications in Traffic SystemsReport on Knowledge Modeling in Various applications in Traffic Systems
Report on Knowledge Modeling in Various applications in Traffic SystemsYomna Mahmoud Ibrahim Hassan
 
Knowledge Modeling in Various applications in Traffic Systems
Knowledge Modeling in Various applications in Traffic SystemsKnowledge Modeling in Various applications in Traffic Systems
Knowledge Modeling in Various applications in Traffic SystemsYomna Mahmoud Ibrahim Hassan
 
Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...
Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...
Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...Yomna Mahmoud Ibrahim Hassan
 
Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...
Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...
Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...Yomna Mahmoud Ibrahim Hassan
 
How a company may expand its share in the student/university market segment f...
How a company may expand its share in the student/university market segment f...How a company may expand its share in the student/university market segment f...
How a company may expand its share in the student/university market segment f...Yomna Mahmoud Ibrahim Hassan
 
Using Information Systems to Improve Businesses: The present and the future
Using Information Systems to Improve Businesses: The present and the futureUsing Information Systems to Improve Businesses: The present and the future
Using Information Systems to Improve Businesses: The present and the futureYomna Mahmoud Ibrahim Hassan
 
ECG beats classification using multiclass SVMs with ECOC
ECG beats classification using multiclass SVMs with ECOCECG beats classification using multiclass SVMs with ECOC
ECG beats classification using multiclass SVMs with ECOCYomna Mahmoud Ibrahim Hassan
 

Mehr von Yomna Mahmoud Ibrahim Hassan (20)

W1_CourseIntroduction.pptx advancedgraphics
W1_CourseIntroduction.pptx advancedgraphicsW1_CourseIntroduction.pptx advancedgraphics
W1_CourseIntroduction.pptx advancedgraphics
 
First Umrah Application Details - A proposal
First Umrah Application Details - A  proposalFirst Umrah Application Details - A  proposal
First Umrah Application Details - A proposal
 
1Computer Graphics new-L1-Introduction to Computer Graphics.pdf
1Computer Graphics new-L1-Introduction to Computer Graphics.pdf1Computer Graphics new-L1-Introduction to Computer Graphics.pdf
1Computer Graphics new-L1-Introduction to Computer Graphics.pdf
 
Human Computer Interaction-fall2021 - CSC341-L1.pptx.pdf
Human Computer Interaction-fall2021 - CSC341-L1.pptx.pdfHuman Computer Interaction-fall2021 - CSC341-L1.pptx.pdf
Human Computer Interaction-fall2021 - CSC341-L1.pptx.pdf
 
Word Tagging using Max Entropy Model and Feature selection
Word Tagging using Max Entropy Model and Feature selection Word Tagging using Max Entropy Model and Feature selection
Word Tagging using Max Entropy Model and Feature selection
 
Social Learning
Social LearningSocial Learning
Social Learning
 
Planning Innovation
Planning InnovationPlanning Innovation
Planning Innovation
 
3alem soora : Submission to ITU competition
3alem soora : Submission to ITU competition3alem soora : Submission to ITU competition
3alem soora : Submission to ITU competition
 
Report on Knowledge Modeling in Various applications in Traffic Systems
Report on Knowledge Modeling in Various applications in Traffic SystemsReport on Knowledge Modeling in Various applications in Traffic Systems
Report on Knowledge Modeling in Various applications in Traffic Systems
 
Knowledge Modeling in Various applications in Traffic Systems
Knowledge Modeling in Various applications in Traffic SystemsKnowledge Modeling in Various applications in Traffic Systems
Knowledge Modeling in Various applications in Traffic Systems
 
Yomna Hassan CV 2014
Yomna Hassan CV 2014Yomna Hassan CV 2014
Yomna Hassan CV 2014
 
Image Annotation
Image AnnotationImage Annotation
Image Annotation
 
Heterogeneous data annotation
Heterogeneous data annotationHeterogeneous data annotation
Heterogeneous data annotation
 
Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...
Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...
Applicability of Interactive Genetic Algorithms to Multi-agent Systems: Exper...
 
Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...
Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...
Genetic Algorithms in Repeated Matrix Games: The Effects of Algorithmic Modif...
 
Sparks RSS Reader
Sparks RSS ReaderSparks RSS Reader
Sparks RSS Reader
 
How a company may expand its share in the student/university market segment f...
How a company may expand its share in the student/university market segment f...How a company may expand its share in the student/university market segment f...
How a company may expand its share in the student/university market segment f...
 
Using Information Systems to Improve Businesses: The present and the future
Using Information Systems to Improve Businesses: The present and the futureUsing Information Systems to Improve Businesses: The present and the future
Using Information Systems to Improve Businesses: The present and the future
 
ECG beats classification using multiclass SVMs with ECOC
ECG beats classification using multiclass SVMs with ECOCECG beats classification using multiclass SVMs with ECOC
ECG beats classification using multiclass SVMs with ECOC
 
Beginners XNA
Beginners XNABeginners XNA
Beginners XNA
 

Kürzlich hochgeladen

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 

Kürzlich hochgeladen (20)

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 

Introduction to Google Colaboratory and Machine Learning

  • 1. Introduction to Google Colaboratory Yomna Hassan Misr International University
  • 2. Why this session? This is session is to introduce you to cloud based IDE’s such as Colab and Jupyter. This is to help in facilitating your coding experience while minimizing the amount of setup effort needed to run standard AI and machine learning based projects using Python. We are focused on python as it is one of the main languages focused on machine learning applications.
  • 3. Survey - What’s your knowledge level? 1- Python 2-Machine Learning 3- Google Colab
  • 4. Difference between Jupyter and Colab Jupyter is the open source project on which Colab is based. Colab allows you to use and share Jupyter notebooks with others without having to download, install, or run anything.
  • 5. Google Colab In this session, we will focus on Google Colab. Colab has already installed many of the popular libraries you may need to run your code. In addition to this you can access and run your code from anywhere with an internet connection. Google Colab also facilitates teamwork/sharing between multiple programmers.
  • 6. Colab Pros and Cons Pros: 1. Fast with no hassle GPU support 2. Can be accessed from anywhere 3. Leaves you free to work on your computer without using resources 4. File can be saved out as Jupiter file 5. Most popular libraries are pre-installed
  • 7. Colab Pros and Cons Cons: 1. Can be hard to upload local file 2. Files need to be downloaded which may take time if your internet is slow
  • 8. Today’s Program 1- How to start a Google Colab Notebook (file is saved automatically on your google drive) 2- Running basic code with a “Local” file 3- Uploading files to Google Drive and connecting files to the code 4- Python Libraries 5- Simple Classifications Tasks : - What is Classification - CSV Data Classification - Image Classification
  • 9. New notebook https://colab.research.google.com/ - Notebooks Location - Playground mode - External Files - Github and Colab: ex: continualai - Revisions, Show Diff - Cells - Sharing - Comments
  • 10. Colab Runtime - What is runtime? - GPU versus TPU - Resources Note: Colab offers optional accelerated compute environments, including GPU and TPU. Executing code in a GPU or TPU runtime does not automatically mean that the GPU or TPU is being utilized. To avoid hitting your GPU usage limits, we recommend switching to a standard runtime if you are not utilizing the GPU. Choose Runtime > Change Runtime Type and set Hardware Accelerator to None. Colab is able to provide free resources in part by having dynamic usage limits that sometimes fluctuate, and by not providing guaranteed or unlimited resources. This means that overall usage limits as well as idle timeout periods, maximum VM lifetime, GPU types available, and other factors vary over time. Colab does not publish these limits, in part because they can (and sometimes do) vary quickly.
  • 11. Runtime Accelerators ● CPU: Central Processing Unit. Manage all the functions of a computer. ● GPU: Graphical Processing Unit. Enhance the graphical performance of the computer. ● TPU: Tensor Processing Unit. Custom build ASIC to accelerate TensorFlow projects.
  • 12. Python Python is an interpreted high-level general-purpose programming language. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
  • 13. Let’s start Coding! - Basic line of code/ Printing (Input/Output consoles) - Files Location - Google Drive - from google.colab import drive drive.mount('/content/gdrive' ) Try: with open('/content/gdrive/My Drive/foo.txt' , 'w') as f: f.write('Hello Google Drive!' ) !cat /content/gdrive/My Drive/foo.txt Note: Upload Zipped folder and extract on drive
  • 14.
  • 16. Type of Data - Images/ Videos - Tables / Structures
  • 17. Datasets UCI Machine Learning repository Kaggle Google Dataset Search Visual Data Tensor Flow Catalog https://data.mendeley.com/
  • 18. Python Libraries Numpy : Matrices and numbers PIL: Images os: file systems Scikit-learn: Machine learning TensorFlow: machine learning
  • 19. Terminologies Data Frame Algorithms:knn, kmeans , DT Tuning Features Training Testing Accuracy Epoch Neural networks
  • 20. KNN The k-Nearest Neighbor classifier is by far the most simple machine learning and image classification algorithm. It doesn’t actually “learn” anything. Instead, this algorithm directly relies on the distance between feature vectors (which in our case, are the raw RGB pixel intensities of the images). k-NN algorithm classifies unknown data points by finding the most common class among the k closest examples. Each data point in the k closest data points casts a vote, and the category with the highest number of votes wins. Or, in plain English: “Tell me who your neighbors are, and I’ll tell you who you are”
  • 21. Choosing K Value - Bias-Variance Tradoff ● The bias error is an error from erroneous assumptions in the learning algorithm. High bias can cause an algorithm to miss the relevant relations between features and target outputs (underfitting). ● The variance is an error from sensitivity to small fluctuations in the training set. High variance may result from an algorithm modeling the random noise in the training data (overfitting).
  • 23. Writing Code #Import Libraries #Import dataset #Shape dataset into dataframe /struct #Design model #Fit data model #Compute accuracy -------- Extra Steps: pre and post processing
  • 24. Task 1 - Heart Disease Classification Dataset: https://www.kaggle.com/ronitf/heart-disease-uci Code: https://colab.research.google.com/drive/19XE4497Gh-Xth U9YE12ucuOPw3jywVtL
  • 27.
  • 28. Task 2 - Image Classification Dataset: https://www.kaggle.com/c/dogs-vs-cats Code: https://colab.research.google.com/drive/1ZdRYZIMtMcBelTn4lCzx aT9_ZD5Foe0s?usp=sharing
  • 30. Downloading Data from Link Directly on Colab !wget -cq https://s3.amazonaws.com/content.udacity-data.com/courses/nd188/flo wer_data.zip !unzip -qq flower_data.zip
  • 31. Running Colab Code Offline Colaboratory lets you connect to a local runtime using Jupyter. This allows you to execute code on your local hardware and have access to your local file system. Instructions for setting up Jupyter for the local runtime available here : https://research.google.com/colaboratory/local-runtimes.html
  • 32. Where to go from there? Reading papers related to your topic to identify the most suitable tools/ methods to use If you want to extend your knowledge about machine learning using python: https://cognitiveclass.ai/courses/machine-learning-with-python https://www.youtube.com/watch?v=ihK_YRMMHQM https://www.analyticsvidhya.com/blog/2021/06/how-to-learn-mathematics-for-machin e-learning-what-concepts-do-you-need-to-master-in-data-science/?fbclid=IwAR0gsww 28F2sppZ95LVAmQFEG2N0ohhsDMigE3g7HTiNG5ly_QYk30PMsQ4