跟特征数量没关系
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run

This commit is contained in:
zhangkun9038@dingtalk.com 2025-04-28 14:08:34 +08:00
parent ec7d7c2842
commit 29fd0941a0

View File

@ -145,9 +145,9 @@ class FreqaiExampleStrategy(IStrategy):
# 生成更复杂的目标变量 up_or_down
# Ensure the target variable is reshaped correctly
dataframe["up_or_down"] = np.where(
dataframe["close"].shift(-label_period) > dataframe["close"], 1, 0
).reshape(-1, 1) # Reshape to 2D array
dataframe["up_or_down"] = np.where(
dataframe["close"].shift(-label_period) > dataframe["close"], 1, 0
).reshape(-1, 1) # Reshape to 2D array
# 生成 %-volatility 特征
dataframe["%-volatility"] = dataframe["close"].pct_change().rolling(20).std()