Get the attributes with more impact in the final prediction using Java API WEKA

classic Classic list List threaded Threaded
4 messages Options
JC
Reply | Threaded
Open this post in threaded view
|

Get the attributes with more impact in the final prediction using Java API WEKA

JC
Hi guys!

I have a dataset with data of differents diseases and I would like to know
*how can I get the attributes with more impact in the final prediction*
without deleted the attributes with less impact in this prediction.

I am using Naive Bayes to weight attributes.

How could I do this? are there some examples?

*This is the code* where I am working on, is this the way?

AttributeSelection attSelection = new AttributeSelection();
attSelection.setEvaluator( new InfoGainAttributeEval() );
attSelection.setRanking(true);

Ranker rank = new Ranker();
rank.setThreshold(0.5);

attSelection.setSearch(rank);
attSelection.SelectAttributes(data);

data = attSelection.reduceDimensionality(data);
               
System.out.println("Muestro el rank: " + attSelection.toResultsString());

With this I get the attributes with a threshold more than 0.5.

Thank you guys!



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Get the attributes with more impact in the final prediction using Java API WEKA

Eibe Frank-3
Not entirely sure what you are trying to do. Yes, you could use attribute selection method to figure out the individually most predictive attributes. Is the plan to give those a higher weight in the NaiveBayes model? How would you determine the weights to use? Why don't you instead get the scores from an attribute evaluator (e.g., InfoGainAttributeEval) and set the weights based on these scores?

Are you absolutely set on using NaiveBayes? I suspect that in most cases you will get better results with boosted decision stumps (e.g., obtained with LogitBoost), as long as you use a sufficient number of boosting iterations.

Cheers,
Eibe

On Tue, Aug 20, 2019 at 11:17 PM JC <[hidden email]> wrote:
Hi guys!

I have a dataset with data of differents diseases and I would like to know
*how can I get the attributes with more impact in the final prediction*
without deleted the attributes with less impact in this prediction.

I am using Naive Bayes to weight attributes.

How could I do this? are there some examples?

*This is the code* where I am working on, is this the way?

AttributeSelection attSelection = new AttributeSelection();
attSelection.setEvaluator( new InfoGainAttributeEval() );
attSelection.setRanking(true);

Ranker rank = new Ranker();
rank.setThreshold(0.5);

attSelection.setSearch(rank);
attSelection.SelectAttributes(data);

data = attSelection.reduceDimensionality(data);

System.out.println("Muestro el rank: " + attSelection.toResultsString());

With this I get the attributes with a threshold more than 0.5.

Thank you guys!



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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: [hidden email]
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
JC
Reply | Threaded
Open this post in threaded view
|

Re: Get the attributes with more impact in the final prediction using Java API WEKA

JC
Hi Eibe!

I am using Naive Bayes because it is the only one that accepts to modify the
weights.
What I am trying with this is to know which attribute has more impact on the
final prediction to give more importance to the weights.

For example, if SYS is more important than DIA, give SYS more weight than
DIA and get a better prediction.

What exactly does these "more predictive attributes" mean?
So, would you recommend using an attribute evaluator like
InfoGainAttributeEval?



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Get the attributes with more impact in the final prediction using Java API WEKA

Eibe Frank-2
Administrator
Yes, you could just use the score for an attribute returned by an attribute evaluator as the weight.

As discussed in

Zaidi, N. A., Cerquides, J., Carman, M. J., & Webb, G. I. (2013). Alleviating naive Bayes attribute independence assumption by attribute weighting. The Journal of Machine Learning Research, 14(1), 1947-1988.

the gain ratio appears to have been used like this before, for example.

Cheers,
Eibe

> On 26/08/2019, at 10:16 PM, JC <[hidden email]> wrote:
>
> Hi Eibe!
>
> I am using Naive Bayes because it is the only one that accepts to modify the
> weights.
> What I am trying with this is to know which attribute has more impact on the
> final prediction to give more importance to the weights.
>
> For example, if SYS is more important than DIA, give SYS more weight than
> DIA and get a better prediction.
>
> What exactly does these "more predictive attributes" mean?
> So, would you recommend using an attribute evaluator like
> InfoGainAttributeEval?
>
>
>
> --
> Sent from: https://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> 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: [hidden email]
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