SlideShare a Scribd company logo
2
Most read
4
Most read
11
Most read
Logistic Ordinal Regression
Wendy C Wong

Michal K and Nidhi M
Table of Content
• Ordinal Regression

• Building Linear Models Ordinal Regression

• Linear Models used;

• model parameters updates;

• model predictions

• H2O implementations

• Example and results
What is Ordinal Regression?
• Ordinal regression/classification or ranking learning is a
regression analysis used to predict an ordinal variable (a
variable where the relative ordering between different
values is significant);

• Ordinal regression are used most often in social sciences
to model human levels of preference/satisfaction (levels
1-5 for very poor, poor, average, good, excellent)
Linear Models used for Ordinal Regression
• Let be our predictor of size p and be the associated
ordinal response. Note: takes value from 1 to K.

• A GLM is used to fit ONE coefficient vector for all classes of
the ordinal variable response and a set of thresholds to a data
set.

• model the CUMULATIVE PROBABILITY as the logistic function 

• Note that the separating hyperplanes are parallel for all
classes. The non-decreasing vector is
used to separate all the classes.

• Ordered Probit-standard normal distribution and Proportional
Hazards:
xi
1 + exp(−exp(βT
xi + θj))
yj
θ1 < θ2 < . . . < θK−1
P(y < = j|xi) = σ(βT
xi + θj) = 1/(1 + exp(−βT
xi − θj)) = γij
yi
Logistic Ordinal Regression
Model Parameters Updates
• The likelihood function:

• The log-likelihood function is 

• The pdfs are:

• for j = 1

• for j = K 

• To find the model parameters, maximize the log-likelihood
function minus your favorite regularization penalties. Take
the derivatives and update each model parameter with a
learning rate*the derivative for that model parameter…..
N−1
∏
i=0
pdf(yi = yrespi)
N−1
∑
n=0
log(σ(βT
xi + θyj
) − σ(βT
xi + θyj−1))
pdf(yi = 1) = σ(βT
xi + θ1)
pdf(yi = K) = 1 − pdf(yi = K − 1)
Model Predictions
• The log proportional odds is:

• When the proportional odds > 1 (log(.) > 0), it implies that
it is more probable that the data point belongs to class
j or lower than belonging to classes j+1 and beyond.

• This implies that a data point is classified as:

• class K:

• class j (>=1 and <= K-1): and
log(
γij
1 − γij
) =
1
1 + exp(−βT xi − θj)
1 − 1
1 + exp(−βT xi − θj))
= βT
xi + θj
xi
xi
βT
xi + θK−1 > 0
βT
xi + θj > 0 βT
xi + θj+1 < = 0
Alternate Model Parameters Optimization
• I decided to modify the model parameters to directly
increase the probability of correct predictions. 

• Hence, I will optimize the error function
where

• for correct prediction 

• for incorrect predictionL(β, θ, xi, yrespi) = (βT
xi + θj)2
N−1
∑
i=0
L(β, θ, xi, yrespi)
L(β, θ, xi, yrespi) = 0
βT
xi + θj < = 0
j < yrespiβT
xi + θj > 0
j > = yrespi
βT
xi + θj > 0
j < yrespi
βT
xi + θj < = 0
j > = yrespi
H2O Implementation
• To use ordinal regression, set family=“ordinal”;

• To change model parameters using the likelihood function, do not set solver or
set solver to “GRADIENT_DESCENT_LH”

• To change model parameters using the other loss function, set solver to
“GRADIENT_DESCENT_SQERR”

• Gradient descent: first-order method, use gridsearch to find good learning rate,
regularization values (beta, alpha)….

• In R: ordinal.fit <- h2o.glm(y=Y, x=X, training_frame=
Dtrain, family="ordinal",
solver="GRADIENT_DESCENT_SQERR")
• In Python:
ordinal_fit = H2OGeneralizedLinearEstimator(family="ordinal",
solver=“GRADIENT_DESCENT_LH”)

