Cross validation for machine learning

1 Ansicht (letzte 30 Tage)
Lester Lim
Lester Lim am 21 Jan. 2013
Where would I be able to find a cross validation code? I don't have statistics toolbox and I neeed to do cross validation for machine learning. Need help thanks!!!

Akzeptierte Antwort

Shashank Prasanna
Shashank Prasanna am 21 Jan. 2013
What type of machine learning are you doing? Cross validation is fairly straightforward, all you need to do is use some random part of your data for training and other part of the data for testing and you may do this several times. A popular method is called leave-one-out. Where you divide your data into several chunks and use all except one to train and the last one to test.
There is no special code required, if you have your training and testing methods ready, its just about how you partition and provide data to these function.
Take a look at the other common types of cross validation methods:
Of course if you have Stats toolbox, they have a function that can take your training function as input and itself splits the data for you, but its not really that much of an effort to do it.
  1 Kommentar
Lester Lim
Lester Lim am 22 Jan. 2013
I recall it as cvpartition and crossvalind for statistical toolbox. I am currently doing supervised machine learning and I have only found a cross validation method which calculated the mean square error. How may I derive the accuracy from it?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by