Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Learning Decision Tree from input file using testing data

License

Notifications You must be signed in to change notification settings

srepollockarchive/learning-decision-tree

Repository files navigation

LearningDecisionTree

Learning Decision Tree from input file using testing data

This was for my COMP8901 Course at BCIT. We used the ID3 algorithm to run training data through the program and then run test data in and check how well the tree does in comparison to the test data.

All comments are inline in proper C# syntax.

Build and Run

To build and run this program, it requires .NET Core to build and run.

After installing, the framework (link above) navigate the the parent directory of the class. Once there, run the command in a shell dotnet build. This will create a build in ./LearningDecisionTree/bin/Debug/netcoreapp2.0 labelled LearningDecisionTree.dll. Now run dotnet ./LearningDecisionTree/bin/Debug/netcoreapp2.0/LearningDecisionTree.dll <training data> <testing data> (formats given below).

Data Formats

The program needs data in the following form strictly:

// class labels
[label 1]
[label 2]
// number of features
2
// name of features and attributes
[feature1 name] [attribute1] [attribute2]
[feature2 name] [attribute1] [attribute2]
// number of examples
4
// examples
[example name] [class label] [feature1 attribute] [feature2 attribute]
[example name] [class label] [feature1 attribute] [feature2 attribute]
[example name] [class label] [feature1 attribute] [feature2 attribute]
[example name] [class label] [feature1 attribute] [feature2 attribute]

The data files can then be modified as you see fit.

Data file structure was given by my instructor Aaron, I did not make them myself

About

Learning Decision Tree from input file using testing data

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages