def get_raw_data(dataset_name):
    raw_data = None
    if dataset_name == "amazon_book":
        raw_data = dataloader.load_amazon_book()
    elif dataset_name == "citeulike":
        raw_data = dataloader.load_citeulike()
    elif dataset_name == "tradesy":
        raw_data = dataloader.load_tradesy()
    else:
        print("Bad dataset name.")
        exit()
    return raw_data
Exemple #2
0
import os
import sys
sys.path.append(os.getcwd())

from openrec.legacy import ImplicitModelTrainer
from openrec.legacy.utils import ImplicitDataset
from openrec.legacy.recommenders import ConcatVisualBPR
from openrec.legacy.utils.evaluators import AUC
from openrec.legacy.utils.samplers import PairwiseSampler
from config import sess_config
import dataloader

raw_data = dataloader.load_tradesy()
batch_size = 1000
test_batch_size = 100
item_serving_size = 1000
display_itr = 10000

train_dataset = ImplicitDataset(raw_data['train_data'],
                                raw_data['max_user'],
                                raw_data['max_item'],
                                name='Train')
val_dataset = ImplicitDataset(raw_data['val_data'],
                              raw_data['max_user'],
                              raw_data['max_item'],
                              name='Val')
test_dataset = ImplicitDataset(raw_data['test_data'],
                               raw_data['max_user'],
                               raw_data['max_item'],
                               name='Test')