Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

请问模型训练好之后怎么应用? #11

@HickeyHsu

Description

@HickeyHsu

十分感谢分享!我用自己的数据训练了一个模型,请问怎么应用训练好的模型?(即测试集应用)
即:如何给模型输入测试集序列,输出return的label?

我尝试model.predict(test_data),其中test_data是一个TimeSeriesData,但似乎并不能成功。

` # load entire model using load_model() from alphanet module
model = load_model("model.bt")

# only load weights by first creating a model instance
model = AlphaNetV3(l2=0.001, dropout=0.0)
model.load_weights("weights.bt")
test_data=TimeSeriesData(
    dates=test_df["int_date"].values,                   # date column            
    data=test_df[metrics_std].values,                # data columns
    labels=test_df["future_return"].values # label column
)
output=model.predict(test_data.data)
print(output)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions