My goal is to include a Random Forest model inside my Anylogic model to predict the value of a variable of my agent.
I’ve seen an example of python connections and ML models usage where is included the pyCom library, Simple Hospital with AI, but I’m not even able to run it.
I have imported the pypeline library.
But I face two errors:
the first before run the model:
- The import com.google cannot be resolved. Location: Simple Hospital (AI Testbed)/Patient – Agent Type
the second when I run it:
- Failed to run python code; feedback: TypeError(“<class ‘keras.src.initializers.random_initializers.GlorotUniform’> could not be deserialized properly. Please ensure that components that are Python object instances (layers, models, etc.) returned by
get_config()
are explicitly deserialized in the model’sfrom_config()
method.nnconfig={‘module’: ‘keras.initializers’, ‘class_name’: ‘GlorotUniform’, ‘config’: {‘seed’: None, ‘dtype’: ‘float32’}, ‘registered_name’: None}.nnException encountered: GlorotUniform.init() got an unexpected keyword argument ‘dtype'”)
I have python on my PC, with all the libraries ( numpy, pandas, tensorflow, skit-learn…) and pyCommunicator seems to work since I tested the basic tutorial. The problem could be the version of keras in the second case? But which is the correct version?
They could be easily solvable issue, but I’m autodidact at programming I need more detailed instruction.