O'Reilly logo

Hands-On Machine Learning with C# by Matt R. Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning code

Following is the learning code:

// Specify the input variablesDecisionVariable[] variables ={new DecisionVariable("x", DecisionVariableKind.Continuous),new DecisionVariable("y", DecisionVariableKind.Continuous),};// Create the C4.5 learning algorithmvar c45 = new C45Learning(variables);// Learn the decision tree using C4.5tree = c45.Learn(inputs, outputs);// Show the learned tree in the viewdecisionTreeView1.TreeSource = tree;// Get the ranges for each variable (X and Y)DoubleRange[] ranges = table.GetRange(0);// Generate a Cartesian coordinate systemdouble[][] map = Matrix.Mesh(ranges[0],   200, ranges[1], 200);// Classify each point in the Cartesian coordinate systemdouble[,] surface = map.ToMatrix(). InsertColumn(tree.Decide(map)); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required