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
2 answers
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 ...
27 votes
3 answers
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 ...
0 votes
1 answer
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 ...
0 votes
0 answers
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,...
9 votes
3 answers
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
1 answer
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
1 answer
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 ...
0 votes
0 answers
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 ...
0 votes
1 answer
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
2 answers
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?
0 votes
2 answers
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
2 answers
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 ...
2 votes
1 answer
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 ...
2 votes
2 answers
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:...
0 votes
0 answers
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 ...
2 votes
2 answers
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
2 answers
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 ...
0 votes
2 answers
350 views

Logistic regression for classification?

I have a dataset with most columns having Boolean values and categorical values. A sample of it is: ...
0 votes
1 answer
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
1 answer
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
1 answer
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 ...
0 votes
1 answer
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 ...
2 votes
1 answer
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 ...
2 votes
3 answers
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 ...
2 votes
1 answer
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 ...
2 votes
1 answer
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 ...
0 votes
0 answers
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 ...
0 votes
0 answers
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
1 answer
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
1 answer
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 ...
0 votes
1 answer
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. ...
4 votes
3 answers
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
1 answer
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 ...
3 votes
1 answer
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 ...
2 votes
1 answer
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 ...
0 votes
1 answer
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 ...
0 votes
0 answers
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
0 answers
17 views

Deriving a binary logistic classifier from a multi class logistic classifier

Given a multi class logisitic classifier $f(x)=argmax(softmax(Ax + \beta))$, and a specific class of interest $y$, is it possible to construct a binary logistic classifier $g(x)=(\sigma(\alpha^T x + b)...
0 votes
0 answers
13 views

Exact Shap calculations for logistic regression?

Given the relatively simple form of the model of standard logistic regression. I was wondering if there is an exact calculation of shap values for logistic regressions. To be clear I am looking for a ...
-4 votes
1 answer
102 views

Verifying my understanding of MLE & Gradient Descent in Logistic Regression

Here is my understanding of the relation between MLE & Gradient Descent in Logistic Regression. Please correct me if I'm wrong: 1) MLE estimates optimal parameters by taking the partial derivative ...
1 vote
0 answers
21 views

Is it possible to "fine-tune" a pre-trained logistic regression model?

Fine tuning is a concept commonly used in deep learning. We may have a pre-trained model and then fine-tune it to our specific task. Does that apply to simple models, such as logistic regression? For ...
3 votes
1 answer
345 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 what the optimal value is for a variable ...
1 vote
2 answers
58 views

Odds vs Likelihood

Odds is the chance of an event occurring against the event not occurring. Likelihood is the probability of a set of parameters being supported by the data in hand. In logistic regression, we use log ...
1 vote
1 answer
211 views

Custom regularisation for logistics regression

My understanding of l2 regularisation: Weights of the model are assumed to have a prior guassian distribution centered around 0. Then MAP estimate over data adds an extra penalty in cost function. My ...
1 vote
1 answer
45 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. ...
1 vote
1 answer
37 views

Why is Word2vec regarded as a neural embedding?

In the skip-gram model, the probability that a word $w$ is part of the set of context words $\{w_o^{(i)}\}$ $(i= 1:m)$ where $m$ is the context window around the central word, is given by: $$p(w_o | ...
0 votes
1 answer
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
1 answer
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 ...
0 votes
0 answers
25 views

Possibility of close-form solution in logistic regression

In logistic regression, is a closed-form solution using MLE possible when we have data with a single independent variable? Because then, modeling the data & deriving a close-form solution wouldn't ...
0 votes
1 answer
30 views

Individual P-values in Logistic Regression

I ran a logistic regression with like 10 variables (with R) and some of them have high P-values (>0.05). Should we follow the elimination techniques that we follow in multiple linear regression to ...

1
2 3 4 5
13