Java Doc for Estimator.java in  » Science » weka » weka » estimators » 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.estimators 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   weka.estimators.Estimator

All known Subclasses:   weka.classifiers.bayes.net.estimate.DiscreteEstimatorBayes,  weka.estimators.PoissonEstimator,  weka.estimators.DiscreteEstimator,  weka.estimators.NormalEstimator,  weka.estimators.KernelEstimator,  weka.estimators.MahalanobisEstimator,
Estimator
abstract public class Estimator implements Cloneable,Serializable,OptionHandler,CapabilitiesHandler(Code)
Abstract class for all estimators. Example code for a nonincremental estimator
 // create a histogram for estimation
 EqualWidthEstimator est = new EqualWidthEstimator();
 est.addValues(instances, attrIndex);
 
Example code for an incremental estimator (incremental estimators must implement interface IncrementalEstimator)
 // Create a discrete estimator that takes values 0 to 9
 DiscreteEstimator newEst = new DiscreteEstimator(10, true);
 // Create 50 random integers first predicting the probability of the
 // value, then adding the value to the estimator
 Random r = new Random(seed);
 for(int i = 0; i < 50; i++) {
 current = Math.abs(r.nextInt() % 10);
 System.out.println(newEst);
 System.out.println("Prediction for " + current 
 + " = " + newEst.getProbability(current));
 newEst.addValue(current, 1);
 }
 
Example code for a main method for an estimator.

 public static void main(String [] argv) {
 try {
 LoglikeliEstimator est = new LoglikeliEstimator();      
 Estimator.buildEstimator((Estimator) est, argv, false);      
 System.out.println(est.toString());
 } catch (Exception ex) {
 ex.printStackTrace();
 System.out.println(ex.getMessage());
 }
 }
 

author:
   Gabi Schmidberger (gabi@cs.waikato.ac.nz)
author:
   Len Trigg (trigg@cs.waikato.ac.nz)
version:
   $Revision: 1.9 $


Field Summary
protected  doublem_classValueIndex
    
final static  longserialVersionUID
    


Method Summary
public  voidaddValue(double data, double weight)
     Add a new data value to the current estimator.
public  voidaddValues(Instances data, int attrIndex)
     Initialize the estimator with a new dataset.
public  voidaddValues(Instances data, int attrIndex, double min, double max, double factor)
     Initialize the estimator with all values of one attribute of a dataset.
public  voidaddValues(Instances data, int attrIndex, int classIndex, int classValue)
     Initialize the estimator using only the instance of one class.
public  voidaddValues(Instances data, int attrIndex, int classIndex, int classValue, double min, double max)
     Initialize the estimator using only the instance of one class.
public static  voidbuildEstimator(Estimator est, String[] options, boolean isIncremental)
     Build an estimator using the options.
public static  voidbuildEstimator(Estimator est, Instances instances, int attrIndex, int classIndex, int classValueIndex, boolean isIncremental)
    
public static  Estimatorclone(Estimator model)
     Creates a deep copy of the given estimator using serialization.
public  StringdebugTipText()
    
public  booleanequals(Object obj)
    
public static  EstimatorforName(String name, String[] options)
     Creates a new instance of a estimatorr given it's class name and (optional) arguments to pass to it's setOptions method.
public  CapabilitiesgetCapabilities()
     Returns the Capabilities of this Estimator.
public  booleangetDebug()
     Get whether debugging is turned on.
public  String[]getOptions()
     Gets the current settings of the Estimator.
abstract public  doublegetProbability(double data)
     Get a probability estimate for a value.
public  EnumerationlistOptions()
     Returns an enumeration describing the available options.
public static  Estimator[]makeCopies(Estimator model, int num)
     Creates a given number of deep copies of the given estimator using serialization.
Parameters:
  model - the estimator to copy
Parameters:
  num - the number of estimator copies to create.
public static  EstimatormakeCopy(Estimator model)
     Creates a deep copy of the given estimator using serialization.
public  voidsetDebug(boolean debug)
     Set debugging mode.
public  voidsetOptions(String[] options)
     Parses a given list of options.
public  voidtestCapabilities(Instances data, int attrIndex)
     Test if the estimator can handle the data.

Field Detail
m_classValueIndex
protected double m_classValueIndex(Code)
The class value index is > -1 if subset is taken with specific class value only



serialVersionUID
final static long serialVersionUID(Code)
for serialization





Method Detail
addValue
public void addValue(double data, double weight)(Code)
Add a new data value to the current estimator.
Parameters:
  data - the new data value
Parameters:
  weight - the weight assigned to the data value



addValues
public void addValues(Instances data, int attrIndex) throws Exception(Code)
Initialize the estimator with a new dataset. Finds min and max first.
Parameters:
  data - the dataset used to build this estimator
Parameters:
  attrIndex - attribute the estimator is for
exception:
  Exception - if building of estimator goes wrong



