3

I'm trying to run frbs package in order to solve a classification problem, taking iris dataset as an example.

My dataset (Dataset_match) contains 9 input variables (all numeric), 1 binary output variable and 27 196 observations.

I've split the data in the following manner:

 data.train<-Dataset_match[1 : 17200, ]
 data.test<-Dataset_match[17201 : 27196, 1:9]
 data.real<-matrix(Dataset_match[17201 : 27196, 10],ncol = 1)
 range.data.input<-apply(Dataset_match[, -ncol(Dataset_match)], 2, range)

The method and its parameters were defined as follows:

 method.type <- "FRBCS.W"
 control <- list(num.labels = 15, type.mf = "GAUSSIAN", type.tnorm = "MIN",type.snorm = "MAX", type.implication.func = "ZADEH")

But when I try to generate the model, by using:

 object.cls <- frbs.learn(data.train, range.data.input, method.type, control)

I get the following error:

 Error in MF.temp[m, ] : incorrect number of dimensions.

Can someone please give me some clue on this?

I'm not very at ease with R and I can't find much information about the package in question.

Sowmya S. Manian
  • 3,723
  • 3
  • 18
  • 30
PCruz
  • 31
  • 2

1 Answers1

2

I am beginning to use the frbs package as well. This is what I have found regarding the class variable.

The class variable must be numeric, monotone, and greater than 0.

Values of {0,1} would be result in an error; {-1, 1} resulted in an error, but {1,2} worked.

You can see this in the demo() examples in the line where the class variable for the iris dataset is "unclass()"-ed.

    irisShuffled[,5] <- unclass(irisShuffled[,5])

This line takes the original factor variable and converts to a numeric with the values {1,2,3}.

Hope this helps.

ces
  • 21
  • 1