[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wekalist
Subject:    Re: [Wekalist] Weight an attribute in Java API for WEKA
From:       <eibe () waikato ! ac ! nz>
Date:       2019-05-26 7:39:24
Message-ID: 026701d51396$259e6f60$70db4e20$ () waikato ! ac ! nz
[Download RAW message or body]

In the first code snippet, you modify the weight of the first attribute, not
the second one, that's also a difference.

There is no upper limit to an attribute weight other than Double.MAX_VALUE.
Of course, depending on what the learning algorithm does internally, you may
get an overflow with very large values.

Cheers,
Eibe

-----Original Message-----
From: wekalist-bounces@list.waikato.ac.nz
<wekalist-bounces@list.waikato.ac.nz> On Behalf Of JC
Sent: Thursday, 23 May 2019 9:51 PM
To: wekalist@list.waikato.ac.nz
Subject: Re: [Wekalist] Weight an attribute in Java API for WEKA

Hi Eibe!

I used *this code but it has no effect on the predictions*.

data = (new
weka.core.converters.ConverterUtils.DataSource("/Users/eibe/datasets/UCI/iri
s.arff")).getDataSet()
data.setAttributeWeight(0, 2.0)
print(data.toString()) 

However, I have used *this code and it does have an effect*:

for (int i = 0; i < trainingSet.numInstances(); i++) { 
    	trainingSet.instance(i).attribute(1).setWeight(2.8 + factor*i); }

Using setWeight I have to use a double ... What is the upper limit when
modifying a weight? For example, I am using 2.8, 5, 6, etc.



--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: Wekalist@list.waikato.ac.nz To subscribe, unsubscribe, etc.,
visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette:
http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: Wekalist@list.waikato.ac.nz
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic