Class

org.apache.predictionio.core

BaseAlgorithm

Related Doc: package core

Permalink

abstract class BaseAlgorithm[PD, M, Q, P] extends AbstractDoer with BaseQuerySerializer

:: DeveloperApi :: Base class of all algorithm controllers

PD

Prepared data class

M

Model class

Q

Query class

P

Predicted result class

Annotations
@DeveloperApi()
Linear Supertypes
BaseQuerySerializer, AbstractDoer, Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BaseAlgorithm
  2. BaseQuerySerializer
  3. AbstractDoer
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BaseAlgorithm()

    Permalink

Abstract Value Members

  1. abstract def batchPredictBase(sc: SparkContext, bm: Any, qs: RDD[(Long, Q)]): RDD[(Long, P)]

    Permalink

    :: DeveloperApi :: Engine developers should not use this directly.

    :: DeveloperApi :: Engine developers should not use this directly. This is called by evaluation workflow to perform batch prediction.

    sc

    Spark context

    bm

    Model

    qs

    Batch of queries

    returns

    Batch of predicted results

    Annotations
    @DeveloperApi()
  2. abstract def predictBase(bm: Any, q: Q): P

    Permalink

    :: DeveloperApi :: Engine developers should not use this directly.

    :: DeveloperApi :: Engine developers should not use this directly. Called by serving to perform a single prediction.

    bm

    Model

    q

    Query

    returns

    Predicted result

    Annotations
    @DeveloperApi()
  3. abstract def trainBase(sc: SparkContext, pd: PD): M

    Permalink

    :: DeveloperApi :: Engine developers should not use this directly.

    :: DeveloperApi :: Engine developers should not use this directly. This is called by workflow to train a model.

    sc

    Spark context

    pd

    Prepared data

    returns

    Trained model

    Annotations
    @DeveloperApi()

Concrete 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. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  10. lazy val gsonTypeAdapterFactories: Seq[TypeAdapterFactory]

    Permalink

    :: DeveloperApi :: Serializer for Java query classes using Gson

    :: DeveloperApi :: Serializer for Java query classes using Gson

    Definition Classes
    BaseQuerySerializer
  11. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  13. def makePersistentModel(sc: SparkContext, modelId: String, algoParams: Params, bm: Any): Any

    Permalink

    :: DeveloperApi :: Engine developers should not use this directly.

    :: DeveloperApi :: Engine developers should not use this directly. Prepare a model for persistence in the downstream consumer. PredictionIO supports 3 types of model persistence: automatic persistence, manual persistence, and re-training on deployment. This method provides a way for downstream modules to determine which mode the model should be persisted.

    sc

    Spark context

    modelId

    Model ID

    algoParams

    Algorithm parameters that trained this model

    bm

    Model

    returns

    The model itself for automatic persistence, an instance of org.apache.predictionio.workflow.PersistentModelManifest for manual persistence, or Unit for re-training on deployment

    Annotations
    @DeveloperApi()
  14. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  17. def queryClass: Class[Q]

    Permalink

    :: DeveloperApi :: Obtains the type signature of query for this algorithm

    :: DeveloperApi :: Obtains the type signature of query for this algorithm

    returns

    Type signature of query

  18. lazy val querySerializer: Formats

    Permalink

    :: DeveloperApi :: Serializer for Scala query classes using org.apache.predictionio.controller.Utils.json4sDefaultFormats

    :: DeveloperApi :: Serializer for Scala query classes using org.apache.predictionio.controller.Utils.json4sDefaultFormats

    Definition Classes
    BaseQuerySerializer
  19. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from BaseQuerySerializer

Inherited from AbstractDoer

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped