필터 지우기
필터 지우기

time series cross validation in svm

조회 수: 9 (최근 30일)
mono
mono 2019년 8월 7일
댓글: mono 2023년 5월 3일
HI,
I am trying to write a kernel based regression model (svm or gaussian process) to predict time series data. I note that fitrsvm has cross validation input arguement that random shuffs the set and generate both training and validation sets. BUT, I am working on a time series data that the built in cross validation or kfold methods is not a good choice due to the data sequencial property.
Would be appreciated if anyone can give a tip or two to tackle the task while still using fitrgp or fitrsvm functions...

답변 (1개)

Drew
Drew 2023년 1월 20일
In R2022b, the "tspartition" function for time series partition was introduced: https://www.mathworks.com/help/stats/tspartition.html
An example of the use of tspartition is here: https://www.mathworks.com/help/stats/time-series-forecasting-using-ensemble-of-boosted-regression-trees.html . A similar workflow would apply to fitrgp or fitrsvm.
In earlier releases of MATLAB, before tspartition was introduced, you always have the option to create your own partition and then control the partitioning for validation experiments by directly passing datasets to the relevant model-buillding and model-testing functions.
  댓글 수: 1
mono
mono 2023년 5월 3일
Thanks for the information. I checked out the sample using tspartition. The basic idea is to seperate the whole data set into "old" set and "future" set, and use "old" one for training and "future" one for test.
singleHoldoutModel = fitrensemble(X(trainIdx,:),y{trainIdx,:}, ...
Method="LSBoost",LearnRate=0.2,NumLearningCycles=150, ...
Learners=tree,CategoricalPredictors=catPredictors);
However, take fitrenseble as an example, if we want to optimize hyperparameters, the whole data set would be used directly within the fitrensemble command, e.g.:
Mdl = fitrensemble([Horsepower,Weight],MPG,'OptimizeHyperparameters','auto')
I think I am stuck at how to use fitrensemble to optimize hyperparamters while still take the data sequential property into consideration.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by