model.protect: Protected a Fitted Model from Producing Non-Finite Results

Description Usage Arguments Value

Description

This function can protect a model which was trained on a certain metric against non-finite results. The idea is that we use the model directly for any situation where the results are finite. When they are not finite, we try to extrapolate the model values linearly between the two closest finite results. If we fail in doing so, we simply extrapolate results from the x-y data directly.

Using protected models may be useful if a model function f includes, e.g., a log-scaled x-axis and is fed with an x-coordinate where the log would receive a zero or negative parameter.

Notice: This function and using the produced model may lead to many warnings.

Usage

1
model.protect(f, x, y)

Arguments

f

the trained model

x

the x coordinates on which the model was trained

y

the y coordinates on which the model was trained

Value

a new model function which can be as drop-in replacement for f and will produce the same results as f for all inputs where f has finite results and finite output results where f does yield non-finite results.


thomasWeise/regressoR.base documentation built on May 9, 2019, 8:13 p.m.