static double Test(IHypothesis<Matrix, Vector> network, IDataSet<Matrix, Vector> dataSet, double oldcost = Double.PositiveInfinity) { var rtester = new RegressionTester<Matrix>(network); var cost = rtester.Test(dataSet); var classifier = new MaxFitClassifier<Matrix>(network); var ctester = new ClassifierTester<Matrix, Vector, int>(classifier, x => x.IndexOfMax); var accuracy = ctester.Test(dataSet); Console.Write("C {0} | {1}%", cost, accuracy * 100); if (oldcost < cost) { Console.WriteLine(); Console.WriteLine("Warning: probably weights will divergent!"); } return cost; }
public IHypothesis <object> AssertThat() { _hypothesis = Hypothesis.For <object>(); return(_hypothesis); }