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
0 votes
1 answer
1k views

Improving precision and recall for imbalanced large data set

I have a data set of 1 million points and 30 features. The output variable has multiple classes (1 to $n$) but the problem I'm interested in is only concerned whether the output belongs to class 1 or ...
2 votes
0 answers
34 views

Why is cross-entropy increasing with accuracy?

I'm making an implementation of the softmax regression and I'm struggling to understand the nature behind the problem of increasing value of Cross-Entropy: $H(y_i, p_i)=-\sum_{i=1}^C y_i log(p_i)$, ...
0 votes
1 answer
197 views

Understanding the stochastic average gradient (SAG) algorithm used in sklearn

For pedagogical purposes I've been trying to create my own implementation of the stochastic average gradient (SAG) algorithm in a logistic regression framework. Page 10 of the associated paper ...
1 vote
1 answer
635 views

Finding logistic loss/negative log likelihood - binary logistic regression classification

I am new to ML and data science and am struggling with a simple problem. In my problem, I am given a series of datapoints $X_i$ where $X_i = (x_{i1}, x_{i2})$ with each data point having a label $y_i$ ...
1 vote
0 answers
33 views

Analysis of relationship between accuracy and total loss (or cost) during training with logistic loss function and threshold 0.5

I'm trying to understanding the relationship between training accuracy and training loss in classification tasks, specifically using logistic regression. When using logistic loss as the loss function ...
1 vote
1 answer
187 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 ...
3 votes
1 answer
488 views

Error while plotting Logistic Regression Classification

I was trying to plot by using the following code ...
0 votes
0 answers
25 views

Help with multinomial logistic regression

I am a data science student and have the opportunity to work on an article regrading cardiac arrests in our country. For now I performed the multinomial regression model and I also plan on doing a ...
0 votes
1 answer
54 views

Random Forest overfitting to unbalanced data set

I am working on an unbalanced classification problem. I have have 2000 points which are positive, and 6000 points as -ve (chosen randomly from 100k universe of -ve points universe). Although I have ~...
1 vote
2 answers
79 views

Does it make sense to train data in scikit-learn and copy+paste parameters into Rust's linfa?

I have a situation where my data can only be read from in a hosted Python environment, due to data security reasons. However, I am constrained to run ML models in a Rust environment due to work-...
0 votes
0 answers
19 views

Logistics or linear regression for a regression task involving outputs between 0 and 1

Problem Consider a regression task of mapping inputs $X$ to outputs $y$ where $y \in [0,1]$. Two linear models that we can use to model this input-output relationships are logistic regression $f_\...
2 votes
1 answer
259 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 ...
1 vote
2 answers
1k 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 ...
1 vote
1 answer
384 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 ...
0 votes
1 answer
318 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 ...
1 vote
2 answers
248 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. ...
0 votes
2 answers
2k views

Gridsearch ValueError: Input contains infinity or a value too large for dtype('float64'). - Using Pipeline

Update: I have non NAN values so fillna is not an issue. Clean dataset. I'm having this error occur when I try to predict using my grid best params. I get a score when fit it onto the training data. I ...
0 votes
0 answers
38 views

Doubts on a custom loss function for regression problems

From what I read, I know we don't use log loss or cross entropy for regression problems. However, the entire logic behind binary cross entropy(say) is to firstly squeeze the y_hat between 0 and 1 (...
2 votes
2 answers
103 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 ...
0 votes
1 answer
184 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 ...
9 votes
4 answers
3k 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 ...
2 votes
2 answers
234 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
1 answer
170 views

Does it make sense to repeat calculating AUC in logistic regression?

I have a question regarding logistic regression models and testing its skill. I am not quite sure if I understand correctly how the ROC Curve is established. When calculating the ROC curve, is a train ...
1 vote
1 answer
65 views

Linear Regression and Logistic Regression

I'm a beginner, and I'm wondering whether a logistic regression in a nut-shell is just normalizing a linear regression? Correct me if I'm wrong, but I came to this conclusion because the predicted ...
0 votes
0 answers
4 views

Error while using saved logistic regression model on scoring vector data -The columns of A don't match the number of elements of x. A: 6011, x: 232964

0 I'm getting error while using saved logistic regression model on scoring vector data. SparkException: [FAILED_EXECUTE_UDF] Failed to execute user defined function (ProbabilisticClassificationModel$$...
0 votes
0 answers
21 views

Logistic regression with E-net regularization produces different set of weights with each run

I am currently trying to make a model to classify brain tumor patients by incidence of epilepsy using a combination of variables extracted from clinical records, and radiomics features from segmented ...
0 votes
0 answers
17 views

Mplus Monte Carlo Sim w/Covariates

I have an Mplus INP file with which I am running a Monte Carlo sim for a latent class analysis. I have the class solution working properly, but I genuinely cannot figure out how to add in covariates ...
0 votes
2 answers
652 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
1k 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 ...
0 votes
0 answers
26 views

SMOTE-NC not working, Error: Pandas output does not support sparse data

I want to get my SMOTENC to work, but i've been failing successfully ...
0 votes
1 answer
70 views

Redundant feature after one hot encoding

I have a numerical feature called $x$ and a categorical feature called $y$. $y$ is an ordinal feature (A,B,C,D,E,F). I am using label encoding for my y feature and when I am seeing the correlation ...
0 votes
1 answer
280 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 ...
1 vote
1 answer
137 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 ...
3 votes
2 answers
65 views

Low scale ML/statistical techniques for data poor settings

I have two separate problems, but both suffer from a paucity of data problems: logistic regression Time series prediction For logistic regression, I have a tiny dataset with 10 observations which ...
0 votes
0 answers
10 views

warning 'newdata' had X row but variables found have Y rows

Linear Discriminant Analysis (LDA)+logistic regression model lda_model <- lda(train_labels ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data = train_data) LDA scores for the training ...
1 vote
1 answer
25 views

Feature selection for propensity model

I'm trying to build a propensity model for whether or not a customer will buy a second product. I was given data that looks like this: | Age | Income | DaysSince1stPurchase | Bought2ndProduct | |:---- ...
0 votes
1 answer
155 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 ...
3 votes
1 answer
141 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
2 answers
1k 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
3 answers
169 views

Binomial family in logistic regression

I was asked in an interview why do we use the binomial distribution in logistic regression and how is it related to the class that we are predicting? Could anyone explain, without any mathematical ...
0 votes
1 answer
125 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?
0 votes
0 answers
14 views

If my logistic regression model is performing well, does it matter if my features don't pass the Box Tidwell Test?

I've built a logistic regression model for binary classification with a high F1 score, but when I run Box-Tidwell tests on continuous independent features/predictive variables, I find non-linearities ...
0 votes
1 answer
202 views

Naive bayes expectation maximization vs logistic regression for binary classification

Assuming I'm dealing with binary classification. For what kind of data Naive bayes using expectation maximization would give a better solution and for what kind of data logistic regression would be ...
1 vote
1 answer
276 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 ...
3 votes
1 answer
508 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
1 answer
68 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. ...
0 votes
1 answer
60 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. ...
2 votes
2 answers
386 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
1 answer
82 views

Data Structure For Multilevel Analysis

I am little confused about how to structure my specific data for multilevel analysis. I have 10 categories and each category has some items in them. The dataset is available for 117 weeks. There is ...
0 votes
1 answer
777 views

Decision tree vs logistic regression feature importances

I have trained Logistic regression and decision tree in skearn on the same standardized dataset (binary classification). Top important coefficients for the decision tree are (sorted by ...

1
2 3 4 5
15