# Questions tagged [logistic-regression]

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

642 questions
Filter by
Sorted by
Tagged with
139 views

### Gradient descent implementation of logistic regression

Objective Seeking for help, advise why the gradient descent implementation does not work below. Background Working on the task below to implement the logistic regression. Gradient descent Derived the ...
108k views

### How to get p-value and confident interval in LogisticRegression with sklearn?

I am building a multinomial logistic regression with sklearn (LogisticRegression). But after it finishes, how can I get a p-value and confident interval of my model? It only appears that sklearn only ...
215 views

### Text classification analysis based on similarity

I have been reading a lot of literature regarding text classification and different approaches/models, especially using Python language, but probably I am still missing something on how to build the ...
8 views

### Goodness on test or train set?

I split my data set before on train (80%) and test (20%) splits. Trained logistic regression model on the train set. Now, want to check the goodness of fit using the Chi-square likelihood omnibus test,...
2k views

### Loss Function for Probability Regression

I am trying to predict a probability with a neural network, but having trouble figuring out which loss function is best. Cross entropy was my first thought, but other resources always talk about it in ...
1 vote
45 views

### When should we use jaccard score?

I am a newbie in Machine Learning, I trained a binary classifier for bank loan prediction through Logistic Regression. I measured the accuracy of it with two methods: accuracy score and jaccard index. ...
1 vote
293 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 ...
17 views

### Is a simple linear regression appropriate for an originally ordinal outcome variable?

Context: To form an index, I summed (and weighted) 2 variables containing ratings (1-9). Potentially problem: Wondering if it is appropriate to conduct a linear regression, all other assumptions being ...
16 views

### Predict data using Pre-Trained Classification Model

I have pre trained classification model (saved as pickle file) to predict employee attrition. My question is when I use new dataset to predict using Pickle file do I need do all preprocessing steps (...
1 vote
401 views

### Relation between MLE (Maximum Likelihood Estimation) & Gradient Descent

What are the similarities & dissimilarities between MLE (used to find the best parameters in logistic regression) & Gradient Descent?
476 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 - ...
1 vote
177 views

### MLE & Gradient Descent in Logistic Regression

In Logistic Regression, MLE is used to develop a mathematical function to estimate the model parameters, optimization techniques like Gradient Descent are used to solve this function. Can somebody ...
194 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 ...
165 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:...
24 views

### Using class weights with training on imbalanced dataset gives worse result w.r.t logloss than without weights

I am trying to make a model for usual binary classification that is able to predict probabilities of classes. I have not very big dataset of 10k objects where classes are imbalanced as 80:20 and tried ...
18 views

### Why do we don't write units with MAE or RSME for regression problem ? If I wish to write the units when how do I identify the units for them?

I have referred many research paper but no one is talking about the units of the metrics. Do MAE , RMSE etc have some units ?
1 vote
66 views

### Classification report question

I need some help to interpret the 2 classification reports of the same logistic regression. The only difference between them is the size of test_size. Even though my second classification report has a ...
350 views

### Logistic regression for classification?

I have a dataset with most columns having Boolean values and categorical values. A sample of it is: ...
22 views

### LSTM basic doubt

How LSTM are able to figure out that a particular word has occurred. Like in classical algos, We have column order. But in LSTM, Since each cell receives different words, How does it know a particular ...
1 vote
19 views

### NLP logistic regression

A basic doubt I have, Usually when dealing with text data for classic ML algos, We use Tf-idf which uses entire vocabulary for each row and assigns some weighted value. My doubt is can I use 5 feature ...
1 vote
71 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 ...
51 views

### Kernel dies or proses stuck when making LR prediction on dataframe using apply

I'm trying to making predictions with a simple model. model=LogisticRegression() model.fit(X_train,y_train) After fitting, i try to make predictions. A sample ...
46 views

### What to do when one feature has very large importance/weight?

I am new to Data Science and currently am trying to predict customers churn for a company that offers of subscription-based bookings management software. Its customers are gyms. I have a small ...
637 views

### Why is my training accuracy decreasing higher degrees of polynomial features?

I am new to Machine Learning and started solving the Titanic Survivor problem on Kaggle. While solving the problem using Logistic Regression I used various models having polynomial features with ...
29 views

### How to generate a rule-based system based on binary data?

I have a dataset where each row is a sample and each column is a binary variable. The meaning of $X_{i, j} = 1$ is that we've seen feature $j$ for sample $i$. $X_{i, j} = 0$ means that we haven't seen ...
27 views

### How do I modify a Logistic Regression to target a specific point on the ROC curve?

From a conceptual standpoint I understand the trade off involved with the ROC curve. You can increase the accuracy of true positive predictions but you will be taking on more false positives and vise ...
29 views

### The accuracy depends on the hyper-parameter in a strongly non-monotinic way

I have a data set labelled with a binary classes. I calculated the principal components from the data, then made the PC transformation. The goal is to find an optimal number of PCs so that the binary ...
10 views

### Determining increments for aggregated time series data to determine impact of individual features

I'm working with a data source that provides itemised transactions, which I am aggregating into 1 hour blocks to determine a 'rate per hour' as the dependent or target variable - i.e. like a time ...
1 vote
56 views

### Log odds vs Log probability

Log-odds has a linear relationship with the independent variables, which is why log-odds equals a linear equation. What about log of probability? How is it related to the independent variables? Is ...
1 vote
132 views

### Deciding Initial Weights In A Linear Classifier For Sentiment Analysis

I would like to build a simple sentiment analysis classifier using logistic regression. I downloaded a list of positive and negative words from cs.uic.edu. There are more than 6000 words both positive ...
40 views

### NAN in keras neural network results

I am creating a neural network simple architecture. But I keep getting NAN in result, cant figure out why, below is my code. ...
53 views

### For Logistic regression, why is that particular logistic function chosen as opposed to other logistic functions?

The logistic function used in logistic regression is: $\frac{e^{B_{0} + B_{1}x}}{1 + e^{B_{0} + B_{1}x}}$. Why is this particular one used?
1 vote
57 views

### Logistic Regression for prediction

I would like to ask about the theoretical approach of using Logistic Regression for customer data and more specifically Churn Prediction (in BigQuery and Python). I have my customer data for an online ...
70 views

### Issues with self-implemented logistic regression

I am trying to self-implement a logistic regression algorithm to do some self-learning but I am having a bit of trouble with achieving similar accuracy to the logistic regression of sklearn. Here is ...
45 views

### Can I perform a Logistic regression on this data?

I have the data below: I want to explain the relationship between 'Milieu' who has two factors, and 'DAM'. As you may notice, the blue population's included in the red population. Can I apply a ...
125 views

### Decomposing R squared or VIF

In the context of multi-regression, I am wondering if there is a way to decompose $$VIF_i = 1/(1-R_i^2)$$ where $R_i^2$ is the r squared obtained from the regression of dependent variable = i and ...
27 views

### Different results in same logistic regression model from sklearn and same dataset

I got this strange behavior when deploying my logistic regression trained in scikit-learn into production. I trained the model on my own machine and stored it in form of ...
1 vote
17 views

77 views

### Interpretation of log odds

Equation of log odds: Example: Log odds of getting a heart disease--> 0.8=2.5(Hypertension)+0.3(Gender)+0.06(Age)+15 How is this equation interpreted?
1 vote
33 views

### Why should MLE be considered in Logistic Regression when it cannot give a definite solution?

If MLE (Maximum Likelihood Estimation) cannot give a proper closed-form solution for the parameters in Logistic Regression, why is this method discussed so much? Why not just stick to Gradient Descent ...