예제 #1
0
        default=500,
        help="How often (in terms of number of data points) to evaluate on dev."
    )
    return parser


if __name__ == '__main__':

    args = return_parser().parse_args()

    data = loader.read_data_sets(
        args.datadir, folders=['train', 'test', 'dev', 'user', 'item'])
    data.train.labels['ratings'] = loader.center(data.train.labels['ratings'],
                                                 axis=None)
    data.dev.labels['ratings'] = loader.center(data.dev.labels['ratings'],
                                               axis=None)

    x = tree_model.tree(data,
                        args.config,
                        initrange=args.initrange,
                        kfactors=args.kfactors,
                        lamb=args.lamb,
                        mb=args.mb,
                        learnrate=args.learnrate,
                        verbose=args.verbose,
                        maxbadcount=args.maxbadcount,
                        epochs=args.epochs,
                        random_seed=args.random_seed,
                        eval_rate=args.eval_rate)
    #print stuff here to file.
예제 #2
0
    parser.add_argument("random_seed", metavar="RANDOM_SEED", type=int,
                        help="For reproducible results.")
    parser.add_argument("eval_rate", metavar="EVAL_RATE", type=int,
                        help="How often (in terms of number of data points) to evaluate on dev.")
    return parser

if __name__ == '__main__':

    args = return_parser().parse_args()

    data = loader.read_data_sets(args.datadir, folders=['train', 'test', 'dev', 'user', 'item'])
    data.train.labels['ratings'] = loader.center(data.train.labels['ratings'], axis=None)
    data.dev.labels['ratings'] = loader.center(data.dev.labels['ratings'], axis=None)
    data.user.features['age'] = loader.center(data.user.features['age'], axis=None)
    data.item.features['year'] = loader.center(data.item.features['year'], axis=None)
    data.user.features['age'] = loader.maxnormalize(data.user.features['age'])
    data.item.features['year'] = loader.maxnormalize(data.item.features['year'])

    x = tree_model.tree(data, args.config,data, args.config,
                        initrange=args.initrange,
                        kfactors=args.kfactors,
                        lamb =args.lamb,
                        mb=args.mb,
                        learnrate=args.learnrate,
                        verbose=args.verbose,
                        maxbadcount=args.maxbadcount,
                        epochs=args.epochs,
                        random_seed=args.random_seed,
                        eval_rate=args.eval_rate)
    #print stuff here to file.
예제 #3
0
if __name__ == '__main__':

    args = return_parser().parse_args()
    data = loader.read_data_sets(args.datadir,
                                 folders=['train', 'dev', 'user', 'item'])
    data.train.labels['ratings'] = loader.center(data.train.labels['ratings'])
    data.dev.labels['ratings'] = loader.center(data.dev.labels['ratings'])
    data.user.features['age'] = loader.center(data.user.features['age'],
                                              axis=None)
    data.item.features['year'] = loader.center(data.item.features['year'],
                                               axis=None)
    data.user.features['age'] = loader.maxnormalize(data.user.features['age'])
    data.item.features['year'] = loader.maxnormalize(
        data.item.features['year'])
    data.show()
    print('=================mfmodel============================')
    x = mfmodel.mf(data, 'mf.config', epochs=1)
    print('=================treemodel============================')
    x2 = tree_model.tree(data, 'tree.config', epochs=1)
    print('=================dssmmodel============================')
    x3 = dssm_model.dssm(data, 'dssm.config', epochs=1)
    print('=================dnnconcat============================')
    x4 = dnn_concat_model.dnn_concat(data, 'dnn_concat.config', epochs=1)
    print('=================mult_dnn_concat============================')
    x5 = dnn_concat_model.dnn_concat(data, 'dnn_mult_concat.config', epochs=1)
    print('=================dsadd============================')
    x5 = dsaddmodel.dsadd(data, 'dssm.config', epochs=1)
    print('=================dssmrestricted============================')
    x6 = dssm_restricted_model(data, 'dssm.config', epochs=1)