[R] J48 / Transform from numeric to nominal

Ista Zahn izahn at psych.rochester.edu
Mon Feb 21 17:29:38 CET 2011


Hi Patrick,
You didn't say how exactly you tried to "Discretize" your variable,
but have you tried

?factor
?as.character

?

Best,
Ista

On Mon, Feb 21, 2011 at 3:34 PM, Patrick Skorupka
<patrick.skorupka at gmx.de> wrote:
> Hi everyone,
>
> I am new to field of data mining as well as particularly using R respectively RWeka for writing my master thesis.
>
> I intend to create some specific J48 classification trees with the RWeka_classifiers_tree function. When I run the source code it says “cannot handle numeric class”. I therefore checked the arff-file and indeed there it says that the class variable is numeric although it only contains 0 and 1. In a next step I tried to Discretize my dataset but received the same error message. I googled the issue several times and also read about the filter function in WEKA but did not know how to use it and unfortunately did not find a proper solution.
>
> So – how can I transform my class variable from numeric to nominal / binary, I just don’t get it?! As I said, I am new to all of this and so appreciate anything little which helps!
>
> Pat
>
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list