Closed nebfield closed 6 years ago
I'm afraid you are right. Needs to be added. For temporary solution you can use native implementation of rseslib.processing.classification.rules.roughset.RoughSetRuleClassifier with e.g. getRules(),toString().
Thanks! As I already have a trained model is there a way to cast a weka.classifiers.rules.RoughSet
to a rseslib.processing.classification.rules.roughset.RoughSetRuleClassifier
? Or am I best starting from scratch with rseslib
?
Hi,
You need to start from scratch by training the native rseslib classifier. It needs to be fixed too.
Arek
OK, no problem. Thank you both for all the help.
Hi Ben,
Let us keep the issue open until it is fixed. We will fix it soon in master and close the issue then.
Arek
Sorry about that! I have another question:
Thanks to your help I have trained a RoughSetRuleClassifier
and extracted the rules. However, I can't work out how to extract the statistics for each rule (e.g. the support). getRules()
returns a collection of Rule
objects. I think I need RuleWithStatistics
objects, but I don't know if it's possible to extract RuleWithStatistics
objects from a RoughSetRuleClassifier
. calculateStatistics()
appears to only return the number of rules in the RoughSetRuleClassifier
. Am I missing anything obvious?
Each Rule
object from the rough set classifier is actually EqulityDescriptorsRule
which implements RuleWithStatistics
interface. So you can just use casting:
Rule r = <a rule from rough set classifier>
((RuleWithStatistics)r).getSupport()
That works perfectly, thank you.
Hello,
I have a simple question, and I have probably overlooked something obvious: is there a way to extract the rules generated by a trained model?
weka.classifiers.rules.JRip
has the useful methodgetRuleset()
. Is there an equivalent forweka.classifiers.rules.RoughSet
?I know the rules can be visualised with
Qmak
, but I would like to extract the list of rules into a text based format for further analysis and optimisation.Thanks, Ben