You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the given data, taking the hyperparameters yielding the best R2 score as in: index = numpy.where(param_results[:, 0] == numpy.amax(param_results[:, 0])) # Maximum des R2
will cause the following line to raise an error on conversion to float: best_out = model_energy_demand(wz_out, float(param_results[index, 1]), float(param_results[index, 2]), float(param_results[index, 3]), dfAnwend, True, True, 0.25)
The error is: TypeError: only size-1 arrays can be converted to Python scalars
Indeed, index is not a scalar, causing param_results[index, 1] not to be a scalar either:
With the given data, taking the hyperparameters yielding the best R2 score as in:
index = numpy.where(param_results[:, 0] == numpy.amax(param_results[:, 0])) # Maximum des R2
will cause the following line to raise an error on conversion to float:
best_out = model_energy_demand(wz_out, float(param_results[index, 1]), float(param_results[index, 2]), float(param_results[index, 3]), dfAnwend, True, True, 0.25)
The error is:
TypeError: only size-1 arrays can be converted to Python scalars
Indeed,
index
is not a scalar, causingparam_results[index, 1]
not to be a scalar either:Suggested solution
Take the first index only
The text was updated successfully, but these errors were encountered: