jeff
(Jeff Burns)
1
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?
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 *)