addValues
public void addValues(Instances data, int attrIndex, double min, double max, double factor) throws Exception(Code)
Initialize the estimator with all values of one attribute of a dataset. Some estimator might ignore the min and max values.
Parameters:
  data - the dataset used to build this estimator
Parameters:
  attrIndex - attribute the estimator is for
Parameters:
  min - minimal border of range
Parameters:
  max - maximal border of range
Parameters:
  factor - number of instances has been reduced to that factor
exception:
  Exception - if building of estimator goes wrong



addValues
public void addValues(Instances data, int attrIndex, int classIndex, int classValue) throws Exception(Code)
Initialize the estimator using only the instance of one class. It is using the values of one attribute only.
Parameters:
  data - the dataset used to build this estimator
Parameters:
  attrIndex - attribute the estimator is for
Parameters:
  classIndex - index of the class attribute
Parameters:
  classValue - the class value
exception:
  Exception - if building of estimator goes wrong



addValues
public void addValues(Instances data, int attrIndex, int classIndex, int classValue, double min, double max) throws Exception(Code)
Initialize the estimator using only the instance of one class. It is using the values of one attribute only.
Parameters:
  data - the dataset used to build this estimator
Parameters:
  attrIndex - attribute the estimator is for
Parameters:
  classIndex - index of the class attribute
Parameters:
  classValue - the class value
Parameters:
  min - minimal value of this attribute
Parameters:
  max - maximal value of this attribute
exception:
  Exception - if building of estimator goes wrong



buildEstimator
public static void buildEstimator(Estimator est, String[] options, boolean isIncremental) throws Exception(Code)
Build an estimator using the options. The data is given in the options.
Parameters:
  est - the estimator used
Parameters:
  options - the list of options
Parameters:
  isIncremental - true if estimator is incremental
exception:
  Exception - if something goes wrong or the user requests help oncommand options



buildEstimator
public static void buildEstimator(Estimator est, Instances instances, int attrIndex, int classIndex, int classValueIndex, boolean isIncremental) throws Exception(Code)



clone
public static Estimator clone(Estimator model) throws Exception(Code)
Creates a deep copy of the given estimator using serialization.
Parameters:
  model - the estimator to copy a deep copy of the estimator
exception:
  Exception - if an error occurs



debugTipText
public String debugTipText()(Code)
Returns the tip text for this property tip text for this property suitable fordisplaying in the explorer/experimenter gui



equals
public boolean equals(Object obj)(Code)
Tests whether the current estimation object is equal to another estimation object
Parameters:
  obj - the object to compare against true if the two objects are equal



forName
public static Estimator forName(String name, String[] options) throws Exception(Code)
Creates a new instance of a estimatorr given it's class name and (optional) arguments to pass to it's setOptions method. If the classifier implements OptionHandler and the options parameter is non-null, the classifier will have it's options set.
Parameters:
  name - the fully qualified class name of the estimatorr
Parameters:
  options - an array of options suitable for passing to setOptions. Maybe null. the newly created classifier, ready for use.
exception:
  Exception - if the classifier name is invalid, or the optionssupplied are not acceptable to the classifier



getCapabilities
public Capabilities getCapabilities()(Code)
Returns the Capabilities of this Estimator. Derived estimators have to override this method to enable capabilities. the capabilities of this object
See Also:   Capabilities



getDebug
public boolean getDebug()(Code)
Get whether debugging is turned on. true if debugging output is on



getOptions
public String[] getOptions()(Code)
Gets the current settings of the Estimator. an array of strings suitable for passing to setOptions



getProbability
abstract public double getProbability(double data)(Code)
Get a probability estimate for a value.
Parameters:
  data - the value to estimate the probability of the estimated probability of the supplied value



listOptions
public Enumeration listOptions()(Code)
Returns an enumeration describing the available options. an enumeration of all the available options.



makeCopies
public static Estimator[] makeCopies(Estimator model, int num) throws Exception(Code)
Creates a given number of deep copies of the given estimator using serialization.
Parameters:
  model - the estimator to copy
Parameters:
  num - the number of estimator copies to create. an array of estimators.
exception:
  Exception - if an error occurs



makeCopy
public static Estimator makeCopy(Estimator model) throws Exception(Code)
Creates a deep copy of the given estimator using serialization.
Parameters:
  model - the estimator to copy a deep copy of the estimator
exception:
  Exception - if an error occurs



setDebug
public void setDebug(boolean debug)(Code)
Set debugging mode.
Parameters:
  debug - true if debug output should be printed



setOptions
public void setOptions(String[] options) throws Exception(Code)
Parses a given list of options. Valid options are:

-D
If set, estimator is run in debug mode and may output additional info to the console.


Parameters:
  options - the list of options as an array of strings
exception:
  Exception - if an option is not supported




testCapabilities
public void testCapabilities(Instances data, int attrIndex) throws Exception(Code)
Test if the estimator can handle the data.
Parameters:
  data - the dataset the estimator takes an attribute from
Parameters:
  attrIndex - the index of the attribute
See Also:   Capabilities



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.