Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fixed bug handling multi-class classification #19427

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 3 commits into
base: main
Choose a base branch
Loading
from
Open

Fixed bug handling multi-class classification #19427

wants to merge 3 commits into from

Conversation

isaacknjama
Copy link
Contributor

@isaacknjama isaacknjama commented Feb 10, 2021

Reference Issues/PRs

#19270

What does this implement/fix? Explain your changes.

Fixes a bug in the function handling multi-class classification by reducing the fixed value of the ovr_decision_function, which is too large.

@isaacknjama isaacknjama changed the title Fixed bug handling mulit-class classification Fixed bug handling multi-class classification Feb 10, 2021
@ogrisel
Copy link
Member

ogrisel commented Feb 20, 2021

We would need to adjust the OVO related tests to also expect this shift by (n_classes - 1) / 2.

Also as discussed in #19270 (comment) we probably need to go through a deprecation cycle.

@reshamas
Copy link
Member

#DataUmbrella
@Mariam-ke

@Mariam-ke
Copy link
Contributor

@icky254 How is this PR going? Please let us know if we can answer any questions.

cc: @reshamas

@isaacknjama
Copy link
Contributor Author

I'm having a bit of a challenge. I seem to have lost my PR from my local repo. How can I get this PR to my repo?

@cmarmo
Copy link
Contributor

cmarmo commented Mar 11, 2021

Hi @icky254,

How can I get this PR to my repo?

assuming you have configured your remote as origin, from your local repo the command

$ git checkout -b bug-fix-ovr-decision-function -t origin/bug-fix-ovr-decision-function

will create a new branch named bug-fix-ovr-decision-function tracking the remote branch origin/bug-fix-ovr-decision-function and put you in this new branch.
Then you will probably need to synchronize with upstream/main.
Let me know if this solves your issue.

@isaacknjama
Copy link
Contributor Author

It's good now. Thanks.

@reshamas
Copy link
Member

@isaack-mungui
Are you still working on this? Do you know how to check where the tests are failing?

@isaacknjama
Copy link
Contributor Author

@isaack-mungui
Are you still working on this? Do you know how to check where the tests are failing?

@reshamas I am working on it. I'll make a commit soon.

@isaacknjama
Copy link
Contributor Author

isaacknjama commented May 3, 2021

I'm trying to run pytest, but getting the following error:
ImportError while loading conftest '/home/isaack/Documents/scikit-learn/conftest.py'. conftest.py:14: in <module> from sklearn.utils import _IS_32BIT sklearn/__init__.py:81: in <module> from . import __check_build # noqa: F401 sklearn/__check_build/__init__.py:46: in <module> raise_build_error(e) sklearn/__check_build/__init__.py:41: in raise_build_error %s""" % (e, local_dir, ''.join(dir_content).strip(), msg)) E ImportError: No module named _check_build E ___________________________________________________________________________ E Contents of /home/isaack/Documents/scikit-learn/sklearn/__check_build: E setup.py __init__.py _check_build.cpython-38-x86_64-linux-gnu.so E __init__.pyc __pycache__ _check_build.c E _check_build.pyx E ___________________________________________________________________________ E It seems that scikit-learn has not been built correctly. E E If you have installed scikit-learn from source, please do not forget E to build the package before using it: run python setup.py installor E make in the source directory. E E If you have used an installer, please check that it is suited for your E Python version, your operating system and your platform.

I followed the steps in https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source but face the following error upon running step 5:
`Traceback (most recent call last):
File "", line 1, in
File "sklearn/init.py", line 81, in
from . import __check_build # noqa: F401
File "sklearn/__check_build/init.py", line 46, in
raise_build_error(e)
File "sklearn/__check_build/init.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: No module named _check_build


Contents of sklearn/__check_build:
setup.py init.py _check_build.cpython-38-x86_64-linux-gnu.so
init.pyc pycache _check_build.c
_check_build.pyx


It seems that scikit-learn has not been built correctly.

If you have installed scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install or
make in the source directory.

It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.`

Where am I going wrong with this?

@cmarmo
Copy link
Contributor

cmarmo commented May 3, 2021

Hi @isaack-mungui I have been there without knowing how to solve :(.
My suggestion is to clean your installaton with

$ git clean -xdf

all files related to the build should disappear, but you can check that all __pycache__ has been removed (just to be sure).
Then start from scratch... are you using conda or a python venv?

@isaacknjama
Copy link
Contributor Author

@cmarmo I managed to fix it. I ran git clean -xdf and observed that beginning the process anew <- https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source -> worked as it should(including setting up conda).

@lorentzenchr lorentzenchr added Needs Decision Requires decision Breaking Change Issue resolution would not be easily handled by the usual deprecation cycle. and removed Needs Decision - Backward Compatibility labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Issue resolution would not be easily handled by the usual deprecation cycle. module:utils Needs Decision Requires decision Sprint Stalled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.