Beispiel #1
0
def loadData(config_path):
    train_path, test_path, save_path = NetworkConfigParser.getDataInfo(
        config_path)
    nn = NetworkConfigParser.constructNetwork(config_path)
    d = Data()
    d.import_ratings(train_path, shape=(None, nn.layers[0].num_units))
    train = d.R.copy()
    test = loadTestData(d, test_path)
    return train, test
Beispiel #2
0
def LoadDataAndMapping(config_path):
    train_path, test_path, save_path = NetworkConfigParser.getDataInfo(
        config_path)
    nn = NetworkConfigParser.constructNetwork(config_path)
    d = Data()
    d.import_ratings(train_path, shape=(None, nn.layers[0].num_units))
    train = d.R.copy()
    test = loadTestData(d, test_path)
    usermap = {v: k for k, v in d.users.items()}
    itemmap = {v: k for k, v in d.items.items()}
    return train, test, usermap, itemmap