[R] FW: Interfacing R and Weka

Peter Alspach Peter.Alspach at plantandfood.co.nz
Thu Nov 8 23:30:11 CET 2012



-----Original Message-----
From: Patrick Connolly 
Sent: Friday, 9 November 2012 11:29 a.m.
To: Peter Alspach
Subject: Interfacing R and Weka

> version
               _
platform       x86_64-unknown-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          2
minor          15.2
year           2012
month          10
day            26
svn rev        61015
language       R
version.string R version 2.15.2 (2012-10-26)
nickname       Trick or Treat


I'm trying to use RWeka, in particular an example in the help file for make_Weka_classifier


>          model <- NB(Class ~ ., data = HouseVotes84)
Error in .jnew("weka/core/Attribute", attname[i], .jcast(levels,
"java/util/List")) :
  java.lang.NoSuchMethodError: <init>


> traceback()
8: stop(list(message = "java.lang.NoSuchMethodError: <init>", call = .jnew("weka/core/Attribute",
       attname[i], .jcast(levels, "java/util/List")), jobj = <S4 object of class
"jobjRef">)) at call.R#13
7: .External(RcreateObject, class, ..., silent = silent) at call.R#13
6: .jnew("weka/core/Attribute", attname[i], .jcast(levels, "java/util/List")) at
readers.R#243
5: read_data_into_Weka(mf, 1L) at readers.R#33
4: read_model_frame_into_Weka(mf) at classifiers.R#72
3: RWeka_build_classifier(mf, control, name, handlers, options,
       init) at utils.R#109
2: .structure(c(RWeka_build_classifier(mf, control, name, handlers,
       options, init), list(call = mc, handlers = handlers, levels = levels(mf[[1L]]),
       terms = attr(mf, "terms"))), class = classes) at classifiers.R#47
1: NB(Class ~ ., data = HouseVotes84)



The NB used in the failing call comes a little earlier

NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayes")

Though I have the correct environment variables set to enable Weka to work from the command line, the only file I have on my system with the "weka/classifiers/bayes/NaiveBayes" string in its name is an HTML documentation file, so I'd think it rather likely that is behind my problem.  Question is: What else should I have done?

TIA

Patrick

The contents of this e-mail are confidential and may be ...{{dropped:14}}



More information about the R-help mailing list