You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-29Lines changed: 52 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
[](http://isitmaintained.com/project/firefly-cpp/niaarm"Average time to resolve an issue")
16
16
17
17
## General outline of the framework
18
-
NiaARM is a framework for Association Rule Mining based on nature-inspired algorithms for optimization. The framework is written fully in Python and runs on all platforms. NiaARM allows users to preprocess the data in a transaction database automatically, to search for association rules and provide a pretty output of the rules found. This framework also supports numerical and real-valued types of attributes besides the categorical ones. Mining the association rules is defined as an optimization problem, and solved using the nature-inspired algorithms that come from the related framework called [NiaPy](https://github.com/NiaOrg/NiaPy).
18
+
NiaARM is a framework for Association Rule Mining based on nature-inspired algorithms for optimization. The framework is written fully in Python and runs on all platforms. NiaARM allows users to preprocess the data in a transaction database automatically, to search for association rules and provide a pretty output of the rules found. This framework also supports integral and real-valued types of attributes besides the categorical ones. Mining the association rules is defined as an optimization problem, and solved using the nature-inspired algorithms that come from the related framework called [NiaPy](https://github.com/NiaOrg/NiaPy).
19
19
20
20
## Detailed insights
21
21
The current version includes (but is not limited to) the following functions:
@@ -44,19 +44,63 @@ $ apk add py3-niaarm
44
44
45
45
## Usage
46
46
47
-
### Basic example
47
+
### Loading data
48
48
49
-
In this example we'll use Differential Evolution to mine association rules on the Abalone Dataset.
49
+
In NiaARM, data loading is done via the `Dataset` class. There are two options for loading data:
50
+
51
+
#### Option 1: From a pandas DataFrame (recommended)
52
+
53
+
```python
54
+
import pandas as pd
55
+
from niaarm import Dataset
56
+
57
+
58
+
df = pd.read_csv('datasets/Abalone.csv')
59
+
# preprocess data...
60
+
data = Dataset(df)
61
+
print(data) # printing the dataset will generate a feature report
62
+
```
63
+
64
+
#### Option 2: From CSV file directly
65
+
66
+
```python
67
+
from niaarm import Dataset
68
+
69
+
70
+
data = Dataset('datasets/Abalone.csv')
71
+
print(data)
72
+
```
73
+
74
+
### Mining association rules the easy way (recommended)
75
+
76
+
Association rule mining can be easily performed using the `get_rules` function:
77
+
78
+
```python
79
+
80
+
from niaarm import get_rules
81
+
from niapy.algorithms.basic import DifferentialEvolution
0 commit comments