public IWebPostClassifier GetClassifier() { if (type == WebPostClassifierType.backPropagationActivationNeuralNetwork) { if (neuralnetwork == null) { neuralnetwork = new ClassifierNeuralNetworkSettings(); } } IWebPostClassifier output = (IWebPostClassifier)type.GetClassifierInstance(); output.Deploy(this); return(output); }
public WebPostClassifierSettings(WebPostClassifierType _type, String _name) { type = _type; name = _name; switch (type) { case WebPostClassifierType.backPropagationActivationNeuralNetwork: //HiddenLayerOneNeuronCount = 8; //HiddenLayerTwoNeuronCount = 8; neuralnetwork = new ClassifierNeuralNetworkSettings(); neuralnetwork.HiddenLayersNeuronCounts.Add(6); neuralnetwork.HiddenLayersNeuronCounts.Add(5); neuralnetwork.alpha = 2; neuralnetwork.learningRate = 1; neuralnetwork.momentum = 0.5; neuralnetwork.errorLowerLimit = 0.010; neuralnetwork.learningIterationsMax = 50; break; case WebPostClassifierType.kNearestNeighbors: kNN_k = 2; break; case WebPostClassifierType.multiClassSVM: lossFunctionForTraining = Loss.L2; break; case WebPostClassifierType.naiveBayes: break; case WebPostClassifierType.simpleTopScore: break; } }