-1

I need to do Logistic Regression using Python, but I have constantly comunicate as below when I try to apply the logistic regression. Please help me, what should I do? I can add that I have already installed sklearn.

C:\Users\John12\Anaconda3\lib\site-packages\sklearn\linear_model\logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning. FutureWarning)

dingaro
  • 2,156
  • 9
  • 29
  • Please first try something and then post your question here. – Sachith Muhandiram Nov 20 '19 at 02:58
  • 1
    Possible duplicate of [How do I solve the future warning -> % (min\_groups, self.n\_splits)), Warning) in python?](https://stackoverflow.com/questions/52640386/how-do-i-solve-the-future-warning-min-groups-self-n-splits-warning-in) – PV8 Nov 20 '19 at 07:12

2 Answers2

1

Go to where you implement your LR and make sure you add the following. Please provide code next time

# create and configure model
model = LogisticRegression(solver='lbfgs')
Xhuliano Brace
  • 121
  • 1
  • 9
0

This is not an error, this is a warning. There is a good post about it: How do I solve the future warning -> % (min_groups, self.n_splits)), Warning) in python?.

Your warning means that the default solver will change in another version of your library.

One way is to ignore the warning (not recommended):

import warnings
warnings.filterwarnings("ignore", category=FutureWarning)

And the other one is to specifiy your solver:

model = LogisticRegression(solver='lbfgs')

When you specified your solver, you will not have the problem that the defaul solver (when you don't specifiy anything) will be changed in the next version...

PV8
  • 5,799
  • 7
  • 43
  • 87