Class/Object

org.apache.predictionio.controller

Engine

Related Docs: object Engine | package controller

Permalink

class Engine[TD, EI, PD, Q, P, A] extends BaseEngine[EI, Q, P, A]

This class chains up the entire data process. PredictionIO uses this information to create workflows and deployments. In Scala, you should implement an object that extends the EngineFactory trait similar to the following example.

object ItemRankEngine extends EngineFactory {
  def apply() = {
    new Engine(
      classOf[ItemRankDataSource],
      classOf[ItemRankPreparator],
      Map(
        "knn" -> classOf[KNNAlgorithm],
        "rand" -> classOf[RandomAlgorithm],
        "mahoutItemBased" -> classOf[MahoutItemBasedAlgorithm]),
      classOf[ItemRankServing])
  }
}
TD

Training data class.

EI

Evaluation info class.

PD

Prepared data class.

Q

Input query class.

P

Output prediction class.

A

Actual value class.

See also

EngineFactory

Linear Supertypes
BaseEngine[EI, Q, P, A], Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Engine
  2. BaseEngine
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Engine(dataSourceClass: Class[_ <: BaseDataSource[TD, EI, Q, A]], preparatorClass: Class[_ <: BasePreparator[TD, PD]], algorithmClassMap: Map[String, Class[_ <: BaseAlgorithm[PD, _, Q, P]]], servingClass: Class[_ <: BaseServing[Q, P]])

    Permalink

    Java-friendly constructor

    Java-friendly constructor

    dataSourceClass

    Data source class.

    preparatorClass

    Preparator class.

    algorithmClassMap

    Map of algorithm names to classes.

    servingClass

    Serving class.

  2. new Engine(dataSourceClass: Class[_ <: BaseDataSource[TD, EI, Q, A]], preparatorClass: Class[_ <: BasePreparator[TD, PD]], algorithmClassMap: Map[String, Class[_ <: BaseAlgorithm[PD, _, Q, P]]], servingClass: Class[_ <: BaseServing[Q, P]])

    Permalink

    This auxiliary constructor is provided for backward compatibility.

    This auxiliary constructor is provided for backward compatibility.

    dataSourceClass

    Data source class.

    preparatorClass

    Preparator class.

    algorithmClassMap

    Map of algorithm names to classes.

    servingClass

    Serving class.

  3. new Engine(dataSourceClassMap: Map[String, Class[_ <: BaseDataSource[TD, EI, Q, A]]], preparatorClassMap: Map[String, Class[_ <: BasePreparator[TD, PD]]], algorithmClassMap: Map[String, Class[_ <: BaseAlgorithm[PD, _, Q, P]]], servingClassMap: Map[String, Class[_ <: BaseServing[Q, P]]])

    Permalink

    dataSourceClassMap

    Map of data source names to class.

    preparatorClassMap

    Map of preparator names to class.

    algorithmClassMap

    Map of algorithm names to classes.

    servingClassMap

    Map of serving names to class.

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. val algorithmClassMap: Map[String, Class[_ <: BaseAlgorithm[PD, _, Q, P]]]

    Permalink

    Map of algorithm names to classes.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def batchEval(sc: SparkContext, engineParamsList: Seq[EngineParams], params: WorkflowParams): Seq[(EngineParams, Seq[(EI, RDD[(Q, P, A)])])]

    Permalink

    :: DeveloperApi :: Override this method to further optimize the process that runs multiple evaluations (during tuning, for example).

    :: DeveloperApi :: Override this method to further optimize the process that runs multiple evaluations (during tuning, for example). By default, this method calls eval for each element in the engine parameters list.

    sc

    An instance of SparkContext.

    engineParamsList

    A list of EngineParams for running batch evaluation.

    params

    An instance of WorkflowParams that controls the workflow.

    returns

    A list of engine parameters and evaluation result (from eval) tuples.

    Definition Classes
    BaseEngine
    Annotations
    @DeveloperApi()
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def copy(dataSourceClassMap: Map[String, Class[_ <: BaseDataSource[TD, EI, Q, A]]] = dataSourceClassMap, preparatorClassMap: Map[String, Class[_ <: BasePreparator[TD, PD]]] = preparatorClassMap, algorithmClassMap: Map[String, Class[_ <: BaseAlgorithm[PD, _, Q, P]]] = algorithmClassMap, servingClassMap: Map[String, Class[_ <: BaseServing[Q, P]]] = servingClassMap): Engine[TD, EI, PD, Q, P, A]

    Permalink

    Returns a new Engine instance, mimicking case class's copy method behavior.

  9. val dataSourceClassMap: Map[String, Class[_ <: BaseDataSource[TD, EI, Q, A]]]

    Permalink

    Map of data source names to class.

  10. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def eval(sc: SparkContext, engineParams: EngineParams, params: WorkflowParams): Seq[(EI, RDD[(Q, P, A)])]

    Permalink

    This is implemented such that org.apache.predictionio.controller.Evaluation can use this method to generate inputs for org.apache.predictionio.controller.Metric.

    This is implemented such that org.apache.predictionio.controller.Evaluation can use this method to generate inputs for org.apache.predictionio.controller.Metric.

    sc

    An instance of SparkContext.

    engineParams

    An instance of EngineParams for running a single evaluation.

    params

    An instance of WorkflowParams that controls the workflow.

    returns

    A list of evaluation information and RDD of query, predicted result, and actual result tuple tuple.

    Definition Classes
    EngineBaseEngine
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  17. def jValueToEngineParams(variantJson: JValue, jsonExtractor: JsonExtractorOption): EngineParams

    Permalink

    :: DeveloperApi :: Implement this method to convert a JValue (read from an engine variant JSON file) to an instance of EngineParams.

    :: DeveloperApi :: Implement this method to convert a JValue (read from an engine variant JSON file) to an instance of EngineParams.

    variantJson

    Content of the engine variant JSON as JValue.

    jsonExtractor

    Content of the engine variant JSON as JValue.

    returns

    An instance of EngineParams converted from JSON.

    Definition Classes
    EngineBaseEngine
  18. lazy val logger: Logger

    Permalink
    Attributes
    protected
  19. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  22. val preparatorClassMap: Map[String, Class[_ <: BasePreparator[TD, PD]]]

    Permalink

    Map of preparator names to class.

  23. val servingClassMap: Map[String, Class[_ <: BaseServing[Q, P]]]

    Permalink

    Map of serving names to class.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  26. def train(sc: SparkContext, engineParams: EngineParams, engineInstanceId: String, params: WorkflowParams): Seq[Any]

    Permalink

    Training this engine would return a list of models.

    Training this engine would return a list of models.

    sc

    An instance of SparkContext.

    engineParams

    An instance of EngineParams for running a single training.

    params

    An instance of WorkflowParams that controls the workflow.

    returns

    A list of models.

    Definition Classes
    EngineBaseEngine
  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 BaseEngine[EI, Q, P, A]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped