MACHINE LEARNING
Machine Learning: Concepts and Application
LECTURE NOTES
UNIT-1
, UNIT-1
Syllabus
INTRODUCTION TO MACHINE LEARNING
Introduction to Machine Learning: Introduction. Different types of learning, Hypothesis space
and inductive bias, Evaluation. Training and test sets, cross validation, Concept of over fitting,
under fitting, Bias and Variance. Linear Regression: Introduction, Linear regression, Simple and
Multiple Linear regression, Polynomial regression, evaluating regression
1. Introduction to Machine Learning
1.1 What is machine learning?
Machine learning is a subset of Artificial Intelligence (AI) that involves the development of
algorithms and statistical models which enable computers to perform tasks without explicit
instructions.
In machine learning, Instead of being programmed with specific rules for every possible scenario,
machine learning algorithms learn patterns from data and make decisions based on that learning.
1.2 Difference between traditional programing and Machine learning
The primary difference between traditional programming and machine learning lies in how they
approach solving problems and generating outputs.
Traditional Programming
Process: In traditional programming, a human programmer writes explicit rules (logic) to
process input data and produce output. The logic is crafted based on the programmer’s
understanding of the problem.
Components:
o Input: Data provided to the program.
o Logic/Rules: Manually written code that specifies how to process the input.
o Output: The result generated by applying the rules to the input.
Example: A program to calculate the area of a rectangle.
o Input: Length and width
o Logic: Multiply length by width (area = length * width)
o Output: Area of the rectangle
Best Suited For: Problems with clear rules, logic, and conditions that can be explicitly
coded, such as sorting algorithms, calculations, and fixed decision trees.
Machine Learning
Process: In machine learning, instead of explicitly programming the rules, the system
learns patterns and relationships in data by being trained on examples. The algorithm
generates its own logic based on the data it processes.
, Components:
o Input Data: A dataset with examples (inputs and outputs for supervised learning).
o Training Algorithm: Learns patterns from the data.
o Model: The "learned" logic that can make predictions or decisions on new inputs.
Example: Predicting house prices.
o Input: Features like size, location, number of bedrooms
o Training: Algorithm learns from a dataset of past house prices
o Output: Predicted price for a new house based on its features
Best Suited For: Problems with complex patterns, where explicit rules are difficult to
define, such as image recognition, natural language processing, and recommendation
systems.
Key Differences
Aspect Traditional Programming Machine Learning
Manually written by the
Rules/Logic Learned automatically from data
programmer
Input Data + explicitly defined rules Data (examples) for training
Output Determined by the rules Rules (model) + predictions on new data
Limited; requires rewriting code High; the model adapts as new data is
Flexibility
for changes introduced
Example Use Simple calculators, web Fraud detection, speech recognition,
Case development autonomous driving
1.3 work flow in Machine learning Process
, Understanding how machine learning works involves delving into a step-by-step process that
transforms raw data into valuable insights.
Step 1: Data collection
The first step in the machine learning process is data collection. Data is the lifeblood of machine
learning - the quality and quantity of data can directly impact the model's performance.
Data can be collected from various sources such as databases, text files, images, audio files, or
even scraped from the web.
Once collected, the data needs to be prepared for machine learning. This process involves
organizing the data in a suitable format, such as a CSV file or a database, and ensuring that the
data is relevant to the problem
Step 2: Data preprocessing