ipex-llm icon indicating copy to clipboard operation
ipex-llm copied to clipboard

Chronos: Make `test_tsdataset.is_predict` more friendly

Open liangs6212 opened this issue 1 year ago • 4 comments

Description

Before that, since the horizon is not 0, the length of the predicted data will be less than the actual demand data. Now if is_predict set to True, then horizon will be set to 0, which avoids the prediction data being split.

Usage


test = TSDataset.from_pandas(...)
test.is_predict = True
yhat = forecaster.predict(test)

liangs6212 avatar Sep 07 '22 02:09 liangs6212

Should we use a setter for this member? since we want to use it as a external API

TheaperDeng avatar Sep 15 '22 14:09 TheaperDeng

Should we use a setter for this member? since we want to use it as a external API

Like this?

yhat = forecaster.predict(test, is_predict=True)

It looks a little weird, but it's friendly to use.

liangs6212 avatar Sep 15 '22 15:09 liangs6212

Should we use a setter for this member? since we want to use it as a external API

Like this?

yhat = forecaster.predict(test, is_predict=True)

It looks a little weird, but it's friendly to use.

no I mean make this member a https://docs.python.org/3/library/functions.html#property .

We may try some thing new in this PR, since we might have such syntax supported more and more in future.

TheaperDeng avatar Sep 16 '22 01:09 TheaperDeng

Diff:

  1. Removed redundant parameters(is_predict)
  2. Some changes based on property(experiment)
  3. Descriptor applied(experiment)

liangs6212 avatar Sep 19 '22 07:09 liangs6212