TransWikia.com

Error in discretizeDF.supervised(formula, data, method = disc.method) :data needs to be a data.frame

Data Science Asked by Heba Emam on June 17, 2021

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).

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP