machine-learning-for-trading icon indicating copy to clipboard operation
machine-learning-for-trading copied to clipboard

04_q_learning_for_trading -> Error during Observation Space creation

Open hacky1610 opened this issue 2 years ago • 1 comments

Describe the bug The creation of a Box in trading_env.py:242 is failung. The Datatype of the parameters is not correct. It has to be an nd_array.

Steps to reproduce the behavior:

  1. OPen 04_q_learning_for_trading
  2. Execute all

Expected behavior No error occurs

Screenshots image

Environment jupyter/datascience-notebook:latest

Solution: self.observation_space = spaces.Box(self.data_source.min_values.to_numpy(), self.data_source.max_values.to_numpy())

hacky1610 avatar Mar 16 '23 11:03 hacky1610

Describe the bug The creation of a Box in trading_env.py:242 is failung. The Datatype of the parameters is not correct. It has to be an nd_array.

Steps to reproduce the behavior:

1. OPen 04_q_learning_for_trading

2. Execute all

Expected behavior No error occurs

Screenshots image

Environment jupyter/datascience-notebook:latest

Solution: self.observation_space = spaces.Box(self.data_source.min_values.to_numpy(), self.data_source.max_values.to_numpy())

A million thanks! I was getting the same error and this worked :)

yeonmo317 avatar Apr 05 '23 09:04 yeonmo317