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 *)