SDEFSR_DatasetFromDataFrame {SDEFSR} | R Documentation |
Creates a SDEFSR_Dataset
object from a data.frame
Description
Creates a SDEFSR_Dataset
object from a data.frame
and create fuzzy labels for numerical variables too.
Usage
SDEFSR_DatasetFromDataFrame(
data,
relation,
names = NA,
types = NA,
classNames = NA
)
Arguments
data |
A |
relation |
A string that indicate the name of the relation. |
names |
An optional character vector indicating the name of the attributes. |
types |
An optional character vector indicating 'c' if variable is categorical, 'r' if is real and 'e' if it is an integer |
classNames |
An optional character vector indicating the values of the target class. |
Details
The information of the data.frame must be stored with instances in rows and variables in columns If you dont specify any of the optional parameter the function try to obtain them automatically.
For 'names'
if it is NA, the function takes the name of the columns by colnames
.
For 'types'
if it is NA, the function takes the type of an attribute asking the type of the column of the data.frame.
If it is 'character'
it is assumed that it is categorical, and if 'numeric'
it is assumed that it is a real number.
PLEASE, PAY ATTENTION TO THIS WAY OF WORK. It can cause tranformation errors taking a numeric variable as categorical or vice-versa.
For 'classNames'
if it is NA, the function returns unique values of the last attribute of the data.frame that is considered the class attribute.
Value
A SDEFSR_Dataset
object with all the information of the dataset.
Author(s)
Angel M Garcia <amgv0009@red.ujaen.es>
See Also
Examples
library(SDEFSR)
df <- data.frame(matrix(runif(1000), ncol = 10))
#Add class attribute
df[,11] <- c("0", "1", "2", "3")
SDEFSR_DatasetObject <- SDEFSR_DatasetFromDataFrame(df, "random")
invisible()