Commit c510eb48 authored by Anze Vavpetic's avatar Anze Vavpetic
Browse files

fix [fix [mapper fix when the target table has exactly two attributes and no...

fix [fix [mapper fix when the target table has exactly two attributes and no features are produced; isprogramirano] bolje isprogramirano] jos bolje isprogramirano
parent b7ec322a
...@@ -117,11 +117,11 @@ class RSD_Converter(ILP_Converter): ...@@ -117,11 +117,11 @@ class RSD_Converter(ILP_Converter):
''' '''
Converts the database context to RSD inputs. Converts the database context to RSD inputs.
''' '''
def all_examples(self, target=None): def all_examples(self, pred_name=None):
if not target:
target = self.db.target_table target = self.db.target_table
pred_name = pred_name if pred_name else target
examples = self.db.rows(target, [self.db.target_att, self.db.pkeys[target]]) examples = self.db.rows(target, [self.db.target_att, self.db.pkeys[target]])
return '\n'.join(["%s('%s', %s)." % (target, cls, pk) for cls, pk in examples]) return '\n'.join(["%s('%s', %s)." % (pred_name, cls, pk) for cls, pk in examples])
def background_knowledge(self): def background_knowledge(self):
modeslist, getters = [self.mode(self.db.target_table, [('+', self.db.target_table)], head=True)], [] modeslist, getters = [self.mode(self.db.target_table, [('+', self.db.target_table)], head=True)], []
......
...@@ -30,8 +30,8 @@ def domain_map(features, feature_format, train_context, test_context, ...@@ -30,8 +30,8 @@ def domain_map(features, feature_format, train_context, test_context,
train_rsd = RSD_Converter(train_context) train_rsd = RSD_Converter(train_context)
test_rsd = RSD_Converter(test_context, discr_intervals=intervals) test_rsd = RSD_Converter(test_context, discr_intervals=intervals)
mapper_target_name = train_context.target_table + '_mapper' mapper_target_name = train_context.target_table + '_mapper'
train_examples = train_rsd.all_examples(target=mapper_target_name) train_examples = train_rsd.all_examples(pred_name=mapper_target_name)
test_examples = test_rsd.all_examples(target=mapper_target_name) test_examples = test_rsd.all_examples(pred_name=mapper_target_name)
if feature_format == 'aleph': if feature_format == 'aleph':
features = aleph_to_rsd_features(features) features = aleph_to_rsd_features(features)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment