コード例 #1
0
ファイル: logrprediction.py プロジェクト: javs0188/bigmler
def local_prediction(models, test_reader, output, args, exclude=None):
    """Get local model and issue prediction

    """
    # Only one model at present
    local_model = SupervisedModel(models[0], api=args.retrieve_api_)
    kwargs = {"full": True}
    if has_value(args.operating_point_):
        kwargs.update({"operating_point": args.operating_point_})
    for input_data in test_reader:
        input_data_dict = test_reader.dict(input_data, filtering=False)
        prediction_info = local_model.predict(input_data_dict, **kwargs)
        write_prediction(prediction_info, output, args.prediction_info,
                         input_data, exclude)
コード例 #2
0
def fusion_dispatcher(args=sys.argv[1:]):
    """Parses command line and calls the different processing functions

    """

    # If --clear-logs the log files are cleared
    if "--clear-logs" in args:
        clear_log_files(LOG_FILES)

    settings = {}
    settings.update(SETTINGS)
    if '--evaluate' in args:
        settings.update({"default_output": "evaluation"})

    command_args, _, api, session_file, _ = get_context(args, settings)

    # Selects the action to perform
    if a.has_value(command_args, "fusion_models_") or a.has_test(command_args):
        compute_output(api, command_args)
    u.log_message("_" * 80 + "\n", log_file=session_file)
コード例 #3
0
ファイル: dispatcher.py プロジェクト: jaor/bigmler
def fusion_dispatcher(args=sys.argv[1:]):
    """Parses command line and calls the different processing functions

    """

    # If --clear-logs the log files are cleared
    if "--clear-logs" in args:
        clear_log_files(LOG_FILES)

    settings = {}
    settings.update(SETTINGS)
    if '--evaluate' in args:
        settings.update({"default_output": "evaluation"})

    command_args, command, api, session_file, resume = get_context(args,
                                                                   settings)

    # Selects the action to perform
    if a.has_value(command_args, "fusion_models_") or a.has_test(command_args):
        compute_output(api, command_args)
    u.log_message("_" * 80 + "\n", log_file=session_file)
コード例 #4
0
ファイル: sl_prediction.py プロジェクト: jaor/bigmler
def local_prediction(models, test_reader, output, args,
                     exclude=None):
    """Get local model and issue prediction

    """
    # Only one model at present
    try:
        bigml.api.get_fusion_id(models[0])
        local_model = Fusion(models[0], api=args.retrieve_api_)
    except ValueError:
        local_model = SupervisedModel(models[0],
                                      api=args.retrieve_api_)
    kwargs = {"full": True}
    if has_value(args, "operating_point_"):
        kwargs.update({"operating_point": args.operating_point_})
    for input_data in test_reader:
        input_data_dict = test_reader.dict(input_data, filtering=False)
        prediction_info = local_model.predict(
            input_data_dict, **kwargs)
        write_prediction(prediction_info, output,
                         args.prediction_info, input_data, exclude)