Message Boards Message Boards

0
|
6764 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Apply IndeterminateThreshold to a neural net classifier?

Posted 7 years ago

I hope to apply IndeterminateThreshold to my neural net classifier like this:

myClassifier = Import[“myNet.wlnet"]];
class = myClassifier[myDataItem ,IndeterminateThreshold ->  0.8]

Unfortunately, IndeterminateThreshold is not a valid option in this case.

It seems that this should be allowed since this ClassifierMeasurements[ myClassifier, testSet, IndeterminateThreshold -> 0] is a valid statement.

How can I change the IndeterminateThreshold without retraining?

POSTED BY: Jeff Burns
2 Replies

Use Classify to convert your net into a ClassifierFunction.

class = (Classify@myClassifier)[myDataItem, IndeterminateThreshold -> 0.8]

Example:

net = NetChain[
   {10, 2, SoftmaxLayer[]},
   "Input" -> 5, "Output" -> NetDecoder[{"Class", {0, 1}}]
   ] // NetInitialize

c = Classify@net;

c[Range[5], "Probabilities"]
(* <|0 -> 0.365243, 1 -> 0.634757|> *)

c[Range[5], IndeterminateThreshold -> 0.8]
(* Indeterminate *)

c[Range[5], IndeterminateThreshold -> 0.6]
(* 1 *)
POSTED BY: Alexey Golyshev
Posted 7 years ago

Thanks - It works!

POSTED BY: Jeff Burns
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract