fitcsvm: how can I decide training (and test) data set composition?

2 ビュー (過去 30 日間)
Giorgio De Nunzio
Giorgio De Nunzio 2016 年 5 月 10 日
コメント済み: Giorgio De Nunzio 2016 年 5 月 11 日
Hi all. Is it possible to "convince" fitcsvm to use a well-defined (not random) subset of the sample vectors for training (leaving the others for testing)? Not simply a random percentage, as set by the "'Holdout', value" pair, but a list of indices (decided by me) to exactly choose the desired samples from the whole dataset. If I could have a percentage equal to 0 in Holdout, it would do, because the machine would be trained on all the input vectors, then I'd use predict on the test subset. This is absolutely necessary for my code, because I must be able to use the same sample subsets for training etc of different classifiers. To be clearer, when using a neural network (by patternnet, in the Neural Network Toolbox), I can decide which sample vectors to use for training, validation, and test, by net.divideFcn = 'divideind', then setting manually the indices to be used for training etc. Thanks. Best regards. Giorgio
  1 件のコメント
Giorgio De Nunzio
Giorgio De Nunzio 2016 年 5 月 11 日
Replying to myself... I think I was not understanding but perhaps now it is clear.
By training fitcsvm with a simple fitcsvm(x,y) I can train the machine with the whole set of data (everything is used as the training set). The trained machine can then be applied to a new (test) data set by the predict function. This is exactly what I need.
Only if I set an option such as 'CrossVal', 'CVPartition', etc, I get a ClassificationPartitionedModel, with a number of machines trained accordingly. Otherwise, I get a ClassificationSVM classifier.
It was simple...
Bye
Giorgio

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeClassification Trees についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by