How do I solve the future warning -> % (min_groups, self.n_splits)), Warning) in python?
If you want to ignore it, add the following to your code at the top:
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
Else specify solver as so:
LogisticRegression(solver='lbfgs')
Source:
solver : str, {‘newton-cg’, ‘lbfgs’, ‘liblinear’, ‘sag’, ‘saga’}, default: ‘liblinear’.
Algorithm to use in the optimization problem.
For small datasets, ‘liblinear’ is a good choice, whereas ‘sag’ and ‘saga’ are faster for large ones.
For multiclass problems, only ‘newton-cg’, ‘sag’, ‘saga’ and ‘lbfgs’ handle multinomial loss; ‘liblinear’ is limited to one-versus-rest schemes.
‘newton-cg’, ‘lbfgs’ and ‘sag’ only handle L2 penalty, whereas ‘liblinear’ and ‘saga’ handle L1 penalty.
If you are using Logistic Regression Model having penalty='l1' as hyper-parameter you can use solver='liblinear'
My Code sample::
logistic_regression_model=LogisticRegression(penalty='l1',dual=False,max_iter=110, solver='liblinear')