private static SupportVectorMachine Create(IMLDataSet theset, int inputs) { IMLDataSet training = new BasicMLDataSet(theset); SupportVectorMachine result = new SupportVectorMachine(inputs, SVMType.EpsilonSupportVectorRegression, KernelType.Sigmoid); SVMTrain train = new SVMTrain(result, training); train.Iteration(); return result; }
private SupportVectorMachine Create() { IMLDataSet training = new BasicMLDataSet(XOR.XORInput, XOR.XORIdeal); SupportVectorMachine result = new SupportVectorMachine(2, SVMType.EpsilonSupportVectorRegression, KernelType.RadialBasisFunction); SVMTrain train = new SVMTrain(result, training); train.Iteration(); return result; }
public static double TrainNetworks(SupportVectorMachine network, MarketMLDataSet training) { // train the neural network SVMTrain trainMain = new SVMTrain(network, training); StopTrainingStrategy stop = new StopTrainingStrategy(0.0001, 200); trainMain.AddStrategy(stop); var sw = new Stopwatch(); sw.Start(); while (!stop.ShouldStop()) { trainMain.PreIteration(); trainMain.Iteration(); trainMain.PostIteration(); Console.WriteLine(@"Iteration #:" + trainMain.IterationNumber + @" Error:" + trainMain.Error); } sw.Stop(); Console.WriteLine("SVM Trained in :" + sw.ElapsedMilliseconds + "For error:" + trainMain.Error + " Iterated:" + trainMain.IterationNumber); return trainMain.Error; }
/// <inheritdoc/> public override sealed void FinishTraining() { _internalTrain.Gamma = BestGamma; _internalTrain.C = BestConst; _internalTrain.Iteration(); }
public static void train(SupportVectorMachine network,IMLDataSet training) { SVMTrain train = new SVMTrain(network, training); train.Iteration(); }
public static double train(SupportVectorMachine network, IMLDataSet training) { SVMTrain train = new SVMTrain(network, training); train.Iteration(); return train.Error; }
public static double TrainSVM(SVMTrain train, SupportVectorMachine machine) { StopTrainingStrategy stop = new StopTrainingStrategy(0.0001, 200); train.AddStrategy(stop); var sw = new Stopwatch(); sw.Start(); while (!stop.ShouldStop()) { train.PreIteration(); train.Iteration(); train.PostIteration(); Console.WriteLine(@"Iteration #:" + train.IterationNumber + @" Error:" + train.Error +" Gamma:"+train.Gamma); } sw.Stop(); Console.WriteLine(@"SVM Trained in :" + sw.ElapsedMilliseconds); return train.Error; }