# Questions tagged [logistic-regression]

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

511 questions
Filter by
Sorted by
Tagged with
0answers
13 views

### Which one first? Imputing missing values or dummy creation?

While working on model building using Logistic Regression, we did two different ways. Method 1: Created dummy variables before treating missing values. This resulted in 37 columns expanding to 192 ...
0answers
17 views

### how to add cross term in logistic regression model?

I have a data of 2000 (say locations of different fruits grow) and 10000 (say factors responsile for growth of fruits). And I also know that there are 20 different types of fruits in these locations. ...
0answers
34 views

### Normalizing and joining of independent logistic regression model's prediction

I need to train several Logistic regression models on a different set of data (with a different set of labels): ...
0answers
18 views

### What is the Intuition behind weight vector W which is normal to the plane? Is the weight vector W same as the W which is normal to the plane π?

In an interview, I was asked the intuition behind the weight vector. I told the weight vector is a vector which we try to minimize to a local minima with the help of regulariser so we don't overfit. ...
0answers
20 views

### Predicting % of demand going to each product

I work within an industry with products that expire, therefore we would like to be able to choose which specific marketing keywords we should switch on to drive demand to the products that are over-...
0answers
17 views

### Simple constraints on Logistic Regression

I am doing with a binary classification problem. I have three features (w1x1 + w2x3 + w3x3 + w4), and I want to get a rule so that there is for sure w1 > 0, w2 > 0, w3 < 0 and any constant. ...
1answer
39 views

### Logistic Regression optimal threshold is a negative value

I run the code below: ...
1answer
86 views

### Baby cry detection model using binary classification through logistic regression

I need some help regarding my final year project. I am fairly new to machine learning and I have tried a lot to understand how to train a model using logistic regression. I have two datasets of audio ...
1answer
148 views

### Two steps optimization of a credit card limit

I have a problem similar to what is on the title but not the same, the problem on the title allows me to explain the dynamics of my need. I have to determine how much is the optimal value for a ...
0answers
12 views

### How to interpret feature weight coefficients in logistic regression for text classification?

I am working on a simple text classification problem where I have as inputs tweets and as class whether that tweet contains fake news or not (0 is real news, 1 is fake news). I have trained a logistic ...
1answer
29 views

### Derivative of a custom loss function with the logistic function

I have costum loss function with $\mu ,p, o, u, v$ as variables and $\sigma$ is the logistic function. I need to derive this loss function. Due to multiple variables in the loss function, I need to ...
2answers
26 views

### How can i solve the classification's problem with cross validation in LogisticRegression?

I want to make a data frame with most repeated word in sentences and make a classification via Logistic-Regression. I tried to write the steps clearly in codes. ...
1answer
14 views

### Math of Logistic regression cost function

