skflow regression predict multiple values

前端 未结 1 1314
陌清茗
陌清茗 2021-01-18 04:16

I\'m trying to forecast a time series: given 50 previous values, I want to predict the 5 next values.

To do so, I\'m using the skflow package (based on

相关标签:
1条回答
  • 2021-01-18 04:36

    I've just added support for multi-output regression into skflow since this #e443c734, so please reinstall the package are try again. If it doesn't work, please follow up on Github.

    I also added an example of multioutput regression to examples folder:

    # Create random dataset.
    rng = np.random.RandomState(1)
    X = np.sort(200 * rng.rand(100, 1) - 100, axis=0)
    y = np.array([np.pi * np.sin(X).ravel(), np.pi * np.cos(X).ravel()]).T
    
    # Fit regression DNN model.
    regressor = skflow.TensorFlowDNNRegressor(hidden_units=[5, 5])
    regressor.fit(X, y)
    score = mean_squared_error(regressor.predict(X), y)
    print("Mean Squared Error: {0:f}".format(score))
    
    0 讨论(0)
提交回复
热议问题