public abstract class MojoPipeline
extends java.lang.Object
implements java.io.Serializable
This class represents the MOJO scoring pipeline.
It transforms an instance of MojoFrame and produces a new MojoFrame.
| Modifier | Constructor and Description |
|---|---|
protected |
MojoPipeline(java.lang.String uuid,
org.joda.time.DateTime timestamp,
java.lang.String license) |
| Modifier and Type | Method and Description |
|---|---|
org.joda.time.DateTime |
getCreationTime()
Get the creation time of the mojo file
|
protected abstract MojoFrameBuilder |
getFrameBuilder(MojoColumn.Kind kind) |
MojoFrameBuilder |
getInputFrameBuilder()
Get an instance of an
MojoFrameBuilder that can be used to make an input frame |
MojoFrameMeta |
getInputMeta()
Get the meta data for the input frame (see
MojoFrameMeta |
java.lang.String |
getLicense()
Get the license of the mojo file
|
protected abstract MojoFrameMeta |
getMeta(MojoColumn.Kind kind) |
MojoFrameMeta |
getOutputMeta()
Get the meta data for the output frame (see
MojoFrameMeta |
java.lang.String |
getUuid()
Get the pipeline’s uuid, if stated in the creation file.
|
static MojoPipeline |
loadFrom(MojoReaderBackend mrb)
Instantiate MojoPipeline from the provided
MojoReaderBackend. |
static MojoPipeline |
loadFrom(java.lang.String file)
Instantiate MojoPipeline from the provided .mojo file.
|
abstract MojoFrame |
transform(MojoFrame inputFrame)
Executes the pipeline of transformers as stated in this model’s mojo file.
|
MojoFrame |
transform(MojoFrameBuilder inputFrameBuilder)
Executes the pipeline of transformers as stated in this model’s mojo file.
|
abstract MojoFrame |
transform(MojoFrame inputFrame,
MojoFrame outputFrame)
Executes the pipeline of transformers as stated in this model’s mojo file.
|
protected MojoPipeline(java.lang.String uuid,
org.joda.time.DateTime timestamp,
java.lang.String license)
public static MojoPipeline loadFrom(java.lang.String file) throws java.io.IOException, LicenseException
Instantiate MojoPipeline from the provided .mojo file. This is the primary method for creating MojoPipeline instances.
file - Name of the .mojo file with saved model information.java.io.IOException - In case the file cannot be read, or has invalid format, or is not a Mojo-2 file.LicenseExceptionpublic static MojoPipeline loadFrom(MojoReaderBackend mrb) throws java.io.IOException, LicenseException
Instantiate MojoPipeline from the provided MojoReaderBackend.
mrb - The MojoReaderBackend that contains the model informationjava.io.IOException - In case the file cannot be read, or has invalid format, or is not a Mojo-2 file.LicenseExceptionpublic java.lang.String getUuid()
Get the pipeline’s uuid, if stated in the creation file.
public org.joda.time.DateTime getCreationTime()
Get the creation time of the mojo file
public java.lang.String getLicense()
Get the license of the mojo file
public MojoFrameBuilder getInputFrameBuilder()
Get an instance of an MojoFrameBuilder that can be used to make an input frame
protected abstract MojoFrameBuilder getFrameBuilder(MojoColumn.Kind kind)
public MojoFrameMeta getInputMeta()
Get the meta data for the input frame (see MojoFrameMeta
public MojoFrameMeta getOutputMeta()
Get the meta data for the output frame (see MojoFrameMeta
protected abstract MojoFrameMeta getMeta(MojoColumn.Kind kind)
public MojoFrame transform(MojoFrameBuilder inputFrameBuilder)
Executes the pipeline of transformers as stated in this model’s mojo file.
inputFrameBuilder - A MojoFrameBuilder from which an input frame can be retrievedpublic abstract MojoFrame transform(MojoFrame inputFrame)
Executes the pipeline of transformers as stated in this model’s mojo file.
inputFrame - A MojoFrame containing the input datapublic abstract MojoFrame transform(MojoFrame inputFrame, MojoFrame outputFrame)
Executes the pipeline of transformers as stated in this model’s mojo file.
inputFrame - A MojoFrame containing the input dataoutputFrame - A MojoFrame to which the results of the transform pipeline should be writtenoutputFrame reference