際際滷

際際滷Share a Scribd company logo
Machine Learning Interviews  
Day 2 
Arpit Agarwal
Decision Trees 
 JPs very practical problem:- Whether to go 
to prakruthi for tea or not? 
Ask Rishabh if he 
wants to come? 
Yes No 
Does Rishabh has 
money for both of us? 
Dont go for tea 
Yes No 
Go for tea Dont go for tea
Decision Trees 
 A tree in which each internal node represents 
a test of an attribute and a leaf represents a 
label and a branch represents an attribute 
value. 
 A node in a decision tree partitions the space. 
 Can be used for classification and regression.
Decision Trees
Decision Tree Learning 
 Choose the best attribute to split the remaining instances 
and make that attribute a decision node 
 Each node will correspond to a subset of the training set 
 Repeat this process recursively for each child 
 Stop when: 
 All the instances in a node have the same label 
 There are no more attributes 
 There are no more instances
How to select the best attribute? 
 Various heuristics such as 
 Entropy Impurity (which is minimized when all the 
instances in a given node have same label) 
 Entropy(S) = - p1 * log2(p1) - p0 * log2(p0) 
 Gini Impurity 
 Entropy(S) = p0 * p1
Decision Tree Pruning 
 In pruning we remove a bad decision node 
and merge its children. 
 Two techniques: 
 Subtree Replacement 
 Subtree Raising
Decision Trees 
 Advantage- Easy to understand and interpret; 
can be applied to wide variety of problems 
 Disadvantage- Difficult to learn, Overfittting 
problem, Error-propagation
Support Vector Machine (SVM) 
 Belong to the Marwari family of algorithms 
- Always thinks about maximizing its margins
SVM 
 Which classifier is better?
SVM 
 Which classifier is better?
SVM 
denotes +1 
denotes -1 
f(x,w,b) = sign(w x + b) 
The maximum 
margin linear 
classifier is the 
linear classifier 
with the, um, 
maximum margin. 
This is the 
simplest kind of 
SVM (Called an 
LSVM) 
Linear SVM 
Support Vectors 
are those 
datapoints that 
the margin 
pushes up 
against 
1. Maximizing the margin is good 
according to intuition and PAC theory 
2. Implies that only support vectors are 
important; other training examples 
are ignorable. 
3. Empirically it works very very well.
Hard Margin SVM 
What we know: 
 w . x+ + b = +1 
 w . x- + b = -1 
 w . (x+-x-) = 2 
X-x+ 
M=Margin Width 
x x w 
w w 
M 
( ) 2
 Goal: 1) Correctly classify all training data 
if yi = +1 
if yi = -1 
for all i 
wx  b 1 i 
wx  b 1 i 
y (wx  b) 1 i i 
2) Maximize the Margin 
same as minimize 
2 
w 
|| || 
M  
1 
w w t 
2 
 We can formulate a Quadratic Optimization Problem and solve for w and b
Hard Margin SVM 
 The lagrangian dual of the problem:- 
 After solving this we get the optimal 留i and the solution is 
w = 裡留iyixi b= yk- wTxk for any xk such that 留k 0 
 The points for which 留i > 0 are called the support vectors.
Soft Margin SVM 
 Hard Margin: So far we require 
all data points be classified correctly 
- No training error 
 What if the training set is 
noisy? 
- Solution 1: use very powerful 
kernels 
denotes +1 
denotes -1 
OVERFITTING!
Soft Margin SVM 
Slack variables 両i can be added to allow misclassification 
of difficult or noisy examples. 
e11 
e7 
e2 
What should our quadratic 
optimization criterion be? 
Minimize 
ワ 
 
R 
C 竜k 
k 
1 
1 
|| w 
|| 
2
Soft Margin SVM 
 Optimization problem 
 Lagrange Dual 
 After solving this, the solution as 
w = 裡留iyixi b= yk- wTxk for any xk such that 留k 0
Kernel SVM 
 General idea: the original input space can always be mapped 
to some higher-dimensional feature space where the training 
set is separable: 
陸: x  (x)
Kernel SVM 
 If every data point is mapped into high-dimensional 
space via some transformation 陸: 
x  (x), the dot product becomes: 
K(xi,xj)= (xi) T(xj) 
 A kernel function is some function that 
corresponds to an inner product in some 
expanded feature space.
Learning with Kernel SVM 
 Optimization problem: 
 The solution is
