### ----------------------------------------------------
### -- ML::AssociationRuleLearning
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: t/05-basic-usage-associationa-rules.rakutest
### ----------------------------------------------------
use v6.d;
use Test;

use lib '.';
use lib './lib';

use ML::AssociationRuleLearning;
use Data::ExampleDatasets;
use Data::Reshapers;

my @dsTitanic = get-titanic-dataset();

plan 3;

## 1
ok association-rules(@dsTitanic.map({ $_.values.List }).Array, method => 'eclat', min-support => 0.1, min-confidence => 0.7, min-number-of-items => 2, max-number-of-items => 3);

## 2
ok association-rules(@dsTitanic.map({ $_.values.List }).Array, method => 'apriori', min-support => 0.3, min-confidence => 0.7, min-number-of-items => 2, max-number-of-items => 2);

## 3
is association-rules(@dsTitanic.map({ $_.values.List }).Array, min-support => 0.1, min-confidence => 0.7, min-number-of-items => 2, max-number-of-items => 3, :!object)[0].keys.sort,
        <antecedent consequent count support confidence lift leverage conviction>.sort;


done-testing;



