bszek213 / ml_mlb

Deep Learning to Predict MLB Outcomes
10 stars 1 forks source link

Data Missing? #2

Open omar319 opened 9 months ago

omar319 commented 9 months ago

So it looks like I can run it fine but it seems like I might be missing something or a step? I ran python mlb_ml_classify_deep_learn_test.py test and right after I ran python mlb_ml_classify_deep_learn_test.py notest (this is on dev branch) they both seemed to work, then I ran python mlb_ml_classify_deep_learn.py tune or python mlb_ml_classify_deep_learn.py notune which gave this error ::

Traceback (most recent call last):
  File "mlb_ml_classify_deep_learn.py", line 558, in <module>
    main()
  File "mlb_ml_classify_deep_learn.py", line 556, in main
    mlbDeep().run_analysis()
  File "mlb_ml_classify_deep_learn.py", line 548, in run_analysis
    self.get_teams()
  File "mlb_ml_classify_deep_learn.py", line 87, in get_teams
    self.all_data.drop(columns='cli',inplace=True)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/frame.py", line 4913, in drop
    errors=errors,
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/generic.py", line 4150, in drop
    obj = obj._drop_axis(labels, axis, level=level, errors=errors)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/generic.py", line 4185, in _drop_axis
    new_axis = axis.drop(labels, errors=errors)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 6017, in drop
    raise KeyError(f"{labels[mask]} not found in axis")
KeyError: "['cli'] not found in axis"

Then I ran python mlb_ml_classify_deep_learn.py test

which gave this ::

Need data for year: []
len data:  63458
Traceback (most recent call last):
  File "mlb_ml_classify_deep_learn.py", line 558, in <module>
    main()
  File "mlb_ml_classify_deep_learn.py", line 556, in main
    mlbDeep().run_analysis()
  File "mlb_ml_classify_deep_learn.py", line 544, in run_analysis
    self.get_teams()
  File "mlb_ml_classify_deep_learn.py", line 87, in get_teams
    self.all_data.drop(columns='cli',inplace=True)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/frame.py", line 4913, in drop
    errors=errors,
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/generic.py", line 4150, in drop
    obj = obj._drop_axis(labels, axis, level=level, errors=errors)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/generic.py", line 4185, in _drop_axis
    new_axis = axis.drop(labels, errors=errors)
  File "/mnt/f/repositories/ml_mlb/mlmlbvenv/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 6017, in drop
    raise KeyError(f"{labels[mask]} not found in axis")
KeyError: "['cli'] not found in axis"
bszek213 commented 9 months ago

cli is a feature that I removed. I do not think you need to run python mlb_ml_classify_deep_learn.py tune or python mlb_ml_classify_deep_learn.py notune as they are old ways of tuning the parameters of the model. I think I fixed this in the dev branch so that you just have the test or notest arguments

omar319 commented 9 months ago

Not sure if it's an issue with versioning but running tune/notune there is the following error ::

Traceback (most recent call last):
  File "./ml_mlb/mlb_ml_classify_deep_learn.py", line 5, in <module>
    from tensorflow.keras.wrappers.scikit_learn import KerasClassifier
ModuleNotFoundError: No module named 'tensorflow.keras.wrappers'

Is there a requirements.txt or does that package have to be updated since I am using python 3.10