class: DecTreeMethod

public abstract class: DecTreeMethod
Author:
Project: Phase: 1.0; Status: Proposed; Version: 1.0; Complexity: 1
Dates: Created: 7.12.2005 12:27:52; Modified: 12.12.2005 21:46:03;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {A34DB894-1D40-412c-8AC1-BB6B14B94D67}
Abstract class for building the tree or classifying the data.

 

Goto: Fields, Methods

See also: DecisionTree, DecTreeDataBuild, DecTreeDataClassify, DecTreeProperties, DecTreeData, StepInfo, ID3, StepInfo, CART

Appears in: Algorithm classes

Connections
 
DecTreeMethod Attributes
Attribute Details
public Form
  Properties
public Form
  Window
Notes: Parent window - due to owner for error messages.

public DecisionTree
  Tree
Notes: The decision tree to use.

public DecTreeDataBuild
  DataBuild
Notes: The data for build properties.

public DecTreeDataClassify
  DataClassify
Notes: The data for build properties.

public DecTreeProperties
  GeneralProperties
Notes: General properties for methods.

public ProgressBar
  MethodProgressBar
Notes: Progress bar to show the algorithm progress.

public int
  TransformId
Notes: ID of this method - from the main application.

protected DecTreeData
  Data
Notes: It is DataClassify or DataBuild according to a context.

protected ArrayList
  ResultClasses
Notes: List of all the result classes in data. It is used when working.

private bool
  noStep
Initial: false
Notes: If user canceled the stepping.

private bool
  abortedProcess
Initial: false
Notes: If user aborted all the process.

private StepInfo
  StepInfoWindow
Initial: null
Notes: Window for stepping information

protected DataSrc
  dsrc
Notes: Working DataSrc ( = table)

protected OdbcCommand
  command
Notes: ODBC command for the run the query over the data table.

protected int
  MaxNode
Notes: MaxNode + 1 is the first not used number of node.

 
DecTreeMethod Methods
Operation Details
public abstract
DescribeMethod():string
Sequential
Notes: Get a description for a method instance, for its options etc. Used by stepping.
public
Build():int
Sequential
Notes: Main function for building the decision tree.

@returns negative if error, zero if succes
protected abstract
BuildSpecific():int
Sequential
Notes: Main function for building the decision tree, specific according to a current method.

@returns negative if error, zero if succes
protected abstract
CompareSplitters(
   int node,
   DecTreeSplitter splitter1,
   DecTreeSplitter splitter2):int
Sequential
Notes: Compares two splitters which is better.

@returns 1 if splitter1 is better than splitter2, 0 if it is equivalent, -1 else
protected abstract
GetSplitters(
   int node):ArrayList
Sequential
Notes: Returns ArrayList of Spitter class - all available splitters in node.

@returns
protected
EndCondition(
   int node):bool
Sequential
Notes: Condition for ending of algorithm - if returns true, actual node will be a leaf. For most algorithm is good this general method of EndCondition.

@returns
public
Classify(
   String newVersionName):int
Sequential
Notes: Classify the data according to the Tree. For all methods (descendants) the same code.
protected
ClassifyRecursive(
   int node,
   DecisionTreeNode actualNode):void
Sequential
Notes: Recursive kernel of the classification algorithm.
protected
SetResultClass(
   int node,
   object resultClass):void
Sequential
Notes: Set the class of node.
protected
GetNodeClass(
   int node,
   double prob):object
Sequential
Notes: Returns the biggest class in the node. If there are more ones, returns one of them.

@returns
protected
Split(
   int node,
   DecTreeSplitter splitter):ArrayList
Sequential
Notes: Splits the data according a splitter. Returns ArrayList of nodes (int).

@returns
protected
BuildRecursive(
   int node,
   DecisionTreeNode actualNode,
   int depth):void
Sequential
Notes: The "kernel" of the decision tree algorithms.
protected
BestSplit(
   DecisionTreeNode actualNode,
   int depth,
   int node,
   DecTreeSplitter BestSplitter):ArrayList
Sequential
Notes: Makes a best split of node.

@returns ArrayList of subnodes and the BestSplitter
protected
GetNodeWhere(
   int node):string
Sequential
Notes: Gets SQL WHERE clause for the node.

@returns SQL WHERE clause for the node
protected
MakeSubNode(
   int node,
   string where):int
Sequential
Notes: Makes a subnode of node according to a where clause.

@returns number of the new node
protected
GetCount(
   int node):int
Sequential
Notes: Returns the number of data rows in the node.

@returns
protected
GetCount(
   int node,
   string where):int
Sequential
Notes: Returns the number of data rows in the node, where "where".

@returns
protected
GetCount(
   int node,
   string where,
   string colname,
   object colvalue):int
Sequential
Notes: Returns the number of data rows in the node, where "where" and where colname == colvalue.

@returns
protected
Prob(
   int node,
   object classvalue):double
Sequential
Notes: Returns a probability of class (classvalue) in the node.

@returns
protected
Prob(
   int node,
   string where,
   object classvalue):double
Sequential
Notes: Returns a probability of class (classvalue) in the node, where "where".

@returns
protected
GetColumnValues(
   int node,
   string colname):ArrayList
Sequential
Notes: Gets a list of all values in column in node.

@returns
protected
GetNumericalBreakPoints(
   int node,
   string colname):ArrayList
Sequential
Notes: Gets a list of numerical values (breakpoints) that divides a data to class groups.

@returns
protected
FillResultClasses(
   int node):void
Sequential
Notes: Fills the ArrayList ResultClasses of all the result classes in node.
protected
InitRootNode(
   int node):void
Sequential
Notes: Marks every row as the member of node.
protected
AddColumn(
   string colname,
   string coltype):void
Sequential
Notes: Adds a column to a table specificated in Data.Table. If this column already exists, drops it before - due to types problem.
protected
DropColumn(
   string colname):void
Sequential
Notes: Drops a column in a table specificated in Data.Table.
protected
ExistsColumn(
   string colname):bool
Sequential
Notes: Return if exists the colname in Data.Table.

@returns
public
GetDBString(
   string colname,
   object o):String
Sequential
Notes: Returns string of o suitable for DB query.

@returns
protected
GetScalarDB(
   string query):object
Sequential
Notes: Encapsulation for SQL query.

@returns
protected
GetReaderDB(
   string query):OdbcDataReader
Sequential
Notes: Encapsulation for SQL query.

@returns
protected
ExecuteDB(
   string query):int
Sequential
Notes: Encapsulation for SQL query.

@returns