Package org.pentaho.di.forecasting
Class WekaForecastingMeta
- java.lang.Object
-
- org.pentaho.di.trans.step.BaseStepMeta
-
- org.pentaho.di.forecasting.WekaForecastingMeta
-
- All Implemented Interfaces:
Cloneable
,org.pentaho.di.trans.step.StepAttributesInterface
,org.pentaho.di.trans.step.StepMetaInterface
@Step(id="WekaForecasting", image="WEKAF.svg", documentationUrl="https://pentaho-community.atlassian.net/wiki/display/EAI/Weka+Forecasting", name="Weka Forecasting", description="This step makes time series forecasts from a pre-built Weka forecasting model", categoryDescription="Data Mining") public class WekaForecastingMeta extends org.pentaho.di.trans.step.BaseStepMeta implements org.pentaho.di.trans.step.StepMetaInterface
Contains the meta data for the WekaForecasting step.- Version:
- $Revision$
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
-
Constructor Summary
Constructors Constructor Description WekaForecastingMeta()
Creates a newWekaForecastingMeta
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check(List<org.pentaho.di.core.CheckResultInterface> remarks, org.pentaho.di.trans.TransMeta transmeta, org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info)
Check the settings of this step and put findings in a remarks list.Object
clone()
Clone this step's meta dataprotected void
deSerializeBase64Model(String base64modelXML)
boolean
equals(Object obj)
Check for equalityString
getArtificialTimeStartOffset()
Get the offset, from the value associated with the last training instance, for the artificial time stamp.String
getDialogClassName()
void
getFields(org.pentaho.di.core.row.RowMetaInterface row, String origin, org.pentaho.di.core.row.RowMetaInterface[] info, org.pentaho.di.trans.step.StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space)
Generates row meta data to represent the fields output by this stepint[]
getMappingIndexes()
Get the mapping from attributes to incoming Kettle fieldsWekaForecastingModel
getModel()
Get the forecasting modelString
getNumStepsToForecast()
Get the number of steps to forecast into the futureboolean
getRebuildForecaster()
Gets whether the forecaster is to be rebuilt/re-estimated on the the incoming data stream.String
getSavedForecasterFileName()
Get the name of the file to save the forecaster out to.String
getSerializedModelFileName()
Get the filename of the serialized Weka model to load/import fromorg.pentaho.di.trans.step.StepInterface
getStep(org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.trans.step.StepDataInterface stepDataInterface, int cnr, org.pentaho.di.trans.TransMeta tr, org.pentaho.di.trans.Trans trans)
Get the executing step, needed by Trans to launch a step.org.pentaho.di.trans.step.StepDataInterface
getStepData()
Get a new instance of the appropriate data class.String
getXML()
Return the XML describing this (configured) stepint
hashCode()
Hash code methodprotected void
loadModelFile()
void
loadXML(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters)
Loads the meta data for this (configured) step from XML.void
mapIncomingRowMetaData(weka.core.Instances header, org.pentaho.di.core.row.RowMetaInterface inputRowMeta)
Finds a mapping between the attributes that a forecasting model model has seen during training and the incoming row format.void
readRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters)
Read this step's configuration from a repositoryvoid
saveRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step)
Save this step's meta data to a repositoryvoid
setArtificialTimeStartOffset(String art)
Set the offset, from the value associated with the last training instance, for the artificial time stamp.void
setDefault()
void
setModel(WekaForecastingModel model)
Set the forecasting modelvoid
setNumStepsToForecast(String numSteps)
Set the number of steps to forecast into the futurevoid
setRebuildForecaster(boolean rebuild)
Set whether to rebuild the forecaster on the incoming data stream.void
setSavedForecasterFileName(String name)
Set the name of the file to save the forecaster out to or null not to save the forecaster.void
setSerializedModelFileName(String mfile)
Set the file name of the serialized Weka model to load/import from-
Methods inherited from class org.pentaho.di.trans.step.BaseStepMeta
analyseImpact, analyseImpact, cancelQueries, check, check, createEntry, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, exportResources, extractStepMetadataEntries, findAttribute, findParent, findParentEntry, getActiveReferencedObjectDescription, getDescription, getFields, getLog, getLogChannelId, getName, getObjectCopy, getObjectId, getObjectRevision, getObjectType, getOptionalStreams, getParent, getParentStepMeta, getReferencedObjectDescriptions, getRepCode, getRepositoryDirectory, getRequiredFields, getRequiredFields, getResourceDependencies, getSQLStatements, getSQLStatements, getStepInjectionMetadataEntries, getStepIOMeta, getStepIOMeta, getStepMetaInjectionInterface, getSupportedTransformationTypes, getTableFields, getTooltip, getUsedArguments, getUsedDatabaseConnections, getUsedLibraries, getXmlCode, handleStreamSelection, hasChanged, hasRepositoryReferences, isBasic, isDebug, isDetailed, isReferencedObjectEnabled, isRowLevel, loadReferencedObject, loadReferencedObject, loadStepAttributes, loadXML, loadXML, logBasic, logBasic, logDebug, logDebug, logDetailed, logDetailed, logError, logError, logError, logMinimal, logMinimal, logRowlevel, logRowlevel, lookupRepositoryReferences, readRep, readRep, resetStepIoMeta, saveRep, searchInfoAndTargetSteps, setChanged, setChanged, setParentStepMeta, setStepIOMeta, supportsErrorHandling
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.di.trans.step.StepMetaInterface
analyseImpact, analyseImpact, cancelQueries, check, cleanAfterHopFromRemove, cleanAfterHopFromRemove, cleanAfterHopToRemove, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, exportResources, extractStepMetadataEntries, fetchTransMeta, getActiveReferencedObjectDescription, getFields, getOptionalStreams, getParentStepMeta, getReferencedObjectDescriptions, getRequiredFields, getResourceDependencies, getSQLStatements, getSQLStatements, getStepIOMeta, getStepMetaInjectionInterface, getSupportedTransformationTypes, getTableFields, getUsedArguments, getUsedDatabaseConnections, getUsedLibraries, handleStreamSelection, hasChanged, hasRepositoryReferences, isReferencedObjectEnabled, loadReferencedObject, loadXML, lookupRepositoryReferences, passDataToServletOutput, readRep, resetStepIoMeta, saveRep, searchInfoAndTargetSteps, setChanged, setParentStepMeta, supportsErrorHandling
-
-
-
-
Field Detail
-
PKG
protected static Class<?> PKG
-
XML_TAG
public static final String XML_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
setRebuildForecaster
public void setRebuildForecaster(boolean rebuild)
Set whether to rebuild the forecaster on the incoming data stream.- Parameters:
rebuild
- true if the forecaster is to be rebuilt.
-
getRebuildForecaster
public boolean getRebuildForecaster()
Gets whether the forecaster is to be rebuilt/re-estimated on the the incoming data stream.- Returns:
- true if the forecaster is to be rebuilt/re-estimated.
-
setSavedForecasterFileName
public void setSavedForecasterFileName(String name)
Set the name of the file to save the forecaster out to or null not to save the forecaster. The model will only be saved if the rebuild forecaster property is set.- Parameters:
name
- the name of the file to save the rebuilt forecaster to.
-
getSavedForecasterFileName
public String getSavedForecasterFileName()
Get the name of the file to save the forecaster out to. May return null - this indicates not to save.- Returns:
- the name of the file to save to or null if not to save.
-
setNumStepsToForecast
public void setNumStepsToForecast(String numSteps)
Set the number of steps to forecast into the future- Parameters:
numSteps
- the number of steps to forecast
-
getNumStepsToForecast
public String getNumStepsToForecast()
Get the number of steps to forecast into the future- Returns:
- the number of steps to forecast
-
setArtificialTimeStartOffset
public void setArtificialTimeStartOffset(String art)
Set the offset, from the value associated with the last training instance, for the artificial time stamp. Has no effect if an artificial time stamp is not in use by the forecaster. If in use, this needs to be set so that the forecaster knows what time stamp value corresponds to the first requested forecast (i.e. it should be equal to the number of recent historical priming instances that occur after the last training instance in time).- Parameters:
art
- the offset from the last artificial time value in the training data for which the forecast is requested.
-
getArtificialTimeStartOffset
public String getArtificialTimeStartOffset()
Get the offset, from the value associated with the last training instance, for the artificial time stamp. Has no effect if an artificial time stamp is not in use by the forecaster. If in use, this needs to be set so that the forecaster knows what time stamp value corresponds to the first requested forecast (i.e. it should be equal to the number of recent historical priming instances that occur after the last training instance in time).- Returns:
- the offset from the last artificial time value in the training data for which the forecast is requested.
-
setSerializedModelFileName
public void setSerializedModelFileName(String mfile)
Set the file name of the serialized Weka model to load/import from- Parameters:
mfile
- the file name
-
getSerializedModelFileName
public String getSerializedModelFileName()
Get the filename of the serialized Weka model to load/import from- Returns:
- the file name
-
setModel
public void setModel(WekaForecastingModel model)
Set the forecasting model- Parameters:
model
- aWekaForecastingModel
-
getModel
public WekaForecastingModel getModel()
Get the forecasting model- Returns:
- a
TSForecaster
-
mapIncomingRowMetaData
public void mapIncomingRowMetaData(weka.core.Instances header, org.pentaho.di.core.row.RowMetaInterface inputRowMeta)
Finds a mapping between the attributes that a forecasting model model has seen during training and the incoming row format. Returns an array of indices, where the element at index 0 of the array is the index of the Kettle field that corresponds to the first attribute in the Instances structure, the element at index 1 is the index of the Kettle fields that corresponds to the second attribute, ...- Parameters:
header
- the Instances headerinputRowMeta
- the meta data for the incoming rows
-
getMappingIndexes
public int[] getMappingIndexes()
Get the mapping from attributes to incoming Kettle fields- Returns:
- the mapping as an array of integer indices
-
getXML
public String getXML()
Return the XML describing this (configured) step- Specified by:
getXML
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
getXML
in classorg.pentaho.di.trans.step.BaseStepMeta
- Returns:
- a
String
containing the XML
-
equals
public boolean equals(Object obj)
Check for equality
-
hashCode
public int hashCode()
Hash code method
-
clone
public Object clone()
Clone this step's meta data- Specified by:
clone
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
clone
in classorg.pentaho.di.trans.step.BaseStepMeta
- Returns:
- the cloned meta data
-
setDefault
public void setDefault()
- Specified by:
setDefault
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
-
loadXML
public void loadXML(Node stepnode, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters) throws org.pentaho.di.core.exception.KettleXMLException
Loads the meta data for this (configured) step from XML.- Specified by:
loadXML
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
loadXML
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
stepnode
- the step to load- Throws:
org.pentaho.di.core.exception.KettleXMLException
- if an error occurs
-
deSerializeBase64Model
protected void deSerializeBase64Model(String base64modelXML) throws Exception
- Throws:
Exception
-
readRep
public void readRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_step, List<org.pentaho.di.core.database.DatabaseMeta> databases, Map<String,org.pentaho.di.core.Counter> counters) throws org.pentaho.di.core.exception.KettleException
Read this step's configuration from a repository- Specified by:
readRep
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
readRep
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
rep
- the repository to accessid_step
- the id for this step- Throws:
org.pentaho.di.core.exception.KettleException
- if an error occurs
-
saveRep
public void saveRep(org.pentaho.di.repository.Repository rep, org.pentaho.di.repository.ObjectId id_transformation, org.pentaho.di.repository.ObjectId id_step) throws org.pentaho.di.core.exception.KettleException
Save this step's meta data to a repository- Specified by:
saveRep
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
saveRep
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
rep
- the repository to save toid_transformation
- transformation idid_step
- step id- Throws:
org.pentaho.di.core.exception.KettleException
- if an error occurs
-
getFields
public void getFields(org.pentaho.di.core.row.RowMetaInterface row, String origin, org.pentaho.di.core.row.RowMetaInterface[] info, org.pentaho.di.trans.step.StepMeta nextStep, org.pentaho.di.core.variables.VariableSpace space) throws org.pentaho.di.core.exception.KettleStepException
Generates row meta data to represent the fields output by this step- Specified by:
getFields
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
getFields
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
row
- the meta data for the output producedorigin
- the name of the step to be used as the origininfo
- The input rows metadata that enters the step through the specified channels in the same order as in method getInfoSteps(). The step metadata can then choose what to do with it: ignore it or not.nextStep
- if this is a non-null value, it's the next step in the transformation. The one who's asking, the step where the data is targetted towards.space
- not sure what this is :-)- Throws:
org.pentaho.di.core.exception.KettleStepException
- if an error occurs
-
check
public void check(List<org.pentaho.di.core.CheckResultInterface> remarks, org.pentaho.di.trans.TransMeta transmeta, org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.core.row.RowMetaInterface prev, String[] input, String[] output, org.pentaho.di.core.row.RowMetaInterface info)
Check the settings of this step and put findings in a remarks list.- Specified by:
check
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
check
in classorg.pentaho.di.trans.step.BaseStepMeta
- Parameters:
remarks
- the list to put the remarks in. seeorg.pentaho.di.core.CheckResult
transmeta
- the transform meta datastepMeta
- the step meta dataprev
- the fields coming from a previous stepinput
- the input step namesoutput
- the output step namesinfo
- the fields that are used as information by the step
-
getDialogClassName
public String getDialogClassName()
- Specified by:
getDialogClassName
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Overrides:
getDialogClassName
in classorg.pentaho.di.trans.step.BaseStepMeta
-
getStep
public org.pentaho.di.trans.step.StepInterface getStep(org.pentaho.di.trans.step.StepMeta stepMeta, org.pentaho.di.trans.step.StepDataInterface stepDataInterface, int cnr, org.pentaho.di.trans.TransMeta tr, org.pentaho.di.trans.Trans trans)
Get the executing step, needed by Trans to launch a step.- Specified by:
getStep
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Parameters:
stepMeta
- the step infostepDataInterface
- the step data interface linked to this step. Here the step can store temporary data, database connections, etc.cnr
- the copy number to get.tr
- the transformation info.trans
- the launching transformation- Returns:
- a
StepInterface
value
-
getStepData
public org.pentaho.di.trans.step.StepDataInterface getStepData()
Get a new instance of the appropriate data class. This data class implements the StepDataInterface. It basically contains the persisting data that needs to live on, even if a worker thread is terminated.- Specified by:
getStepData
in interfaceorg.pentaho.di.trans.step.StepMetaInterface
- Returns:
- a
StepDataInterface
value
-
-