Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [logistic-regression]

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

1
vote
1answer
7 views

TypeError: object of type 'int' has no len(), LogisticRegression()

I'm trying to fit my Logistic Regression model, but I'm running into an error that I don't understand. Looked around and haven't found a straight answer. Shape of independent features (X): (495,30) ...
0
votes
0answers
17 views

Capturing movement importance - logistic regression output

I'm studying some event for a set of objects that can be plotted on a square $[0, 100] ^ 2$. I have used logistic regression to calculate probabilities that event occur for different objects and the ...
1
vote
1answer
16 views

Why is the logistic regression decision boundary linear in X?

The logistic regression model, \begin{equation} \operatorname{p}(X) = \frac{\operatorname{e}^{\beta_0 + \beta_1 X}}{1 + \operatorname{e}^{\beta_0 + \beta_1 X}} \end{equation} is said to create a ...
1
vote
2answers
65 views

What are the differences between logistic and linear regression?

I know that linear regression does "regression" and logistic regression does "classification". When we implement these two methods, the only difference I could notice is the loss function: linear ...
0
votes
1answer
17 views

Super basic logistic regression example

I am new to ML and I created a super basic logistic regression example with 4 points on the $x$ line that belong to two classes: ...
0
votes
1answer
17 views

MinMaxScaler returned values greater than one

Basically I was looking for a normalization function part of sklearn, which is useful later for logistic regression. Since I have negative values, I chose MinMaxScaler with like so: ...
1
vote
1answer
25 views

What is the difference between SGD classifier and the Logisitc regression?

To my understanding, the SGD classifier, and Logistic regression seems similar. An SGD classifier with loss = 'log' implements Logistic regression and loss = 'hinge' implements Linear SVM. I also ...
0
votes
0answers
11 views

Can I use MCA on categorical features, and PCA on numeric then combine both for learning

So all is said in the title. I have a mix of both categorical and numeric features, both are more than 20 columns and reside in the same data-set. I am using PCA solution from sklearn.decomposition ...
1
vote
1answer
64 views

Purpose of backpropagation in neural networks

I've just finished conceptually studying linear and logistic regression functions and their optimization as preparation for neural networks. For example, say we are performing binary classification ...
0
votes
1answer
19 views

Confusion Matrixs for Binary classifier

I am new to modeling, and I am practicing building a logistic regression model. I would like to create a confusion matrix, but my code doesn't seem to work. Here is the code for the model (which ...
0
votes
1answer
32 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
1answer
29 views

Why does Bagging or Boosting algorithm give better accuracy than basic Algorithms in small datasets?

I was working with a small dataset, with 392 values, and it was kind of an imbalanced dataset, with 262 values belonging to class 1 and rest 130 to class 0. So I did the upsampling technique, ...
0
votes
1answer
47 views

Should highly correlated features be omitted before applying Lasso?

I would greatly appreciate if you could let me know whether I should omit highly correlated features before using Lasso logistic regression (L1) to do feature ...
0
votes
1answer
21 views

Classification models with multi-class allowed for each record

