logistic-regression

which coefficients go to which class in multiclass logistic regression in scikit learn?

时光毁灭记忆、已成空白 提交于 2019-12-03 15:25:36
I'm using scikit learn's Logistic Regression for a multiclass problem. logit = LogisticRegression(penalty='l1') logit = logit.fit(X, y) I'm interested in which features are driving this decision. logit.coef_ The above gives me a beautiful dataframe in (n_classes, n_features) format, but all the classes and feature names are gone. With features, that's okay, because making the assumption that they're indexed the same way as I passed them in seems safe... But with classes, it's a problem, since I never explicitly passed in the classes in any order. So which class do coefficient sets (rows in the

Confidence Intervals for Lethal Dose (LD) for Logistic Regression in R

青春壹個敷衍的年華 提交于 2019-12-03 15:16:57
问题 I want to find Lethal Dose ( LD50 ) with its confidence interval in R . Other softwares line Minitab, SPSS, SAS provide three different versions of such confidence intervals. I could not find such intervals in any package in R (I also used findFn function from sos package). How can I find such intervals? I coded for one type of intervals based on Delta method (as not sure about it correctness) but would like to use any established function from R package. Thanks MWE: dose <- c(10.2, 7.7, 5.1,

How can I get the relative importance of features of a logistic regression for a particular prediction?

醉酒当歌 提交于 2019-12-03 15:14:34
I am using a Logistic Regression (in scikit) for a binary classification problem, and am interested in being able to explain each individual prediction. To be more precise, I'm interested in predicting the probability of the positive class, and having a measure of the importance of each feature for that prediction. Using the coefficients (Betas) as a measure of importance is generally a bad idea as answered here , but I'm yet to find a good alternative. So far the best I have found are the following 3 options: Monte Carlo Option : Fixing all other features, re-run the prediction replacing the

scikit-learn return value of LogisticRegression.predict_proba

无人久伴 提交于 2019-12-03 15:14:05
问题 What exactly does the LogisticRegression.predict_proba function return? In my example I get a result like this: [[ 4.65761066e-03 9.95342389e-01] [ 9.75851270e-01 2.41487300e-02] [ 9.99983374e-01 1.66258341e-05]] From other calculations, using the sigmoid function, I know, that the second column are probabilities. The documentation says, that the first column are n_samples , but that can't be, because my samples are reviews, which are texts and not numbers. The documentation also says, that

How to interpret Weka Logistic Regression output?

早过忘川 提交于 2019-12-03 12:10:42
问题 Please help interpret results of logistic regression produced by weka.classifiers.functions.Logistic from Weka library. I use numeric data from Weka examples: @relation weather @attribute outlook {sunny, overcast, rainy} @attribute temperature real @attribute humidity real @attribute windy {TRUE, FALSE} @attribute play {yes, no} @data sunny,85,85,FALSE,no sunny,80,90,TRUE,no overcast,83,86,FALSE,yes rainy,70,96,FALSE,yes rainy,68,80,FALSE,yes rainy,65,70,TRUE,no overcast,64,65,TRUE,yes sunny

Can MICE pool complete GLM output binary logistic regression?

喜欢而已 提交于 2019-12-03 10:13:43
I am running a logistic regression with a binary outcome variable on data that has been multiply imputed using MICE. It seems straightforward to pool the coefficients of the glm model: imp=mice(nhanes2, print=F) imp$meth fit0=with(data=imp, glm(hyp~age, family = binomial)) fit1=with(data=imp, glm(hyp~age+chl, family = binomial)) summary(pool(fit1)) However, I can't figure out a way to pool other output generated by the glm. For instance, the glm function produces AIC, Null deviance and Residual deviance that can be used for model testing. pool(summary(fit1)) ## summary of imputation 1 : Call:

What are alternatives of Gradient Descent?

吃可爱长大的小学妹 提交于 2019-12-03 05:15:53
问题 Gradient Descent has a problem of Local Minima. We need run gradient descent exponential times for to find global minima. Can anybody tell me about any alternatives of gradient descent with their pros and cons. Thanks. 回答1: This is more a problem to do with the function being minimized than the method used, if finding the true global minimum is important, then use a method such a simulated annealing. This will be able to find the global minimum, but may take a very long time to do so. In the

Confidence Intervals for Lethal Dose (LD) for Logistic Regression in R

有些话、适合烂在心里 提交于 2019-12-03 05:06:37
I want to find Lethal Dose ( LD50 ) with its confidence interval in R . Other softwares line Minitab, SPSS, SAS provide three different versions of such confidence intervals. I could not find such intervals in any package in R (I also used findFn function from sos package). How can I find such intervals? I coded for one type of intervals based on Delta method (as not sure about it correctness) but would like to use any established function from R package. Thanks MWE: dose <- c(10.2, 7.7, 5.1, 3.8, 2.6, 0) total <- c(50, 49, 46, 48, 50, 49) affected <- c(44, 42, 24, 16, 6, 0) finney71 <- data

scikit-learn return value of LogisticRegression.predict_proba

天涯浪子 提交于 2019-12-03 04:55:43
What exactly does the LogisticRegression.predict_proba function return? In my example I get a result like this: [[ 4.65761066e-03 9.95342389e-01] [ 9.75851270e-01 2.41487300e-02] [ 9.99983374e-01 1.66258341e-05]] From other calculations, using the sigmoid function, I know, that the second column are probabilities. The documentation says, that the first column are n_samples , but that can't be, because my samples are reviews, which are texts and not numbers. The documentation also says, that the second column are n_classes . That certainly can't be, since I only have two classes (namely +1 and

How to interpret Weka Logistic Regression output?

泄露秘密 提交于 2019-12-03 03:25:42
Please help interpret results of logistic regression produced by weka.classifiers.functions.Logistic from Weka library. I use numeric data from Weka examples: @relation weather @attribute outlook {sunny, overcast, rainy} @attribute temperature real @attribute humidity real @attribute windy {TRUE, FALSE} @attribute play {yes, no} @data sunny,85,85,FALSE,no sunny,80,90,TRUE,no overcast,83,86,FALSE,yes rainy,70,96,FALSE,yes rainy,68,80,FALSE,yes rainy,65,70,TRUE,no overcast,64,65,TRUE,yes sunny,72,95,FALSE,no sunny,69,70,FALSE,yes rainy,75,80,FALSE,yes sunny,75,70,TRUE,yes overcast,72,90,TRUE,yes