Ejemplo n.º 1
0
    | LETTOR    | MQ2007_Super %  MQ2008_Super %  MQ2007_Semi %  MQ2008_Semi                |
    -----------------------------------------------------------------------------------------
    | MSLRWEB   | MSLRWEB10K %  MSLRWEB30K                                                  |
    -----------------------------------------------------------------------------------------
    | Yahoo_LTR | Set1 % Set2                                                               |
    -----------------------------------------------------------------------------------------
    | ISTELLA_LTR | Istella_S | Istella | Istella_X                                         |
    -----------------------------------------------------------------------------------------
    
    """

    debug = True  # in a debug mode, we just check whether the model can operate

    config_with_json = True  # specify configuration with json files or not

    evaluator = TreeLTREvaluator()

    if config_with_json:  # specify configuration with json files
        # the directory of json files
        dir_json = '/Users/dryuhaitao/WorkBench/Dropbox/CodeBench/GitPool/wildltr_ptranking/testing/ltr_tree/json/'

        evaluator.run(debug=debug,
                      model_id='LightGBMLambdaMART',
                      config_with_json=config_with_json,
                      dir_json=dir_json)

    else:
        #data_id = 'MQ2008_Super'
        data_id = 'MSLRWEB30K'

        #dir_data = '/home/dl-box/WorkBench/Datasets/L2R/LETOR4.0/MQ2008/'
Ejemplo n.º 2
0
    -----------------------------------------------------------------------------------------
    | Yahoo_LTR | Set1 % Set2                                                               |
    -----------------------------------------------------------------------------------------
    | ISTELLA_LTR | Istella_S | Istella | Istella_X                                         |
    -----------------------------------------------------------------------------------------

    """

    args_obj = ArgsUtil(given_root='./')
    l2r_args = args_obj.get_l2r_args()

    if l2r_args.model in LTR_ADHOC_MODEL:
        evaluator = LTREvaluator(cuda=l2r_args.cuda)

    elif l2r_args.model in LTR_ADVERSARIAL_MODEL:
        evaluator = AdLTREvaluator(cuda=l2r_args.cuda)

    elif l2r_args.model in LTR_TREE_MODEL:
        evaluator = TreeLTREvaluator()

    else:
        args_obj.args_parser.print_help()
        sys.exit()

    print('Started evaluation with pt_ranking !')
    evaluator.run(model_id=l2r_args.model,
                  dir_json=l2r_args.dir_json,
                  debug=l2r_args.debug,
                  config_with_json=True)
    print('Finished evaluation with pt_ranking !')