from main import read_data
from main import split_dataset
from tree import decision_tree_learning, predict, prune_tree
# load in the dataset from filepath into dataset
dataset = read_data("filepath.txt")
# get training, validation and test numpy datasets with 90% split
training, test = split_dataset(dataset, 90)
training, validation = split_dataset(training, 90)
# store the decision tree trained on the dataset
dtree = decision_tree_learning(dataset=training)
# load testcase as numpy array here, however you'd like as a numpy 1 row with every attribute
tc = read_data("single_testcase.txt")
# predict using the tree
predict(tree=dtree, attributes=tc)
# prune a given tree
prune_tree(node=dtree, validation_set=validation)
-
Notifications
You must be signed in to change notification settings - Fork 0
salaseviciusm/ml-cw1
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published