# Rewrite Composition to include Method in Classify?

I was reading this answer and thought I would ask a question since it had been asked ~5 years ago. Now there is a line in the answer where it states that to train the classifier, you can use the code:

cfun = titUnclass["Train", Classify @* Values, #Features -> #Objective &];


I had never seen this "at star" notation before, so I looked it up, and discovered it was called Composition (@*). Now I know for Classify that it can specify several methods, however, written like this, it seems that Mathematica goes through several methods before determining the best to use.

My issue is this: I would like to specify the method, however I do not know enough to figure out how to rewrite this line to do so. I tried

cfun = titUnclass["Train", Classify[Values, Method -> "DecisionTree"], #Features -> #Objective &];


and

Composition[Classify][Values]


but received the error (for both)

Classify::bdfmt: Argument Values should be a rule, a list of rules, or an association.


If someone could point me in the right direction for tackling this, it would be greatly appreciated.

• You misread the notation. Look at the result of FullForm[Classify @* Values]. Then, look at the result of (f @* g)[x]. – J. M.'s torpor Apr 25 '20 at 4:33
• Oh! I see! My mistake. I wrote work around where I use //Normal, but I'm still curious to see how Composition[Classify,Values] would be re-written to include Method. – Illari Apr 25 '20 at 4:36
• Normally, the function concerned would be something like Classify[Values[stuff]], which you want to modify to Classify[Values[stuff], Method -> "DecisionTree"]. Since you're calling it inside a Dataset[], you'd need to use # and & somewhere in there. – J. M.'s torpor Apr 25 '20 at 4:39
• Thanks for taking the time to comment. – Illari Apr 25 '20 at 4:46
• does cfun = titUnclass["Train", (Classify[#,Method->"DecisionTree"]&)@*Values, #Features -> #Objective &]; work? – kglr Apr 25 '20 at 4:52

cfun = titUnclass["Train", (Classify[#, Method->"DecisionTree"]&) @* Values,

• titUnclass["Train", Classify[Values[#], Method -> "DecisionTree"] &, #Features -> #Objective &] was the result I was hoping OP would think up, but oh well. – J. M.'s torpor Apr 25 '20 at 9:18