0
$\begingroup$

I tried using Classify. It gives the wrong answer even for training data.

c = Classify[trainingset];
c[13]
"T"

when the training set itself says "F".

 trainingset := 
   {1 -> "F", 2 -> "T", 3 -> "F", 4 -> "T", 5 -> "F", 6 -> "T", 7 -> "F", 
    8 -> "T", 9 -> "F", 10 -> "T", 11 -> "F", 12 -> "T", 13 -> "F", 14 -> "T", 
    15 -> "F", 16 -> "T"}
$\endgroup$
  • $\begingroup$ en.m.wikipedia.org/wiki/Overfitting $\endgroup$ – Shredderroy Sep 26 at 13:57
  • $\begingroup$ It gives the wrong answer for TRAINING data! $\endgroup$ – Quasar Supernova Sep 26 at 13:59
  • 1
    $\begingroup$ A classifier generates some classification based on a training set. It does not mean that it classifies all points of the training data perfectly. Note : you can get a bit more insight: c[13, "Probabilities"]: <|"F" -> 0.455556, "T" -> 0.544444|>. You might want to play with the Method. $\endgroup$ – anderstood Sep 26 at 14:33
  • $\begingroup$ Thanks for this $\endgroup$ – Quasar Supernova Sep 26 at 15:36
2
$\begingroup$

Up to the @anderstood's advice, the command

 trainingset = {1 -> "F", 2 -> "T", 3 -> "F", 4 -> "T", 5 -> "F",6 
 -> "T", 7 -> "F", 8 -> "T", 9 -> "F", 10 -> "T", 11 -> "F", 12 -> 
 "T", 13 -> "F", 14 -> "T", 15 -> "F", 16 -> "T"};
c = Classify[trainingset, Method -> "SupportVectorMachine"]

does the job, outputting

c[13]
(*F*)

and

c[13,"Probabilities"]
(*<|"F" -> 0.965753, "T" -> 0.0342467|>*)
| improve this answer | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.