semvec/pypi-packages huggingface dataset:
pyarc 1.1.4
An implementation of CBA algorithm
Keywords: classification CBA association rules machine learning

# pyARC
 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

pyARC is an implementation of CBA (Classification Based on Assocation) algorithm introduced in


 ```Liu, B. Hsu, W. and Ma, Y (1998). Integrating Classification and Association Rule Mining. Proceedings KDD-98, New York, 27-31 August. AAAI. pp 80-86.```

In addition, pyARC contains the implementation of QCBA (Quantitative CBA) algorithm introduced in 

 ```KLIEGR, Tomas. Quantitative CBA: Small and Comprehensible Association Rule Classification Models. arXiv preprint arXiv:1711.10166, 2017.```

The use of [QCBA](https://arxiv.org/abs/1711.10166) algorithm is demonstrated in [this jupyter notebook](https://github.com/jirifilip/pyARC/tree/master/notebooks/extensions/QCBA_demonstration.ipynb).


The [fim](http://www.borgelt.net/pyfim.html) package is used for the rule generation step. 

 If you find this package useful in your research, please cite ([EasyChair link](https://easychair.org/publications/preprint/5d6G)):

```
 @techreport{filip2018classification,
  title={Classification based on Associations (CBA)-a performance analysis},
  author={Filip, Ji{\v{r}}{\'\i} and Kliegr, Tom{\'a}{\v{s}}},
  year={2018},
  institution={EasyChair}
}
```


## Installation
```
pip install pyarc
```

For using pyARC, the [fim](http://www.borgelt.net/pyfim.html) package needs to be installed (refer to http://www.borgelt.net/pyfim.html for installation guide).


## Testing
```
python -m unittest discover -s pyarc/test  -p '*test_*.py'
```


## Examples

Simplest example

```python
from pyarc import CBA, TransactionDB
import pandas as pd

data_train = pd.read_csv("iris.csv")
data_test = pd.read_csv("iris.csv")

txns_train = TransactionDB.from_DataFrame(data_train)
txns_test = TransactionDB.from_DataFrame(data_test)


cba = CBA(support=0.20, confidence=0.5, algorithm="m1")
cba.fit(txns_train)

accuracy = cba.rule_model_accuracy(txns_test) 
```

Using top_rules function to mine the best rules possible

```python
from pyarc import TransactionDB
from pyarc.algorithms import (
    top_rules,
    createCARs,
    M1Algorithm,
    M2Algorithm
)
import pandas as pd


data_train = pd.read_csv("iris.csv")
data_test = pd.read_csv("iris.csv")

txns_train = TransactionDB.from_DataFrame(data_train)
txns_test = TransactionDB.from_DataFrame(data_test)

# get the best association rules
rules = top_rules(txns_train.string_representation)

# convert them to class association rules
cars = createCARs(rules)

classifier = M1Algorithm(cars, txns_train).build()
# classifier = M2Algorithm(cars, txns_train).build()

accuracy = classifier.test_transactions(txns_test)

```
dnstap-dashboard 0.2.0
dnstap dashboard - real-time metrics for dns server
Keywords: dnstap dashboard dns metrics

# Dnstap dashboard - real-time metrics for dns server

## Table of contents
* [Overview](#overview)
* [Installation](#installation)
* [Configuration](#configuration)

## Overview

**dnstap_dashboard** can display metrics of your dns server in real-time, a top-like command.

> If you want to use-it, your server must support the ``dnstap`` feature and also deploy the following [dnstap receiver](https://github.com/dmachard/dnstap-receiver)
                       
      [             ] ---- stream 1 ------------|
      [     DNS     ]                           |
      [             ]                           v
      [   servers   ] ---- stream 2 ----> [ dnstap receiver ] <-- [ dnstap dashboard ]
      [             ]                         

## Installation

Install the dnstap_dashboard command with the pip command.

```python
pip install dnstap_dashboard
```

After installation, you can execute the binary `./dnstap_dashboard` to start-it.
Prefer to install the dnstap_dashboard binary on the same machine of your dnstap receiver.

![dnstap_dashboard](/screenshot.png)

## Configuration

See [default config file](/dnstap_dashboard/dashboard.conf) example.

You can provide your own configuration, to do that create the following file `/etc/dnstap_dashboard/dashboard.conf`.

If your dnstap_dashboard command is not on the same machine of your dnstap receiver, you need to configure the api address and provide the good api-key, for example:

```yaml
dnstap-receiver:
  api-ip: 127.0.0.1
  api-port: 8080
  api-key: changeme
```