Types of Kernels 
 Linear: K(xi,xj)= xi 
Txj 
 Polynomial of power p: K(xi,xj)= (1+ xi 
Txj)p 
 Gaussian (radial-basis function network): 
i j 
( , ) exp( 2 
 Sigmoid: K(xi,xj)= tanh(硫0xi 
Txj + 硫1) 
) 
2 
2 
 
i j 
x x 
x x 
 
K
SVM 
 Takeaway- SVM maximizes margin 
 Hard Margin  Use when data is seperable 
 Soft Margin  Use when data is non-seperable
- What is Overfitting? How to avoid it? 
- Cross-validation, regularization 
- What is regularization? Why do we need it? 
- What is Bias-Variance tradeoff?
Overfitting  Curve Fitting
Overfitting

More Related Content

What's hot (9)

Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)
Marina Santini
Understanding Bagging and Boosting
Understanding Bagging and BoostingUnderstanding Bagging and Boosting
Understanding Bagging and Boosting
Mohit Rajput
Lecture 3: Basic Concepts of Machine Learning - Induction & Evaluation
Lecture 3: Basic Concepts of Machine Learning - Induction & EvaluationLecture 3: Basic Concepts of Machine Learning - Induction & Evaluation
Lecture 3: Basic Concepts of Machine Learning - Induction & Evaluation
Marina Santini
Pc 8.1 notes
Pc 8.1 notesPc 8.1 notes
Pc 8.1 notes
Jonathan Fjelstrom
Lec4b pong from_pixels
Lec4b pong from_pixelsLec4b pong from_pixels
Lec4b pong from_pixels
Ronald Teo
Random Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin AnalyticsRandom Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin Analytics
Palin analytics
Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1) Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1)
Marina Santini
22 Machine Learning Feature Selection
22 Machine Learning Feature Selection22 Machine Learning Feature Selection
22 Machine Learning Feature Selection
Andres Mendez-Vazquez
Multi-Class Sentiment Classification using Machine Learning and Deep Learning...
Multi-Class Sentiment Classification using Machine Learning and Deep Learning...Multi-Class Sentiment Classification using Machine Learning and Deep Learning...
Multi-Class Sentiment Classification using Machine Learning and Deep Learning...
saurav singla
Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)Lecture 3b: Decision Trees (1 part)
Lecture 3b: Decision Trees (1 part)
Marina Santini
Understanding Bagging and Boosting
Understanding Bagging and BoostingUnderstanding Bagging and Boosting
Understanding Bagging and Boosting
Mohit Rajput
Lecture 3: Basic Concepts of Machine Learning - Induction & Evaluation
Lecture 3: Basic Concepts of Machine Learning - Induction & EvaluationLecture 3: Basic Concepts of Machine Learning - Induction & Evaluation
Lecture 3: Basic Concepts of Machine Learning - Induction & Evaluation
Marina Santini
Lec4b pong from_pixels
Lec4b pong from_pixelsLec4b pong from_pixels
Lec4b pong from_pixels
Ronald Teo
Random Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin AnalyticsRandom Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin Analytics
Palin analytics
Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1) Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1)
Marina Santini
22 Machine Learning Feature Selection
22 Machine Learning Feature Selection22 Machine Learning Feature Selection
22 Machine Learning Feature Selection
Andres Mendez-Vazquez
Multi-Class Sentiment Classification using Machine Learning and Deep Learning...
Multi-Class Sentiment Classification using Machine Learning and Deep Learning...Multi-Class Sentiment Classification using Machine Learning and Deep Learning...
Multi-Class Sentiment Classification using Machine Learning and Deep Learning...
saurav singla

Similar to Machine learning interviews day2 (20)

