FR: Probability output of mlpclassifier

Bit of a late-in-the-game FR for adding probability output to fluid.mlpclassifier~.

Basically the predict_proba from scikit-learn (link).

I don’t know if this is, essentially, what @a.harker did for his custom build of fluid.mlpclassifier~ as discussed in this thread when he said:

But having a flag to (somehow) output this information would be useful for all sorts of things (cascaded classifiers, or double-checking onset detection etc…).

I imagine that the value is being computed internally, but it would be a matter of adding an attribute and/or way to output it.

there is already a thread where I show how to retrieve that by loading the model in the mlpregressor… check it out :wink:

1 Like

In case you didn’t find it: Using MLPregressor to get the confidence vector of MLPclassifier

2 Likes

Very handy.

I (super) vaguely remember that.

Sadly the syntax has changed, and not knowing exactly what it should be doing, it’s not clear what goes where.

quickly because on the road:

  1. train your classifier
  2. dump
  3. extract the “mlp” key
  4. load that in a regressor

done!

1 Like

Also, would be handy to have an actual probability vector where the values sum up to 1.

For my intended purposes the workaround is useful, but having an actual probability vector would be handy, as an FR. (I can add it as an issue to git if it’s easier to maintain a history there).

it is a little more complicated than that. There is a thread with @danieleghisi and @weefuzzy about providing (eventually) a tool to get softMax on arrays, maybe buffer-style à la FluCoMa

2 Likes

Just to chime in and say

  1. This stuff will eventually happen.
  2. This thread is in danger of conflating some different stuff. tl;dr be wary of too much belief that something that looks like a probability or a distribution can be reliably treated as such. There be dragons, as ever.
  3. If you’re on Max 9, then you can use arrays sum the contents of a buffer to 1 relatively painlessly. Untested:
1 Like