machine learning - How to input test data using the DecisionTree module in python? -


Python DesisionTree modules attach a piece of the homepage (), they provide the code. Here it is:

  dt = decisionTree (training_datafile = "training.dat", debug1 = 1) dt.get_training_data () dt.show_training_data () root_node = dt.construct_decision_tree_classifier () root_node.display_decision_tree ( "") Test_sanpl = [ 'Acssersising = & gt; Never ',' smoking = & gt; Heavy ',' fatIntake = & gt; Heavy ',' VideoVision = & gt; The high '] classification = dt.classify (root_node, test_sample) print "classified", classification   

My question: How can I specify the sample data (test_sample here) From the variable? On the project homepage, it says: "You first classify new data by creating a new data vector:" I have searched but I am unable to figure out what the data vector is or answer to my question.

Any help would be appreciated!

um, such as a list of strings that everyone says, which characteristics and values ​​"= & Gt; For example, using a characteristic "exercise", and the value 'never'.

Comments