Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to do out of sample forecast by SVM in r? #6

Open
Rizwanrustam opened this issue Mar 20, 2019 · 0 comments
Open

How to do out of sample forecast by SVM in r? #6

Rizwanrustam opened this issue Mar 20, 2019 · 0 comments

Comments

@Rizwanrustam
Copy link

hi,
I am doing uni variate forecasting by using SVM in r. I did my in sample forecast precisely but when i do forecast for some next time period it gives the same values. here are codes.
lagged_data<-y[complete.cases(y),]
View(lagged_data)
n<-dim(lagged_data)[1]
train_data<-lagged_data[1:(n-24),]
test_data<-lagged_data[(n-23):n,]
modelsvm = svm(inflation~.,train_data)
predYsvm = predict(modelsvm, test_data)
forecast<-data.frame(test_data$inflation, predYsvm)
till now it did good but it is in sample forecast but when i do for out sample forecast it repeats the training values.
out_predYsvm = predict(modelsvm, h=24)

@Rizwanrustam Rizwanrustam changed the title How to forecast out of sample by SVM in r? How to do out of sample forecast by SVM in r? Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant