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
11
votes
1 answer

How to interpret Weka Logistic Regression output?

Please help interpret results of logistic regression produced by weka.classifiers.functions.Logistic from Weka library. I use numeric data from Weka examples: @relation weather @attribute outlook {sunny, overcast, rainy} @attribute temperature…
Anton Ashanin
  • 1,817
  • 5
  • 30
  • 43
10
votes
1 answer

What is the Search/Prediction Time Complexity of Logistic Regression?

I am looking into the time complexities of Machine Learning Algorithms and I cannot find what is the time complexity of Logistic Regression for predicting a new input. I have read that for Classification is O(c*d) c-beeing the number of classes,…
10
votes
1 answer

Kernel in a logistic regression model LogisticRegression scikit-learn sklearn

How can I use a kernel in a logistic regression model using the sklearn library? logreg = LogisticRegression() logreg.fit(X_train, y_train) y_pred =…
Rubiks
  • 461
  • 1
  • 6
  • 21
10
votes
0 answers

Statsmodels Anova for logistic regression

I found the statsmodels implementation of the anova testing for linear models to be very useful (http://www.statsmodels.org/dev/generated/statsmodels.stats.anova.anova_lm.html#statsmodels.stats.anova.anova_lm) but I was wondering, since it's not…
Asher11
  • 1,295
  • 2
  • 15
  • 31
10
votes
2 answers

Logistic Regression: How to find top three feature that have highest weights?

I am working on UCI breast cancer dataset and trying to find the top 3 features that have highest weights. I was able to find the weight of all features using logmodel.coef_ but how can I get the feature names? Below is my code, output and dataset…
10
votes
1 answer

Logistic regression when response is a proportion (using JAGS)

I am trying to fit a logistic regression model in JAGS, but I have data in the form of (# success y, # attempts n), rather than a binary variable. In R, one can fit a model to data such as these by using glm(y/n ~ ) with the "weights" argument, but…
Kirk Fogg
  • 521
  • 5
  • 14
10
votes
6 answers

Deciding threshold for glm logistic regression model in R

I have some data with predictors and a binary target. Eg: df <- data.frame(a=sort(sample(1:100,30)), b= sort(sample(1:100,30)), target=c(rep(0,11),rep(1,4),rep(0,4),rep(1,11))) I trained a logistic regresion model using…
user2175594
  • 799
  • 3
  • 9
  • 17
10
votes
3 answers

maximum entropy model and logistic regression

I am doing a project that has some Natural Language Processing to do. I am using stanford MaxEnt Classifier for the purpose.But I am not sure, whether Maximum entropy model and logistic regression are one at the same or is it some special kind of…
Amrith Krishna
  • 2,768
  • 3
  • 31
  • 65
10
votes
2 answers

R How to get confidence interval for multinominal logit?

Let me use UCLA example on multinominal logit as a running example--- library(nnet) library(foreign) ml <- read.dta("http://www.ats.ucla.edu/stat/data/hsbdemo.dta") ml$prog2 <- relevel(ml$prog, ref = "academic") test <- multinom(prog2 ~ ses +…
user2966726
  • 101
  • 1
  • 1
  • 3
10
votes
3 answers

GridSearchCV on LogisticRegression in scikit-learn

I am trying to optimize a logistic regression function in scikit-learn by using a cross-validated grid parameter search, but I can't seem to implement it. It says that Logistic Regression does not implement a get_params() but on the documentation…
9
votes
1 answer

What do maskers really do in SHAP package and fit them to train or test?

I have been trying to work with the shap package. I want to determine the shap values from my logistic regression model. Contrary to the TreeExplainer, the LinearExplainer requires a so-called masker. What exactly does this masker do and what is the…
JonnDough
  • 827
  • 6
  • 25
9
votes
1 answer

Save spark model summary

I am running a logistic regression in PySpark using spark version: 2.1.2 I know it is possible to save a regression model as follows: model = LogisticRegression(featuresCol='features', labelCol='is_clickout', …
hamiq
  • 465
  • 1
  • 3
  • 10
9
votes
2 answers

Interpreting logistic regression feature coefficient values in sklearn

I have fit a logistic regression model to my data. Imagine, I have four features: 1) which condition the participant received, 2) whether the participant had any prior knowledge/background about the phenomenon tested (binary response in…
9
votes
3 answers

Obtaining summary from logistic regression(Python)

model = LogisticRegression(random_state=0) model.fit(X2, Y2) Y2_prob=model.predict_proba(X2)[:,1] I've built a logistic regression model on my training dataset X2 and Y2. Now is it possible for me to obtain the coefficients and p values from…
IndigoChild
  • 842
  • 3
  • 11
  • 29
9
votes
1 answer

Python scikit-learn to JSON

I have a model built with Python scikit-learn. I understand that the models can be saved in Pickle or Joblib formats. Are there any existing methods out there to save the jobs in JSON format? Please see the model build code below for…
user1124702
  • 1,015
  • 4
  • 12
  • 22