On Wed, 7 Jan 2009, "H?ring, Tim (LWF)" wrote:
> Dear List,
>
> I?m trying to implement the functionalities from WEKA into my modeling
project in R through the RWeka package.
> In this context I have a slightly special question about the filters
implemented in WEKA.
> I want to convert nominal attributes with k values into k binary attributes
through the NominalToBinary filter
("weka.filters.supervised.attribute.NominalToBinary"). But
unfortunately I can`t apply the filter to my data.
> Here is my code:
>
> nombi <-
make_Weka_filter("weka/filters/supervised/attribute/NominalToBinary")
> x2bin <- nombi(data=dat, control =Weka_control(N=TRUE, A=TRUE))
>
> I didn't get an error message, but it still don't work. My nominal
> attribute is of class "factor".
I do get a warning or an error, depending on what "dat" is exactly...
> Maybe the problem has to do with the argument list.
> Argument list:
> (formula, data, subset, na.action, control = NULL)
> What is meant with the argument "formula"?
You need to supply formulas for filters, specifying which variables should
be involved. For unsupervised filters, such as Normalize(), this is not
very intuitive, but for supervised filters like Discretize() or your
nombi() it seems quite natural. See
help("Discretize", package = "RWeka")
for an example.
hth,
Z
> Any advice? I`d be glad for any hint!
> I`m using R 2.7.2 and RWEKA 0.3-14
>
> TIM
>
-------------------------------------------------------------------------------
> Dipl.-Geogr. Tim H?ring
> Sachgebiet Standort und Bodenschutz (SG 2.1)
> Bayerische Landesanstalt f?r Wald und Forstwirtschaft
> Am Hochanger 11
> D-85354 Freising
>
> E-Mail: tim.haering at lwf.bayern.de
> http://www.lwf.bayern.de
>
>
>
>
> [[alternative HTML version deleted]]
>
>