Kanwal Prakash Singh
Kanwal Prakash Singh

Reputation: 349

MATLAB SVMStruct (obtained from svmtrain) save in a file and read it later

Is there a way by which I could write an SVMStruct (obtained using Matlab's svmtrain) to a file and then read it later when I need it. I want to do this because I'm unable to use SVMclassify after training the data, it gives out of memory error.

Upvotes: 3

Views: 3201

Answers (1)

Oli
Oli

Reputation: 16055

You can just use save to save:

svmstruct=svmtrain(........
save('file2save.mat','svmstruct');

and load to reload it later:

load('file2save.mat','svmstruct');
svmclassify(svmstruct,.........

Upvotes: 5

Related Questions