summaryrefslogtreecommitdiff
path: root/abml/learn_dist.py
blob: 44e19c360cd11c7bb95f294a2d0a33d537b2995e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os.path
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('path', help='path to data directory')
args = parser.parse_args()
path = args.path

data = Table(os.path.join(path, 'programs-train'))

rule_learner = rp.create_learner(path, evds=False)
rule_learner.calculate_evds(data)
pickle.dump(rule_learner.evds, open(os.path.join(path, 'evds.pickle'), "wb"))