1
is it correct code to set key parameters ?
2
by the way is it possible to set max number of rules?
or some recommendations how to gt less rules for the approximately same confusion matrix (or F1)
3
what to do with unbalanced data?
4
did you compared performance with with corels ?
https://github.com/fingoldin/pycorels
5
how to set better accuracy by worse recall
or
vice versa ?
6
can predict_proba be used?
from pyarc import TransactionDB
from pyarc.algorithms import (
top_rules,
createCARs,
M1Algorithm,
M2Algorithm,
generateCARs
)
import pandas as pd
import numpy as np
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)
cars = generateCARs(txns_train , maxlen= 3, support= 0.1 , confidence = 0.2 )
classifier = M1Algorithm(cars, txns_train).build()
classifier = M2Algorithm(cars, txns_train).build()
accuracy = classifier.test_transactions(txns_test)
predicted_txns_train = classifier.predict_all(txns_train)
data_train['class'].values
from sklearn.metrics import confusion_matrix
print(confusion_matrix(predicted_txns_train,data_train['class'].values ))
for each_rule in classifier.rules :
q=0
1
is it correct code to set key parameters ?
2
by the way is it possible to set max number of rules?
or some recommendations how to gt less rules for the approximately same confusion matrix (or F1)
3
what to do with unbalanced data?
4
did you compared performance with with corels ?
https://github.com/fingoldin/pycorels
5
how to set better accuracy by worse recall
or
vice versa ?
6
can predict_proba be used?
from pyarc import TransactionDB
from pyarc.algorithms import (
)
import pandas as pd
import numpy as np
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)
cars = generateCARs(txns_train , maxlen= 3, support= 0.1 , confidence = 0.2 )
classifier = M1Algorithm(cars, txns_train).build()
classifier = M2Algorithm(cars, txns_train).build()
accuracy = classifier.test_transactions(txns_test)
predicted_txns_train = classifier.predict_all(txns_train)
data_train['class'].values
from sklearn.metrics import confusion_matrix
print(confusion_matrix(predicted_txns_train,data_train['class'].values ))
for each_rule in classifier.rules :
q=0