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) |
abstract MojoFrameBuilder |
getOutputFrameBuilder(MojoFrameBuilder inputFrameBuilder)
Get an instance of an
MojoFrameBuilder that can be used to make an output frame |
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)
Deprecated.
use
MojoPipelineService.loadPipeline(ReaderBackend, ai.h2o.mojos.runtime.api.PipelineConfig) instead |
static MojoPipeline |
loadFrom(java.lang.String file)
Deprecated.
use
MojoPipelineService.loadPipeline(File, ai.h2o.mojos.runtime.api.PipelineConfig) instead |
abstract void |
printPipelineInfo(java.io.PrintStream out) |
abstract void |
setListener(ai.h2o.mojos.runtime.api.BasePipelineListener listener)
Deprecated.
use
PipelineConfig.Builder#listener(BasePipelineListener) instead. |
abstract void |
setShapPredictContrib(boolean enable)
Deprecated.
use
PipelineConfig.Builder#enableShap(boolean) instead. |
abstract void |
setShapPredictContribOriginal(boolean enable)
Deprecated.
use
PipelineConfig.Builder#enableShapOriginal(boolean) instead. |
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)
@Deprecated public static MojoPipeline loadFrom(java.lang.String file) throws java.io.IOException, LicenseException
MojoPipelineService.loadPipeline(File, ai.h2o.mojos.runtime.api.PipelineConfig) insteadInstantiate 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.LicenseException@Deprecated public static MojoPipeline loadFrom(MojoReaderBackend mrb) throws java.io.IOException, LicenseException
MojoPipelineService.loadPipeline(ReaderBackend, ai.h2o.mojos.runtime.api.PipelineConfig) insteadjava.io.IOExceptionLicenseExceptionpublic 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
public abstract MojoFrameBuilder getOutputFrameBuilder(MojoFrameBuilder inputFrameBuilder)
Get an instance of an MojoFrameBuilder that can be used to make an output frame
inputFrameBuilder - a frame builder potentially containing some shared columns (for feature exposeInputColumns)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 MojoFrame transform(MojoFrame inputFrame)
Executes the pipeline of transformers as stated in this model’s mojo file.
inputFrame - A MojoFrame containing the input datamark this method final after https://github.com/h2oai/dai-deployment-templates/pull/172 is merged
public 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@Deprecated public abstract void setShapPredictContrib(boolean enable)
PipelineConfig.Builder#enableShap(boolean) instead.@Deprecated public abstract void setShapPredictContribOriginal(boolean enable)
PipelineConfig.Builder#enableShapOriginal(boolean) instead.@Deprecated public abstract void setListener(ai.h2o.mojos.runtime.api.BasePipelineListener listener)
PipelineConfig.Builder#listener(BasePipelineListener) instead.public abstract void printPipelineInfo(java.io.PrintStream out)