ordinal_fit.train(y=Y, x=X, training_frame=Dtrain)
Summary/Results
Table 1
Dataset LH
performance
SQERR
performance
R ordinal
5 columns with enum 0.9959 0.99751
5 numerical columns 0.99968 0.999445
10 columns with enum 0.999405 0.99919
10 numerical columns 0.99507 0.99305
15 columns with enum 0.996385 0.99802
15 numerical columns 0.99938 0.99912
20 columns with enums 0.998 0.999155
20 numerical columns 0.995895 0.99735
50 numerical columns 0.9893 0.9953
Multinomial dataset 0.47372 0.45527
nidhi dataset 0.5675 0.58 0.5775
Reference
• Peter McCullagh, Regression Models for Ordinal Data, J.
R. Statist, Soc. B(1980), 42, No 2, pp.109-142

• Wikipedia, Ordinal Regression

• Alan Agresti, “Analysis of Ordinal Categorical data”, John
Wiley & Sons, Inc. July, 2012

More Related Content

PDF
Ordinal Logistic Regression
PDF
Ordinal logistic regression
PPTX
Statistical inference concept, procedure of hypothesis testing
PDF
Application of ordinal logistic regression in the study of students’ performance
PDF
Multilevel Binary Logistic Regression
PPTX
Goodness of fit (ppt)
PPTX
A.6 confidence intervals
PPT
Testing Hypothesis
Ordinal Logistic Regression
Ordinal logistic regression
Statistical inference concept, procedure of hypothesis testing
Application of ordinal logistic regression in the study of students’ performance
Multilevel Binary Logistic Regression
Goodness of fit (ppt)
A.6 confidence intervals
Testing Hypothesis

What's hot (20)

PDF
Linear regression theory
PPT
Confidence intervals
PPTX
PPTX
Regression analysis
PPT
Inferential Statistics
PPTX
Regression analysis
PPTX
Basic Statistics & Data Analysis
PPTX
Lecture 6. univariate and bivariate analysis
PPTX
Logistic regression
PDF
Inferential Statistics
PDF
Logistic regression
PPTX
Confidence interval & probability statements
PPTX
One Way ANOVA and Two Way ANOVA using R
ODP
Multiple linear regression
PPTX
How to calculate power in statistics
PPTX
Data Analysis and Statistics
PPTX
Descriptive statistics
PPTX
Poisson regression models for count data
PPTX
Binomial distribution
PDF
multiple linear regression in spss (procedure and output)
Linear regression theory
Confidence intervals
Regression analysis
Inferential Statistics
Regression analysis
Basic Statistics & Data Analysis
Lecture 6. univariate and bivariate analysis
Logistic regression
Inferential Statistics
Logistic regression
Confidence interval & probability statements
One Way ANOVA and Two Way ANOVA using R
Multiple linear regression
How to calculate power in statistics
Data Analysis and Statistics
Descriptive statistics
Poisson regression models for count data
Binomial distribution
multiple linear regression in spss (procedure and output)
Ad

Similar to Logistic Ordinal Regression (20)

PDF
Logistic Ordinal Regression
PDF
L1 intro2 supervised_learning
PDF
Lecture 5 - Linear Regression Linear Regression
PDF
11_Học máy cơ bản_Hồi quy tuyến tính.pdf
PPTX
ngboost.pptx
PPTX
2a-linear-regression-18Maykjkij;oik;.pptx
PPTX
ngboost.pptx
PDF
General Tips for participating Kaggle Competitions
PDF
Gradient Boosted Regression Trees in scikit-learn
PPTX
Supervised learning for IOT IN Vellore Institute of Technology
PDF
3.1. Linear Regression and Gradient Desent.pdf
PDF
variBAD, A Very Good Method for Bayes-Adaptive Deep RL via Meta-Learning.pdf
PDF
مدخل إلى تعلم الآلة
PPTX
variBAD, A Very Good Method for Bayes-Adaptive Deep RL via Meta-Learning.pptx
PDF
Lecture 5 - Gradient Descent, a lecture in subject module Statistical & Machi...
PPTX
Scientific Computing and linear programming
PDF
eviewsOLSMLE
PPTX
Linear Regression.pptx
PDF
Calculus Review Session Brian Prest Duke University Nicholas School of the En...
PPTX
Demystifying deep reinforement learning
Logistic Ordinal Regression
L1 intro2 supervised_learning
Lecture 5 - Linear Regression Linear Regression
11_Học máy cơ bản_Hồi quy tuyến tính.pdf
ngboost.pptx
2a-linear-regression-18Maykjkij;oik;.pptx
ngboost.pptx
General Tips for participating Kaggle Competitions
Gradient Boosted Regression Trees in scikit-learn
Supervised learning for IOT IN Vellore Institute of Technology
3.1. Linear Regression and Gradient Desent.pdf
variBAD, A Very Good Method for Bayes-Adaptive Deep RL via Meta-Learning.pdf
مدخل إلى تعلم الآلة
variBAD, A Very Good Method for Bayes-Adaptive Deep RL via Meta-Learning.pptx
Lecture 5 - Gradient Descent, a lecture in subject module Statistical & Machi...
Scientific Computing and linear programming
eviewsOLSMLE
Linear Regression.pptx
Calculus Review Session Brian Prest Duke University Nicholas School of the En...
Demystifying deep reinforement learning
Ad

