firefly-cpp / NiaARM

A minimalistic framework for Numerical Association Rule Mining
MIT License
15 stars 6 forks source link

If i want to just mine the rules without using optimization algorithm, how should i do that? #111

Closed RamaSubramanianT closed 4 days ago

RamaSubramanianT commented 4 months ago

I am doing swarm-based optimization in the association rules, i want to compare the before and after, before optimization how many rules are generated and then after optimization how many rules are shown.

zStupan commented 4 months ago

Every individual in the population represents an association rule that is generated and if it has a support and confidence greater than 0, it is kept in a list of rules. So for example if your stopping condition is 10,000 evaluations, there will be 10,000 generated rules. And you can get the number of rules that were actually saved by getting the length of the rule list.

RamaSubramanianT commented 4 months ago

I understand your views but could you please provide a practical example or a demo illustrating how to retrieve the association rules before applying the optimization algorithm? This would greatly assist me in understanding the process and proceeding with my task effectively.

erkankarabulut commented 3 months ago

@RamaSubramanianT So the initial rule generation is completely random. Why would you want to compare the complete random rule set with the end result?

This library just represents the problem of ARM as an optimization problem (see the NiaARM class). And then runs the underlying optimization algorithm, which are implemented as part of NiaPy library.

Therefore, with the current implementation, you can't get the initial set of rules first. But what you could do is to set max_iterations to 1, to get a randomly initialized set of association rules. Then you can run it again this time with a high number of max_iterations and get actual results. Of course, the second run won't use the randomly initialized rules from the first run, but still it will give you an idea of how the results are getting better.