Python Forum
sklearn.neural_network MLPClassifier forecast variances
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sklearn.neural_network MLPClassifier forecast variances
#1
Issue described below
Reply
#2
Hi, So the issue is historic forecasts change when data last data input from a time series is deleted. So data is 1500 data point time series starting with 1.31238 ending with 1.32875 varying within 1.3 to 1.45. I prepare 5 lag bins which are converted to directional bins. So if the next data point is less than previous point the bin loads with a 1. If greater the bin loads a 2, if no change the bin loads a zero.

So I run in Jupiter Notebook the following script: (This follows the bin preparation scripts.)

In [108]: from sklearn.neural_network import MLPClassifier
In [109]: model = MLPClassifier(solver='lbfgs', alpha=1e-5,
hidden_layer_sizes=3 * [200],
random_state=5)

In [110]: %time model.fit(data[cols_bin], data['direction'])



The results are fine.

If I then delete the last data point and run the entire 100 lines of script, I get similar results but several of the 1499 predictions are different to the predictions from running the 1500 data points. varying from 6-8& differences or 120-140 differences.

The forecast is either 1 or -1.

It seems a bit fatal to then run the forecast every time a new data point is available if every time the historic or previously generated predictions vary to such an extent.

How do I continue calculating accurate forecasts ( generally 56-58% accuracy) without the historical predictions changing?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Column Transformer with Mixed Types - sklearn aaldb 0 250 Feb-22-2024, 03:27 PM
Last Post: aaldb
  Energy Forecast with SARIMAX PatiencePlease 0 328 Jan-31-2024, 11:53 PM
Last Post: PatiencePlease
  Recommendations for ML libraries for time-series forecast AndreasPython 0 1,862 Jan-06-2021, 01:03 PM
Last Post: AndreasPython
  Customizing an sklearn submodule with cython JHogg11 0 1,930 May-27-2020, 05:39 PM
Last Post: JHogg11
  sklearn and train_test_split nsadams87xx 1 1,794 Apr-23-2020, 05:32 PM
Last Post: jefsummers
  Error When Using sklearn Predict Function firebird 0 2,026 Mar-21-2020, 04:34 PM
Last Post: firebird
  Outputing LogisticRegression Coefficients (sklearn) RawlinsCross 6 4,657 Feb-27-2020, 02:47 PM
Last Post: RawlinsCross
  Predicting an output variable with sklearn Ccross1 1 2,487 Jun-04-2019, 03:11 PM
Last Post: michalmonday
  sklearn regression to excel punksnotdead 1 2,723 Apr-14-2019, 12:32 PM
Last Post: punksnotdead
  Creating a matrix of rolling variances vvvcvvcv 1 2,734 May-26-2018, 12:51 PM
Last Post: killerrex

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020