In the current scikit-learn documentation for binary Logistic regression there is the minimization of the following cost function: \min_{w, c} \frac{1}{2}w^T w + C \sum_{i=1}^n \log(\exp(- y_i (X_i^...
1answer
30 views

### How to predict when and why of hospitalization?

I have an EHR data source which has info on a) Patient visit records (Inpatient, outpatient, Emergency etc) and why did he visit hospital (diagnosis codes attached to each visit) b) Patients drugs ...
0answers
11 views

### Which features are causing a class to be classified correctly or incorrectly?

I am doing a project that involves training and testing different algorithms to predict a developer's profile type (Frontend, Fullstack, QA, ML, etc.) using that developer's skills (AWS, Selenium, ...
0answers
20 views

### Residual Deviance in GLM Output in Python vs. R

I am coming from R to Python for econometrics. In R, in case of fitting a logistic regression with glm, the output summary would include the result of test of the proposed model against the saturated ...
1answer
27 views

### Effect of a few wrongly scaled feature values on logistic regression model

I was given a situation to predict the validity of the logistic regression model when it was found that certain values of a heavily weighted feature were found to be erroneously multiplied by 1000. ...
1answer
42 views

### How to combine two logistic regression models trained on different set of data?

My data has a hierarchy structure - meaning that there is an N class at level 1 and an M class at level M. After training both models separately with a different set of data (both are Logistic ...
1answer
34 views

### Having trouble scaling scores of logistic regression

I am constructing a credit scorecard using logistic regression, similar to the one shown here. However, when trying to convert the coefficients of logistic regression into score representation (by ...
1answer
56 views

### How to interpret my logistic regression result with statsmodels

so I'am doing a logistic regression with statsmodels and sklearn. My result confuses me a bit. I used a ...
0answers
61 views

### How to interpret my logistic regression result?

I'm having a hard time to interpret my result of the logistic regression. I have a few question. Firstly, how can I check if a feature is more important to the others, like that there is a real ...
1answer
25 views

### Selecting a boundary on a binary classifier to optimal precision and recall

I have a logistic regression classifier that shows differing levels of performance for precision and recall at different probability boundaries as follows: The default threshold for the classifier to ...
0answers
39 views

### Best practice to select precision vs. recall threshold for a binary classifier

I have a logistic regression model in Scikit-Learn doing a binary classification. Looking at the Roc curve for the classifier I can see that it performs really well: The AUC score is 0.99 which is ...
2answers
59 views

### Concatenating embedding and hand-designed features for logistic regression

An interviewer told me that we cannot concatenate an embedding from a neural network (such as a pre-trained image representation) and hand designed features (such as image metadata) for use in a ...
0answers
13 views

### analyze the effect of some new changes to business rules on customers retention and sales

I am trying to analyze the effect of a particular business rule on customer behavior. Background: I have two call centers operating in my company. One is an in-house call center and the other one is a ...
2answers
66 views

### Bad results in Logistic Regression from-scratch Python implementation on sample gender data

I am quite a newbie to Machine Learning, now trying to implement from scratch in Python (using numpy) a logistic regression algorithm. I took the gender/height/weight data from here. Then I did the ...
0answers
92 views

### How to retrieve results summary from statsmodels GLM with regularization?

I'm trying to fit a GLM to predict continuous variables between 0 and 1 with statsmodels. Because I have more features than data, I need to regularize. ...
1answer
31 views

### Finding value of theta in linear classification

I have an examing coming up, and I'm practicing with exams from previous years. However, the answers to the questions are not provided unfortunately. I'm currently doing the question below, and the ...
0answers
9 views

### Prediction problem across a wide space

I have assembled a database of Clash Royale games in an attempt to understand the outcomes of various match-ups. The game is composed of an 8 card deck drawn from 102 cards. As you can see from the ...
1answer
20 views

### SKLearn - Understanding Discrepancy Between LogisticRegressionCV classification_report and scores_

Cross-posting from Stack Overflow: I'm running into a weird situation where my sklearn LogisticRegressionCV model is apparently getting 100% accuracy (the lack of ...
1answer
35 views

### How to improve results from ML model? (spam classification)

I am trying to build a model that predicts if an email is spam/not-spam. After building a logistic regression model, I have got the following results: ...
0answers
16 views

### How Do I Plot a Nonlinear Decision Boundary? [duplicate]

I finished training my Sci-Kit Learn Logistic Regression model and it is performing at 100% accuracy. However, when I went to plot the decision boundary, I got a bit confused. I am not running the ...
1answer
18 views

### How to determine a sufficient number of training examples for a linear regression classifier?

How do we determine a sufficient number of training examples for a linear regression classifier? What kind of behaviors might we expect if we use too few training examples?
0answers
12 views

### In multinomial logistic regression, how to explain the softmax outputs properly?

I tried to solve multiclass problem ("cat", "dog", "horse") problem and figured out that the more words in test text, the more difference between classes. I grouped the ...
0answers
19 views

### Logistic Regression performs better on longer texts

I trained the LogisticRegression model with TF-IDF (both birgams and unigrams) and while predicting class it revealed that in longer texts (up to 3000 symbols)it works better that if I use short (+-...
0answers
15 views

### Neural Network probabilities problem

I am using machine learnig to measure probability for the outcome of tennis matches. If the winer is 1 that means that p1 won otherwise p2 won. in Columns LG, SVC, RF and NN there are probaiblities ...
0answers
221 views

### Non-linear decision boundary in logistic regression algorithm with polynomial features

Lately I have been playing with drawing non-linear decision boundaries using the Logistic Regression Classifier. I used this notebook to learn how to create a proper plot. Author presents a really ...
2answers
94 views

### Logistic Regression Manual Update

For the logistic regression below, how can I manually update the coefficients a and b manually? EDIT y = 1.0 / (1.0 + exp(-ax - b)) after observing the following ...
1answer
132 views

### From logistic regression to XGBoost - selecting features to run the model with

I have been asked to look at XGBoost (as implemented in R, and with a maximum of around 50 features) as an alternative to an already existing but not developed by me logistic regression model created ...
1answer
49 views

### Predictive model to maximize sum of dependent variable?

I am trying to classify cars for a towing company. Junky cars earn more when sent to the junkyard, and the more valuable cars should earn more at the auction, despite the auction fee. Creating a ...
0answers
31 views

### Assessing model performance on different sub-segments [closed]

I am currently working on a credit risk related project where i built a binary logistic regression model for an imbalanced dataset. According to the regulations i have to prove that the model performs ...
2answers
23 views

### Impossible to increase model accuracy [closed]

I'm building binary classification models on my company's dataset. The problem I'm having is that I haven't been able to increase the accuracy of my models. I have trained, tuned, cross validated ...
1answer
35 views

### Predicting results of tennis matches based on historical data [closed]

I am writing my Bachelor thesis in Python about predicting results of tennis matches based on historical data. I have started from Logistic Regression but my model isn't efficient. If you could look ...
0answers
16 views

### How many positive responses are good enough for building a marketing response model when the response rate is low(0.5%)

We are planning a marketing campaign to collect data and the response rates for a random sample. Total population size is 10 million and historically, response rates are low (0.5 - 0.65 %). How long ...
2answers
56 views

### How much data do you need to build a classifier?

I would like to ask you what a good size of dataset would be for building a classifier. I know that there are datasets of 1000 obs and datasets of 1m obs. But I also read papers where classifiers were ...
1answer
26 views

### Including column of indices as predictor for model?

I have a small dataset consisting of 1000 observations (rows), 11 predictors + 1 response (12 columns). It is a toy dataset used for learning purposes in a machine learning class at university -- ...
1answer
268 views

### Determining whether a Machine Learning model is overfitted with regard to the stability of the features

I need to know how would I get to know if I have overfitted my Machine Learning model on the train data. The performance metric I have used is Logistic Loss. Does the stability of the features affect ...
0answers
7 views

### What is the explanation of discretized log logistic in the following code? Is there any reference regarding this piece of code?

I have taken the following piece of code from the OpenAI code of GitHub from the following link: https://github.com/openai/iaf/blob/master/tf_utils/distributions.py#L28 def discretized_logistic(mean, ...
0answers
81 views

### What's the order in applying SMOTE transformation in a pipeline?

Here's the thing, I have an imbalanced data and I was thinking about using SMOTE transformation. However, when doing that using a sklearn pipeline, I get an error because of missing values. This is my ...
1answer
56 views

### Modifying binary classification to Multi-Class Classification (Logistic Regression) [closed]

I am using this code that I found here for logistic regression for binary classification with 2 classes. Git Repo The data that I am testing with is calling for multi-class classification (6 classes). ...