0% found this document useful (0 votes)
18 views15 pages

Introduction to Machine Learning Basics

The document provides an overview of Machine Learning (ML), explaining its definition, importance, and various learning methods such as supervised, unsupervised, reinforcement, and semi-supervised learning. It also discusses different machine learning models, including regression models like linear and polynomial regression, as well as classification models like Support Vector Machines, Decision Trees, Random Forest, and K-Nearest Neighbors. The key takeaway is that ML is essential for automating tasks, enhancing decision-making, and driving technological innovation.
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)
18 views15 pages

Introduction to Machine Learning Basics

The document provides an overview of Machine Learning (ML), explaining its definition, importance, and various learning methods such as supervised, unsupervised, reinforcement, and semi-supervised learning. It also discusses different machine learning models, including regression models like linear and polynomial regression, as well as classification models like Support Vector Machines, Decision Trees, Random Forest, and K-Nearest Neighbors. The key takeaway is that ML is essential for automating tasks, enhancing decision-making, and driving technological innovation.
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

Machine

Government Engineering College, Ajmer

Learning submitted by :
Name : Pranay Pratap Singh
University roll no. : 23EEACS083
Semester : V
Class: B1

submitted to : Mr. Mangilal


Introduction to Machine
Learning
UNDERSTANDING THE BASICS AND IMPORTANCE

What is Machine Learning (ML)?:


A subset of Artificial Intelligence (AI) that enables systems to learn from data and improve
performance without explicit programming.
How ML Works:
ML systems identify patterns in data and make predictions or decisions based on those patterns.
Importance of ML:
- Automates complex tasks and decision-making.
- Enhances accuracy and efficiency in various fields (healthcare, finance, marketing, etc.).
- Drives innovation in AI-powered technologies like self-driving cars, recommendation systems, and
virtual assistants.
- Key Takeaway:
- Machine Learning is transforming how we process information and make decisions, making it a
cornerstone of modern technology.
Learning Methods in 1. Supervised Learning

Machine Learning The model is trained on labeled data (input +


correct output).
Learns to map inputs to outputs and make
predictions.
Examples:
Email spam detection
Predicting house prices

2. Unsupervised Learning
The model works with unlabeled data and
identifies patterns or structures.
Useful for discovering hidden insights.
Examples:
Customer segmentation
Market basket analysis
3. Reinforcement Learning (RL)
The model learns by trial and error using feedback from its environment.
Focuses on maximizing rewards.
Examples:
Game-playing AI (e.g., Chess, Go)
Self-driving cars
4. Semi-Supervised Learning
Uses a small amount of labeled data and a large amount of unlabeled
data.
Helps when labeling data is expensive or time-consuming.
Examples:
Image recognition
Medical diagnosis
Introduction to Learning
Models
UNDERSTANDING MODELS AND THEIR IMPORTANCE

Machine learning models map input features to output


predictions. Selecting the right model is crucial, as different
problems require different approaches, impacting accuracy
and effectiveness.
Regression
Models
Linear Regression Model
Linear Regression is one of the simplest and most widely used models in machine learning.
It assumes a linear relationship between the dependent variable y and the independent variable X.
The equation of a simple linear regression line is:
y = θo + θ1X​
where
θo : intercept
θ1 ​: slope or weight coefficient

→ Explanation of code:
The code implements normal equation solution for
finding the best model parameters for a given data.
NORMAL EQUATION: θ = (Xᵀ X)⁻¹ Xᵀ y
As we can see the graph plotted by using the model
parameters calculated by NORMAL EQUATION
- Blue dots represent the original data points
- Red Line represent the linear model equation derived.
Polynomial Regression
Polynomial Regression extends Linear Regression by considering non-
linear relationships between features and target variables.
Instead of fitting a straight line, it fits a curve by introducing
polynomial terms of the input variable.

Explanation of the code:

Model Fitting:
A linear model is fitted on these new polynomial features,
effectively becoming a quadratic regression.
A Quadratic data is generated model a non-linear relationship
Polynomial Features: PolynomialFeatures(degree=2)
transforms input X into [X, X^2], enabling a curved
fit.

Model Fitting:
A linear model is fitted on these new polynomial
features, effectively becoming a quadratic regression.
Prediction & Plotting:
Data is sorted and the red curve shows the quadratic
relationship that best fits the data.
Classification
Models
Support Vector Machine
SVM is a supervised classification algorithm
that finds the best hyperplane separating
different classes with maximum margin.

Hyperplane: SVM finds the line (or


plane) that best separates the data
classes.
Margin Maximization: Ensures
maximum distance between the
boundary and data points.
Kernel: Can use linear, polynomial,
or RBF kernels for non-linear data.
Decision Tree
Decision Trees are intuitive models that represent
decisions and their possible consequences in a tree-like
structure. Each branch corresponds to a choice, while
the leaves signify outcomes, allowing for easy
interpretation and visualization of data-driven decision-
making processes in various contexts.

Dataset: Uses the famous Iris dataset (3 flower


classes).
Training: Tree splits features recursively to
minimize impurity.
Depth Control: max_depth=3 prevents overfitting.
Visualization: Displays tree structure with
decision splits.
Random Forest Overview
Random Forest is an ensemble learning method combining
multiple decision trees.
Each tree is trained on a random subset of data and
features, and the final output is the majority vote of all trees.

Ensemble Concept: Combines results from multiple decision trees.


Randomness: Each tree is trained on random samples & features → reduces
overfitting.
Aggregation: Final decision = majority voting across all trees.
Performance: More robust than a single decision tree.
K-Nearest Neighbors (KNN)
KNN is a non-parametric
algorithm that classifies a data
point based on the majority class
among its K nearest neighbors in
feature space.

Explanation:
Training: Stores all data points; no
actual model fitting.
Prediction: Calculates distances to all
training points and selects k nearest
ones.
Majority Voting: Class with maximum
frequency among neighbors is
predicted.
Parameter: n_neighbors controls
sensitivity (too low → noisy, too high
→ smooth).

You might also like