More from Sri Ambati (20)

PDF
H2O Label Genie Starter Track - Support Presentation
PDF
H2O.ai Agents : From Theory to Practice - Support Presentation
PDF
H2O Generative AI Starter Track - Support Presentation Slides.pdf
PDF
H2O Gen AI Ecosystem Overview - Level 1 - Slide Deck
PDF
An In-depth Exploration of Enterprise h2oGPTe Slide Deck
PDF
Intro to Enterprise h2oGPTe Presentation Slides
PDF
Enterprise h2o GPTe Learning Path Slide Deck
PDF
H2O Wave Course Starter - Presentation Slides
PDF
Large Language Models (LLMs) - Level 3 Slides
PDF
Data Science and Machine Learning Platforms (2024) Slides
PDF
Data Prep for H2O Driverless AI - Slides
PDF
H2O Cloud AI Developer Services - Slides (2024)
PDF
LLM Learning Path Level 2 - Presentation Slides
PDF
LLM Learning Path Level 1 - Presentation Slides
PDF
Hydrogen Torch - Starter Course - Presentation Slides
PDF
Presentation Resources - H2O Gen AI Ecosystem Overview - Level 2
PDF
H2O Driverless AI Starter Course - Slides and Assignments
PPTX
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
PDF
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
PPTX
Generative AI Masterclass - Model Risk Management.pptx
H2O Label Genie Starter Track - Support Presentation
H2O.ai Agents : From Theory to Practice - Support Presentation
H2O Generative AI Starter Track - Support Presentation Slides.pdf
H2O Gen AI Ecosystem Overview - Level 1 - Slide Deck
An In-depth Exploration of Enterprise h2oGPTe Slide Deck
Intro to Enterprise h2oGPTe Presentation Slides
Enterprise h2o GPTe Learning Path Slide Deck
H2O Wave Course Starter - Presentation Slides
Large Language Models (LLMs) - Level 3 Slides
Data Science and Machine Learning Platforms (2024) Slides
Data Prep for H2O Driverless AI - Slides
H2O Cloud AI Developer Services - Slides (2024)
LLM Learning Path Level 2 - Presentation Slides
LLM Learning Path Level 1 - Presentation Slides
Hydrogen Torch - Starter Course - Presentation Slides
Presentation Resources - H2O Gen AI Ecosystem Overview - Level 2
H2O Driverless AI Starter Course - Slides and Assignments
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
Generative AI Masterclass - Model Risk Management.pptx

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
KodekX | Application Modernization Development
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
MIND Revenue Release Quarter 2 2025 Press Release
KodekX | Application Modernization Development
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Mobile App Security Testing_ A Comprehensive Guide.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm

