train_x, train_y = [], [] for i in range(look_back, len(train_data)): x = [] for j in range(len(svr_models)): x.append(svr_models[j].predict(np.reshape(low_freq_imfs.iloc[i-look_back:i, j].values, (1, -1)))[0]) x.append(lstm_model.predict(np.reshape(high_freq_imfs.iloc[i-look_back:i, :].values, (1, look_back, -1)))[0]) train_x.append(x) train_y.append(train_data.iloc[i, 1]) train_x, train_y = np.array(train_x), np.array(train_y) stack_model = SVR(kernel='rbf', C=100, gamma=0.1, epsilon=.1) stack_model.fit(train_x, train_y) 将以上代码按规范排列,突出显示缩进情况
时间: 2024-01-21 14:02:20 浏览: 114
train_运行图matlab画图_train_
5星 · 资源好评率100%
```
train_x, train_y = [], []
for i in range(look_back, len(train_data)):
x = []
for j in range(lenvr_models)):
x.append(svr_models[j].predict(np.reshape(low_freq_imfs.iloc[i-look_back:i, j].values, (1, -1)))[0])
x.append(lstm_model.predict(np.reshape(high_freq_imfs.iloc[i-look_back:i, :].values, (1, look_back, -1)))[0])
train_x.append(x)
train_y.append(train_data.iloc[i, 1])
train_x, train_y = np.array(train_x), np.array(train_y)
stack_model = SVR(kernel='rbf', C=100, gamma=0.1, epsilon=.1)
stack_model.fit(train_x, train_y)
```
阅读全文