qmac / nba-predictor-ann

Neural network AI to analyze/predict NBA games
6 stars 3 forks source link

from neat.nn import nn_pure as nn is not working #1

Closed Sandy4321 closed 8 years ago

Sandy4321 commented 8 years ago

file nba_predict.py can not be run from neat import config from neat import genome from neat import population these are ok but from neat import chromosome Traceback (most recent call last): File "", line 1, in ImportError: cannot import name chromosome when folder does not have file chromosome.py neat-python-master\neat\ ctrnn\ ifnn\ iznn\ nn\ init.py config.py diversity.py genes.py genome.py indexer.py math_util.py population.py species.py visualize.py

qmac commented 8 years ago

Where did you get this version of the NEAT library? This project was meant to run using https://code.google.com/p/neat-python/ or https://github.com/neat-python/neat-python. You may be using a more updated version thought, let me know.

qmac commented 8 years ago

Now, I'm actually guessing you just used pip install neat-python to get NEAT. The source code for that version (0.5) of the library is at https://github.com/CodeReclaimers/neat-python.

I will probably not write any code to support this version of the library. Alternatively, you can install version 0.1 using pip install neat-python==0.1. The code in this repository should work then.

Sandy4321 commented 8 years ago

Quinn McNamara thank you very much for help so I did it :pip install neat-python==0.1

and got


C:\Users\Sander> pip install neat-python==0.1 Collecting neat-python==0.1 Requirement already satisfied (use --upgrade to upgrade): matplotlib in c:\anaco nda\lib\site-packages (from neat-python==0.1) Requirement already satisfied (use --upgrade to upgrade): graphviz in c:\anacond a\lib\site-packages (from neat-python==0.1) Installing collected packages: neat-python Found existing installation: neat-python 0.4 Uninstalling neat-python-0.4: Successfully uninstalled neat-python-0.4 Successfully installed neat-python Traceback (most recent call last): File "C:\Anaconda\Scripts\pip-script.py", line 5, in sys.exit(main()) File "C:\Anaconda\lib\site-packages\pipinit.py", line 230, in main return command.main(cmd_args) File "C:\Anaconda\lib\site-packages\pip\basecommand.py", line 248, in main pip_version_check(session) File "C:\Anaconda\lib\site-packages\pip\utils\outdated.py", line 102, in pip_v ersion_check installed_version = get_installed_version("pip") File "C:\Anaconda\lib\site-packages\pip\utilsinit.py", line 858, in get_i nstalled_version working_set = pkg_resources.WorkingSet() File "C:\Anaconda\lib\site-packages\pip_vendor\pkg_resourcesinit.py", li ne 629, in init self.add_entry(entry) File "C:\Anaconda\lib\site-packages\pip_vendor\pkg_resourcesinit.py", li ne 685, in add_entry for dist in find_distributions(entry, True): File "C:\Anaconda\lib\site-packages\pip_vendor\pkg_resourcesinit.py", li ne 2075, in find_eggs_in_zip if metadata.has_metadata('PKG-INFO'): File "C:\Anaconda\lib\site-packages\pip_vendor\pkg_resourcesinit.py", li ne 1605, in has_metadata return self.egg_info and self._has(self._fn(self.egg_info, name)) File "C:\Anaconda\lib\site-packages\pip_vendor\pkg_resourcesinit.py", li ne 1963, in _has return zip_path in self.zipinfo or zip_path in self._index() File "C:\Anaconda\lib\site-packages\pip_vendor\pkg_resourcesinit.py", li ne 1843, in zipinfo return self._zip_manifests.load(self.loader.archive) File "C:\Anaconda\lib\site-packages\pip_vendor\pkg_resourcesinit.py", li ne 1783, in load mtime = os.stat(path).st_mtime WindowsError: [Error 2] The system cannot find the file specified: 'C:\Anaconda \lib\site-packages\neat_python-0.4-py2.7.egg'


what is my next step? how to check if all ok? some simple test to check functionality pls... Thanks Sander

On Fri, Dec 11, 2015 at 2:27 PM, Quinn McNamara notifications@github.com wrote:

Closed #1 https://github.com/qmac/nba-predictor-ann/issues/1.

— Reply to this email directly or view it on GitHub https://github.com/qmac/nba-predictor-ann/issues/1#event-489694959.

Sandy4321 commented 8 years ago

Quinn McNamara

1 now when I run testing.py from nba-predictor-ann-maste

I got error nba-predictor-ann\nba-predictor-ann-master\neat-python-read-only\testing.py", line 8, in file = open("winner_chromosome_mov")

IOError: [Errno 2] No such file or directory: 'winner_chromosome_mov'

2

by the where you took file eras\data\nbaallelo.csv from?

Thanks Sander

On Fri, Dec 11, 2015 at 2:25 PM, Quinn McNamara notifications@github.com wrote:

