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
2
votes
1answer
76 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
71 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
73 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 ...
2
votes
0answers
25 views

Interpretable models apart from Logistic Regression

I am wondering about other interpretable models apart from logistic regression. I am looking for models that can interpret the effect on the target variable by unit change in any feature variable. I ...
1
vote
1answer
98 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
102 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
130 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
136 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
61 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 (...
2
votes
1answer
2k 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 ...
2
votes
1answer
154 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
255 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 ...
5
votes
2answers
182 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
268 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
100 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
1k views

How to interpret coefficients from logistic regression?

I ran a logistic regression (statsmodel) on my data with 60 features using the below code ...
2
votes
2answers
112 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:...
1
vote
1answer
3k views

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

I'm running the following code: ...
1
vote
1answer
21 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
380 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 ...
2
votes
1answer
375 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.: [...
1
vote
0answers
79 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, ...
1
vote
2answers
32 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 ...
1
vote
2answers
547 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
161 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
189 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
300 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
453 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 ...
1
vote
1answer
512 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
1answer
56 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: ...
1
vote
0answers
316 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
64 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
48 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
236 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
31 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
243 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
95 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 ...
0
votes
2answers
2k views

kNN vs Logistic Regression

Good day, I had this question set as optional homework and wanted to ask for some input. Suppose an individual was to take a data set, divide it in half into training and test data sets and then try ...
1
vote
1answer
111 views

Get Logistic regression scores in CNN using Keras

...
1
vote
1answer
50 views

build a classification model under constraint

Suppose I have n features $(x_1, x_2, ...., x_n)$ (all float) and want to classify $y$ (0 or 1) For now I have a legacy expert system to do the classification. Expert system rules: Categorize all $...
1
vote
1answer
88 views

Interpreting fraction of zero weights in TensorFlow

I am using the TensorFlow to do a simple linear classification using logistic regression. The graph included from the TensorBoard displays what they call the fraction of zero weights. How do I ...
2
votes
1answer
55 views

is the logit transform ever actually computed in modeling process of logistic regression?

i've been tying to wrap my head around logistic regression, the logit transform, and the sigmoid function. logit transform: from what i understand, in practice all we want to do is maximize the ...
0
votes
1answer
27 views

How does the given data gets plotted on a graph

I come from a programming background and learning the math behind the data science and algorithms now. I would like to understand the logic behind how a data gets plotted in a graph when using ...
2
votes
3answers
510 views

References for longitudinal data analysis

So my goal is to study longitudinal data (data in time series) by applying some data mining techniques. Ultimately I want to be able to "predict" outcomes. For example, a study of patients along the ...
1
vote
1answer
34 views

Accuracy noise patterns during model training

I'm training a logistic regression model on a small dataset. I have about 1300 samples that I split into a training and a testing set (70% and 30% respectively). The training seems ok, however when I ...
1
vote
1answer
44 views

Why the Logistic regression model trained with tensorflow performed so poor

I trained a logistic regression model with tensorflow but the accuracy of the model was so poor (accuracy = 0.68). The model was trained using simulated dataset and the result should be very good. is ...
2
votes
1answer
51 views

Is it compulsary to normalize the dataset if doing so can negatively impact a Binary Logistic regression performance?

I am using raw data set with 4 feature variables to do a Binominal Classification using Logistic Regression Algorithm. I made sure that the class counts are balanced. i.e., an equal number of ...
0
votes
0answers
68 views

Linear/Logistic Regression for unknown values or how to get a good prior for new coefficients

Suppose, we model the probability of making holidays by country and town. The input data are people and how many people actually made holiday in that particular town: ...
2
votes
1answer
5k views

How to interpret Logistic regression coefficients using scikit learn

I have created a model using Logistic regression with 21 features, most of which is binary. I created these features using get_dummies. Few of the other features are numeric. I get a very good ...
0
votes
1answer
61 views

What do we learn from training a dataset for logistic regression

What do we learn from training our dataset in Logistic Resgression? Like in Linear Regression, with the help of training set we are able to generate a best fit line(y = mx+c) where m and c come from ...

1 2 3
4
5
11