data = RandomReal[{0, 35}, {400, 200}];
trset = Association[{"class1" -> data[[1 ;; 100]], "class2" -> data[[101 ;; 200]]}];
valset = Association[{"class1" -> data[[201 ;; 250]], "class2" -> data[[201 ;; 250]]}];
Classify[trset, ValidationSet -> valset, Method -> "SupportVectorMachine"]
I get this error:
"Part::partd: Part specification 0.[[1]] is longer than depth of object. >>
Part::partd: Part specification 0.[[2,1]] is longer than depth of object. >>"
Here this example with MNIST dataset work correctly,!?!
totalSet = ExampleData[{"MachineLearning", "MNIST"}, "Data"];
{trainingSet, validationSet,testSet} = {#[[;; 400]], #[[401 ;; 550]], #[[551 ;; 700]]} &RandomSample[totalSet]];
c = Classify[trainingSet, ValidationSet -> validationSet, Method ->"SupportVectorMachine"];
Comments
Post a Comment