I am training a multi-class classification model. Each record can belong to one or more classes. (actually can I still call it a classification model? or should it ...
1
vote
1answer
24 views

Logistic Regression or regression SVM for probability of outcome

I am working on a prediction question: what's the percentage of Y = 1 using a number of features? The output Y values I have for training are in binary. In this case, should the prediction be ...
2
votes
1answer
22 views

Gradient descent multidimensional linear regression - does learning rate affects concurrency? [closed]

I wonder if gradient descent for multidimensional regression always finds the right result? I feel like this doesn't always have to be true. I have done some calculations and actually got correct ...
0
votes
0answers
9 views

Octave fminunc error: “Trust region radius became excessively small”

I am trying to run a linear regression using fminunc to optimize my parameters. However, while the code never fails, the fminunc function seems to only be running once and not converging. The exit ...
0
votes
0answers
27 views

Logistic Regression sklearn vs matlab Different Answers

Years ago I built a model in Matlab that used glmfit(X, Y, 'binomial, 'link', 'logit') and I am now trying to transfer the model to python using sklearn (i.e sklear.linear_model.LogisticRegression). ...
0
votes
2answers
27 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
0answers
58 views

Machine Learning: Stochastic gradient descent method for logistic regression in R

I am trying to write a code to solve the following problem (As stated in HW5 in the CalTech course Learning from Data): In this problem you will create your own target function f (probability in this ...
1
vote
0answers
209 views

How does binary cross entropy work?

Let's say I'm trying to classify some data with logistic regression. Before passing the summed data to the logistic function (normalized in range $[0,1]$), weights must be optimized for desirable ...
0
votes
0answers
11 views

Direct Mail Response Modelling

Hi, I have a question regarding Direct Mail response model performance. I created a model based on previous DM campaign responders and non-responders. Applied it on the new prospects and calculated ...
1
vote
1answer
41 views

Why is patsy used to prepare data for logistic regression?

I'm pretty new to both ML & scikit-learn. I've noticed that some example tutorials & codes online use patsy's dmatrices to prepare data for logistic regression. I don't understand why this is ...
0
votes
0answers
7 views

Kernel Logistic Regression: Training vs Test Kernel

I'm currently implementing the Kernel Logistic Regression (KLR) for binary classification. I have split my data sets into training and testing with the number of test observations far greater than the ...
0
votes
0answers
21 views

How to format data for localized image classification in Keras?

I have a bunch of image files and, for each image, an associated csv file that contains coordinates, and a label. This indicates a label of a specific part of the image. I want to train a neural ...
0
votes
0answers
134 views
1
vote
1answer
30 views

Interpreting lasso logistic regression feature coefficients in multiclass problem

I have a dataset with a large number of text features, where the target variable has three classes. I have encoded the features using tf-idf. This has resulted in a dataset with an extremely large ...
1
vote
0answers
15 views

When should the bias b be updated with weights w and when should it be updated seperately?

It seems in some Machine Learning models, the bias term $b$ is updated just like other weights $w_i, i=1...n$. For example, in Logistic Regression, using SGD, $b \ \text{or} \ w_0$ is updated with: $$...
9
votes
3answers
589 views

Is this a good practice of feature engineering?

I have a practical question about feature engineering... say I want to predict house prices by using logistic regression and used a bunch of features including zip code. Then by checking the feature ...
1
vote
1answer
91 views

Why do we need the sigmoid function in logistic regression?

What is the purpose of the logistic sigmoid function as it is used in logistic regression? Why does it need to be part of the hypothesis function h(x) ? As I understand it, the logistic sigmoid ...
0
votes
1answer
43 views

Regression equation for ordinal data

I'm doing research where a part of the collected data is of Ordinal type. I will implement ANN with Logistic Regression function in the Activation function. What I have learnt from documents of other ...
4
votes
0answers
84 views

How are ANN's, RNN's related to logistic regression and CRF's?

This question is about placing the classes of neural networks in perspective to other models. In "An Introduction to Conditional Random Fields" by Sutton and McCallum, the following figure is ...
1
vote
1answer
41 views

Estimating Propensity Score via Regression Trees (in R Using rpart)

I am trying to estimate propensity scores in R. By this I mean that I am trying to estimate probability that an individual selects into treatment, where the selection into treatment is a binary ...
3
votes
2answers
48 views

Adding new variable to model

Let's say I already have a logistic regression model (or other) with N number of explanatory variables and is 70% accurate. Now if there are other variables available, how would I test if the new ...
2
votes
0answers
11 views

Analysis of factors that have impact on explanatory variable [closed]

for my master thesis I am analyzing stock outs. I want to find out what factors played key roles that finally led to a stock out or (will) lead to a high stockout probability, for example late ...
8
votes
2answers
153 views

The differences between SVM and Logistic Regression

I am reading about SVM and I've faced to the point that non-kernelized SVMs are nothing more than linear separators. Therefore, ...
2
votes
0answers
27 views

What Is The Difference Between Additive Natural Cubic Splines and Tensor Product Natural Cubic Splines?

Good day. Taking into account the picture shown, using tensor product is computationally expensive considering the fact that it has higher dimensions. I am just thinking why it is compared both ...
3
votes
1answer
99 views

Why Root Finding is important in Logistic Regression? (i.e. Newton Raphson)

I'd like to ask what is the main reason why we find the roots in logistic regression (i.e. why we use Newton Raphson method on logistic regression ). I understand the basics of Newton Raphson method, ...
1
vote
0answers
29 views

Multi class logistic regression performs bad on certain classes

I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, ...
2
votes
0answers
39 views

logistic regression

I am writing a scientific paper that - among other things - deals with logistic regression in the context of machine learning. I read this article where the author states that, given a set of instance-...
13
votes
1answer
88 views

What is meant by sharing of parameters between features and classes

When reading this paper there is a line which says "linear classifiers do not share parameters among features and classes." What is the meaning of this statement? Does it mean that linear ...
1
vote
2answers
48 views

Which learning algorithms to use in what order - dimensionality reduction, bayesian network structure, regression?

The data is a huge set of observations of dozens of variables, all (potentially, somehow) related to a dichotomous outcome variable, and all (potentially) correlated to each other, or to unknown / ...
0
votes
0answers
165 views

Softmax regression cost function and Logistic regression cost function not giving same value?

I'm writing a python program for Softmax regression using equations found here. According to this, the cost function of a Softmax classifier \begin{align} J(\theta) = - \frac{1}{m} \left[ \sum_{i=1}^{...
1
vote
2answers
54 views

Is there a quick way to check for multicollinearity between categorical variables in R?

I have a large amount of categorical and dummy variables (36) and I would like to remove a number of them based on their multicollinearity (or just collinearity). Instead of using Chi Square tests ...
-1
votes
1answer
246 views

Predict_proba and confusion matrix result interpretaion with Logistic regression in Python

I have a credit data set, and I need to find the probability of credit balance >1500 for given 2 sets of values My code is the following 1- Confusion Matrix results confusion_matrix(y,y_pred) array([[...
1
vote
1answer
33 views

Logistic regression if 3 categories in outcome variable

Logistic regression is generally performed if there are 2 categories in outcome variables. I just tried it for iris dataset with species as y variable which has 3 categories. I used following code: <...
0
votes
1answer
54 views

predict() function in R

While predicting, what happens if we pass the newdata along with the target variable? Do we need to isolate the target variable before feeding into predict function?...
0
votes
0answers
84 views

Logistic Regression: finding the decision boundary

I implemented my own Logisitic regression model using the Newton method. Orginally my X is 462*8 and Y is 462*1. Now after ...
0
votes
0answers
30 views

Logistic regression for text relationship data

I have two columns of text, one is the subject and one column is the message. The dataset has labels: related and unrelated (means that if the subject related or not related to the message). In ...