SlideShare une entreprise Scribd logo
1  sur  8
Télécharger pour lire hors ligne
© 2013 ExcelR Solutions. All Rights Reserved
Advanced Regression
AGENDA	
Mul)nomial	
Regression	
Zero	Inflated	
Poisson	
Regression	
Nega)ve	
Binomial
© 2013 ExcelR Solutions. All Rights Reserved
Multinomial Regression
•  Logis'c	regression	(Binomial	distribu'on)	is	used	when	output	has	‘2’	categories	
•  Mul'nomial	regression	(classifica'on	model)	is	used	when	output	has	>	‘2’	categories	
•  Extension	to	logis'c	regression	
	
•  No	natural	ordering	of	categories	
•  Response	variable	has	>	‘2’	categories	&	hence	we	apply	mul'logit	
•  Understand	the	impact	of	cost	&	'me	on	the	various	modes	of	transport	
Mode	of	
transport	
Car	 Carpool	 Bus	 Rail	 All	modes	
Count	 218	 32	 81	 122	 453	
Probability	 0.48	 0.07	 0.18	 0.27	 1
© 2013 ExcelR Solutions. All Rights Reserved
Multinomial Regression
•  Whether	we	have	‘Y’	(response)	or	‘X’	(predictor),	which	is	categorical	with	‘s’	categories	
ü  Lowest	in	numerical	/	lexicographical	value	is	chosen	as	baseline	/	reference	
ü  Missing	level	in	output	is	baseline	level	
ü  We	can	choose	the	baseline	level	of	our	choice	based	on	‘relevel’	func'on	in	R	
ü  Model	formulates	the	rela'onship	between	transformed	(logit)	Y	&	numerical	X	linearly	
ü  Modeling	quan'ta've	variables	linearly	might	not	always	be	correct
© 2013 ExcelR Solutions. All Rights Reserved
Multinomial Regression - Output
Itera'on	History:		
•  Itera've	procedure	is	used	to	compute	maximum	likelihood	es'mates	
•  #	itera'ons	&	convergence	status	is	provided	
•  -2logL	=	2	*	nega've	log	likelihood	
•  -2logL	has	χ2	distribu'on,	which	is	used	for	hypothesis	tes'ng	of	goodness	of	fit	
#	parameters	=	27
© 2013 ExcelR Solutions. All Rights Reserved
Multinomial Regression - Output
Log(P(choice	=	carpool	|	x)	/	P(choice	=	car	|	x)	=	β20	+	β21	*	cost.car	+	β22	*	cost.carpool	+	…………….		
	
This	equa'on	compares	the	log	of	probabili'es	of	carpool	to	car			
•  ‘car’	has	been	chosen	as	baseline	
•  x	=	vector	represen'ng	the	values	of	all	inputs	
•  The	regression	coefficient	0.636	indicates	that	for	a	‘1’	unit	increases	the	‘cost.car’,	the	log	odds	of	‘carpool’	to	‘car’	
increases	by	0.636	
•  Intercept	value	does	not	mean	anything	in	this	context	
	
•  If	we	have	a	categorical	X	also,	say	Gender	(female	=	0,	male	=	1),	then	regression	coefficient	(say	0.22)	indicates	
that	rela've	to	females,	males	increase	the	log	odds	of	‘carpool’	to	‘car’	by	0.22
© 2013 ExcelR Solutions. All Rights Reserved
Probability
•  Let	p	=	p(x	|	A)	be	the	probability	of	any	event	(say	airi'on)	under	condi'on	A	(say	
gender	=	female)		
	
•  Then		p(x	|	A)	÷	(1	-	p(x	|	A)	is	called	the	odds	associated	with	the	event	
Odds
•  If	there	are	two	condi'ons	A	(gender	=	female)	&	B	(gender	=	male)	then	the	ra'o	
						p(x	|	A)	÷	(1	-	p(x	|	A)	/	p(x	|	B)	÷	(1	-	p(x	|	B)		is	called	as	odds	ra'o	of	A	with	respect	to	B	
Odds Ratio
•  p(x	|	A)	÷	p(x	|	B)	is	called	as	rela've	risk	
Relative Risk
hips://en.wikipedia.org/wiki/Rela've_risk
© 2013 ExcelR Solutions. All Rights Reserved
•  Odds	ra'o	is	computed	from	the	coefficients	in	the	linear	model	equa'on	by	simply	
exponen'a'ng	
•  Exponen'ated	regression	coefficients	are	odds	ra'o	for	a	unit	change	in	a	predictor	
variable	
•  The	odds	ra'o	for	a	unit	increase	in	cost.car	is	1.88	for	choosing	carpool	vs	car	
Odds Ratio
© 2013 ExcelR Solutions. All Rights Reserved
Goodness of fit
Linear	 GLM	
Analysis	of	Variance	 Analysis	of	Deviance	
Residual	Deviance	 Residual	Sum	of	Squares	
OLS	 Maximum	Likelihood	
•  Residual	Deviance	is	-2	log	L	
•  Adding	more	parameters	to	the	model	will	reduce	Residual	Deviance	even	if	it	is	not	
going	to	be	useful	for	predic'on	
•  In	order	to	control	this,	penalty	of	“2	*	number	of	parameters”	is	added	to	to	
Residual	deviance	
•  This	penalized	value	of	-2	log	L	is	called	as	AIC	criterion	
•  AIC	=	-2	log	L	+	2	*	number	of	parameters	
Note:	“Mul'logit	Model	with	Interac(on”

Contenu connexe

Plus de prathyusha1234

Business analytics course in mumbai
Business analytics course in mumbaiBusiness analytics course in mumbai
Business analytics course in mumbaiprathyusha1234
 
Business analytics course in chennai
Business analytics course in chennaiBusiness analytics course in chennai
Business analytics course in chennaiprathyusha1234
 
Business analytics course in delhi
Business analytics course in delhiBusiness analytics course in delhi
Business analytics course in delhiprathyusha1234
 
Business analytics training in hyderabad
Business analytics training in hyderabadBusiness analytics training in hyderabad
Business analytics training in hyderabadprathyusha1234
 
Pmi acp training in hyderabad
Pmi acp training in hyderabadPmi acp training in hyderabad
Pmi acp training in hyderabadprathyusha1234
 
Business analytics course in chennai
Business analytics course in chennaiBusiness analytics course in chennai
Business analytics course in chennaiprathyusha1234
 
Business analytics course in delhi
Business analytics course in delhiBusiness analytics course in delhi
Business analytics course in delhiprathyusha1234
 

Plus de prathyusha1234 (20)

Data science training
Data science trainingData science training
Data science training
 
Business analytics course in mumbai
Business analytics course in mumbaiBusiness analytics course in mumbai
Business analytics course in mumbai
 
Business analytics course in chennai
Business analytics course in chennaiBusiness analytics course in chennai
Business analytics course in chennai
 
Business analytics course in delhi
Business analytics course in delhiBusiness analytics course in delhi
Business analytics course in delhi
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Business analytics training in hyderabad
Business analytics training in hyderabadBusiness analytics training in hyderabad
Business analytics training in hyderabad
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Pmi acp training in hyderabad
Pmi acp training in hyderabadPmi acp training in hyderabad
Pmi acp training in hyderabad
 
Business analytics course in chennai
Business analytics course in chennaiBusiness analytics course in chennai
Business analytics course in chennai
 
Pmi acp training
Pmi acp trainingPmi acp training
Pmi acp training
 
Business analytics course in delhi
Business analytics course in delhiBusiness analytics course in delhi
Business analytics course in delhi
 

Dernier

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
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
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
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
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 

Dernier (20)

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
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
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
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)
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
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
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 

Data scientist course in mumbai

  • 1. © 2013 ExcelR Solutions. All Rights Reserved Advanced Regression AGENDA Mul)nomial Regression Zero Inflated Poisson Regression Nega)ve Binomial
  • 2. © 2013 ExcelR Solutions. All Rights Reserved Multinomial Regression •  Logis'c regression (Binomial distribu'on) is used when output has ‘2’ categories •  Mul'nomial regression (classifica'on model) is used when output has > ‘2’ categories •  Extension to logis'c regression •  No natural ordering of categories •  Response variable has > ‘2’ categories & hence we apply mul'logit •  Understand the impact of cost & 'me on the various modes of transport Mode of transport Car Carpool Bus Rail All modes Count 218 32 81 122 453 Probability 0.48 0.07 0.18 0.27 1
  • 3. © 2013 ExcelR Solutions. All Rights Reserved Multinomial Regression •  Whether we have ‘Y’ (response) or ‘X’ (predictor), which is categorical with ‘s’ categories ü  Lowest in numerical / lexicographical value is chosen as baseline / reference ü  Missing level in output is baseline level ü  We can choose the baseline level of our choice based on ‘relevel’ func'on in R ü  Model formulates the rela'onship between transformed (logit) Y & numerical X linearly ü  Modeling quan'ta've variables linearly might not always be correct
  • 4. © 2013 ExcelR Solutions. All Rights Reserved Multinomial Regression - Output Itera'on History: •  Itera've procedure is used to compute maximum likelihood es'mates •  # itera'ons & convergence status is provided •  -2logL = 2 * nega've log likelihood •  -2logL has χ2 distribu'on, which is used for hypothesis tes'ng of goodness of fit # parameters = 27
  • 5. © 2013 ExcelR Solutions. All Rights Reserved Multinomial Regression - Output Log(P(choice = carpool | x) / P(choice = car | x) = β20 + β21 * cost.car + β22 * cost.carpool + ……………. This equa'on compares the log of probabili'es of carpool to car •  ‘car’ has been chosen as baseline •  x = vector represen'ng the values of all inputs •  The regression coefficient 0.636 indicates that for a ‘1’ unit increases the ‘cost.car’, the log odds of ‘carpool’ to ‘car’ increases by 0.636 •  Intercept value does not mean anything in this context •  If we have a categorical X also, say Gender (female = 0, male = 1), then regression coefficient (say 0.22) indicates that rela've to females, males increase the log odds of ‘carpool’ to ‘car’ by 0.22
  • 6. © 2013 ExcelR Solutions. All Rights Reserved Probability •  Let p = p(x | A) be the probability of any event (say airi'on) under condi'on A (say gender = female) •  Then p(x | A) ÷ (1 - p(x | A) is called the odds associated with the event Odds •  If there are two condi'ons A (gender = female) & B (gender = male) then the ra'o p(x | A) ÷ (1 - p(x | A) / p(x | B) ÷ (1 - p(x | B) is called as odds ra'o of A with respect to B Odds Ratio •  p(x | A) ÷ p(x | B) is called as rela've risk Relative Risk hips://en.wikipedia.org/wiki/Rela've_risk
  • 7. © 2013 ExcelR Solutions. All Rights Reserved •  Odds ra'o is computed from the coefficients in the linear model equa'on by simply exponen'a'ng •  Exponen'ated regression coefficients are odds ra'o for a unit change in a predictor variable •  The odds ra'o for a unit increase in cost.car is 1.88 for choosing carpool vs car Odds Ratio
  • 8. © 2013 ExcelR Solutions. All Rights Reserved Goodness of fit Linear GLM Analysis of Variance Analysis of Deviance Residual Deviance Residual Sum of Squares OLS Maximum Likelihood •  Residual Deviance is -2 log L •  Adding more parameters to the model will reduce Residual Deviance even if it is not going to be useful for predic'on •  In order to control this, penalty of “2 * number of parameters” is added to to Residual deviance •  This penalized value of -2 log L is called as AIC criterion •  AIC = -2 log L + 2 * number of parameters Note: “Mul'logit Model with Interac(on”