Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A javascript or java app with decision tree mechanism and simple graphical user

ID: 3575936 • Letter: A

Question

A javascript or java app with decision tree mechanism and simple graphical user interface

Decision tree can be static or can be generated dynamically any time starting programme –you should explain tree generation technique.

TASK REQUIREMENTS

1. Define at least 4 level decision tree with priority tags. (you can use any decision tree topic – any application domain can be observed)

2. Manually recalculate tags value based on its priority – identify repeated object, and recalculate priority tag value of default decision tree.

3. Create application to identify best solution for selected problem:
a. User can adapt decision by selecting any 3 result value from existing tree - Order of selection should be identify in solution chain making – first selected option will have higher tag value. Selection should recalculate total solution tag value for priority.
b. System should provide solution chain how to get selected results – system should select best chain order according to recalculated object and decision tag values.

This decision tree has been made manually from google search by searching '' Computer d '' and see what results and priority tags has. You can refer to this tree for application.

App is about '' trying to find best chain of tree ''

User can select tree solutions and system should provide user with best step chain how to get this solution. For example;

0.9 Desk 0.9 0.7 0.8 With hutch Top kea 0.9 0.7 0.8 Definition Wallpaper mages Computer 0.7 0.8 Definition Desktop 0.7 0.9 0.9 T 0.7 0.8 0.8 Wikipedia pdf In hindi Definition Wallpaper Images 0.9 0.7 0.7 0.9 0.8- Pdf Defined Mouse Digita Hardware Wikipedia

Explanation / Answer

import java.io.*;

import java.util.*;

public category ID3

the category to represent a knowledge purpose consisting of numAttributes values

of attributes */

class DataPoint

};

/* the category to represent a node within the decomposition tree.

*/

class TreeNode

};

TreeNode root = new TreeNode();

public int getSymbolValue(int attribute, String symbol)

return index;

}

public int []getAllValues(Vector information, int attribute) {

Vector values = new Vector();

int num = information.size();

for (int i=0; i< num; i++) {

DataPoint purpose = (DataPoint)data.elementAt(i);

String image =

(String)domains[attribute].elementAt(point.attributes[attribute] );

int index = values.indexOf(symbol);

if (index < 0)

}

int []array = new int[values.size()];

for (int i=0; i< array.length; i++) {

String image = (String)values.elementAt(i);

array = domains[attribute].indexOf(symbol);

}

values = null;

return array;

}

public Vector getSubset(Vector information, int attribute, int value) set = new Vector();

int num = information.size();

for (int i=0; i< num; i++) {

DataPoint purpose = (DataPoint)data.elementAt(i);

if (point.attributes[attribute] == value) set.addElement(point);

}

return subset;

}

public double calculateEntropy(Vector data) {

int numdata = information.size();

if (numdata == 0) come 0;

int attribute = numAttributes-1;

int numvalues = domains[attribute].size();

double total = 0;

for (int i=0; i< numvalues; i++) {

int count=0;

for (int j=0; j< numdata; j++) {

DataPoint purpose = (DataPoint)data.elementAt(j);

if (point.attributes[attribute] == i) count++;

}

double chance = one.*count/numdata;

if (count > 0) total += -probability*Math.log(probability);

}

return sum;

}

public Boolean alreadyUsedToDecompose(TreeNode node, int attribute)

if (node.parent == null) come false;

return alreadyUsedToDecompose(node.parent, attribute);

}

public void decomposeNode(TreeNode node) {

double bestEntropy=0;

boolean selected=false;

int selectedAttribute=0;

int numdata = node.data.size();

int numinputattributes = numAttributes-1;

node.entropy = calculateEntropy(node.data);

if (node.entropy == 0) return;

for (int i=0; i< numinputattributes; i++) {

int numvalues = domains.size();

if ( alreadyUsedToDecompose(node, i) ) continue;

double averageentropy = 0;

for (int j=0; j< numvalues; j++) set = getSubset(node.data, i, j);

if (subset.size() == 0) continue;

double subentropy = calculateEntropy(subset);

averageentropy += subentropy *

subset.size();

}

averageentropy = averageentropy / numdata; //

Taking the weighted average

if (selected == false) else {

if (averageentropy < bestEntropy)

}

}

if (selected == false) return;

int numvalues = domains[selectedAttribute].size();

node.decompositionAttribute = selectedAttribute;

node.children = new TreeNode [numvalues];

for (int j=0; j< numvalues; j++)

for (int j=0; j< numvalues; j++)

node.data = null;

}

public int readData(String filename) throws Exception catch ( Exception e) {

System.err.println( "Unable to open information file: " + file name + " " + e);

return 0;

}

BufferedReader bin = new BufferedReader(new InputStreamReader(in) );

String input;

while(true) {

input = bin.readLine();

if (input == null) {

System.err.println( "No information found within the information file: " + file name +

" ");

return 0;

}

if (input.startsWith("//")) continue;

if (input.equals("")) continue;

break;

}

StringTokenizer tokenizer = new StringTokenizer(input);

numAttributes = tokenizer.countTokens();

if (numAttributes <= 1) {

System.err.println( "Read line: " + input);

System.err.println( "Could not obtain the names of attributes within the

line");

System.err.println( "Expecting a minimum of one input attribute and one

output attribute");

return 0;

}

domains = new Vector[numAttributes];

for (int i=0; i < numAttributes; i++) domains = new Vector();

attributeNames = new String[numAttributes];

for (int i=0; i < numAttributes; i++)

while(true)

root.data.addElement(point);

}

bin.close();

return 1;

}

public void printTree(TreeNode node, String tab) Pine Tree State = new ID3();

int standing = American state.readData("c:\in.txt");

if (status <= 0) return;

me.createDecisionTree();

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote