I was trying our the code provided on this particular notebook and man you guys skip a LOT of informations. For example the importing a local python script which is designed to make a new Neural Network was skipped, I had to search around a bit to understand why
from Keras_CV import create_new_model
was causing an error.
Immediately after fixing that issue, I am facing this:
RETURNS:
RuntimeError: Cannot clone object <keras.wrappers.scikit_learn.KerasClassifier object at 0x0000014EBE7032E8>, as the constructor either does not set or modifies parameter class_weight
Apparently this error is because my code is trying to clone something.
How do I fix this?
Pretty disappointing that I have to come here and ask for help even for the code which is provided to us as an example.
Now I have to wait for hours for someone to actually reply to this so that I can move ahead with my learning/experimenting because you guys won't provide an actual working strategy.
What a waste of time and money. Thank you Quantra.
The above fix worked but that defeats the purpose of balancing the input data based on their weights. Doesn’t that ruin the purpose of pre-processing ?
Plus in the same example of Trading strategy with cross-validation, why the final output from the best_model.predict() is a decimal number instead of 0 or 1 , which it was trained to predict. y_train consists of 0s and 1s
Hi Abhinash, The final output is a probability of the data belonging to a particular class. This is explained in the strategy notebook used in the Section 2 Unit 11 of the course. We are currently working on the runtime error issue that you have posted earlier and will get back to you as soon as we find a solution to this problem.
Hi Abhinash, There is solution to the class_weights problem. You can pass them as parameter when you fit the data to the grid search object. Please check the following code for clarity:
The class_weights feature is facing some issues in the latest version of Keras wrapper and is a known issue. You can track it on the github: Using callbacks with the SciKit-Learn API? · Issue #4081 · keras-team/keras · GitHub . Meanwhile, we will update the current solution file and downloadable code in the course so that you can try the solution at your end and confirm it.