Questions tagged [logistic-regression]

Refers generally to statistical procedures that utilize the logistic function, most commonly various forms of logistic regression

Filter by
Sorted by
Tagged with
-3
votes
0answers
21 views
2
votes
1answer
33 views

Error while plotting Logistic Regression Classification

I was trying to plot by using the following code ...
2
votes
0answers
19 views

Logistic Regression Maximum Likelihood

Is it true that we assume our P(y|x;theta) to follow Bernoulli's distribution given y has binary output in Logistic Regression? Is there any specific reason why we consider Bernoulli's distribution? ...
3
votes
0answers
23 views

Some of the p-values are NaN - logistic regression

I am trying to do logisitc regression, but have this issue - some of the p values are NaN ...
3
votes
1answer
34 views

Risk prediction vs classification model

I am working on a binary classification model. Currently, when I use scikit logistic regression, it outputs binary values like 0s and 1s. However, I understand, from online reading, that it outputs ...
1
vote
0answers
28 views

Class of prediction in logistic regression

Very elementary question: While doing logistic regression(yes vs no), the coefficients shown by summary function. My question is +ve coefficients supports to which class "yes" or "No"(or defaulter/...
1
vote
1answer
18 views

Optimum values of all predictors in logistic regression

I am trying to figure out in logistic regression, with the help of coefficients of $x$ variables, we could figure out that on unit change in any $x$ variable what will be the change in probability of ...
6
votes
1answer
136 views

Why continuous features are more important than categorical features in decision tree models?

I have both categorical and continuous features in my prediction model and want to select (and rank) most important features. I have converted all categorical variables into dummy variables using one ...
2
votes
1answer
34 views

batched CrossEntropyLoss in pytorch

I'm wondering how to implement this with pytorch built-ins. I've got a 3 dimensional input of uints called policy. Most of the entries are zero, and if I were to L1 normalize this I would have a (...
2
votes
0answers
41 views

Probability of the recipient to open the email

I am trying to build a model using logistic regression, where my dependent variable is y=1 if the mail was opened, y=0 if it was not. I have data approximately 10 records (10 rows) for every ...
1
vote
1answer
28 views

Why results of statsmodel logreg is different from scikit-learn logreg?

I am trying to do a binary classification. I have only 6 input variables and one output variables. Label 1 is 1554 records and Label 0 is 3558 records. As you can see below, the metrics that I get ...
0
votes
0answers
6 views

Advisory models apart from logistic regression

I am wondering, if we have some more advisory models apart from logistic regression? That mean i am looking for models that can interpret the effect on y variable by unit change in any chance ...
1
vote
1answer
27 views

How to use scikit metrics for a statsmodel or vice versa?

Am working on binary classification problem with 5K records. Label 1 is 1554 and Label 0 is 3558. I did refer this post but not sure whether it is updated now or anyone has any way to compute this ...
2
votes
1answer
26 views

Why and how to match variables in logistic regression?

I have a dataset of ~4.7K records focused on binary classification with 60 features. class 1 is of 1554 records and class 2 is of 3558 records. Now I would like to find the risk factors that ...
4
votes
1answer
40 views

About the maximum likelihood, when we convert the maximization problem into minimization, why we take the negative?

On page 12, we take $log$ on both side. $\max_{\boldsymbol{w}}L\boldsymbol({w})=\max_{w}\displaystyle\prod_{n=1}^Np(t^{(i)}|x^{(i)};\boldsymbol{w})$ $\ell(\boldsymbol{w})=-logL(\boldsymbol{w})$ $\ ...
0
votes
1answer
39 views

1: 10 rule in logistic regression - EPV

I have a dataset with 4712 records. Label Yes - 1558 records and Label No - 3554 records. I read online that ...
0
votes
0answers
54 views

Why a significant risk factor doesn't increase AUC-score/F1-metric?

I have a binary classification problem with 5K records and 60+ features/columns/variables. dataset is slighlt imbalanced with 33:67 class proportion What I did was 1st) Run a logistic regression (...
1
vote
1answer
29 views

How to interpret statsmodel output - logit?

I ran a logit model using statsmodel api available in Python. I have few questions on how to make sense of these 1) What's the difference between ...
1
vote
1answer
50 views

difference between feature interactions and confounding variables

Let me define the problem space. I am working a binary classification problem. I am trying to build a causal model as well as predictive model. My aim is to find list of significant features (based ...
2
votes
1answer
32 views

Can we apply to GridSearchCV to Logistic regression .?

When I apply GridSearchCV to my model Logistic Regression, it's continuously throwing below error. I understand that it's trying to convert string to float. But that's was my data. So how can I ...
3
votes
2answers
81 views

How to adjust cofounders in Logistic regression?

I have a binary classification problem where I apply logistic regression. I have a set of features that are found significant. But I understand that Logistic regression doesn't consider feature ...
1
vote
0answers
21 views

Feature importance using logistic regression in pyspark

I am using logistic regression in PySpark. I have after splitting train and test dataset ...
2
votes
1answer
30 views

Logistic Regression Model for categorical features with multiple values in each category

I am working on an insurance use case to build a logistic regression classifier to predict if a policy will lapse or not. The dataset has more than 20 categorical features for a policy. Each ...
2
votes
1answer
316 views

How to interpret coefficients from logistic regression?

I ran a logistic regression (statsmodel) on my data with 60 features using the below code ...
0
votes
2answers
41 views

Different results for LogisticRegression on python 2.7 and 3

I have different results for the same kernel on python 2.7 (local machine) and python3 (the system running on kaggle) for LogisticRegression. How it is possible? Here my results from my local machine:...
0
votes
0answers
9 views

Handling data with exactly same features but slightly different outputs? [Regression Problem]

I have a dataset where if I remove two attributes, in some cases remaining features are exactly the same but target value changes slightly. In my test set, I don't have those removed attributes so I ...
0
votes
0answers
163 views

Python - Logistic (Logit) Regression - why am I getting an Endog error?

I'm running the following code: ...
1
vote
1answer
14 views

Error while using predict [closed]

After splitting into test and train the glm function is used on train set. For example m1 = glm(target ~ ., data = train, family="binomial") Then ...
0
votes
2answers
36 views

Logistic regression threshold value

How can i set the threshold value for the target variable. For example if a target variable is chance_of_admit and it has values from 0 to 1, how can I pick a value and so that I can convert it to 0's ...
0
votes
0answers
16 views

Code for churn column

Problem Statement -- A Newspaper Publishing Company (NPC) is facing increasing churn rates since years. This evolution has been jumpstarted by the rise of news- websites, and has continued at an ...
2
votes
1answer
33 views

Predict_proba() probabilities distribution [closed]

I’m trying to calculate probability of class 1. I’m using gradients boosting (catboost classifier) Is it normal to have an equal rate of positive classes in every predict_proba() bucket? e.g.: [...
0
votes
0answers
20 views

Logistic regression, where is my mistake

I am doing assigment on Logistic Regression on Andrew Ng DL course, and can't understand where is my mistake, ...
0
votes
0answers
59 views

Logistic Regression Plotting Learning Curve and Decision Boundary with Python

I already trained a dataset with Logistic Regression. However , I could not find any plotting code blocks of learning curve and decision boundary of my trained data. I put my codes at below. So , how ...
1
vote
2answers
25 views

Universal function approximation with fixed values (as vector or matrix)

I was thinking about way to represent/approximate universal function and came up with the idea that a plain fixed numbers could be used to represent pretty much any function on a fixed interval. I ...
0
votes
2answers
124 views

Managing NaN in target variables (testing)

Please can someone advise me on how to handle NaN in my target variables set? I've tried a variety of things but none is working. Here's what I've tried: Imputing zeros (0) in Y_test Replacing NaN ...
0
votes
1answer
128 views

Variation in output of Logistic Regression when using SMOTE

I am working on a logistic regression case with an imbalance in the target variable. To fix this I am using SMOTE (Synthetic Minority Oversampling Technique), but each time I run my regression model, ...
0
votes
0answers
169 views

Derivative of logarithm of loss function. Logistic regression

I am reading machine learning literature. I found the log-loss function of logistic regression algorithm: $$ l(w) = \sum_{n=0}^{N-1}\ln(1+e^{-y_nw^Tx_n}) $$ Where $ y \in {-1;1}, w \in R^P, x_n \in R^...
-1
votes
1answer
146 views

How to find and calculate correlation in a data set which has category and continuous variables? [duplicate]

I am working on an Insurance domain use case to predict if an existing customer will buy a second insurance policy or not. I have a few personal details saved under different categories like Marital ...
1
vote
1answer
16 views

SGDClassifier partial_fit() for online learning - is one step of gradient descent enough?

I'm interested in incremental (online) learning for my logistic regression model trained with SGDClassifier. Basically updating the model as more labeled data comes ...
0
votes
1answer
28 views

Feature Importance based on a Logistic Regression Model

I was training a Logistic Regression model over a fairly large dataset with ~1000 columns. I did apply scaling of features using MinMaxScaler. I was wondering how to interpret the coefficients ...
0
votes
0answers
24 views

How do I get confidence intervals for an ElasticNet in sklearn?

I need to produce a row for the confidence interval for every field that I am calculating coefficients and scores off of. So here is my code so far- ...
0
votes
1answer
20 views

Cannot fig out error in my gradient function implementation in python

Im trying to implement following gradient descent function in Python for logistic regression: $∇θ(−logL)=−X^T 􏰀(y−e^{Xθ}􏰁)$ This is my python implementation: ...
0
votes
0answers
85 views

Python, Logistic regression - How to calculate Nagelkerke pseudo r squared

I am doing logistic regression in sklearn and I would like to calculate (Nagelkerke) pseudo r squared, which makes more sense for logistic regression analysis. I don't see it is available in sklearn ...
0
votes
1answer
42 views

Binary classification: is there a tradeoff between predicting class 1 vs 0?

I have been digging much more in detail into classification performance metrics lately to get my head around the 'dynamics' of classification algorithms. What I have noticed is that in binary ...
1
vote
0answers
34 views

Low ROC AUC with good Information Value

I'm trying to build my first application scorecard with Logistic Regression and getting low ROC AUC score (about 0.7). Dataset ...
0
votes
2answers
28 views

How to Keep Missing Values in Ordinal Logistic Regression

I’m using mord package in python to do ordinal logit regression (predict response to movie rating 1-5 stars). One of my predictor variables is also ordinal but ...
0
votes
0answers
22 views

How to handle missing data in a logistic regression?

I am building a model to solve a binary classification task. So far, the input is low dimensional (10 dimensions at most). I need to face the occurrences of missing input. It is my first time at ...
2
votes
1answer
54 views

Help in understanding the maths behind Logistic Regression

I am following the lecture notes available https://www.stat.cmu.edu/~cshalizi/uADA/12/lectures/ch12.pdf I cannot understand how Eqs 12.4 and 12.5 come, why the Bernoulli probability has $1-p(x)$ in ...
0
votes
1answer
31 views

KNN scoring low compared to Logistic regression in MNIST challenge

KNN gives me a score of 0.76100 while it shows 94% accuracy for my training data (splitted with test_size =0.3) in my jupyter notebook while logistic regression gives me a score of 0.91485 with an ...