Now, I'm actually guessing you just used pip install neat-python to get NEAT. The source code for that version of the library is at https://github.com/CodeReclaimers/neat-python. I will probably not write anything to change the code to this version. Alternatively you can install version 0.1 using pip by using pip install neat-python==0.1. The code in this repository should work then.

— Reply to this email directly or view it on GitHub https://github.com/qmac/nba-predictor-ann/issues/1#issuecomment-164026008 .

qmac commented 8 years ago

Sorry, I just fixed the incorrect file names in testing.py. I wrote this code awhile ago and didn't do a great job documenting/making easy to use.

The csv file in nba-analysis I got from https://github.com/fivethirtyeight/data/blob/master/nba-elo/nbaallelo.csv

Did you get the pip install thing taken care of? I'm not sure what the issue could be for you, mine's working fine now.

qmac commented 8 years ago

You must also first run python nba_predict.py to train the network. The network is then serialized into the file "winner_chromosome". Afterwards, you should be able to run python testing.py fine.

Sandy4321 commented 8 years ago

Quinn McNamara 1 supeeeeer! it start to work for example I got Enter home team Houston Rockets Enter away team Denver Nuggets Probability home team wins: 0.560266002253 Margin of victory: 0.631124048023

THANK YOU VERY MUCH now I start to study how it works.... by the way how good this code vs https://www.teamrankings.com/nba/betting-models/detailed-splits/

by the way your second project https://github.com/qmac/nba-analysis how to use it , which file to run to get for example help which player to pick up for fantasy or predict how many fendul points he will have in coming game for team A and team B???

2

I run this line pip install -r requirements.txt as you recommenced on https://github.com/qmac/nba-analysis and got this

  setup_package()
File

"c:\users\sander\appdata\local\temp\pip-build-s5kdqk\scipy\setup.py", l ine 234, in setup_package setup(_metadata) File "C:\Anaconda\lib\site-packages\numpy\distutils\core.py", line 135, in s etup config = configuration() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\scipy\setup.py", l ine 173, in configuration config.add_subpackage('scipy') File "C:\Anaconda\lib\site-packages\numpy\distutils\misc_util.py", line 1001 , in add_subpackage caller_level = 2) File "C:\Anaconda\lib\site-packages\numpy\distutils\misc_util.py", line 970, in get_subpackage caller_level = caller_level + 1) File "C:\Anaconda\lib\site-packages\numpy\distutils\misc_util.py", line 907, in _get_configuration_from_setup_py config = setup_module.configuration(_args) File "scipy\setup.py", line 12, in configuration config.add_subpackage('integrate') File "C:\Anaconda\lib\site-packages\numpy\distutils\misc_util.py", line 1001 , in add_subpackage caller_level = 2) File "C:\Anaconda\lib\site-packages\numpy\distutils\misc_util.py", line 970, in get_subpackage caller_level = caller_level + 1) File "C:\Anaconda\lib\site-packages\numpy\distutils\misc_util.py", line 907, in _get_configuration_from_setup_py config = setup_module.configuration(args) File "scipy\integrate\setup.py", line 12, in configuration blas_opt = get_info('blas_opt',notfound_action=2) File "C:\Anaconda\lib\site-packages\numpy\distutils\system_info.py", line 37 2, in get_info return cl().get_info(notfound_action) File "C:\Anaconda\lib\site-packages\numpy\distutils\system_info.py", line 56 8, in get_info raise self.notfounderror(self.notfounderror.doc) numpy.distutils.system_info.BlasNotFoundError: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [blas]) or by setting the BLAS environment variable.


