Error in discretizeDF.supervised(formula, data, method = disc.method) :data needs to be a data.frame
0
0
Entering edit mode
3.0 years ago

I am using arulesCBA on dataset of words with class attribute which is polarity to be positive or negative. first, I am converting the words to numeric values by using as.numeric function. after that, I am discretizing the columns using this code:

   trans.disc <- as.data.frame(lapply(df[2:75], function(x) discretize(x, categories=9)))

in this step, I have warnings that say: parameter categories is deprecated. Use breaks instead! Also, the default method is now frequency!the next step that I am applying is adding the polarity column :

trans.disc$polarity <- df$polarity

the last step, I am trying to build the classifier:

classifier <- CBA(trans.disc, "polarity", supp = 0.05, conf=0.9)

in this phase, there is an error message that says: (Error in discretizeDF.supervised(formula, data, method = disc.method) :data needs to be a data.frame).

R arulesCBA • 565 views
ADD COMMENT

Login before adding your answer.

Traffic: 1623 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6