FAQ
Hi,

I was wondering whether the NaiveBayes Modules (AI::NaiveBayes1 and
Algorithm::NaiveBayes) are capable of handling numerical attributes. A
first glance on the code tells me they are not. Is this so and if yes,
does anyone have an alternative package? Are there any plans to
introduce numerical attributes in the modules?

Regards,

Dominique
--
------------------------------
Dominique Vlieghe, Ph.D.,
Bioinformatics Core,
Department for Molecular Biomedical Research (DMBR)
VIB - Ghent University
(new) 'Fiers-Schell-Van Montagu' building
(new) Technologiepark 927
(new) B-9052 Ghent (Zwijnaarde), Belgium

(new) Tel : +32-(0)9-33-13.693
(new) Fax : +32-(0)9-33-13.609
(new) email:dominique.vlieghe@dmbr.ugent.be
(new) www:http://www.dmbr.ugent.be/
------------------------------

Search Discussions

  • Ken Williams at Sep 23, 2003 at 2:01 pm

    On Tuesday, September 23, 2003, at 02:21 AM, Dominique Vlieghe wrote:

    Hi,

    I was wondering whether the NaiveBayes Modules (AI::NaiveBayes1 and
    Algorithm::NaiveBayes) are capable of handling numerical attributes. A
    first glance on the code tells me they are not. Is this so and if yes,
    does anyone have an alternative package? Are there any plans to
    introduce numerical attributes in the modules?
    Algorithm::NaiveBayes uses numerical attributes:

    $nb->add_instance
    (attributes => {foo => 1.7, bar => 3.234},
    label => 'whatever');

    Or do I misunderstand your question?

    -Ken
  • Dominique Vlieghe at Sep 23, 2003 at 2:15 pm

    On Tue, 2003-09-23 at 16:00, Ken Williams wrote:
    On Tuesday, September 23, 2003, at 02:21 AM, Dominique Vlieghe wrote:

    Hi,

    I was wondering whether the NaiveBayes Modules (AI::NaiveBayes1 and
    Algorithm::NaiveBayes) are capable of handling numerical attributes. A
    first glance on the code tells me they are not. Is this so and if yes,
    does anyone have an alternative package? Are there any plans to
    introduce numerical attributes in the modules?
    Algorithm::NaiveBayes uses numerical attributes:

    $nb->add_instance
    (attributes => {foo => 1.7, bar => 3.234},
    label => 'whatever');

    Or do I misunderstand your question?
    I think you do, what I mean is that it should create some sort of
    distribution (e.g. a normal distribution) of the values of a given
    attribute. The naive bayes modules will (if I'm not mistaken) count the
    number of occurrences of a (numeric or not) attribute e.g. in your
    example you will have 1 times 1.7 and 1 times 3.234.

    In weka for example the nature of the attribute is determined by the
    input file: either discrete or numeric.

    --
    ------------------------------
    Dominique Vlieghe, Ph.D.,
    Bioinformatics Core,
    Department for Molecular Biomedical Research (DMBR)
    VIB - Ghent University
    (new) 'Fiers-Schell-Van Montagu' building
    (new) Technologiepark 927
    (new) B-9052 Ghent (Zwijnaarde), Belgium

    (new) Tel : +32-(0)9-33-13.693
    (new) Fax : +32-(0)9-33-13.609
    (new) email:dominique.vlieghe@dmbr.ugent.be
    (new) www:http://www.dmbr.ugent.be/
    ------------------------------
  • Ken Williams at Sep 23, 2003 at 2:29 pm

    On Tuesday, September 23, 2003, at 09:12 AM, Dominique Vlieghe wrote:
    On Tue, 2003-09-23 at 16:00, Ken Williams wrote:

    Algorithm::NaiveBayes uses numerical attributes:

    $nb->add_instance
    (attributes => {foo => 1.7, bar => 3.234},
    label => 'whatever');

    Or do I misunderstand your question?
    I think you do, what I mean is that it should create some sort of
    distribution (e.g. a normal distribution) of the values of a given
    attribute. The naive bayes modules will (if I'm not mistaken) count the
    number of occurrences of a (numeric or not) attribute e.g. in your
    example you will have 1 times 1.7 and 1 times 3.234.
    Right, those values essentially mean that the "foo" attribute is
    counted 1.7 times, and the "bar" attribute is counted 3.234 times.
    They're simply arbitrary weights, so "count" is not quite the right
    term, but it's the way many people think of them.

    So what you're looking for is something like this, right?

    $nb->attribute_type('numeric');
    $nb->add_instance
    (attributes => {23 => 1.7, 35 => 3.234},
    label => 'whatever');

    and then the model should correctly interpolate values for unseen
    attributes like 29 using an underlying distribution model? Currently
    this is unsupported by the module, but it could be added - especially
    with some help. =)

    -Ken

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupai @
categoriesperl
postedSep 23, '03 at 7:23a
activeSep 23, '03 at 2:29p
posts4
users2
websiteperl.org

2 users in discussion

Dominique Vlieghe: 2 posts Ken Williams: 2 posts

People

Translate

site design / logo © 2021 Grokbase