Questions tagged [logistic-regression]

Logistic regression is a statistical classification model used for making categorical predictions.

Logistic regression is a statistical analysis method used for predicting and understanding categorical dependent variables (e.g., true/false, or multinomial outcomes) based on one or more independent variables (e.g., predictors, features, or attributes). The probabilities describing the possible outcomes of a single trial are modeled as a function of the predictors using a logistic function (as it follows):

enter image description here

A logistic regression model can be represented by:

enter image description here

The logistic regression model has the nice property that the exponentiated regression coefficients can be interpreted as odds ratios associated with a one unit increase in the predictor.

Multinomial logistic regression (i.e., with three or more possible outcomes) are also sometimes called Maximum Entropy (MaxEnt) classifiers in the machine learning literature.


Tag usage

Questions on should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

3746 questions
1
vote
0 answers

Speed up logistic regression in Python

What are the practical ways to speed up the following Logistic Regression Analysis on Python. Here are my current setup Hardware i5-3350P Quad Core 16GB DDR3 256GB Samsung 840EVO SSD Quadro FX3000 GPU Software Win7x64 Anaconda 5.0.0 with…
Scoodood
  • 583
  • 1
  • 5
  • 13
1
vote
1 answer

Logistic Regression to support multiple classes directly

My Understanding is Softmax Regression is generalization of Logistic Regression to support multiple classes . Softmax Regression model first computes a score for each class then estimates the probability of each class by applying the softmax…
faisal_kk
  • 1,039
  • 1
  • 11
  • 19
1
vote
1 answer

Python Numpy Logistic Regression

I'm trying to implement vectorized logistic regression in python using numpy. My Cost function (CF) seems to work OK. However there is a problem with gradient calculation. It returns 3x100 array whereas it should return 3x1. I think there is a…
1
vote
1 answer

MLE Log-likelihood for logistic regression gives divide by zero error

I want to compute the log-likelihood of a logistic regression model. def sigma(x): return 1 / (1 + np.exp(-x)) def logll(y, X, w): """" Parameters y : ndarray of shape (N,) Binary labels (either 0 or 1). X : ndarray of…
1
vote
3 answers

how to plot logistic regression on the log odd scale using ggplot2

I am trying to plot the result of a logistic regression in the log odd scale. load(url("https://github.com/bossaround/question/raw/master/logisticregressdata.RData")) ggplot(D, aes(Year, as.numeric(Vote), color = as.factor(Male))) + stat_smooth(…
Chuck C
  • 153
  • 2
  • 12
1
vote
2 answers

How to determine if the predicted probabilities from sklearn logistic regresssion are accurate?

I am totally new to machine learning and I'm trying to use scikit-learn to make a simple logistic regression model with 1 input variable (X) and a binary outcome (Y). My data consists of 325 samples, with 39 successes and 286 failures. The data was…
none
  • 263
  • 6
  • 13
1
vote
2 answers

How do I run test data through my Python Machine Learning Model?

So I have finally completed my first machine learning model in Python. Initially I take a data set and split it like such: # Split-out validation dataset array = dataset.values X = array[:,2:242] Y = array[:,1] validation_size = 0.20 seed =…
user3486773
  • 1,174
  • 3
  • 25
  • 50
1
vote
1 answer

Predict certain label with highest possible probability in logistic regression

I am building the model, having 12 parameters and {0,1} labels using logistic regression in sklearn. I need to be very confident about label 0, I am ok if some '0' will be missclassified to 1. The purpose of this, that I would like to exclude the…
1
vote
1 answer

logistic regression doesn't find optimal decision boundary

I run Logistic Regression on a very small and simple dataset that is well separable. But I realized that the model cannot find the optimal decision boundary. Where is my mistake? import pandas as pd import seaborn as sns import matplotlib.pyplot as…
1
vote
0 answers

User Modeling and Anomaly Detection [R]

I have historical data of a online shopping website which is like; userID date timeonSite IsAnomaly? 123 01/01/2012 12:38 14 1 548 01/01/2012 19:56 12 0 Its millions of rows and growing…
1
vote
1 answer

understanding of result of logistic regression

let us suppose we have following data with binary response output(coupon) annual spending is given in 1000th unit, my goal is to estimate whether if customer spend more then 2000 and has Simmons card, will also have coupon, first of all i…
user466534
1
vote
1 answer

What's the cost function in multi-class classification?

I am in trouble to know what is the loss function of a neural network. For a binary classification problem, is it mean squared error, as described in the following video: https://www.youtube.com/watch?v=5u0jaA3qAGk&t=59s or is it cross entropy as…
MysteryGuy
  • 1,091
  • 2
  • 18
  • 43
1
vote
0 answers

Why do I get two random slope terms when forcing no correlation between random slope and intercept in lme4?

I am running a mixed effects logistic regression using lme4 in R. I have one predictor that is a dichotomous categorical variable. It is coded 1/0 and is defined as a factor. I find that the random item intercept is perfectly correlated with the…
Dave
  • 111
  • 2
  • 11
1
vote
0 answers

Using scipy.optimize to perform logistic regression for OCR

I am trying to teach myself different machine learning techniques so i figured I would start working on optical character recognition. I got this to work in octave but I want to leverage python because I figure it will be faster. When I run my code…
varlotbarnacle
  • 821
  • 1
  • 6
  • 7
1
vote
0 answers

Naive Bayes v/s Logistic Regression? Which is more constrained by 'Conditional Independence' assumption?

To my understanding, Logistic Regression is an extension of Naive Bayes. Suppose, X = (X_1, X_2........X_N); Y = {0, 1}, each X_i is i.i.d and the P(X_i|Y=y_k) is a Gaussian Distribution. So in order to create Linear Decision Surface, we take the…
1 2 3
99
100