Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 0 #57

Open
marianafdz465 opened this issue Jul 13, 2022 · 0 comments

Comments

@marianafdz465
Copy link

Hi, I am trying to run this code

#initiate deduplication
df_final = pandas_dedupe.dedupe_dataframe(df1,['name', 'address1'])

#send output to csv
df_final.to_csv('deduplication_output.csv')

My data frame has 143 rows, and I found 3 duplicated rows. But when I tried to run this, I got this error:

7 fits failed with the following error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sklearn/model_selection/_validation.py", line 680, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/usr/local/lib/python3.7/dist-packages/sklearn/linear_model/_logistic.py", line 1558, in fit
    % classes_[0]
ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 0

  warnings.warn(some_fits_failed_message, FitFailedWarning)
/usr/local/lib/python3.7/dist-packages/sklearn/model_selection/_search.py:972: UserWarning: One or more of the test scores are non-finite: [nan nan nan nan nan nan nan]
  category=UserWarning,
Clustering...
# duplicate sets 143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant