summaryrefslogtreecommitdiff
path: root/abml/learn_dist.py
blob: 58e4968790f4643c556bc9f4dcb88974feadd8f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pickle
import argparse
from Orange.data import Table
import abml.rules_prolog as rp

parser = argparse.ArgumentParser(description='Learn and test rules for prolog programs.')
parser.add_argument('Name', type=str, help='Predicate name.')
args = parser.parse_args()
name = args.Name

data = Table('data/{}/programs-train'.format(name))

rule_learner = rp.create_learner(name, evds=False)
rule_learner.calculate_evds(data)
pickle.dump(rule_learner.evds, open("data/{}/evds.pickle".format(name), "wb"))