FitFailedWarning when using LogisticRegression

Thanks Inria team for this great mooc its very helpful for learning machine learning.

warnings.warn(some_fits_failed_message, FitFailedWarning)

I am getting this warning when I am trying to implement on my own computer, did anyone experience similar thing and has found.

Can you please provide a snippet of the code that is raising the warning?

Additionally, please run the following code locally

import sklearn; sklearn.show_versions()

and paste the output below.

System:
python: 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0]
executable: /home/anam_zahra/yes/envs/json_manip/bin/python
machine: Linux-5.14.0-1032-oem-x86_64-with-glibc2.17

Python dependencies:
pip: 21.3.1
setuptools: 58.0.4
sklearn: 1.0.2
numpy: 1.22.3
scipy: 1.8.0
Cython: None
pandas: 1.3.5
matplotlib: 3.5.1
joblib: 1.1.0
threadpoolctl: 3.1.0

Built with OpenMP: True

model = Pipeline(steps=[
(“preprocessor”, StandardScaler()),
(“classifier”, LogisticRegression())
])

This is leading to warning/error

We will need a bit more information. Basically, we need the code that when we copy-paste it, we will get the error ourselves. Indeed, we would need the lines that load the dataset, the line that creates the model (this the ones that you gave us) and the lines that run the cross-validation that raise the error.

Indeed, the warning should be raised together with the error that was raised in the fold that gives more details. But if you provide us with the code that I requested above, we will be able to reproduce the problem and answer your question.

Ok! I can share the code. Is it possible to mail

You can share it in this post. It would be better if someone has the same issue.

@anam_zahra Please simplify the code as much as possible to craft what we call a minimal reproducer.

Here is a guide to do this:

Crafting good minimal reproducers is actually the most important software engineering skill to get when working in teams.

You can use triple backticks to include code snippets in the forum. Highlight a block of code and hit “ctrl-E”. Here is an example:

import sklearn

sklearn.show_versions()
...