water.score
Class ScoreModel

java.lang.Object
  extended by water.score.ScoreModel
Direct Known Subclasses:
RFScoreModel, ScorecardModel

public abstract class ScoreModel
extends java.lang.Object

Embedded Scoring model


Field Summary
 java.lang.String[] _colNames
           
 java.lang.String _name
           
 
Method Summary
 int[] columnMapping(java.lang.String[] features)
           
abstract  double score(java.util.HashMap<java.lang.String,java.lang.Comparable> row)
          Score this model on the specified row of data, where the data is specified as a collection of K/V pairs - Values are one of String or Boolean or Number (or subclasses of Number)
abstract  double score(int[] MAP, java.lang.String[] SS, double[] DS)
          Score this model on the specified row of data, where the data is specified as the members of arrays.
protected static java.lang.String uniqueClassName(java.lang.String name)
           
protected static java.lang.String xml2jname(java.lang.String xml)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

public final java.lang.String _name

_colNames

public final java.lang.String[] _colNames
Method Detail

xml2jname

protected static java.lang.String xml2jname(java.lang.String xml)

uniqueClassName

protected static java.lang.String uniqueClassName(java.lang.String name)

columnMapping

public int[] columnMapping(java.lang.String[] features)

score

public abstract double score(java.util.HashMap<java.lang.String,java.lang.Comparable> row)
Score this model on the specified row of data, where the data is specified as a collection of K/V pairs - Values are one of String or Boolean or Number (or subclasses of Number)


score

public abstract double score(int[] MAP,
                             java.lang.String[] SS,
                             double[] DS)
Score this model on the specified row of data, where the data is specified as the members of arrays. MAP is used to map between the SS/DS columns and the columns desired by the Model; this map can be made by a single call to columnMapping. SS/DS hold either String values (for enum/categorical data) or a primitive double. This format exchanges a HashMap lookup for a bare array access, and can be faster (perhaps much faster) for models that are alread quick to score.