Failed building wheel for scipy Failed to build numpy scipy Installing collected packages: numpy, scipy Found existing installation: numpy 1.10.1 Uninstalling numpy-1.10.1: Successfully uninstalled numpy-1.10.1 Running setup.py install for numpy Complete output from command C:\Anaconda\python.exe -c "import setuptools, t okenize;file='c:\users\sander\appdata\local\temp\pip-build-s5kdqk\num py\setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().repl ace('\r\n', '\n'), file, 'exec'))" install --record c:\users\sander\appdata\ local\temp\pip-kwpxbn-record\install-record.txt --single-version-externally-mana ged --compile: non-existing path in 'numpy\distutils': 'site.cfg' non-existing path in 'numpy\f2py': 'docs' non-existing path in 'numpy\f2py': 'f2py.1' F2PY Version 2 blas_opt_info: blas_mkl_info: libraries mkl,vml,guide not found in ['C:\Anaconda\lib', 'C:\', 'C:\An aconda\libs'] NOT AVAILABLE

openblas_info:
  libraries openblas not found in ['C:\\Anaconda\\lib', 'C:\\',

'C:\Anacond a\libs'] NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in ['C:\\Anaconda\\lib',

'C:\ ', 'C:\Anaconda\libs'] NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in ['C:\\Anaconda\\lib',

'C:\', ' C:\Anaconda\libs'] NOT AVAILABLE

blas_info:
  libraries blas not found in ['C:\\Anaconda\\lib', 'C:\\',

'C:\Anaconda\l ibs'] NOT AVAILABLE

blas_src_info:
  NOT AVAILABLE

  NOT AVAILABLE

non-existing path in 'numpy\\lib': 'benchmarks'
lapack_opt_info:
openblas_lapack_info:
  libraries openblas not found in ['C:\\Anaconda\\lib', 'C:\\',

'C:\Anacond a\libs'] NOT AVAILABLE

lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['C:\\Anaconda\\lib', 'C:\\',

'C:\An aconda\libs'] NOT AVAILABLE

  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in C:\Anaconda\lib
  libraries lapack_atlas not found in C:\Anaconda\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries ptf77blas,ptcblas,atlas not found in C:\Anaconda\libs
  libraries lapack_atlas not found in C:\Anaconda\libs
numpy.distutils.system_info.atlas_threads_info
  NOT AVAILABLE

atlas_info:
  libraries f77blas,cblas,atlas not found in C:\Anaconda\lib
  libraries lapack_atlas not found in C:\Anaconda\lib
  libraries f77blas,cblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries f77blas,cblas,atlas not found in C:\Anaconda\libs
  libraries lapack_atlas not found in C:\Anaconda\libs
numpy.distutils.system_info.atlas_info
  NOT AVAILABLE

lapack_info:
  libraries lapack not found in ['C:\\Anaconda\\lib', 'C:\\',

'C:\Anaconda\ \libs'] NOT AVAILABLE

lapack_src_info:
  NOT AVAILABLE

  NOT AVAILABLE

running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands

--compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building py_modules sources building library "npymath" sources Looking for python27.dll Cannot build msvcr library: "msvcr90d.dll" not found customize GnuFCompiler Could not locate executable g77 Could not locate executable f77 customize IntelVisualFCompiler Could not locate executable ifort Could not locate executable ifl customize AbsoftFCompiler Could not locate executable f90 customize CompaqVisualFCompiler Could not locate executable DF customize IntelItaniumVisualFCompiler Could not locate executable efl customize Gnu95FCompiler Found executable C:\Anaconda\Scripts\gfortran.bat Found executable C:\Anaconda\Scripts\gfortran.bat Running from numpy source directory.

c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\distutils\sy stem_info.py:1526: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. warnings.warn(AtlasNotFoundError.doc)

c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\distutils\sy stem_info.py:1535: UserWarning: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [blas]) or by setting the BLAS environment variable. warnings.warn(BlasNotFoundError.doc)

c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\distutils\sy stem_info.py:1538: UserWarning: Blas (http://www.netlib.org/blas/) sources not found. Directories to search for the sources can be specified in the numpy/distutils/site.cfg file (section [blas_src]) or by setting the BLAS_SRC environment variable. warnings.warn(BlasSrcNotFoundError.doc)

c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\distutils\sy stem_info.py:1432: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. warnings.warn(AtlasNotFoundError.doc)

c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\distutils\sy stem_info.py:1443: UserWarning: Lapack (http://www.netlib.org/lapack/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [lapack]) or by setting the LAPACK environment variable. warnings.warn(LapackNotFoundError.doc)

c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\distutils\sy stem_info.py:1446: UserWarning: Lapack (http://www.netlib.org/lapack/) sources not found. Directories to search for the sources can be specified in the numpy/distutils/site.cfg file (section [lapack_src]) or by setting the LAPACK_SRC environment variable. warnings.warn(LapackSrcNotFoundError.doc) C:\Anaconda\lib\distutils\dist.py:267: UserWarning: Unknown distribution opt ion: 'define_macros' warnings.warn(msg) Traceback (most recent call last): File "", line 1, in File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\setup.py", line 251, in setup_package() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\setup.py", line 243, in setup_package setup(metadata) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\core.py", line 169, in setup return old_setup(new_attr) File "C:\Anaconda\lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Anaconda\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) File "C:\Anaconda\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\install.py", line 62, in run r = self.setuptools_run() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\install.py", line 36, in setuptools_run return distutils_install.run(self) File "C:\Anaconda\lib\distutils\command\install.py", line 563, in run self.run_command('build') File "C:\Anaconda\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) File "C:\Anaconda\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\build.py", line 39, in run old_build.run(self) File "C:\Anaconda\lib\distutils\command\build.py", line 127, in run self.run_command(cmd_name) File "C:\Anaconda\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) File "C:\Anaconda\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\build_src.py", line 153, in run self.build_sources() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\build_src.py", line 164, in build_sources self.build_library_sources(*libname_info) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\build_src.py", line 299, in build_library_sources sources = self.generate_sources(sources, (lib_name, build_info)) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\build_src.py", line 386, in generate_sources source = func(extension, build_dir) File "numpy\core\setup.py", line 684, in get_mathlib_info st = config_cmd.try_link('int main(void) { return 0;}') File "C:\Anaconda\lib\distutils\command\config.py", line 248, in try_link self._check_compiler() File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\command\config.py", line 87, in _check_compiler c_compiler=self.compiler) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\fcompilerinit.py", line 842, in new_fcompiler c_compiler=c_compiler) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\fcompilerinit.py", line 816, in get_default_fcompiler c_compiler=c_compiler) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\fcompilerinit.py", line 765, in _find_existing_fcompiler c.customize(dist) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\fcompilerinit.py", line 540, in customize self.set_libraries(self.get_libraries()) File "c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy\numpy\dist utils\fcompiler\gnu.py", line 337, in get_libraries raise NotImplementedError("Only MS compiler supported with gfortran on w in64") NotImplementedError: Only MS compiler supported with gfortran on win64

----------------------------------------

Rolling back uninstall of numpy Command "C:\Anaconda\python.exe -c "import setuptools, tokenize;file='c:\us ers\sander\appdata\local\temp\pip-build-s5kdqk\numpy\setup.py';exec(compi le(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), fil e, 'exec'))" install --record c:\users\sander\appdata\local\temp\pip-kwpxbn-re cord\install-record.txt --single-version-externally-managed --compile" failed wi th error code 1 in c:\users\sander\appdata\local\temp\pip-build-s5kdqk\numpy

c:\Sander\Spray\NBA\qmac_Dec14\nba-analysis-master>


Thanks Sander

On Fri, Dec 11, 2015 at 4:35 PM, Quinn McNamara notifications@github.com wrote:

You must also first run python nba_predict.py to train the network. The network is then serialized into the file "winner_chromosome". Afterwards, you should be able to run python testing.py fine.

— Reply to this email directly or view it on GitHub https://github.com/qmac/nba-predictor-ann/issues/1#issuecomment-164053017 .

qmac commented 8 years ago

I am not sure how the predictions compare. My guess is that website has done the most refining/tweaking of its algorithm, which I have not.

As far as nba-analysis goes, it is very much still a work in progress. The capabilities are outlined under the "Summary" portion of the README for the repo. Predicting points/fantasy values is not part of the current functionality, sorry to disappoint. As far as the installation error, you need to download BLAS in order to run scipy and the machine learning packages.

Sandy4321 commented 8 years ago

I USE SCIPY ROUTINELY but in any case as I see in order to run your code for nba-analysis I need to install BLAS may you give some clue how to do it for windows?

On Wed, Dec 16, 2015 at 1:28 PM, Quinn McNamara notifications@github.com wrote:

I am not sure how the predictions compare. My guess is that website has done the most refining/tweaking of its algorithm, which I have not.

As far as nba-analysis goes, it is very much still a work in progress. The capabilities are outlined under the "Summary" portion of the README for the repo. Predicting points/fantasy values is not part of the current functionality, sorry to disappoint. As far as the installation error, you need to download BLAS in order to run scipy and the machine learning packages.

— Reply to this email directly or view it on GitHub https://github.com/qmac/nba-predictor-ann/issues/1#issuecomment-165201431 .

Sandy4321 commented 8 years ago

by the way if I need calculate PER for given player only using last 10 games data what would you recommend pls

On Thu, Dec 17, 2015 at 2:29 PM, Sander Stepanov sander.stepanov@gmail.com wrote:

I USE SCIPY ROUTINELY but in any case as I see in order to run your code for nba-analysis I need to install BLAS may you give some clue how to do it for windows?

On Wed, Dec 16, 2015 at 1:28 PM, Quinn McNamara notifications@github.com wrote:

I am not sure how the predictions compare. My guess is that website has done the most refining/tweaking of its algorithm, which I have not.

As far as nba-analysis goes, it is very much still a work in progress. The capabilities are outlined under the "Summary" portion of the README for the repo. Predicting points/fantasy values is not part of the current functionality, sorry to disappoint. As far as the installation error, you need to download BLAS in order to run scipy and the machine learning packages.

— Reply to this email directly or view it on GitHub https://github.com/qmac/nba-predictor-ann/issues/1#issuecomment-165201431 .

qmac commented 8 years ago

http://icl.cs.utk.edu/lapack-for-windows/lapack/ that's all I can find on installing BLAS on windows

to run the main app, run python app.py in the main folder and navigating to either localhost:5000/tiers or localhost:5000/positions in a browser to view the current results for the analyses.

I do not know how to go about calculating PER for the last 10 games using the repo. Running python scrape.py in the tiers/code/ folder will scrape advanced stats into a .csv file in the folder tiers/data/, and one of the statistics is PER (for the current season so far).