Java Doc for ClassifierTree.java in  » Science » weka » weka » classifiers » trees » j48 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » weka » weka.classifiers.trees.j48 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   weka.classifiers.trees.j48.ClassifierTree

All known Subclasses:   weka.classifiers.trees.j48.C45PruneableClassifierTree,  weka.classifiers.trees.j48.NBTreeClassifierTree,  weka.classifiers.trees.j48.PruneableClassifierTree,
ClassifierTree
public class ClassifierTree implements Drawable,Serializable,CapabilitiesHandler(Code)
Class for handling a tree structure used for classification.
author:
   Eibe Frank (eibe@cs.waikato.ac.nz)
version:
   $Revision: 1.21 $


Field Summary
protected  intm_id
     The id for the node.
protected  booleanm_isEmpty
     True if node is empty.
protected  booleanm_isLeaf
     True if node is leaf.
protected  ClassifierSplitModelm_localModel
     Local model at node.
protected  ClassifierTree[]m_sons
     References to sons.
protected  Distributionm_test
     The pruning instances.
protected  ModelSelectionm_toSelectModel
     The model selection method.
protected  Instancesm_train
     The training instances.
final static  longserialVersionUID
    

Constructor Summary
public  ClassifierTree(ModelSelection toSelectLocModel)
     Constructor.

Method Summary
public  intassignIDs(int lastID)
     Assigns a uniqe id to every node in the tree.
public  voidbuildClassifier(Instances data)
     Method for building a classifier tree.
public  voidbuildTree(Instances data, boolean keepData)
     Builds the tree structure.
public  voidbuildTree(Instances train, Instances test, boolean keepData)
    
public  doubleclassifyInstance(Instance instance)
     Classifies an instance.
final public  voidcleanup(Instances justHeaderInfo)
     Cleanup in order to save memory.
final public  double[]distributionForInstance(Instance instance, boolean useLaplace)
     Returns class probabilities for a weighted instance.
public  CapabilitiesgetCapabilities()
     Returns default capabilities of the classifier tree.
protected  ClassifierTreegetNewTree(Instances data)
     Returns a newly created tree.
protected  ClassifierTreegetNewTree(Instances train, Instances test)
     Returns a newly created tree.
Parameters:
  train - the training data
Parameters:
  test - the pruning data.
public  Stringgraph()
     Returns graph describing the tree.
public  intgraphType()
     Returns the type of graph this classifier represents.
protected static  longnextID()
     Gets the next unique node ID.
public  intnumLeaves()
     Returns number of leaves in tree structure.
public  intnumNodes()
     Returns number of nodes in tree structure.
public  Stringprefix()
     Returns tree in prefix order.
protected static  voidresetID()
     Resets the unique node ID counter (e.g.
public  StringBuffer[]toSource(String className)
     Returns source code for the tree as an if-then statement.
public  StringtoString()
     Prints tree structure.

Field Detail
m_id
protected int m_id(Code)
The id for the node.



m_isEmpty
protected boolean m_isEmpty(Code)
True if node is empty.



m_isLeaf
protected boolean m_isLeaf(Code)
True if node is leaf.



m_localModel
protected ClassifierSplitModel m_localModel(Code)
Local model at node.



m_sons
protected ClassifierTree[] m_sons(Code)
References to sons.



m_test
protected Distribution m_test(Code)
The pruning instances.



m_toSelectModel
protected ModelSelection m_toSelectModel(Code)
The model selection method.



m_train
protected Instances m_train(Code)
The training instances.



serialVersionUID
final static long serialVersionUID(Code)
for serialization




Constructor Detail
ClassifierTree
public ClassifierTree(ModelSelection toSelectLocModel)(Code)
Constructor.




Method Detail
assignIDs
public int assignIDs(int lastID)(Code)
Assigns a uniqe id to every node in the tree.
Parameters:
  lastID - the last ID that was assign the new current ID



buildClassifier
public void buildClassifier(Instances data) throws Exception(Code)
Method for building a classifier tree.
Parameters:
  data - the data to build the tree from
throws:
  Exception - if something goes wrong



buildTree
public void buildTree(Instances data, boolean keepData) throws Exception(Code)
Builds the tree structure.
Parameters:
  data - the data for which the tree structure is to begenerated.
Parameters:
  keepData - is training data to be kept?
throws:
  Exception - if something goes wrong



buildTree
public void buildTree(Instances train, Instances test, boolean keepData) throws Exception(Code)
Builds the tree structure with hold out set
Parameters:
  train - the data for which the tree structure is to begenerated.
Parameters:
  test - the test data for potential pruning
Parameters:
  keepData - is training Data to be kept?
throws:
  Exception - if something goes wrong



classifyInstance
public double classifyInstance(Instance instance) throws Exception(Code)
Classifies an instance.
Parameters:
  instance - the instance to classify the classification
throws:
  Exception - if something goes wrong



cleanup
final public void cleanup(Instances justHeaderInfo)(Code)
Cleanup in order to save memory.
Parameters:
  justHeaderInfo -



distributionForInstance
final public double[] distributionForInstance(Instance instance, boolean useLaplace) throws Exception(Code)
Returns class probabilities for a weighted instance.
Parameters:
  instance - the instance to get the distribution for
Parameters:
  useLaplace - whether to use laplace or not the distribution
throws:
  Exception - if something goes wrong



getCapabilities
public Capabilities getCapabilities()(Code)
Returns default capabilities of the classifier tree. the capabilities of this classifier tree



getNewTree
protected ClassifierTree getNewTree(Instances data) throws Exception(Code)
Returns a newly created tree.
Parameters:
  data - the training data the generated tree
throws:
  Exception - if something goes wrong



getNewTree
protected ClassifierTree getNewTree(Instances train, Instances test) throws Exception(Code)
Returns a newly created tree.
Parameters:
  train - the training data
Parameters:
  test - the pruning data. the generated tree
throws:
  Exception - if something goes wrong



graph
public String graph() throws Exception(Code)
Returns graph describing the tree.
throws:
  Exception - if something goes wrong the tree as graph



graphType
public int graphType()(Code)
Returns the type of graph this classifier represents. Drawable.TREE



nextID
protected static long nextID()(Code)
Gets the next unique node ID. the next unique node ID.



numLeaves
public int numLeaves()(Code)
Returns number of leaves in tree structure. the number of leaves



numNodes
public int numNodes()(Code)
Returns number of nodes in tree structure. the number of nodes



prefix
public String prefix() throws Exception(Code)
Returns tree in prefix order.
throws:
  Exception - if something goes wrong the prefix order



resetID
protected static void resetID()(Code)
Resets the unique node ID counter (e.g. between repeated separate print types)



toSource
public StringBuffer[] toSource(String className) throws Exception(Code)
Returns source code for the tree as an if-then statement. The class is assigned to variable "p", and assumes the tested instance is named "i". The results are returned as two stringbuffers: a section of code for assignment of the class, and a section of code containing support code (eg: other support methods).
Parameters:
  className - the classname that this static classifier has an array containing two stringbuffers, the first string containingassignment code, and the second containing source for support code.
throws:
  Exception - if something goes wrong



toString
public String toString()(Code)
Prints tree structure. the tree structure



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.