Support Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the theSupport Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the the
sanjaibalajeessn
Support Vector Machines Simply
Support Vector Machines SimplySupport Vector Machines Simply
Support Vector Machines Simply
Emad Nabil
super vector machines algorithms using deep
super vector machines algorithms using deepsuper vector machines algorithms using deep
super vector machines algorithms using deep
KNaveenKumarECE
ML-Lec-17-SVM,sshwqw - Non-Linear (1).pptx
ML-Lec-17-SVM,sshwqw - Non-Linear (1).pptxML-Lec-17-SVM,sshwqw - Non-Linear (1).pptx
ML-Lec-17-SVM,sshwqw - Non-Linear (1).pptx
shafanahmad06
4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development
PriyankaRamavath3
13Kernel_Machines.pptx
13Kernel_Machines.pptx13Kernel_Machines.pptx
13Kernel_Machines.pptx
KarasuLee
Support vector machine
Support vector machineSupport vector machine
Support vector machine
Prasenjit Dey
PERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNING
PERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNINGPERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNING
PERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNING
abeeratariq20011
Notes relating to Machine Learning and SVM
Notes relating to Machine Learning and SVMNotes relating to Machine Learning and SVM
Notes relating to Machine Learning and SVM
SyedSaimGardezi
Support vector MAchine using machine learning
Support vector MAchine using machine learningSupport vector MAchine using machine learning
Support vector MAchine using machine learning
GauravRaj772344
svm_introductory_ppt by university of texas
svm_introductory_ppt by university of texassvm_introductory_ppt by university of texas
svm_introductory_ppt by university of texas
krutikavermafcs
deeplearninhg........ applicationsWEEK 05.pdf
deeplearninhg........ applicationsWEEK 05.pdfdeeplearninhg........ applicationsWEEK 05.pdf
deeplearninhg........ applicationsWEEK 05.pdf
krishnas665013
Support vector machine
Support vector machineSupport vector machine
Support vector machine
Rishabh Gupta
Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)
Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)
Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)
Universitat Polit竪cnica de Catalunya
Machine Learning workshop by GDSC Amity University Chhattisgarh
Machine Learning workshop by GDSC Amity University ChhattisgarhMachine Learning workshop by GDSC Amity University Chhattisgarh
Machine Learning workshop by GDSC Amity University Chhattisgarh
Poorabpatel
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Maninda Edirisooriya
Support Vector Machine.ppt
Support Vector Machine.pptSupport Vector Machine.ppt
Support Vector Machine.ppt
NBACriteria2SICET
support vector machine algorithm in machine learning
support vector machine algorithm in machine learningsupport vector machine algorithm in machine learning
support vector machine algorithm in machine learning
SamGuy7
svm.ppt
svm.pptsvm.ppt
svm.ppt
RanjithaM32
Support vector machine in data mining.pdf
Support vector machine in data mining.pdfSupport vector machine in data mining.pdf
Support vector machine in data mining.pdf
RubhithaA
Support Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the theSupport Vector Machines is the the the the the the the the the
Support Vector Machines is the the the the the the the the the
sanjaibalajeessn
Support Vector Machines Simply
Support Vector Machines SimplySupport Vector Machines Simply
Support Vector Machines Simply
Emad Nabil
super vector machines algorithms using deep
super vector machines algorithms using deepsuper vector machines algorithms using deep
super vector machines algorithms using deep
KNaveenKumarECE
ML-Lec-17-SVM,sshwqw - Non-Linear (1).pptx
ML-Lec-17-SVM,sshwqw - Non-Linear (1).pptxML-Lec-17-SVM,sshwqw - Non-Linear (1).pptx
ML-Lec-17-SVM,sshwqw - Non-Linear (1).pptx
shafanahmad06
4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development
PriyankaRamavath3
13Kernel_Machines.pptx
13Kernel_Machines.pptx13Kernel_Machines.pptx
13Kernel_Machines.pptx
KarasuLee
Support vector machine
Support vector machineSupport vector machine
Support vector machine
Prasenjit Dey
PERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNING
PERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNINGPERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNING
PERFORMANCE EVALUATION PARAMETERS FOR MACHINE LEARNING
abeeratariq20011
Notes relating to Machine Learning and SVM
Notes relating to Machine Learning and SVMNotes relating to Machine Learning and SVM
Notes relating to Machine Learning and SVM
SyedSaimGardezi
Support vector MAchine using machine learning
Support vector MAchine using machine learningSupport vector MAchine using machine learning
Support vector MAchine using machine learning
GauravRaj772344
svm_introductory_ppt by university of texas
svm_introductory_ppt by university of texassvm_introductory_ppt by university of texas
svm_introductory_ppt by university of texas
krutikavermafcs
deeplearninhg........ applicationsWEEK 05.pdf
deeplearninhg........ applicationsWEEK 05.pdfdeeplearninhg........ applicationsWEEK 05.pdf
deeplearninhg........ applicationsWEEK 05.pdf
krishnas665013
Support vector machine
Support vector machineSupport vector machine
Support vector machine
Rishabh Gupta
Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)
Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)
Optimization (DLAI D4L1 2017 UPC Deep Learning for Artificial Intelligence)
Universitat Polit竪cnica de Catalunya
Machine Learning workshop by GDSC Amity University Chhattisgarh
Machine Learning workshop by GDSC Amity University ChhattisgarhMachine Learning workshop by GDSC Amity University Chhattisgarh
Machine Learning workshop by GDSC Amity University Chhattisgarh
Poorabpatel
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Extra Lecture - Support Vector Machines (SVM), a lecture in subject module St...
Maninda Edirisooriya
Support Vector Machine.ppt
Support Vector Machine.pptSupport Vector Machine.ppt
Support Vector Machine.ppt
NBACriteria2SICET
support vector machine algorithm in machine learning
support vector machine algorithm in machine learningsupport vector machine algorithm in machine learning
support vector machine algorithm in machine learning
SamGuy7
Support vector machine in data mining.pdf
Support vector machine in data mining.pdfSupport vector machine in data mining.pdf
Support vector machine in data mining.pdf
RubhithaA

