-
Notifications
You must be signed in to change notification settings - Fork 2
/
SELFRec.py
22 lines (18 loc) · 942 Bytes
/
SELFRec.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from data.loader import FileIO
class SELFRec(object):
def __init__(self, config):
self.social_data = []
self.feature_data = []
self.config = config
self.training_data = FileIO.load_data_set(config['training.set'], config['model.type'])
self.test_data = FileIO.load_data_set(config['test.set'], config['model.type'])
self.kwargs = {}
# if config.contains('feature.data'):
# self.social_data = FileIO.loadFeature(config,self.config['feature.data'])
print('Reading data and preprocessing...')
def execute(self):
# import the model module
import_str = 'from model.'+ self.config['model.type'] +'.' + self.config['model.name'] + ' import ' + self.config['model.name']
exec(import_str)
recommender = self.config['model.name'] + '(self.config,self.training_data,self.test_data,**self.kwargs)'
eval(recommender).execute()