Answered step by step
Verified Expert Solution
Question
1 Approved Answer
LANGUAGE IS CPP COULD YOU HELP ME IMPLEMENT THESE FUNCTIONS DESICION TREES ARE NEED TO BE MADE AND PREDICTIONS ABOUT GRADES ARE TO BE DONE
LANGUAGE IS CPP
COULD YOU HELP ME IMPLEMENT THESE FUNCTIONS
DESICION TREES ARE NEED TO BE MADE AND PREDICTIONS ABOUT GRADES ARE TO BE DONE
//Data Structure to maintain Tree for training, predictions and traversal templatestruct Tree{ void build_tree(LinkedList trainDataset, int start, int WindowSize){ } //Takes a testDataset and rowIndex as input and returns a potential string i.e. 'Good' T predictOne(LinkedList testDataset, int rowIndex){ } //Takes a testDataset as input and returns a potential predictions as LinkedList i.e. {'Good','Excellent','Notfound'} LinkedList predictAll(LinkedList testDataset){ } //This function computes accuracy after training float accuracy(LinkedList testDataset){ } //This function returns string in csv format i.e. "1,16,2,9" after traversing in preOrder fashion. //Check Test Case for better understanding of output string preOrderTraversal(){ } //This function returns string in csv format i.e. "1,16,2,9" after traversing in inOrder fashion //Check Test Case for better understanding of output string inOrderTraversal(){ } //This function returns string in csv format i.e. "1,16,2,9" after traversing in postOrder fashion //Check Test Case for better understanding of output string postOrderTraversal(){ } }; //Data Structure to maintain Multiple Trees for training and predictions template struct Forest{ //Constructor to set some data members Forest(int NTrees,int WindowSize, int stepSize){ } //This function calls train on each tree individually by following the sliding window logic and keeps track of those trees. void build_forest(LinkedList trainDataset){ } //This function takes predictions on 1 entry of testDataset from all Trees and then merge them together, //and only gives those entries whose occurence is maximum in that list and return that. LinkedList predictOne(LinkedList testDataset, int rowIndex){ } //This function takes predictions on all entries of testDataset from all Trees and then merge them together, //and only gives those entries whose occurence is maximum in that list and return that. LinkedList > predictAll(LinkedList testDataset){ } float accuracy(LinkedList testDataset){ } };
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started