Class

ai.minxiao.ds4s.core.h2o.prediction

H2OSparkPredictor

Related Doc: package prediction

Permalink

class H2OSparkPredictor extends H2OPredictor with Serializable

H2OSparkPredictor

A trained H2O Model for use in Spark Environment. It loads a pre-trained h2o pojo/mojo model and add prediction functions on RDD, Row, DataFrame

Annotations
@SerialVersionUID()
Linear Supertypes
H2OPredictor, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. H2OSparkPredictor
  2. H2OPredictor
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new H2OSparkPredictor(tp: String, src: String)

    Permalink

    load a trained model with a type and source (name/path).

    load a trained model with a type and source (name/path).

    tp

    the model's type: mojo vs pojo

    src

    the name/path of the pojo/mojo

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. lazy val _f: (RowData) ⇒ AbstractPrediction

    Permalink

    partial function for prediction, auxiliary function h2o github

    partial function for prediction, auxiliary function h2o github

    Attributes
    protected
    Definition Classes
    H2OPredictor
  5. def _predictRow(row: Row, cols: Array[String]): (String, Double)

    Permalink

    Predict on Row, one Row is one instance, helpinng function, used in predictRow

    Predict on Row, one Row is one instance, helpinng function, used in predictRow

    row

    one instance

    cols

    Row column names (dataframe column names)

    returns

    label-score pair (if applicable)

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. lazy val easyModel: EasyPredictModelWrapper

    Permalink
    Attributes
    protected
    Definition Classes
    H2OPredictor
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. lazy val genModel: GenModel

    Permalink
    Attributes
    protected
    Definition Classes
    H2OPredictor
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getRowData(row: Row, cols: Array[String]): RowData

    Permalink
    Attributes
    protected
  15. def getRowData(rdd: RDD[(String, Any)]): RowData

    Permalink
    Attributes
    protected
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. val modelCategory: ModelCategory

    Permalink
    Definition Classes
    H2OPredictor
  19. lazy val names: Array[String]

    Permalink

    feature and response column names

    feature and response column names

    Attributes
    protected
    Definition Classes
    H2OPredictor
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. def predict(rowData: RowData): (String, Double)

    Permalink

    predict on each RowData

    predict on each RowData

    returns

    Tuple2[String, Double]: String: class/cluster/low-dimension-string/regression-value-string Double: confidence score if applicable

    Definition Classes
    H2OPredictor
  24. def predictDF(df: DataFrame, keys: Array[String] = Array.empty[String], predLabelName: String = "label", predScoreName: String = "score")(implicit sqlContext: SQLContext): DataFrame

    Permalink

    prediction on a whole dataframe with key attached

    prediction on a whole dataframe with key attached

    df

    data

    keys

    keys, default=Array()

    predLabelName

    the column name used to store the prediction label, default="label"

    predScoreName

    the column name used to store the prediction score, default="score"

    returns

    dataframe with key(s), label, score

  25. def predictRdd(rdd: RDD[(String, Any)]): (String, Double)

    Permalink

    Predict on RDD

    Predict on RDD

    rdd

    One instance is a RDD[Tuple2[String, Any]], where each element is a feature (name-value pair)

    returns

    label-score pairs (if applicable)

  26. def predictRow(row: Row, cols: Array[String], keys: Array[String] = Array()): Row

    Permalink

    Prediction on Row data with key attached

    Prediction on Row data with key attached

    row

    data

    cols

    data column names

    keys

    keys, array of strings, kept in the result, default=Array()

    returns

    a row of predicted label with confidence score (if applicalbe) and original keys (if provided)

  27. def predictRowCond(row: Row, cols: Array[String], usePrediction: (Row) ⇒ Boolean, labelCol: String, score: Double, keys: Array[String] = Array()): Row

    Permalink

    Conditional Prediction on Row data with key attached, along with non-prediction value/score

    Conditional Prediction on Row data with key attached, along with non-prediction value/score

    row

    data

    cols

    data column names

    usePrediction

    the logic function to decide whether apply the model on this particular instance

    labelCol

    origin label column, if not applying the model, this column's value will be directy retrieved

    keys

    origin keys, default=Array()

    returns

    the row of predictions with keys (optional)

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from H2OPredictor

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped