PYFTS / pyFTS

An open source library for Fuzzy Time Series in Python
http://pyfts.github.io/pyFTS/
GNU General Public License v3.0
259 stars 53 forks source link

Question about the get point statistics function in measurement #18

Closed RobinloveCode closed 5 years ago

RobinloveCode commented 5 years ago

Hi Dr.

I am confused about how you calculate the accuracy measurement. Let us take uni variate and one-order for example.

In the Measurement.py, this line of code is used to calculate the RMSE of the targets and forecasts ret.append(np.round(rmse(ndata[model.max_lag:], forecasts), 2)).

Here ndata[model.max_lag:] represents the targets , however the forecasts are generated by the following code, taking yu.model for example, l = len(ndata) if not explain else 1 for k in np.arange(0, l): actual = FuzzySet.get_maximum_membership_fuzzyset(ndata[k], self.sets, ordered_sets) You take all the data to generate predictions. So the forecasts have the same length of input data, but shift forward by prediction horizon. However, the forecasts have the different length of ndata[model.max_lag:].

I am confused about this.

petroniocandido commented 5 years ago

Hi! Thanks to get in touch!

On benchmarks.Measures.rmse (https://github.com/PYFTS/pyFTS/blob/master/pyFTS/benchmarks/Measures.py#L32) assumes that the inputs are already synced up. For example, the function benchmarks.Measures.get_point_statistics (https://github.com/PYFTS/pyFTS/blob/master/pyFTS/benchmarks/Measures.py#L311) take the test data and a FTS model as inputs, then it generate the forecasts of the model and sync those data (it delete the first datapoint of the test data and the last datapoint of the forecasted data, when the order = 1, usually max_lag = 1).

It is clear for you now?

RobinloveCode commented 5 years ago

Thanks for your reply. I have understood your codes.

获取 Outlook for iOShttps://aka.ms/o0ukef


收件人: Petrônio Cândido de Lima e Silva notifications@github.com 发送时间: 星期一, 三月 11, 2019 22:14 收件人: PYFTS/pyFTS 抄送: #GAO; Author 主题: Re: [PYFTS/pyFTS] Question about the get point statistics function in measurement (#18)

Hi! Thanks to get in touch!

On benchmarks.Measures.rmse (https://github.com/PYFTS/pyFTS/blob/master/pyFTS/benchmarks/Measures.py#L32) assumes that the inputs are already synced up. For example, the function benchmarks.Measures.get_point_statistics (https://github.com/PYFTS/pyFTS/blob/master/pyFTS/benchmarks/Measures.py#L311) take the test data and a FTS model as inputs, then it generate the forecasts of the model and sync those data (it delete the first datapoint of the test data and the last datapoint of the forecasted data, when the order = 1, usually max_lag = 1).

It is clear for you now?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/PYFTS/pyFTS/issues/18#issuecomment-471555439, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgyvmyP9lUoIV6fpErEb0fD03FiDg6IGks5vVmTTgaJpZM4bmhQ1.

petroniocandido commented 5 years ago

You are welcome!