Logistic Ordinal Regression

  • 1. Logistic Ordinal Regression Wendy C Wong Michal K and Nidhi M
  • 2. Table of Content • Ordinal Regression • Building Linear Models Ordinal Regression • Linear Models used; • model parameters updates; • model predictions • H2O implementations • Example and results
  • 3. What is Ordinal Regression? • Ordinal regression/classification or ranking learning is a regression analysis used to predict an ordinal variable (a variable where the relative ordering between different values is significant); • Ordinal regression are used most often in social sciences to model human levels of preference/satisfaction (levels 1-5 for very poor, poor, average, good, excellent)
  • 4. Linear Models used for Ordinal Regression • Let be our predictor of size p and be the associated ordinal response. Note: takes value from 1 to K. • A GLM is used to fit ONE coefficient vector for all classes of the ordinal variable response and a set of thresholds to a data set. • model the CUMULATIVE PROBABILITY as the logistic function • Note that the separating hyperplanes are parallel for all classes. The non-decreasing vector is used to separate all the classes. • Ordered Probit-standard normal distribution and Proportional Hazards: xi 1 + exp(−exp(βT xi + θj)) yj θ1 < θ2 < . . . < θK−1 P(y < = j|xi) = σ(βT xi + θj) = 1/(1 + exp(−βT xi − θj)) = γij yi
  • 6. Model Parameters Updates • The likelihood function: • The log-likelihood function is • The pdfs are: • for j = 1 • for j = K • To find the model parameters, maximize the log-likelihood function minus your favorite regularization penalties. Take the derivatives and update each model parameter with a learning rate*the derivative for that model parameter….. N−1 ∏ i=0 pdf(yi = yrespi) N−1 ∑ n=0 log(σ(βT xi + θyj ) − σ(βT xi + θyj−1)) pdf(yi = 1) = σ(βT xi + θ1) pdf(yi = K) = 1 − pdf(yi = K − 1)
  • 7. Model Predictions • The log proportional odds is: • When the proportional odds > 1 (log(.) > 0), it implies that it is more probable that the data point belongs to class j or lower than belonging to classes j+1 and beyond. • This implies that a data point is classified as: • class K: • class j (>=1 and <= K-1): and log( γij 1 − γij ) = 1 1 + exp(−βT xi − θj) 1 − 1 1 + exp(−βT xi − θj)) = βT xi + θj xi xi βT xi + θK−1 > 0 βT xi + θj > 0 βT xi + θj+1 < = 0
  • 8. Alternate Model Parameters Optimization • I decided to modify the model parameters to directly increase the probability of correct predictions. • Hence, I will optimize the error function where • for correct prediction • for incorrect predictionL(β, θ, xi, yrespi) = (βT xi + θj)2 N−1 ∑ i=0 L(β, θ, xi, yrespi) L(β, θ, xi, yrespi) = 0 βT xi + θj < = 0 j < yrespiβT xi + θj > 0 j > = yrespi βT xi + θj > 0 j < yrespi βT xi + θj < = 0 j > = yrespi
  • 9. H2O Implementation • To use ordinal regression, set family=“ordinal”; • To change model parameters using the likelihood function, do not set solver or set solver to “GRADIENT_DESCENT_LH” • To change model parameters using the other loss function, set solver to “GRADIENT_DESCENT_SQERR” • Gradient descent: first-order method, use gridsearch to find good learning rate, regularization values (beta, alpha)…. • In R: ordinal.fit <- h2o.glm(y=Y, x=X, training_frame= Dtrain, family="ordinal", solver="GRADIENT_DESCENT_SQERR") • In Python: ordinal_fit = H2OGeneralizedLinearEstimator(family="ordinal", solver=“GRADIENT_DESCENT_LH”) ordinal_fit.train(y=Y, x=X, training_frame=Dtrain)
  • 10. Summary/Results Table 1 Dataset LH performance SQERR performance R ordinal 5 columns with enum 0.9959 0.99751 5 numerical columns 0.99968 0.999445 10 columns with enum 0.999405 0.99919 10 numerical columns 0.99507 0.99305 15 columns with enum 0.996385 0.99802 15 numerical columns 0.99938 0.99912 20 columns with enums 0.998 0.999155 20 numerical columns 0.995895 0.99735 50 numerical columns 0.9893 0.9953 Multinomial dataset 0.47372 0.45527 nidhi dataset 0.5675 0.58 0.5775
  • 11. Reference • Peter McCullagh, Regression Models for Ordinal Data, J. R. Statist, Soc. B(1980), 42, No 2, pp.109-142 • Wikipedia, Ordinal Regression • Alan Agresti, “Analysis of Ordinal Categorical data”, John Wiley & Sons, Inc. July, 2012