public class TimeSeriesRegressionPredictorImpl extends TimeSeriesBase implements ITimeSeriesRegressionPredictor
Modifier and Type | Field and Description |
---|---|
protected LinkedHashMap<String,Class> |
features |
protected Map<String,Integer> |
featuresIndexes |
protected String |
modelId |
protected Map<String,String> |
modelInfo |
protected int |
numDoubles |
protected int |
numStrings |
protected ConcurrentHashMap<String,String> |
sanitizedFeaturesCache |
protected com.datarobot.prediction.PredictorBase.GenericEvent<ScoreEventT> |
scoreEvent |
protected String |
targetName |
dateColumnName, dateFormat, fdw, fw, seriesIdColumnName, timeStep
Modifier | Constructor and Description |
---|---|
protected |
TimeSeriesRegressionPredictorImpl(TimeSeriesPredictor predictor) |
Modifier and Type | Method and Description |
---|---|
protected Row |
extractFeatures(Iterable<?> row) |
protected Row |
extractFeatures(Map<String,?> row)
Extracts features that are needed from initial row.
|
protected Map<String,?> |
extractFeaturesMap(Iterable<?> row) |
String |
getDateColumnName()
Getter for Date Column Name.
|
String |
getDateFormat()
Expected date format for the input dates.
|
protected String |
getDefaultEmptyCollumnName()
Return label for empty column.
|
protected Set<String> |
getDoubleMissingValuesLabels()
Returns the set of null labels.
|
protected Double |
getDoubleValue(String featureName,
Object value)
Replaces double missing value with NaN.
|
Map.Entry<Integer,Integer> |
getFeatureDerivationWindow()
Getter for Feature Derivation Interval (FDW).
|
LinkedHashMap<String,Class> |
getFeatures()
Model specific features that are required for scoring.
|
protected Field |
getField(Class clazz,
String fieldName) |
Map.Entry<Integer,Integer> |
getForecastWindow()
Getter for Forecast Interval.
|
String |
getModelId()
DataRobot Model ID.
|
Class<?> |
getPredictorClass()
What the type of the model
|
Event<TimeSeriesRegressionScoreEventInfo> |
getScoreEvent()
Returns the event that is invoked for each of the score calculated by the model.
|
String |
getSeriesIdColumnName()
Getter for Series ID Column Name.
|
Map.Entry<Integer,String> |
getTimeStep()
Getter for Time Step.
|
protected Map<String,String> |
initializeModelInfo(PredictorT predictor) |
protected String |
sanitize(String name)
Some pre-processing for feature name.
|
List<TimeSeriesScore<Double>> |
score(ArrayList<Map<String,?>> rows)
Calculates score for the Time-Series
rows . |
List<TimeSeriesScore<Double>> |
score(ArrayList<Map<String,?>> rows,
String forecastPoint)
Calculates score for the Time-Series
rows . |
List<TimeSeriesScore<Double>> |
score(ArrayList<Map<String,?>> rows,
String startDate,
String endDate)
Calculates historical scores for the Time-Series
rows . |
protected void |
sendScoreInfo(ScoreEventT eventInfo) |
extractRows
protected int numDoubles
protected int numStrings
protected LinkedHashMap<String,Class> features
protected ConcurrentHashMap<String,String> sanitizedFeaturesCache
protected String modelId
protected String targetName
protected final com.datarobot.prediction.PredictorBase.GenericEvent<ScoreEventT extends EventInfo> scoreEvent
protected TimeSeriesRegressionPredictorImpl(TimeSeriesPredictor predictor)
public List<TimeSeriesScore<Double>> score(ArrayList<Map<String,?>> rows)
ITimeSeriesRegressionPredictor
rows
. NOTE: rows
will be sorted lexicographical order by series_id then by date so
adds linear overhead if all data is already sorted and historic data is extracted from the rows to predict by the setted/unsetted to
not NaN target values.score
in interface ITimeSeriesRegressionPredictor
rows
- time-series that contains both historic data and points to predict.public List<TimeSeriesScore<Double>> score(ArrayList<Map<String,?>> rows, String forecastPoint)
ITimeSeriesRegressionPredictor
rows
. NOTE: rows
will be sorted lexicographical order by series_id then by date so
adds linear overhead if all data is already sorted. Historic data is extracted from the rows to predict by the forecastPoint
.score
in interface ITimeSeriesRegressionPredictor
rows
- time-series that contains both historic data and points to predict.forecastPoint
- date from which to start predictions.public List<TimeSeriesScore<Double>> score(ArrayList<Map<String,?>> rows, String startDate, String endDate)
ITimeSeriesRegressionPredictor
rows
. NOTE: rows
is expected to be sorted by the date, and contains
only historic data.score
in interface ITimeSeriesRegressionPredictor
rows
- history time-series.startDate
- start date for historical predictions.endDate
- end date for historical predictions.startDate
and endDate
.public String getSeriesIdColumnName()
ITimeSeriesModelInfo
getSeriesIdColumnName
in interface ITimeSeriesModelInfo
public String getDateColumnName()
ITimeSeriesModelInfo
getDateColumnName
in interface ITimeSeriesModelInfo
public Map.Entry<Integer,String> getTimeStep()
ITimeSeriesModelInfo
getTimeStep
in interface ITimeSeriesModelInfo
public Map.Entry<Integer,Integer> getFeatureDerivationWindow()
ITimeSeriesModelInfo
getFeatureDerivationWindow
in interface ITimeSeriesModelInfo
public Map.Entry<Integer,Integer> getForecastWindow()
ITimeSeriesModelInfo
getForecastWindow
in interface ITimeSeriesModelInfo
public String getDateFormat()
ITimeSeriesModelInfo
getDateFormat
in interface ITimeSeriesModelInfo
public String getModelId()
IPredictorInfo
getModelId
in interface IPredictorInfo
public LinkedHashMap<String,Class> getFeatures()
IPredictorInfo
getFeatures
in interface IPredictorInfo
public Class<?> getPredictorClass()
IPredictorInfo
getPredictorClass
in interface IPredictorInfo
public Event<TimeSeriesRegressionScoreEventInfo> getScoreEvent()
IEventProvider
getScoreEvent
in interface IEventProvider<TimeSeriesRegressionScoreEventInfo>
protected Row extractFeatures(Map<String,?> row)
row
- - Map of initial feature name to its value.protected String sanitize(String name)
name
- - original feature name.protected Double getDoubleValue(String featureName, Object value)
featureName
- - name of the feature.value
- - object feature value.protected String getDefaultEmptyCollumnName()
protected Set<String> getDoubleMissingValuesLabels()
protected void sendScoreInfo(ScoreEventT eventInfo)
Copyright © 2020. All rights reserved.