Math Utilities 0.4

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

Aspire / Aspire Components / Aspire Math - Math Utilities

Aspire Math - Math Utilities
Description: Provides advanced math utilities for use by other bundles.

Provides the classes for Apache Commons Math, plus a useful token histogramming utility.

Inputs: Method calls
Outputs: Apache Commons Math Classes, or the Histogram Class
Factory: aspire-math
Sub Type: default
Object Type: N/A

Aspire Math is used to provide classes to for statistical analyis. See Apache Commons Math for more details.

There is also one custom Aspire class, a "Histogram" class which is used to easily create and output histograms in Aspire.

See below for Groovy Scripting usage examples.


Example Configuration

    <component name="Math" subType="default" factoryName="aspire-math"/>


Using the Histogram Class

 <component name="Math" subType="default" factoryName="aspire-math"/>
 
 <component name="TestHistogram" subType="default" factoryName="aspire-groovy">
   <config>
     <variable name="math" component="Math"/>
       <script>
         <![CDATA[
           // INITIALIZE:  Someplace at the start of the pipeline:
           testHist = math.newHistogram();
           .
           .
           .
           
           // INCREMENT:  Increment the counter:
           topTagHist.increment("Obama");
           topTagHist.increment("Bush");
           topTagHist.increment("Obama");
           topTagHist.increment("Bush");
           topTagHist.increment("Clinton");
           topTagHist.increment("Clinton");
           .
           .
           .
           
           // PRINT TO FILE:  Someplace later in the pipeline, typically...
           // writes the histogram to a tab-delimited file, sorted in order of strength
           testHist.printToFile("President", "data/topTagHist.txt");
         ]]>
     </script>
   </config>
 </component>

Using the DescriptiveStatistics Class

TBD


Using the SimpleRegression Class

TBD