예제 #1
0
 public void UpdateInfGain(double entropyForClassificationFactor, int[] afterClassificationVlaues, int amountOfExamplesUsed,
                           int[][] diferentOutcomesafterClassValues)
 {
     //TODO: complete the method
     this.InfGain = DecisionTreeCreator.calculateInformationGain(entropyForClassificationFactor, afterClassificationVlaues, amountOfExamplesUsed,
                                                                 diferentOutcomesafterClassValues);
 }
예제 #2
0
        static void Main(string[] args)
        {
            // var examples = DataReader.ReturnAllExamplesFromFile("../../TrainingData/DataExamples.txt");
            // Console.WriteLine(examples);
            DecisionTreeCreator treeCreator = new DecisionTreeCreator();

            treeCreator.StartBuilding();
            Console.WriteLine(treeCreator);
            ITreeExporter exporter = new JSONTreeExporter();
            DateTime      dateTime = DateTime.Now;

            // Add this option in configuration

            String resultsPathFile = "../../Results/Tree-" + dateTime.ToString().Replace("/", "-") + ".txt";

            exporter.exportTree(resultsPathFile, treeCreator.RootNode);
        }
예제 #3
0
 public void UpdateEntropy(int[] arrayWithAmountsOfDifferentClassificationValues,
                           int amountOfTrainingExamples)
 {
     this.Entropy = DecisionTreeCreator.calculateEntropy(arrayWithAmountsOfDifferentClassificationValues,
                                                         amountOfTrainingExamples);
 }