public void LogisticRegression_Test() { Assert.Fail(); //Takes really long MyLogisticRegression mlr = new MyLogisticRegression(3); Assert.AreEqual(0d, TestMachineLearning(mlr), 0.4); }
public static double getPredictivePowerWithMl(double[][] trainingInput, double[][] trainingOutput, double[][] testInput, double[][] testOutput, MLMethodForPPAnalysis method) { Logger.log("Start", "getPredictivePowerWithMl " + method); IMachineLearning ml; if (method == MLMethodForPPAnalysis.LinearRegression) ml = new MyRegression(1); else if (method == MLMethodForPPAnalysis.LogRegression) ml = new MyLogisticRegression(1); else throw new Exception("No method given..."); Logger.log("Train", "getPredictivePowerWithMl " + method); ml.train(trainingInput, trainingOutput); Logger.log("Get error", "getPredictivePowerWithMl " + method); return 1d / ml.getPredictionErrorFromData(testInput, testOutput); }