paramCoreIO: Input/output of parameters from/to file

View source: R/Rinterface.R

paramCoreIOR Documentation

Input/output of parameters from/to file

Description

All the parameters of the given model are written directly to file, or read from file into model.

Usage

paramCoreIO(model, fileName, io=c("read","write")) 

Arguments

model

The model structure as returned by CoreModel.

fileName

Name of the parameter file.

io

Controls weather the parameters will be read or written.

Details

The function uses the model structure as returned by CoreModel and reads or writes all its parameters from/to file. If parameter io="read" parameters are read from file filename. If parameter io="write" parameters are written to file filename.

Value

Returns invisible list with parameters passed to C function: list(modelID, filename, io.

Author(s)

Marko Robnik-Sikonja

See Also

CORElearn, helpCore.

Examples

# use iris data
# build random forests model with certain parameters
modelRF <- CoreModel(Species ~ ., iris, model="rf", 
              selectionEstimator="MDL",minNodeWeightRF=5,
              rfNoTrees=50, maxThreads=1)

# writes all the used parameters to file
paramCoreIO(modelRF, "parameters.par", io="write")
# and reads them back into the model
paramCoreIO(modelRF, "parameters.par", io="read")

# clean up for the sake of R package checks
file.remove("parameters.par")

destroyModels(modelRF) # clean up


CORElearn documentation built on Nov. 18, 2022, 5:08 p.m.