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
1
vote
1answer
10 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
17 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
14 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
30 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
19 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
27 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
24 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
25 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
30 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
36 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
43 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 ...
0
votes
0answers
8 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
25 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
21 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
18 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
43 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
41 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
30 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
23 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
19 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
53 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
29 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
87 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 ...
1
vote
1answer
18 views
0
votes
0answers
13 views

Is this a reasonable way to deal with known input data uncertainty for logistic regression predictions?

Suppose I want to use a logistic regression model to predict the class of N objects. Further, suppose the prediction is time sensitive: I need the prediction for each object on Day 1, but the value of ...
0
votes
0answers
43 views

Plotting Decision Boundary of Logistic Regression

For plotting decision boundary for Logistic Regression after finding required weights and hypothesis Therefore , we need to plot this equation -- where, This works perfectly fine. Just wanna ask ...
0
votes
0answers
10 views

Recursive feature elimination on train data or complete dataset and dummy encoding

I am using RFE with logistic regression. I will also be doing cross validation with RFE (RFECV in sklearn) to get the optimum number of features. I am not sure whether to use RFECV on just train ...
0
votes
0answers
30 views

Indicator for target variable in logistic regression

I am trying to predict the probability of an event occurrence for different entities based on historical time series data. The event is binary (0, 1) and monthly snapshots are available. I am setting ...
0
votes
1answer
25 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
21 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
28 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
28 views

How to perform logistic regression in R with grouped data?

Say I have a categorical variable with 2 levels, and for instance 289 people fall in level 1 and 386 fall in level 2. How would I go about modelling such a variable as a logistic response? All ...
0
votes
0answers
10 views

High accuracy in one v. all, lower accuracy in all vs. all

I am training a classifier (similar to logistic regression) on MNIST. I have 10 one -vs.-all classifiers for each number, each of which independently achieves >90% test set accuracy. However, when I ...
0
votes
1answer
23 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
118 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
0answers
17 views

How does a simple logistic regression model achieve a 92% classification accuracy on MNIST?

Even though all the images in the MNIST dataset are centered, with a similar scale, and face up with no rotations, they have a significant handwriting variation that puzzles me how a linear model ...
1
vote
1answer
27 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 ...
0
votes
1answer
24 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 ...
1
vote
1answer
36 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
26 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
478 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
0answers
11 views

Code line explanations: Visuals of LogRegression

Why do we use -1 and +1 in the following code? ...
0
votes
1answer
34 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 ...
3
votes
2answers
60 views

Which classifier performs better when using 'class_weight'?

I have used the 'class_weight' method to balance my multi-class classification problem, using Logistic Regression, Random Forest, and XGBoost classifiers. Among these three methods, logistic ...
0
votes
1answer
83 views

Calculating Univariate and MultiVariate Logistic Regression with Python

I have a simple data set of a number of variables and a single binary dependent variable. The data is stored in a data frame. When I use python's statsmodels.api and logit.fit() on the dataframe I ...
0
votes
2answers
122 views

Logistics regression with polynomial features vs neural networks for classification

I am taking Andrew Ng's Coursera class on machine learning. He mentions that training a logistic regression model with polynomial features would be very expensive for certain tasks compared to ...
0
votes
0answers
12 views

Ideas to derive new column or eliminate a column for Logistic Regression problem related to binary classification

I am working on a Logistic Regression problem to identify the leads that result into a student conversion for candidature. I have 2 columns in the dataset 'Last Activity' and 'Last Notable Activity' ...
1
vote
1answer
25 views

How do we decide on the classification algorithm to use with huge training size?

I am solving a questions binary classification problem and the training size for this is huge(291 billion). The data has bloated because of using tfidfvectorizerfor ...
0
votes
2answers
47 views

How to do predict a new sms to be spam or not?

I have trained a model for spam classification - This is my code - ...