[ 
https://issues.apache.org/jira/browse/MAHOUT-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407757#comment-13407757
 ] 

Lance Norskog commented on MAHOUT-1040:
---------------------------------------

The other implementations are used in one place in the source base. The 
standard deviation feature can be an option to a simple class. 

{code}
final class RunningAverage {
   private final boolean doStdev;
   // running doubles
   
   public RunningAverage(boolean doStdev) {
      this.doStdev = doStdev;
   }

   public void addDatum(double d) {
      // do average
      // if (doStdev) do stdev code

   }

   // all getter methods
}
{code}

This has no interface lookup and can be inlined because it is final. Wrapping 
the standard deviation code in an if has zero performance difference.

If all of the other implementations are used by Mahout users, that's fine.

                
> Simplify RunningAverage suite
> -----------------------------
>
>                 Key: MAHOUT-1040
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1040
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Lance Norskog
>            Priority: Minor
>
> The RunningAverage suite of classes is not used in the Mahout source base, 
> except for FullRunningAverage.
> Would it be acceptable to the Mahout user base to collapse this feature into 
> one class?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to