logistic-regression Questions

7

Solved

I'm trying to implement a multiclass logistic regression classifier that distinguishes between k different classes. This is my code. import numpy as np from scipy.special import expit def cost(...

7

I have some data with predictors and a binary target. Eg: df <- data.frame(a=sort(sample(1:100,30)), b= sort(sample(1:100,30)), target=c(rep(0,11),rep(1,4),rep(0,4),rep(1,11))) I trained a ...
Beeson asked 23/4, 2014 at 9:27

2

Solved

I would like to use cross validation to test/train my dataset and evaluate the performance of the logistic regression model on the entire dataset and not only on the test set (e.g. 25%). These co...
Observant asked 26/8, 2016 at 9:46

5

Solved

I know that logistic regression is for binary classification and softmax regression for multi-class problem. Would it be any differences if I train several logistic regression models with the same ...

2

I'm attempting to implement mixed effects logistic regression in python. As a point of comparison, I'm using the glmer function from the lme4 package in R. I've found that the statsmodels module h...
Flabby asked 25/2, 2020 at 21:43

3

I am using Anaconda and I am trying logistic regression. After loading training data set and performed the regression. Then I got the following warning message. train_cols = data.columns[1:] logi...
Dishonorable asked 3/10, 2015 at 18:58

2

I have a statsmodels.discrete.discrete_model.BinaryResultsWrapper that was the output of running statsmodels.api.Logit(...).fit(). I can call the .summary() method which prints a table of results w...
Subserve asked 25/4, 2015 at 18:19

6

Solved

I am using the LogisticRegression() method in scikit-learn on a highly unbalanced data set. I have even turned the class_weight feature to auto. I know that in Logistic Regression it should be pos...

2

What is the meaning of C parameter in sklearn.linear_model.LogisticRegression? How does it affect the decision boundary? Do high values of C make the decision boundary non-linear? How does overfitt...

2

Solved

I am using sklearn.linear_model.LogisticRegression in scikit learn to run a Logistic Regression. C : float, optional (default=1.0) Inverse of regularization strength; must be a positive float. Lik...
Complexioned asked 4/4, 2014 at 0:18

4

Solved

I try to run following code. import pandas as pd import numpy as np from sklearn.linear_model import LogisticRegression # data import and preparation trainData = pd.read_csv('train.csv') train = ...
Shebat asked 27/7, 2017 at 9:23

2

Solved

I am trying to predict the admit variable with predictors such as gre,gpa and ranks. But the prediction accuracy is very low (0.66).The dataset is given below. https://gist.github.com/abyalias/3de8...

2

Solved

What exactly does the LogisticRegression.predict_proba function return? In my example I get a result like this: array([ [4.65761066e-03, 9.95342389e-01], [9.75851270e-01, 2.41487300e-02], [9.999...

2

Solved

I have a binary prediction model trained by logistic regression algorithm. I want know which features (predictors) are more important for the decision of positive or negative class. I know there is...
Dimorphous asked 2/12, 2015 at 20:11

5

This is the head of a train data set. Head of the X_Train Running the below code: logit = sm.GLM(Y_train, X_train, family=sm.families.Binomial()) result = logit.fit() Can you please help? Ge...
Dram asked 29/10, 2018 at 8:42

4

Solved

I have seen the weights of neural networks initialized to random numbers so I am curious why the weights of logistic regression get initialized to zeros?

4

Solved

I have a dataset consisting of both numeric and categorical data and I want to predict adverse outcomes for patients based on their medical characteristics. I defined a prediction pipeline for my d...
Farouche asked 30/6, 2020 at 13:8

1

I have a dataset for one year for all employees with individual-level data (e.g. age, gender, promotions, etc.). Each employee is in a team of a certain manager. I have some variables on the team- ...
Lacerated asked 2/8, 2022 at 9:23

4

Solved

Is there any way to calculate residual deviance of a scikit-learn logistic regression model? This is a standard output from R model summaries, but I couldn't find it any of sklearn's documentation....
Expedition asked 21/6, 2018 at 18:57

2

When performing classification (for example, logistic regression) with an imbalanced dataset (e.g., fraud detection), is it best to scale/zscore/standardize the features before over-sampling the mi...
Sparry asked 21/1, 2018 at 17:10

2

Solved

I am using the logistic regression function from sklearn, and was wondering what each of the solver is actually doing behind the scenes to solve the optimization problem. Can someone briefly descri...
Planogamete asked 28/7, 2016 at 15:2

4

Solved

For a very simple classification problem where I have a target vector [0,0,0,....0] and a prediction vector [0,0.1,0.2,....1] would cross-entropy loss converge better/faster or would MSE loss? When...

2

Solved

I am trying to run below code on Jupyter Notebook: lr = LogisticRegression(class_weight='balanced') lr.fit(X_train,y_train) y_pred = lr.predict(X_train) acc_log = round(lr.score(X_train, y_train) ...
Wilinski asked 14/9, 2020 at 11:46

2

Solved

I am working on UCI breast cancer dataset and trying to find the top 3 features that have highest weights. I was able to find the weight of all features using logmodel.coef_ but how can I get the f...

3

Solved

When running a logistic regression, the coefficients I get using statsmodels are correct (verified them with some course material). However, I am unable to get the same coefficients with sklearn. I...
Starling asked 19/5, 2018 at 19:37

© 2022 - 2024 — McMap. All rights reserved.