0% found this document useful (0 votes)
42 views58 pages

1694266379-Unit1 Machine Learning Introduction CU 2.0

This document provides an introduction to machine learning, including definitions, applications, types of platforms, categories of machine learning, and the machine learning workflow. It discusses supervised and unsupervised learning, common machine learning libraries like Scikit-learn, and how to write a simple machine learning program to classify apples and oranges using only 6 lines of code. It also covers model evaluation and different problem types in machine learning.

Uploaded by

woxiko1688
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views58 pages

1694266379-Unit1 Machine Learning Introduction CU 2.0

This document provides an introduction to machine learning, including definitions, applications, types of platforms, categories of machine learning, and the machine learning workflow. It discusses supervised and unsupervised learning, common machine learning libraries like Scikit-learn, and how to write a simple machine learning program to classify apples and oranges using only 6 lines of code. It also covers model evaluation and different problem types in machine learning.

Uploaded by

woxiko1688
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Machine Learning: Introduction

Unit 1
Machine Learning:
Introduction
Machine Learning: Introduction

Disclaimer
The content is curated from online/offline resources and used for educational purpose only
Machine Learning: Introduction
Machine Learning: Introduction

Learning Objectives

• About Machine Learning


• Applications
• Types of Platforms
• Categories of Machine Learning
• GUI & Non-GUI Approach
• "Hello world to ML"
• Git & GitHub
Machine Learning: Introduction

About Machine Learning


Concept emerged during WW-II
Primarily knows as Turing Machine
• Intent to learn encrypted message.
• Accepted as field of science in 1950’s.

Reference link
Machine Learning: Introduction

Machine Learning: Definition


Early definition of Machine Learning
“Field of study that gives computers the ability to learn without
being explicitly programmed”. Arthur Samuel (1959)
• What do you mean by Explicitly Programmed ?
• So, machine learning algorithms, inspired by the human
learning process, iteratively learn from data, and allow
computers to find hidden insights.
• These models help us in a variety of tasks, such as object
recognition, summarization, recommendation, and so on.

Click here

Reference link
Machine Learning: Introduction

Differs to Casual Programming

Model
Machine Learning: Introduction

Machine Learning Applications

AlphaGo (deepmind.com) Recommendation System Drug Discovery

Facial Recognition Assisted Driving voice-assistant


Character Recognition
Machine Learning: Introduction

Let’s try ML…

Click here

Reference link
Machine Learning: Introduction

Types of Machine Learning

Types of ML
Machine Learning: Introduction

ML Categories: Supervised & Unsupervised

Supervised Learning Unsupervised Learning


Machine Learning: Introduction

ML Hands-on: GUI V/S Bare Coding


