Skip to content

ValueError: Found array with 0 sample(s) (shape=(0, 58)) while a minimum of 1 during Forecasting scores #10

@zanderswai

Description

@zanderswai

During an instance of forecasts for GoliadISD student dougherty, brian, it resulted in an exception below:

 File "/app/app/preprocessors/predictions.py", line 62, in forecast
    predicted_score = forecast_proper(

  File "/app/app/preprocessors/predictions.py", line 31, in forecast_proper
 >>>   predicted = model.predict(x)[0]

  File "/usr/local/lib/python3.9/site-packages/sklearn/ensemble/_forest.py", line 981, in predict
    X = self._validate_X_predict(X)
  File "/usr/local/lib/python3.9/site-packages/sklearn/ensemble/_forest.py", line 602, in _validate_X_predict
    X = self._validate_data(X, dtype=DTYPE, accept_sparse="csr", reset=False)
  File "/usr/local/lib/python3.9/site-packages/sklearn/base.py", line 565, in _validate_data
    X = check_array(X, input_name="X", **check_params)
  File "/usr/local/lib/python3.9/site-packages/sklearn/utils/validation.py", line 931, in check_array
    raise ValueError(
    
ValueError: Found array with 0 sample(s) (shape=(0, 58)) while a minimum of 1 is required by RandomForestRegressor

Where this was caused by The value of x having: Empty DataFrame on this function predicted = model.predict(x)[0]

Here is the student data that ran for this iteration:

..., 'local_key': 'dougherty, brian-14094', 'loginid': 26281, 'school_id': 162, 'subject': 'nan', 'avescore': None, 'predscore': None, 'type': 0, ...

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions