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)
Deprecated.
use
MojoPipelineService.loadPipeline(ReaderBackend) instead |
static MojoPipeline |
loadFrom(java.lang.String file)
Deprecated.
use
MojoPipelineService.loadPipeline(File) instead |
void |
setShapPredictContrib(boolean enable)
Allows prediction contribution columns (computed by SHAP algo) to appear in the transformation result.
|
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) 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) 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
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 referencepublic void setShapPredictContrib(boolean enable)
Allows prediction contribution columns (computed by SHAP algo) to appear in the transformation result. Current implementation removes the standard transformation result. This will be improved in future.
enable -