跟特征数量没关系
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
This commit is contained in:
parent
ec7d7c2842
commit
29fd0941a0
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user