NBA-Predict
NBA-Predict copied to clipboard
Newer version of scikit learn
Hi,
first, this is a great project. Huge thanks for that :)
Second, do you know what do we have to change in the code if we want to use a newer version of scikit learn because currently we get an error saying no module named 'sklearn.linear_model.logistic'
Thanks
just install the new version with pip3 install sklearn
But I thought it has to be 0.21.2 to work. As I mentioned, I have a 1.1 version installed and I received an error no module named 'sklearn.linear_model.logistic
Hi,
first, this is a great project. Huge thanks for that :)
Second, do you know what do we have to change in the code if we want to use a newer version of scikit learn because currently we get an error saying no module named 'sklearn.linear_model.logistic'
Thanks
Hi, I have the same error
this works for me try pip3 install "scikit_learn==0.22.2.post1" then let me know
I have the same issue and the installation of 0.22.2 is not available should I create a new model using Createmodel or is there other way to change the .PKL file
error message as follow:
Collecting scikit_learn==0.22.2.post1 Using cached scikit-learn-0.22.2.post1.tar.gz (6.9 MB) Preparing metadata (setup.py) ... done Requirement already satisfied: numpy>=1.11.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from scikit_learn==0.22.2.post1) (1.23.4) Requirement already satisfied: scipy>=0.17.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from scikit_learn==0.22.2.post1) (1.6.1) Requirement already satisfied: joblib>=0.11 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from scikit_learn==0.22.2.post1) (1.0.1) Installing collected packages: scikit_learn Attempting uninstall: scikit_learn Found existing installation: scikit-learn 0.24.1 Uninstalling scikit-learn-0.24.1: Successfully uninstalled scikit-learn-0.24.1 DEPRECATION: scikit_learn is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for scikit_learn ... error error: subprocess-exited-with-error
× Running setup.py install for scikit_learn did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
Partial import of sklearn during the build process.
C:\Windows\Temp\pip-install-j6z6zqkh\scikit-learn_1a2e5be4bd0d4546b1997be16ad664ea\setup.py:123: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.command.build_ext import build_ext # noqa
Traceback (most recent call last):
File "C:\Windows\Temp\pip-install-j6z6zqkh\scikit-learn_1a2e5be4bd0d4546b1997be16ad664ea\sklearn\_build_utils\__init__.py", line 32, in _check_cython_version
import Cython
ModuleNotFoundError: No module named 'Cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Windows\Temp\pip-install-j6z6zqkh\scikit-learn_1a2e5be4bd0d4546b1997be16ad664ea\setup.py", line 303, in <module>
setup_package()
File "C:\Windows\Temp\pip-install-j6z6zqkh\scikit-learn_1a2e5be4bd0d4546b1997be16ad664ea\setup.py", line 299, in setup_package
setup(**metadata)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "C:\Windows\Temp\pip-install-j6z6zqkh\scikit-learn_1a2e5be4bd0d4546b1997be16ad664ea\setup.py", line 180, in configuration
_check_cython_version()
File "C:\Windows\Temp\pip-install-j6z6zqkh\scikit-learn_1a2e5be4bd0d4546b1997be16ad664ea\sklearn\_build_utils\__init__.py", line 35, in _check_cython_version
raise ModuleNotFoundError(message)
ModuleNotFoundError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of scikit-learn
Moving to c:\users\user\appdata\local\programs\python\python39\lib\site-packages\scikit_learn-0.24.1.dist-info
from C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\site-packages~cikit_learn-0.24.1.dist-info
Moving to c:\users\user\appdata\local\programs\python\python39\lib\site-packages\sklearn
from C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\site-packages~klearn
error: legacy-install-failure
× Encountered error while trying to install package. ╰─> scikit_learn
note: This is an issue with the package mentioned above, not pip.
are you using python3 or python2
i just ran it and results are below
homeTeamWinProb | winProbPercent | awayTeamWinProb | AwayTeamWinProb |
---|---|---|---|
Cleveland Cavaliers | 0.8377 | Orlando Magic | 0.1623 |
Detroit Pistons | 0.3882 | Atlanta Hawks | 0.6118 |
New York Knicks | 0.5458 | Charlotte Bobcats | 0.4542 |
Toronto Raptors | 0.6039 | Philadelphia 76ers | 0.3961 |
Milwaukee Bucks | 0.8002 | New Jersey Nets | 0.1998 |
Chicago Bulls | 0.6392 | Indiana Pacers | 0.3608 |
Minnesota Timberwolves | 0.5451 | San Antonio Spurs | 0.4549 |
Utah Jazz | 0.7733 | Houston Rockets | 0.2267 |
Denver Nuggets | 0.7117 | Los Angeles Lakers | 0.2883 |
Portland Trail Blazers | 0.796 | Miami Heat | 0.204 |
my output is different because im using the details for another program i needed decimals..
I checked the env nd it's python 3.9.2 wat other in do you need?
I think the main error code is this
DEPRECATION: scikit_learn is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
but --use-pep517 doesn't solve it
From what I remember, the logistic regression model in scikit_learn that was used in this project was deprecated some point after 0.21.2. This means that if you want to make sure the code works as is, you'll need to use 0.21.2. If you want to use a different model or something from the more recent scikit versions, you'd likely have to go through and change some of the code in createModel.py.
The project works correctly for me..