Select Page

UW Implement a TextClassifier Data Type & Binary Decision Tree Programming Exercise

Question Description

I’m working on a java project and need support to help me learn.

Below I have attached the workspace as well as the full spec, please implement the methods below according to the spec

Only the following 4 methods need to be implemented in TextClassifier.java:
1) TextClassifier(Vectorizer vectorizer, Splitter splitter)

Constructs a new TextClassifier given a fitted vectorizer for transforming data points and a splitter for determining the splits in the treeTextClassifier(Vectorizer vectorizer, Splitter splitter

2) boolean classify(String text)
Returns a boolean representing the predicted label for the given text.
3) void print()
Prints a Java code representation of this decision tree in if/else statement format without braces and with 1 additional indentation space per level in the decision tree. Leaf nodes should print “return true;” or “return false;” depending on the label value.
4) void prune(int depth)
Prunes this tree to the given depth. Each pruned subtree is replaced with a new node representing the subtree’s majority label. For example, pruning the above decision tree to depth 1 would result in the following structure.

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now