Recently uploaded (20)

Useful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷sUseful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷s
Celine George
Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
Association for Project Management
SOCIAL CHANGE(a change in the institutional and normative structure of societ...
SOCIAL CHANGE(a change in the institutional and normative structure of societ...SOCIAL CHANGE(a change in the institutional and normative structure of societ...
SOCIAL CHANGE(a change in the institutional and normative structure of societ...
DrNidhiAgarwal
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George
Essentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok SonawalaEssentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok Sonawala
Association for Project Management
A PPT on the First Three chapters of Wings of Fire
A PPT on the First Three chapters of Wings of FireA PPT on the First Three chapters of Wings of Fire
A PPT on the First Three chapters of Wings of Fire
Beena E S
Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...
Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...
Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...
sandynavergas1
The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .
saanidhyapatel09
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
Computer Application in Business (commerce)
Computer Application in Business (commerce)Computer Application in Business (commerce)
Computer Application in Business (commerce)
Sudar Sudar
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Finals - El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, TuluThe Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
DrIArulAram
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
Blind spots in AI and Formulation Science, IFPAC 2025.pdf
Blind spots in AI and Formulation Science, IFPAC 2025.pdfBlind spots in AI and Formulation Science, IFPAC 2025.pdf
Blind spots in AI and Formulation Science, IFPAC 2025.pdf
Ajaz Hussain
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptxCRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
PoojaSen20
Useful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷sUseful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷s
Celine George
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
Association for Project Management
SOCIAL CHANGE(a change in the institutional and normative structure of societ...
SOCIAL CHANGE(a change in the institutional and normative structure of societ...SOCIAL CHANGE(a change in the institutional and normative structure of societ...
SOCIAL CHANGE(a change in the institutional and normative structure of societ...
DrNidhiAgarwal
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George
A PPT on the First Three chapters of Wings of Fire
A PPT on the First Three chapters of Wings of FireA PPT on the First Three chapters of Wings of Fire
A PPT on the First Three chapters of Wings of Fire
Beena E S
Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...
Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...
Eng7-Q4-Lesson 1 Part 1 Understanding Discipline-Specific Words, Voice, and T...
sandynavergas1
The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .The Constitution, Government and Law making bodies .
The Constitution, Government and Law making bodies .
saanidhyapatel09
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
Computer Application in Business (commerce)
Computer Application in Business (commerce)Computer Application in Business (commerce)
Computer Application in Business (commerce)
Sudar Sudar
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, TuluThe Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
DrIArulAram
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
Blind spots in AI and Formulation Science, IFPAC 2025.pdf
Blind spots in AI and Formulation Science, IFPAC 2025.pdfBlind spots in AI and Formulation Science, IFPAC 2025.pdf
Blind spots in AI and Formulation Science, IFPAC 2025.pdf
Ajaz Hussain
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptxCRITICAL THINKING AND NURSING JUDGEMENT.pptx
CRITICAL THINKING AND NURSING JUDGEMENT.pptx
PoojaSen20

Machine learning interviews day2

  • 1. Machine Learning Interviews Day 2 Arpit Agarwal
  • 2. Decision Trees JPs very practical problem:- Whether to go to prakruthi for tea or not? Ask Rishabh if he wants to come? Yes No Does Rishabh has money for both of us? Dont go for tea Yes No Go for tea Dont go for tea
  • 3. Decision Trees A tree in which each internal node represents a test of an attribute and a leaf represents a label and a branch represents an attribute value. A node in a decision tree partitions the space. Can be used for classification and regression.
  • 5. Decision Tree Learning Choose the best attribute to split the remaining instances and make that attribute a decision node Each node will correspond to a subset of the training set Repeat this process recursively for each child Stop when: All the instances in a node have the same label There are no more attributes There are no more instances
  • 6. How to select the best attribute? Various heuristics such as Entropy Impurity (which is minimized when all the instances in a given node have same label) Entropy(S) = - p1 * log2(p1) - p0 * log2(p0) Gini Impurity Entropy(S) = p0 * p1
  • 7. Decision Tree Pruning In pruning we remove a bad decision node and merge its children. Two techniques: Subtree Replacement Subtree Raising
  • 8. Decision Trees Advantage- Easy to understand and interpret; can be applied to wide variety of problems Disadvantage- Difficult to learn, Overfittting problem, Error-propagation
  • 9. Support Vector Machine (SVM) Belong to the Marwari family of algorithms - Always thinks about maximizing its margins
  • 10. SVM Which classifier is better?
  • 11. SVM Which classifier is better?
  • 12. SVM denotes +1 denotes -1 f(x,w,b) = sign(w x + b) The maximum margin linear classifier is the linear classifier with the, um, maximum margin. This is the simplest kind of SVM (Called an LSVM) Linear SVM Support Vectors are those datapoints that the margin pushes up against 1. Maximizing the margin is good according to intuition and PAC theory 2. Implies that only support vectors are important; other training examples are ignorable. 3. Empirically it works very very well.
  • 13. Hard Margin SVM What we know: w . x+ + b = +1 w . x- + b = -1 w . (x+-x-) = 2 X-x+ M=Margin Width x x w w w M ( ) 2
  • 14. Goal: 1) Correctly classify all training data if yi = +1 if yi = -1 for all i wx b 1 i wx b 1 i y (wx b) 1 i i 2) Maximize the Margin same as minimize 2 w || || M 1 w w t 2 We can formulate a Quadratic Optimization Problem and solve for w and b
  • 15. Hard Margin SVM The lagrangian dual of the problem:- After solving this we get the optimal 留i and the solution is w = 裡留iyixi b= yk- wTxk for any xk such that 留k 0 The points for which 留i > 0 are called the support vectors.
  • 16. Soft Margin SVM Hard Margin: So far we require all data points be classified correctly - No training error What if the training set is noisy? - Solution 1: use very powerful kernels denotes +1 denotes -1 OVERFITTING!
  • 17. Soft Margin SVM Slack variables 両i can be added to allow misclassification of difficult or noisy examples. e11 e7 e2 What should our quadratic optimization criterion be? Minimize ワ R C 竜k k 1 1 || w || 2
  • 18. Soft Margin SVM Optimization problem Lagrange Dual After solving this, the solution as w = 裡留iyixi b= yk- wTxk for any xk such that 留k 0
  • 19. Kernel SVM General idea: the original input space can always be mapped to some higher-dimensional feature space where the training set is separable: 陸: x (x)
  • 20. Kernel SVM If every data point is mapped into high-dimensional space via some transformation 陸: x (x), the dot product becomes: K(xi,xj)= (xi) T(xj) A kernel function is some function that corresponds to an inner product in some expanded feature space.
  • 21. Learning with Kernel SVM Optimization problem: The solution is
  • 22. Types of Kernels Linear: K(xi,xj)= xi Txj Polynomial of power p: K(xi,xj)= (1+ xi Txj)p Gaussian (radial-basis function network): i j ( , ) exp( 2 Sigmoid: K(xi,xj)= tanh(硫0xi Txj + 硫1) ) 2 2 i j x x x x K
  • 23. SVM Takeaway- SVM maximizes margin Hard Margin Use when data is seperable Soft Margin Use when data is non-seperable
  • 24. - What is Overfitting? How to avoid it? - Cross-validation, regularization - What is regularization? Why do we need it? - What is Bias-Variance tradeoff?
  • 25. Overfitting Curve Fitting