# How to build a NetChain by the information of ClassifierFunction?

NetChain provides a method NetExtract.
I want to see how standClassify = Classify[trainingData, Method -> "NeuralNetwork"] works,beacause it has a better accuracy.
I cann't find a method to do a such thing like NetExtract.
I ranSave["standClassify ", standClassify ],and got all information  standClassify = ClassifierFunction[ <|"Basic" -> ....|>] ,deleted ClassifierFunction[],ran Get["standClassify"].
Then ran standClassify[["Models"]].
I still cann't understand the structure.
Dimensions /@ \ (standClassify[["Models"]][][["NeuralNetwork"]][["Weights"]])

{{972, 324}, {972, 972}, {10, 972}}

My input Dimension is 784, ## Maybe other good solution to get those information.

reduce = DimensionReduction[Keys[trainingData], 324] to get DimensionReducerFunction
Then transform input transform[data_] := Replace[#, RuleDelayed[image_ -> label_, reduce[image] -> label]] & /@ data;
Train standClassify = NetTrain[lineNet, trainingData // transform, MaxTrainingRounds -> 3, TargetDevice -> "GPU"].

This didn't work well,classifier-accuracy is 0.8676.
Accuracy can be 0.9379 if I use Classify.

For example, we have data:

SeedRandom;
n = 1000;
X = RandomReal[{-1, 1}, {n, 10}];
Y = RandomInteger[1, n];

c = Classify[X -> Y, Method -> "NeuralNetwork"]


Let's see the options:

Options[c]


We can see neuron types: Let's reconstruct this network:

net = NetChain[
{LinearLayer, Ramp, LinearLayer, Ramp, 2, SoftmaxLayer[]},
"Input" -> 10,
"Output" -> NetDecoder[{"Class", {0, 1}}]
] But weights are uninitialized. Let's initialize them with NetReplacePart. This is the new function in V11.1. As I see you are using V11.0. But you can experiment with V11.1 in the Wolfram Open Cloud for free.

weights = Options[c][]["Models"][]["NeuralNetwork"]["Weights"];
biases = Options[c][]["Models"][]["NeuralNetwork"]["Biases"];

net = NetReplacePart[net,
{
{1, "Weights"} -> weights[],
{1, "Biases"} -> biases[],
{3, "Weights"} -> weights[],
{3, "Biases"} -> biases[],
{5, "Weights"} -> weights[],
{5, "Biases"} -> biases[]
}
]


Let's compare our classifiers:

ClassifierMeasurements[c, X -> Y, "ConfusionMatrixPlot"] In V11.1 network can be converted into a ClassifierFunction.

ClassifierMeasurements[Classify[net], Standardize[X] -> Y, "ConfusionMatrixPlot"] Result is the same!