I’m trying to implement a multiclass logistic regression classifier that distinguishes between k different classes. This is my code. I can verify that cost and gradient are returning values that are in the right dimension (cost returns a scalar, and gradient returns a 1 by n row vector), but i get the error why is this happening and how can
Tag: logistic-regression
statsmodels logistic regression odds ratio
I’m wondering how can I get odds ratio from a fitted logistic regression models in python statsmodels. Answer You can get the odds ratio with: To also get the confidence intervals (source): Disclaimer: I’ve just put together the comments to your question.
sklearn Logistic Regression “ValueError: Found array with dim 3. Estimator expected <= 2."
I attempt to solve this problem 6 in this notebook. The question is to train a simple model on this data using 50, 100, 1000 and 5000 training samples by using the LogisticRegression model from sklearn.linear_model. This is the code i trying to do and it give me the error. Any idea? Answer scikit-learn expects 2d num arrays for the