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

0
votes
1answer
13 views

How to learn from time series with multiple values for each time points

A multivariate time-serie has more than one time-dependent variable and it is my case. Still for each time I have not one entrie of dependent variables but many entries, like: ...
0
votes
1answer
8 views

In handwritten digit recognition problem using logistic regression, what changes needed to add another class “Not a Digit”

In handwritten digit recognition problem using logistic regression, normal implementation would forcibly classify even a picture of dog or cat as a digit. To eliminate this, what changes are needed to ...
0
votes
0answers
20 views

Perceptron on Logistic Regression

I have already did the training for the data but I am not sure how to do the rest. I just need someone to explain how I should proceed? Implement a perceptron for logistric regression. For your ...
3
votes
2answers
39 views
-1
votes
0answers
19 views

Logistic Regression with Non-Integer feature value

Hi I was following the Machine Learning course by Andrew Ng. I found that in regression problems, specially logistic regression they have used integer values for the features which could be plotted in ...
0
votes
1answer
24 views

Logistic regression from scratch in Python

Here is my logisticRegression class I developed to do gradient descent. There is this one line I marked as problematic ...
0
votes
1answer
17 views

logistic regression score is negative

I am trying to implement logistic regression algorithm. I am using sklearn for this purpose.When I am printing the accuracy its printing negative value. code: ...
0
votes
1answer
24 views

How does combining neurons create non-linear boundaries?

I have been working with NNs for a while, but haven't dug too deep into this unfortunately. By looking at the three neurons below, in each of their boxes we can see that they are really just making ...
0
votes
0answers
15 views

Baseline for Multinomial Logistic Regression in Scikit-learn

I am trying to get the coefficients for my multinomial logistic regression model in Sklearn . However, I am confused what is the baseline if I have more than 2 targets. I need to know since I need to ...
1
vote
0answers
19 views

Logistic Regression with Tensorflow

Is this the correct Estimator for Logistic Regression in TF 1.10? There used to be a function called: LogisticRegressor which is deprecated In README.md file it ...
0
votes
2answers
52 views

C++ return array from function

I would like to implement machine learning algorithm in C++ without using any C++ machine learning library. So I'm writing this initializer function for generating zero matrices but can't figure out ...
0
votes
0answers
13 views

How to choose Elastic-Net parameters for feature selection?

I recently came across using elastic nets for feature selection which brings in regularization to temper the sparsity properties of L1 regressions. I would like to learn how to use elastic nets for ...
1
vote
0answers
30 views

comparison of linear Q-learning and DQN

I saw in DQN nature paper 2015 https://www.nature.com/articles/nature14236(Extended Data Table 4) some comparisons between DQN and linear Q-learning. The ratio ...
1
vote
1answer
17 views

Free parameters in logistic regression

When applying logistic regression, one is essentially applying the following function $1/(1 + e^{\beta x})$ to provide a decision boundary, where $\beta$ are a set of parameters that are learned by ...
0
votes
0answers
13 views

Comparing the performance (reward) of dqn and logistic q-learning?

I have tried to compare my DQN results (rewards) with logistci q-learning (omitting the hidden layer, just inputs and outputs with a sigmoid activation function) My rewards of logistic-Q-N is about 5-...
0
votes
2answers
39 views

Logistic Regression Cost Function: Gives mathematical error since its attempting to calculate log(0)

I am learning machine learning and after reading through materials on logistic regression i attempted to implement logistic regression with gradient descent in python from scratch. It works well for ...
1
vote
1answer
75 views

Dealing with NaN (missing) values for Logistic Regression- Best practices?

I am working with a data-set of patient information and trying to calculate the Propensity Score from the data using MATLAB. After removing features with many missing values, I am still left with ...
1
vote
1answer
22 views

best activation function for ensemble?

i have created some logistic regression model (different preprocessing) with softmax function. and i mix all model with an ensemble with a hierarchical method. so the output of all model (base) will ...
1
vote
1answer
28 views

Target data values are not evenly distributed

Data nature: I have features with 10 numeric type, and other 10 categorical, with a lot of values, at the end, using one-hot encoding I got a matrix of 600 columns. My problem is with accuracy ...
2
votes
1answer
140 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) ...
1
vote
1answer
63 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
22 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
80 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
24 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
57 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
240 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
17 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
81 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
38 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
34 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
44 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
203 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
37 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
30 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
28 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
12 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
62 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
30 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
131 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
388 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
14 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
88 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
10 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
24 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
261 views
1
vote
1answer
69 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: $$...
10
votes
3answers
669 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
209 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 ...