Class TimeSeriesRegressionPredictorImpl

    • Constructor Detail

      • TimeSeriesRegressionPredictorImpl

        protected TimeSeriesRegressionPredictorImpl​(TimeSeriesPredictor predictor)
    • Method Detail

      • score

        public List<TimeSeriesScore<Double>> score​(ArrayList<Map<String,​?>> rows)
        Description copied from interface: ITimeSeriesRegressionPredictor
        Calculates score for the Time-Series 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.
        Specified by:
        score in interface ITimeSeriesRegressionPredictor
        Parameters:
        rows - time-series that contains both historic data and points to predict.
        Returns:
        collection of scores only for the rows to predict.
      • score

        public List<TimeSeriesScore<Double>> score​(ArrayList<Map<String,​?>> rows,
                                                   String forecastPoint)
        Description copied from interface: ITimeSeriesRegressionPredictor
        Calculates score for the Time-Series 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.
        Specified by:
        score in interface ITimeSeriesRegressionPredictor
        Parameters:
        rows - time-series that contains both historic data and points to predict.
        forecastPoint - date from which to start predictions.
        Returns:
        collection of scores only for the rows to predict.
      • score

        public List<TimeSeriesScore<Double>> score​(ArrayList<Map<String,​?>> rows,
                                                   String startDate,
                                                   String endDate)
        Description copied from interface: ITimeSeriesRegressionPredictor
        Calculates historical scores for the Time-Series rows. NOTE: rows is expected to be sorted by the date, and contains only historic data.
        Specified by:
        score in interface ITimeSeriesRegressionPredictor
        Parameters:
        rows - history time-series.
        startDate - start date for historical predictions.
        endDate - end date for historical predictions.
        Returns:
        collection of scores only for the rows between startDate and endDate.
      • getTimeStep

        public Map.Entry<Integer,​String> getTimeStep()
        Description copied from interface: ITimeSeriesModelInfo
        Getter for Time Step. Pair of quantity to time unit. Time Unit could be: - ROW - MILLISECOND - SECOND - MINUTE - HOUR - DAY - WEEK - MONTH - QUARTER - YEAR
        Specified by:
        getTimeStep in interface ITimeSeriesModelInfo
        Returns:
        time step used for the time series processing.
      • getFeatureDerivationWindow

        public Map.Entry<Integer,​Integer> getFeatureDerivationWindow()
        Description copied from interface: ITimeSeriesModelInfo
        Getter for Feature Derivation Interval (FDW). See documentation https://app.datarobot.com/docs/time/time-series.html#framework Pair of min units number and max units number. So window is calculated date based formulas similar to: [ forecast_point - max * time_step_millis, forecast_point - min * time_step_millis ]
        Specified by:
        getFeatureDerivationWindow in interface ITimeSeriesModelInfo
        Returns:
        feature derivation window used for feature extraction.
      • getForecastWindow

        public Map.Entry<Integer,​Integer> getForecastWindow()
        Description copied from interface: ITimeSeriesModelInfo
        Getter for Forecast Interval. Pair of min units number and max units number So window is calculated date based formulas similar to: [ forecast_point + min * time_step_millis, forecast_point + max * time_step_millis ]
        Specified by:
        getForecastWindow in interface ITimeSeriesModelInfo
        Returns:
        feature derivation window used for feature extraction.
      • getFeatures

        public LinkedHashMap<String,​Class> getFeatures()
        Description copied from interface: IPredictorInfo
        Model specific features that are required for scoring. The order of entries is important.
        Specified by:
        getFeatures in interface IPredictorInfo
        Returns:
        Map of feature names and expected type in the order.
      • getPredictorClass

        public Class<?> getPredictorClass()
        Description copied from interface: IPredictorInfo
        What the type of the model
        Specified by:
        getPredictorClass in interface IPredictorInfo
        Returns:
        interface class that implements that particular model.
      • extractFeatures

        protected Row extractFeatures​(Map<String,​?> row)
        Extracts features that are needed from initial row.
        Parameters:
        row - - Map of initial feature name to its value.
        Returns:
        - internal type for scoring.
      • extractFeatures

        protected Row extractFeatures​(Iterable<?> row)
      • extractFeaturesMap

        protected Map<String,​?> extractFeaturesMap​(Iterable<?> row)
      • sanitize

        protected String sanitize​(String name)
        Some pre-processing for feature name.
        Parameters:
        name - - original feature name.
        Returns:
        - sanitized name.
      • getDoubleValue

        protected Double getDoubleValue​(String featureName,
                                        Object value)
        Replaces double missing value with NaN.
        Parameters:
        featureName - - name of the feature.
        value - - object feature value.
        Returns:
        - parsed Double value.
      • getDefaultEmptyColumnName

        protected String getDefaultEmptyColumnName()
        Return label for empty column.
        Returns:
        - empty column name.
      • getDoubleMissingValuesLabels

        protected Set<String> getDoubleMissingValuesLabels()
        Returns the set of null labels.
        Returns:
        - set of null labels.
      • initializeModelInfo

        protected Map<String,​String> initializeModelInfo​(PredictorT predictor)
      • getPredictorMethod

        protected Method getPredictorMethod​(String methodName,
                                            Class<?>... signature)
      • sendScoreInfo

        protected void sendScoreInfo​(ScoreEventT eventInfo)