Learn R Programming

Rfuzzycoco (version 0.1.0)

fit_xy.fuzzycoco_model: fit the FuzzyCoco model using the dataframe interface

Description

N.B: the underlying C++ implementation is able to automatically set some missing parameters (NA). The final parameters are those returned by the function, is the params slot.

Usage

# S3 method for fuzzycoco_model
fit_xy(
  object,
  x,
  y,
  engine = FUZZY_COCO_HYBRID_ENGINE,
  max_generations = object$params$global_params$max_generations,
  max_fitness = object$params$global_params$max_fitness,
  seed = object$seed,
  verbose = object$verbose,
  ...
)

Value

the fit as a named list

Arguments

object

the fuzzycoco_model object to fit

x

the input variables data (usually to fit) as a dataframe

y

the output variables data (usually to fit) as a dataframe

engine

the fuzzy coco fit engine to use, one of rcpp and hybrid

max_generations

The maximum number of iterations of the algorithm. Each iteration produces a new generation of the rules and membership functions populations.

max_fitness

a stop condition: the iterations stop as soon as a generated fuzzy system fitness reaches that threshold.

seed

the RNG seed to use (to fit the model)

verbose

whether to be verbose

...

Arguments passed on to fuzzycoco_fit_df_hybrid

model

a Fuzzy Coco model as a fuzzy_coco object

progress

whether to display the computation progress (using progressr, if available)

until

function that takes an engine and returns TRUE if and only if the evolution must stop. It is a way for the user to customize the stop conditions of the algorithm.

Examples

Run this code
model <- fuzzycoco("regression", example_mtcars()$params, seed = 123)
x <- mtcars[c("mpg", "hp", "wt")]
y <- mtcars["qsec"]
fit <- fit_xy(model, x, y, progress = FALSE)
print(names(fit))

Run the code above in your browser using DataLab