public class WekaForecastingData
extends org.pentaho.di.trans.step.BaseStepData
implements org.pentaho.di.trans.step.StepDataInterface
Modifier and Type | Field and Description |
---|---|
protected org.pentaho.di.core.row.RowMetaInterface |
m_outputRowMeta |
static int |
NO_MATCH |
static int |
TYPE_MISMATCH |
Constructor and Description |
---|
WekaForecastingData() |
Modifier and Type | Method and Description |
---|---|
protected weka.core.Instance |
constructInstance(org.pentaho.di.core.row.RowMetaInterface inputMeta,
Object[] inputRow,
int[] mappingIndexes,
WekaForecastingModel model)
Helper method that constructs an Instance to input to the Weka model based
on incoming Kettle fields and pre-constructed attribute-to-field mapping
data.
|
static int[] |
findMappings(weka.core.Instances header,
org.pentaho.di.core.row.RowMetaInterface inputRowMeta)
Finds a mapping between the attributes that a forecasting model has been
trained with and the incoming Kettle row format.
|
void |
fixTypesForTargets(Object[] row,
List<String> targetFields,
org.pentaho.di.core.row.RowMetaInterface inputRowMeta)
Fixes the type of forecasted fields (if necessary).
|
List<Object[]> |
generateForecast(org.pentaho.di.core.row.RowMetaInterface inputMeta,
org.pentaho.di.core.row.RowMetaInterface outputMeta,
WekaForecastingMeta meta,
List<Object[]> overlayData,
org.pentaho.di.trans.TransMeta transMeta,
PrintStream... progress)
Generates a forecast given a forecasting model (sourced from the meta
object).
|
org.pentaho.di.core.row.RowMetaInterface |
getOutputRowMeta()
Get the meta data for the output format
|
static WekaForecastingModel |
loadSerializedModel(File modelFile,
org.pentaho.di.core.logging.LogChannelInterface log)
Loads a serialized model.
|
static void |
saveSerializedModel(WekaForecastingModel wsm,
File saveTo) |
void |
setOutputRowMeta(org.pentaho.di.core.row.RowMetaInterface rmi)
Set the meta data for the output format
|
boolean |
sortCheck(weka.classifiers.timeseries.TSForecaster forecaster,
weka.core.Instances data) |
getStatus, isDisposed, isEmpty, isFinished, isIdle, isInitialising, isRunning, isStopped, setStatus
public static final int NO_MATCH
public static final int TYPE_MISMATCH
protected org.pentaho.di.core.row.RowMetaInterface m_outputRowMeta
public org.pentaho.di.core.row.RowMetaInterface getOutputRowMeta()
RowMetaInterface
valuepublic void setOutputRowMeta(org.pentaho.di.core.row.RowMetaInterface rmi)
rmi
- a RowMetaInterface
valuepublic void fixTypesForTargets(Object[] row, List<String> targetFields, org.pentaho.di.core.row.RowMetaInterface inputRowMeta) throws org.pentaho.di.core.exception.KettleException
row
- row to checktargetFields
- list of target fields predicted by the forecasterinputRowMeta
- the input row meta dataorg.pentaho.di.core.exception.KettleException
- if a problem occurs.public boolean sortCheck(weka.classifiers.timeseries.TSForecaster forecaster, weka.core.Instances data) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public static WekaForecastingModel loadSerializedModel(File modelFile, org.pentaho.di.core.logging.LogChannelInterface log) throws Exception
modelFile
- a File
valueException
- if there is a problem laoding the model.public static void saveSerializedModel(WekaForecastingModel wsm, File saveTo) throws Exception
Exception
public static int[] findMappings(weka.core.Instances header, org.pentaho.di.core.row.RowMetaInterface inputRowMeta)
header
- the Instances headerinputRowMeta
- the meta data for the incoming rowspublic List<Object[]> generateForecast(org.pentaho.di.core.row.RowMetaInterface inputMeta, org.pentaho.di.core.row.RowMetaInterface outputMeta, WekaForecastingMeta meta, List<Object[]> overlayData, org.pentaho.di.trans.TransMeta transMeta, PrintStream... progress) throws Exception
inputMeta
- the incoming row meta dataoutputMeta
- the outgoing row meta datameta
- the forecasting metaoverlayData
- a list of rows for future time steps (in the same format
as the incoming rows) containing values for "overlay" fields. May
be null if overlay data is not in use.Exception
- if a problem occurs.protected weka.core.Instance constructInstance(org.pentaho.di.core.row.RowMetaInterface inputMeta, Object[] inputRow, int[] mappingIndexes, WekaForecastingModel model)
inputMeta
- a RowMetaInterface
valueinputRow
- an Object
valuemappingIndexes
- an int
valuemodel
- a WekaScoringModel
valueInstance
valueCopyright © 2002–2018 Hitachi Vantara. All rights reserved.