A statistics/model can be obtained when imputing missing values in a given time-series dataset, and this model can be further applied to handling missing values in time-series data of the same structure as the data utilized the model-training phase.

# S3 method for ImputeTS
transform(model, data, key, thread.ratio = NULL)

Arguments

data

DataFrame
DataFrame containing the data for missing value handling using model.
The data must be structured the same as the data used in the training phase.

key

str
Specifies the column name in data that represents the order of time-series.

thread.ratio

double, optional
Controls the proportion of available threads that can be used by this function.
The value range is from 0 to 1, where 0 indicates a single thread, and 1 indicates all available threads.
Values between 0 and 1 will use up to that percentage of available threads.Values outside this range are ignored.
Defaults to 0.

Value

A list of two DataFrames, with names "result" and "stats" respectively:

  • "result": The input time-series data imputed by model.

  • "stats": Related statistics for missing value handling, mostly column-wise imputation types and replacement values.

Examples


> imp <- hanaml.ImputeTS(data_train, key = 'ID',
                         imputation_type='most_frequent.linterp')
> outp <- transform(imp, data=data_trans, key= 'ID')
> outp[["result"]]