Returns the global average of the score returned by the calculate method.
If your query class cannot be automatically serialized/deserialized to/from
JSON, implement a trait by extending this trait, and overriding the
querySerializer
member with your
custom JSON4S serializer.
Defines a deployment that contains an Engine
Empty actual result.
Empty algorithm parameters.
Empty data parameters.
Empty data source parameters.
Empty evaluation info.
Empty metrics parameters.
Empty model.
A concrete implementation of Params representing empty parameters.
Empty preparator parameters.
Empty prepared data.
Empty serving parameters.
Empty training data.
This class chains up the entire data process.
If you intend to let PredictionIO create workflow and deploy serving automatically, you will need to implement an object that extends this class and return an Engine.
This class serves as a logical grouping of all required engine's parameters.
Defines an engine parameters generator.
Defines an evaluation that contains an engine and a metric.
:: Experimental :: FastEvalEngine is a subclass of Engine that exploits the immutability of controllers to optimize the evaluation process
:: Experimental :: Workflow based on FastEvalEngine
A helper concrete implementation of io.prediction.core.BasePreparator that passes training data through without any special preparation.
Base class of a local algorithm.
A concrete implementation of LServing returning the average of all algorithms' predictions, where their classes are expected to be all Double.
Base class of a local data source.
A concrete implementation of LServing returning the first algorithm's prediction result directly without any modification.
Base class of a local preparator.
Base class of serving.
This trait is a convenience helper for persisting your model to the local filesystem.
Implement an object that extends this trait for PredictionIO to support loading a persisted model from local filesystem during serving deployment.
Base class of a Metric.
:: DeveloperApi :: Do no use this directly.
Contains all results of a MetricEvaluator
Case class storing a primary score, and other scores
Returns the global average of the non-None score returned by the calculate method.
Returns the global standard deviation of the non-None score returned by the calculate method
Base class of a parallel-to-local algorithm.
Base class of a parallel algorithm.
Base class of a parallel data source.
Base class of a parallel preparator.
Base trait for all kinds of parameters that will be passed to constructors of different controller classes.
Mix in and implement this trait if your model cannot be persisted by PredictionIO automatically.
Implement an object that extends this trait for PredictionIO to support loading a persisted model during serving deployment.
Trait for metric which returns a score based on Query, PredictedResult, and ActualResult
Extends a data class with this trait if you want PredictionIO to automatically perform sanity check on your data classes during training.
Base class of several helper types that represent emptiness
SimpleEngine has only one algorithm, and uses default preparator and serving layer.
This shorthand class serves the SimpleEngine
class.
Returns the global standard deviation of the score returned by the calculate method
Returns the sum of the score returned by the calculate method.
Returns zero.
DEPRECATED.
DEPRECATED.
DEPRECATED.
DEPRECATED.
DEPRECATED.
DEPRECATED.
DEPRECATED.
Mix in this trait for queries that contain prId (PredictedResultId).
DEPRECATED.
This object contains concrete implementation for some methods of the Engine class.
Companion object for creating EngineParams instances.
:: Experimental :: Workflow based on FastEvalEngine
Companion object of IdentityPreparator that conveniently returns an instance of the class of IdentityPreparator for use with EngineFactory.
A concrete implementation of LServing returning the average of all algorithms' predictions, where their classes are expected to be all Double.
A concrete implementation of LServing returning the first algorithm's prediction result directly without any modification.
Companion object of MetricEvaluator
Controller utilities.
Companion object of ZeroMetric
DEPRECATED.
DEPRECATED.
Provides building blocks for writing a complete prediction engine consisting of DataSource, Preparator, Algorithm, Serving, and Evaluation.
Start Building an Engine
The starting point of a prediction engine is the Engine class.
The DASE Paradigm
The building blocks together form the DASE paradigm. Learn more about DASE here.
Types of Building Blocks
Depending on the problem you are solving, you would need to pick appropriate flavors of building blocks.
Engines
There are 3 typical engine configurations:
In both configurations 1 and 2, data is sourced and prepared in a parallelized fashion, with data type as RDD.
The difference between configurations 1 and 2 come at the algorithm stage. In configuration 1, the algorithm operates on potentially large data as RDDs in the Spark cluster, and eventually outputs a model that is small enough to fit in a single machine.
On the other hand, configuration 2 outputs a model that is potentially too large to fit in a single machine, and must reside in the Spark cluster as RDD(s).
With configuration 1 (P2LAlgorithm), PredictionIO will automatically try to persist the model to local disk or HDFS if the model is serializable.
With configuration 2 (PAlgorithm), PredictionIO will not automatically try to persist the model, unless the model implements the PersistentModel trait.
In special circumstances where both the data and the model are small, configuration 3 may be used. Beware that RDDs cannot be used with configuration 3.
Data Source
PDataSource is probably the most used data source base class with the ability to process RDD-based data. LDataSource cannot handle RDD-based data. Use only when you have a special requirement.
Preparator
With PDataSource, you must pick PPreparator. The same applies to LDataSource and LPreparator.
Algorithm
The workhorse of the engine comes in 3 different flavors.
P2LAlgorithm
Produces a model that is small enough to fit in a single machine from PDataSource and PPreparator. The model cannot contain any RDD. If the produced model is serializable, PredictionIO will try to automatically persist it. In addition, P2LAlgorithm.batchPredict is already implemented for Evaluation purpose.
PAlgorithm
Produces a model that could contain RDDs from PDataSource and PPreparator. PredictionIO will not try to persist it automatically unless the model implements PersistentModel. PAlgorithm.batchPredict must be implemented for Evaluation.
LAlgorithm
Produces a model that is small enough to fit in a single machine from LDataSource and LPreparator. The model cannot contain any RDD. If the produced model is serializable, PredictionIO will try to automatically persist it. In addition, LAlgorithm.batchPredict is already implemented for Evaluation purpose.
Serving
The serving component comes with only 1 flavor--LServing. At the serving stage, it is assumed that the result being served is already at a human- consumable size.
Model Persistence
PredictionIO tries its best to persist trained models automatically. Please refer to LAlgorithm.makePersistentModel, P2LAlgorithm.makePersistentModel, and PAlgorithm.makePersistentModel for descriptions on different strategies.