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

pyspark 2.2.0 concept behind raw predictions field of logistic regression model

I was trying to understand the concept of the output generated from logistic regression model in Pyspark. Could anyone please explain the concept behind the rawPrediction field calculation generated from a logistic regression model? Thanks.
ahmed
  • 273
  • 2
  • 8
  • 16
1
vote
0 answers

Admitted data type in RFE to keep features in a logistic regression

I'm trying to build a logistic regression in python with a dataset that contains continuous features and some binary features. In order to choose the features that I will include in the model I am using RFE. So basically I have this…
1
vote
1 answer

Calculating odds ratio from glm output

It is my first time doing logistic regressions and I am currently trying to teach myself how to find the odds ratio. I got my coefficients from r as shown below. (Intercept) totalmins 0.2239254 1.2424020 To exponentiate the…
louiseo
  • 11
  • 1
  • 3
1
vote
0 answers

Is passing sklearn tfidf matrix to train MultinomialNB model proper?

I'm do some text classification tasks. What I have observed is that if fed tfidf matrix(from sklearn's TfidfVectorizer), Logistic Regression model is always outperforming MultinomialNB model. Below is my code for training both: X =…
1
vote
1 answer

predict.glm() on blind test data

I'm using regularized logistic regression for a classification problem using the glmnet package. In the development process, everything is working fine, but I have a problem when it comes to making predictions on blind test data. Because I don't…
ahanf
  • 59
  • 1
  • 7
1
vote
1 answer

Intuition for back propagation

Below is a forward pass and partly implemented backward pass of back propagation of a neural network : import numpy as np def sigmoid(z): return 1 / (1 + np.exp(-z)) X_train = np.asarray([[1,1], [0,0]]).T Y_train = np.asarray([[1],…
1
vote
1 answer

Speed of Logistic Regression on MNIST with Tensorflow

I am taking the CS 20SI: Tensorflow for Deep Learning Research from Stanford. I have question regarding the following code: import time import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # Step 1:…
1
vote
0 answers

python sklearn.linear_model LogisticRegression weird behaviour inside a loop

I've followed Andrew Ng's machine learning course and tried to reproduce some of the examples in python SciKit. I'm trying to understand the effect of regulation parameter C. The problem I'm constantly running into is easiest to visualise with the…
1
vote
1 answer

My understanding of : How does CV.GLMNET work to choose optimal lambda?

I wish to confirm my understanding of CV procedure in the glmnet package to explain it to a reviewer of my paper. I will be grateful if someone can add information to clarify the answer further. Specifically, I had a binary classification problem…
1
vote
1 answer

Plot the outcome of glm()

I am an R beginner (first semester - we us this programme for univariate statistics) and currently struggling with plotting the outcome of my glm(). I read quite a few threads and help files on the internet, but I have 2 problems: 1) I don't…
V_A
  • 11
  • 3
1
vote
1 answer

tensorflow logistic regression matrix

hello I'm new to tensorflow and I'm getting a feel for it. so i was given a task to multiply these 4 matrices. i was able to do that but now I'm being asked to Take the (16,4) outputs from the multiplication of the (16,8) and (8,4) and Apply a…
1
vote
1 answer

Confusion Matrix in Logistic Regression

In Logistic Regression for binary classification, while using predict(), how does the classifier decide for the class (1/0)? Is it based on the probability threshold, if >0.5 then 1 else 0? If so, can this threshold be manually changed? I know we…
neerdy30
  • 21
  • 5
1
vote
1 answer

How to get the correct answer for logisitc regression?

I'm not getting desired output on binary classification problem. The problem is using a binary classification to label breast cancer as: - benign, or - malignant It is not giving the desired output. First there is a function to load the…
user7481779
1
vote
1 answer

Difficulty running a logistic regression in R

I'm having some difficulty with running a logistic regression in R using glm. There are two ways to pass the binary response variable into glm to perform a logistic regression. You can pass the data to glm in a serial data format (e.g. one row per…
Brad Davis
  • 1,063
  • 3
  • 18
  • 38
1
vote
1 answer

Incorrect ROC score for Kaggle competition?

I was researching a Kaggle competition and used a Logistic Regression classifier to test the top 10 competitiors' approaches. Link to the competition: https://www.kaggle.com/c/detecting-insults-in-social-commentary/leaderboard I'm still fairly new…