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

Update linear_assignment.py #1

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

Conversation

HarshTomar1234
Copy link

"This pull request updates the import statement for the linear assignment function. The change is necessary because the previously used linear_assignment function from sklearn.utils.linear_assignment_ has been deprecated and removed in recent versions of scikit-learn.

The updated import statement:

from scipy.optimize import linear_sum_assignment as linear_assignment

replaces the old import:

from sklearn.utils.linear_assignment_ import linear_assignment

This change offers several benefits:

  1. It resolves the ModuleNotFoundError that occurs with newer versions of scikit-learn.
  2. It uses the linear_sum_assignment function from SciPy, which is the recommended replacement for sklearn's deprecated linear_assignment.
  3. By using as linear_assignment, we maintain compatibility with the existing codebase, minimizing necessary changes.

"This pull request updates the import statement for the linear assignment function. The change is necessary because the previously used `linear_assignment` function from `sklearn.utils.linear_assignment_` has been deprecated and removed in recent versions of scikit-learn.

The updated import statement:
```python
from scipy.optimize import linear_sum_assignment as linear_assignment
```

replaces the old import:
```python
from sklearn.utils.linear_assignment_ import linear_assignment
```

This change offers several benefits:
1. It resolves the ModuleNotFoundError that occurs with newer versions of scikit-learn.
2. It uses the `linear_sum_assignment` function from SciPy, which is the recommended replacement for sklearn's deprecated `linear_assignment`.
3. By using `as linear_assignment`, we maintain compatibility with the existing codebase, minimizing necessary changes.
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