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. 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)

  5. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  15. val modelCategory: ModelCategory

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

    Permalink

    feature and response column names

    feature and response column names

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

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

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

    Permalink
    Definition Classes
    AnyRef
  20. 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
  21. 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

  22. 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)

  23. 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)

  24. 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)

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. 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