Learn R Programming

frbs (version 3.2-0)

write.frbsPMML: The frbsPMML writer

Description

It is a function used to save an FRBS model to the .frbsPMML file. Detailed information about frbsPMML can be seen in frbsPMML.

Usage

write.frbsPMML(object, fileName = NULL)

Arguments

object

a frbsPMML object which is an object produced by frbsPMML.

fileName

a file name with extension .frbsPMML.

Value

a file containing an FRBS model in frbsPMML format

References

A. Guazzelli, M. Zeller, W.C. Lin, and G. Williams., "pmml: An open standard for sharing models", The R Journal, Vol. 1, No. 1, pp. 60-65 (2009).

Data Mining Group, http://www.dmg.org/.

See Also

read.frbsPMML and frbsPMML.

Examples

Run this code
# NOT RUN {
## This example shows how to construct frbsPMML file of frbs model
## Even though we are using MAMDANI model, other models have the same way
## 
## 1. Produce frbs model, for example: we perform Wang & Mendel's technique (WM)
##
## Input data
data(frbsData)
data.train <- frbsData$GasFurnance.dt[1 : 204, ]
data.fit <- data.train[, 1 : 2]
data.tst <- frbsData$GasFurnance.dt[205 : 292, 1 : 2]
real.val <- matrix(frbsData$GasFurnance.dt[205 : 292, 3], ncol = 1)
range.data<-matrix(c(-2.716, 2.834, 45.6, 60.5, 45.6, 60.5), nrow = 2)

## Set the method and its parameters
method.type <- "WM"
control <- list(num.labels = 15, type.mf = "GAUSSIAN", type.defuz = "WAM", 
                type.tnorm = "MIN", type.implication.func = "ZADEH", 
                name = "sim-0") 

## Generate fuzzy model
# }
# NOT RUN {
object <- frbs.learn(data.train, range.data, method.type, control)
# }
# NOT RUN {
## 2. Write frbsPMML file
## In this step, we provide two steps as follows:
## a. by calling frbsPMML() function directly. 
## b. by calling write.frbsPMML() function. 

## 2a. by calling frbsPMML(), the frbsPMML format will be displayed in R console
# }
# NOT RUN {
pmml.obj <- frbsPMML(object)
# }
# NOT RUN {
## 2b. by calling write.frbsPMML(), the result will be saved as a file
##     in the working directory.
# }
# NOT RUN {
write.frbsPMML(pmml.obj, file = "MAMDANI.GasFur")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab