Similar to other predict methods, this function predicts fitted values from a fitted "LogarithmicRegression" object.

# S3 method for LogarithmicRegression
predict(
  model,
  data,
  key,
  features = NULL,
  thread.ratio = NULL,
  model.format = NULL
)

Format

S3 methods

Arguments

model

R6Class object
A "LogarithmicRegression" object for prediction.

data

DataFrame
DataFrame containting the data.

key

character
Name of the ID column.

features

character, optional
Name of feature column for prediciton.
If not provided, it defaults to the first non-key column of data.

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.

model.format

character, optional
Choose the format of mdoel for prediction. optional are "coefficients" or "pmml".
Defaults to "coefficients".

Value

Predicted values are returned as a DataFrame, structured as follows.

  • ID: with same name and type as data's ID column.

  • VALUE: type DOUBLE, representing predicted values.

Examples

DataFrame data2 for prediction:


> data2$Collect()
    ID X1
  1  0  1
  2  1  2
  3  2  3
  4  3  4
  5  4  5
  6  5  6
  7  6  7

Perform prediction based on a "LogarithmicRegression" Object nlr:


> predict(nlr, data2, key = "ID")
    ID     VALUE
  1  0  14.86160
  2  1  82.99353
  3  2 122.84816
  4  3 151.12546
  5  4 173.05905
  6  5 190.98009
  7  6 206.13211