# How to know the internal algorithms of functions like Predict or Classify?

The document centre seems only explain how to use these functions, but just in an very brief way. I know Mathmatica is not open source, so we can not expect to see the code of the function, but are there any materials that describe the internal algorithm in more detailed informations? Like how does Mathematica decide to use a logistic model or a Markov model to do the classify or prediction.

• This is an interesting question but it's not clear anyone but Wolfram staff could answer it. – Verbeia Dec 10 '14 at 2:31
• You particularly want to know how it chooses one method over the other automatically? – Rojo Dec 10 '14 at 17:06

If you want to have a description of the method used by a given ClassifierFunction you can do:

ClassifierInformation[myclassifier, "MethodDescription"]


Also, the methods used are quite classic, so you can easily find documentation on the web.

If you want to know why Classify uses a given model there is a simple answer: Classify tries to find the model that has the highest likelihood on unseen data (that is on test sets). In a nutshell, Classify first selects possible candidates (from heuristics, depending on the characteristics of data). Then the models compete against each other using cross validation techniques, and the best model is selected. There are subtleties in the automation though (not every model get all the data for speed reason etc.), and we intend to make it smarter in the future, which is the reason we did not give a precise description in the documentation.

Simply run DownValues[Classify]

EDIT: it's strange, DownValues does not work. Anyway, I have a dump of Classify (version 10.4) made using this tool. You can find it here.

RE-EDIT: the link was broken, here's a working one

• Hmm, I get {} -- Means nothing to me. Mean anything to you?? – Michael E2 Sep 6 '16 at 2:33
• I don't think this is what he was looking for... – ktm Sep 6 '16 at 3:53
• @MichaelE2 I just edited my post – Zanfronio Sep 6 '16 at 9:55
• @Piruzzolo Spelunk[Classify] still returns output, although the algorithms must be in sub-functions, not just the down-values of Classify. Maybe saying more about how you generated the dump would be helpful. My lame attempt to download your file yielded an error. -- BTW, the DV is not mine. I usually only downvote non-spam answers if they're dangerously wrong/misleading and the author doesn't respond to feedback. I thought maybe you'd forgotten something like Unprotect@Classify; ClearAttributes[Classify, ReadProtected]; Protect@Classify;. This still doesn't get the internal algorithms. – Michael E2 Sep 6 '16 at 11:38
• @MichaelE2 fixed link – Zanfronio Sep 6 '16 at 12:16