public class WekaForecastingData
extends org.pentaho.di.trans.step.BaseStepData
implements org.pentaho.di.trans.step.StepDataInterface
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_MATCH |
static int |
TYPE_MISMATCH |
| Constructor and Description |
|---|
WekaForecastingData() |
| Modifier and Type | Method and Description |
|---|---|
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, setStatuspublic static final int NO_MATCH
public static final int TYPE_MISMATCH
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.KettleExceptionpublic 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
Exceptionpublic 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.