Skip to content

fix: ensure scikit-learn package name consistency in library imports #681

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HarshaVardhanMannem
Copy link

Fix: Correct scikit-learn package name in dependency installation

Problem

When users try to import sklearn in their evaluation scripts, they might get confused about the correct package name for installation.

Solution

Added logic to ensure users are directed to install the correct package name scikit-learn instead of sklearn when dependencies are missing.

#Previous Import error message:
ImportError: To be able to use evaluate-metric/accuracy, you need to install the following dependencies['scikit-learn'] using 'pip install sklearn' for instance'

#Correct Import error message:
ImportError: To be able to use evaluate-metric/accuracy, you need to install the following dependencies['scikit-learn'] using 'pip install scikit-learn' for instance'

Changes

library_import_name = "scikit-learn" if library_import_name == "sklearn" else library_import_name
library_import_path = "scikit-learn" if library_import_name == "scikit-learn" else library_import_path

Impact

Users will now receive the correct installation command (pip install scikit-learn) instead of the incorrect one (pip install sklearn) when the package is not installed, preventing confusion and ensuring successful package installation.

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

Successfully merging this pull request may close these issues.

1 participant