• Two approaches are there to practice ML.
• Dedicated Cloud services for GUI (eg:- https://studio.azureml.net/)
• Customized modeling needs bare coding.
Machine Learning: Introduction

Microsoft Azure Workspace

https://studio.azureml.net/
Machine Learning: Introduction

Model Development with Azure ML Studio

https://studio.azureml.net/
Machine Learning: Introduction

Coding Platform: Python


• Python is a General-Purpose Programming language that is often applied in scripting roles.

• So, Python is programming language as well as scripting language.

• Python is an Interpreted language

Python
Machine Learning: Introduction

Python - Uses

WEB SOFTWARE
MATHEMATICS DATA SCIENCE
DEVELOPMENT DEVELOPMENT

Python Applications
Machine Learning: Introduction

Anaconda : Introduction
• An easy-to-install collection of high-performance
Python libraries
• For managing packages and environments.
• Can use Conda to install over 1.5k packages
(including the R language) from the Anaconda
public repository.
• More than 20k packages from community channels,
such as Conda-forge and bioconda
Machine Learning: Introduction

Lab 1 - Demonstration of Anaconda Installation


Machine Learning: Introduction

Anaconda Installation
• Visit the following link: https://www.anaconda.com/distribution/
• Scroll down the page and select windows.

Anaconda
Machine Learning: Introduction

Anaconda Installation….
• Download version matching to your machine

https://www.anaconda.com/download/
Machine Learning: Introduction

Anaconda Installation….
• Run the installation file and accept product terms

https://docs.anaconda.com/free/anaconda/install/windows/
Machine Learning: Introduction

Anaconda Navigator
• Anaconda Navigator is a desktop graphical user interface included in Anaconda that allows you to
launch applications and easily manage conda packages, environments and channels without the
need to use command line commands.

https://anaconda.org/anaconda/anaconda-navigator
Machine Learning: Introduction

Types of Data

Example
• Nominal – Good, Bad,…
• Ordinal – First, Second….
• Discrete – Student count
• Continuous -- Temperature

Reference
Machine Learning: Introduction

Requisite libraries: Numpy, Pandas & Seaborn

Numpy Pandas Seaborn

• Multidimensional arrays and • Easy data structure • Seaborn


matrices • quicker data analysis • Visualization library
• High-level mathematical • Structed & Un-structured data • Statistical graphics plots
functions • pip install pandas • Relational patterns
• pip install numpy • import pandas as pd • Used for EDA
>>> import numpy • pip install seaborn

>>> numpy.__version__ • import seaborn as sns


Machine Learning: Introduction

Scikit-Learn Library
• A free machine learning library.
• Includes most of the classification, regression and clustering algorithms.
• Works with numerical and scientific libraries, NumPy and SciPy.
• Machine learning pipelined tasks are already in scikit learn.
• Includes pre-processing, feature selection, data splitting, customize algorithms, fitting models,
tuning parameters, prediction, evaluation, and exporting the model.
• Has an extended support for Deep learning and cloud services.
Machine Learning: Introduction

Machine Learning Workflow


Machine Learning: Introduction

Writing your first Machine Learning Codes in Only 6 Lines!

Write a code to differentiate between Apples & Oranges ?


Machine Learning: Introduction

Training Data
Features

Input of classifier Output of classifier

Weight Texture Label


150g Bumpy Orange
170g Bumpy Orange
140g Smooth Apple
130g Smooth Apple
… … …
1. import sklearn
2. features = [[140,"smooth"],[130,"smooth"],[150,"bumpy"],[170,"bumpy"]] Change strings to integers
3. labels = ["apples", "apples", "orange", "orange"]
Machine Learning: Introduction

First 3 Lines of Code !

import sklearn
features = [[140, 1], [130, 1], [150, 0], 0: bumpy ; 1: smooth
[170, 0]] 0: apple ; 1: orange
labels = [0, 0, 1, 1]
Machine Learning: Introduction

Classifier
Decision Tree
• Box of RULES
• Learning Algorithms are the procedure that
creates RULES, by finding patterns in your
training DATA.
• Ex: It creates RULE that heavier fruit is more
likely to be an orange!
Machine Learning: Introduction

Machine Learning………Final Code


1. from sklearn import tree
2. features = [[140, 1], [130, 1], [150, 0], [170, 0]]
3. labels = [0, 0, 1, 1]
4. clf = tree.DecisionTreeClassifier()
0: bumpy ; 1: smooth
5. clf = clf.fit(features, labels) 0: apple ; 1: orange
6. print(clf.predict([[150, 0]]))

Classifier gets trained on input data


Machine Learning: Introduction

Need for Model Evaluation


• Built on a subset of the total data, termed as training data, and they are used to predict on new data that
is not part of this training subset.
• If a model is totally adapted to its training data, it would fail to predict accurately any new data
(Overfitting).
• If model is too general, it would predict poorly on particular cases (Underfitting).
• A good model should be perfectly balanced to avoid both.
• By holding out part of the data from the training set and evaluating model with this subset of test data.
Machine Learning: Introduction

ML: Problem Types


Problem types Algorithms

Regression Linear regression, K-NN, random forest, neural networks


Logistic regression, random forest, K-NN, gradient boosting
Classification classifier, neural networks
K-Means, DBSCAN, Hierarchical clustering, Gaussian mixture
Clustering models, BIRCH

ARIMA, SARIMA, LSTM, Exponential smoothing, Prophet,


Time-series forecasting GARCH, TBATS, Dynamic linear models
IsolationForest, Minimum covariance determinant, Local outlier
Anomaly detection factor, One-class SVM
Content-based and collaborative filtering machine learning
Recommendation methods

Data generation Generative adversarial network (GAN), Hidden Markov models


Machine Learning: Introduction

Git & GitHub

Reference
Machine Learning: Introduction

Git

• Git is software for tracking changes.


• Handle any set of files
• Used for work among programmers collaboratively
• Developing source code during software development.

Click here

Reference link
Machine Learning: Introduction

GitHub
• Provider of Internet hosting for software development and version control.
• Offers the distributed version control
• Supports source code management (SCM)

Click here

Reference link
Machine Learning: Introduction

Difference between Git and GitHub

Git GitHub
Installed locally Hosted in cloud
First released in 2005 Company launched in 2008
Maintained by The Linux Foundation Purchase in 2018 by Microsoft
Focused on version control and code sharing Focused on centralized source code hosting

Primarily a command-line tool Administered through the web


No user management features Built-in user management
Minimal external tool configuration features Active marketplace for tool integration

Competes with Mercurial, Subversion, IBM, Rational Competes with Atlassian Bitbucket and GitLab
Team Concert and ClearCase
Open source licensed Includes a free tier and pay-for-use tiers
Machine Learning: Introduction

Version Controlling
• Version control (also known as revision control, source control, or source code management)
• Responsible for managing changes to computer programs.
• Handle documents, large web sites, or other collections of information.
Machine Learning: Introduction

Distributed Version Control

Distributed control
Machine Learning: Introduction

Centralized Version Control

Centralised control
Machine Learning: Introduction

Code-Cycle

Click here

Reference link
Machine Learning: Introduction

Git CMD Vs Git bash

• Git CMD just like Windows CMD.​

• Can call all Git features

• Git Bash emulates bash


environment
• Also support Unix commands

Click here

Reference link
Machine Learning: Introduction

Lab 2 - GitHub Commands


Machine Learning: Introduction

Git Commands

config init add comm


commit
config init add
it

remote
branc
branch check
checkout merg
merge log remot
add
push
log push
h -out e e add

Click here

Reference link
Machine Learning: Introduction

Processing Stages
• Untracked: Files which are newly created in working directory and git does not aware of these files.

• Staged: Files which are added to staging area. These files are ready to commit.

• Committed: Files which is committed and placed in local repository/ Committed State.

• Modified: File which is already tracked by git. But is modified in working directory .
Machine Learning: Introduction

Git-Flow

Staging Tree

Untracked file – Red color


Staging Area – Green Color
Machine Learning: Introduction

Branching

Master and branch


Machine Learning: Introduction

Create Account on GitHub


https://github.com/join?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&s
ource=header-home
Machine Learning: Introduction

Lab 3 - Getting started with the GitHub


Machine Learning: Introduction

GitHub
Machine Learning: Introduction

Summary

• In the first section, we see definition of Machine Learning, that enables computers to learn from data. We
delve into key types like Supervised, Unsupervised, and Reinforcement Learning, showcasing their real-
world applications and examining different Machine Learning products.

• The second part focuses on Git and GitHub. Git is a version control system, while GitHub is a collaborative
platform. We explain their roles in tracking changes, facilitating teamwork, and managing conflicts.
Towards the end, we guide you through creating a GitHub account.

• Emphasizing best practices for version control, we highlight the benefits of using Git and GitHub for
efficient collaboration and code management.
Machine Learning: Introduction

1. Which type of Machine Learning involves learning from a labeled dataset to make
a) Unsupervised Learning
b) Supervised Learning
c) Semi-Supervised Learning
d) Reinforcement Learning

