AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
10.14k stars 2.44k forks source link

Do train and test dataframes have to have the same column ordering ? #1258

Open arun-dezerv opened 4 months ago

arun-dezerv commented 4 months ago

In sklearn, it is important to have the same column ordering between train and test sets. Is the same required in FinRL as well?

krishdotn1 commented 3 months ago

Hi @arun-dezerv I do not think the same order of columns is required in test and train datasets. Finrl Extract data by column name like data["col_name"] So you did not need to maintain column order.

p.s: But while creating an observation space in an environment you should maintain the order of values contains in observation space. example, Train Case: obs = [cash, num_of_stock,close,indicators_value] Test Case: it should be same as Train. obs = [cash, num_of_stock,close,indicators_value]