B) Supervised Learning
Machine Learning: Introduction

2. Which type of Machine Learning Library use for Prediction of based on past data
a) Pandas
b) Numpy
c) Sci-kit Learn (skleran)
d) CV

C) Sci-kit Learn (skleran)


Machine Learning: Introduction

3. Git is _______ Version Control system

a) Distributed
b) Centralized

Answer: a) Distributed
Machine Learning: Introduction

4. What is the main goal of Unsupervised Learning?

a) To make predictions based on labeled data


b) To learn from rewards and punishments
c) To find hidden patterns and structures in unlabeled data
d) To improve the accuracy of existing models

Answer - c) To find hidden patterns and structures in unlabeled data


Machine Learning: Introduction

5. Which Python Library Use for Data Visualization

a) lineplot
b) Seaborn
c) matplotlib
d) scatterplot

Answer – b and c
Machine Learning: Introduction

References
• https://en.wikipedia.org/wiki/Git
• https://en.wikipedia.org/wiki/GitHub
• https://medium.com/machine-learning-101
• https://medium.com/@randylaosat/a-beginners-guide-to-machine-learning-dfadc19f6caf
• https://sml.csa.iisc.ac.in/Courses/Spring21/E0_270/pdfs/1.pdf
• https://www.geeksforgeeks.org/difference-between-git-and-github/
• https://link.springer.com/book/10.1007/978-3-030-81935-4
• https://ai.stanford.edu/~nilsson/MLBOOK.pdf
• https://mitpress.mit.edu/9780262043793/introduction-to-machine-learning/
Machine Learning: Introduction

Thank you...!

You might also like