Exemplo n.º 1
0
def local_prediction(deepnets, test_reader, output, args, exclude=None):
    """Get local deepnet and issue prediction

    """
    kwargs = {"full": True}
    if args.operating_point_:
        kwargs.update({"operating_point": args.operating_point_})
    # Only one deepnet at present
    local_deepnet = Deepnet(deepnets[0], api=args.retrieve_api_)
    for input_data in test_reader:
        input_data_dict = test_reader.dict(input_data, filtering=False)
        prediction_info = local_deepnet.predict(input_data_dict, **kwargs)
        write_prediction(prediction_info, output, args.prediction_info,
                         input_data, exclude)
Exemplo n.º 2
0
def local_prediction(deepnets, test_reader, output, args,
                     exclude=None):
    """Get local deepnet and issue prediction

    """
    # Only one deepnet at present
    local_deepnet = Deepnet(deepnets[0],
                            api=args.retrieve_api_)
    test_set_header = test_reader.has_headers()
    for input_data in test_reader:
        input_data_dict = test_reader.dict(input_data, filtering=False)
        prediction_info = local_deepnet.predict(
            input_data_dict, by_name=test_set_header)
        write_prediction(prediction_info, output,
                         args.prediction_info, input_data, exclude)
Exemplo n.º 3
0
def local_prediction(deepnets, test_reader, output, args,
                     exclude=None):
    """Get local deepnet and issue prediction

    """
    kwargs = {"full": True}
    if args.operating_point_:
        kwargs.update({"operating_point": args.operating_point_})
    # Only one deepnet at present
    local_deepnet = Deepnet(deepnets[0],
                            api=args.retrieve_api_)
    for input_data in test_reader:
        input_data_dict = test_reader.dict(input_data, filtering=False)
        prediction_info = local_deepnet.predict(
            input_data_dict, **kwargs)
        write_prediction(prediction_info, output,
                         args.prediction_info, input_data, exclude)
    "YEAR": 1,
    "DATE": 1,
    "Index_": 1,
    "ACCNUM": 1,
    "X": 1,
    "Y": 1,
    "AUTOMOBILE": "yes",
    "MOTORCYCLE": "yes",
    "CYCLIST": "yes",
    "STREET1": "ave",
    "STREET2": "ave",
    "DRIVACT": "Driving Properly",
    "MANOEUVER": "Going Ahead",
    "DRIVCOND": "Normal",
    "FATAL_NO": 1,
    "VEHTYPE": "automobile",
    "INITDIR": "West",
    "DATE.hour": 1,
    "DATE.day-of-month": 1,
    "DATE.day-of-week": 1,
    "DATE.year": 1,
    "DATE.month": 1
}
deepnet.predict(input_data, full=True)
#
# input_data: dict for the input values
# (e.g. {"petal length": 1, "sepal length": 3})
# full: if set to True, the output will be a dictionary that includes all the
# available information about the prediction. The attributes vary depending
# on the ensemble type. Please check:
# https://bigml.readthedocs.io/en/latest/#local-deepnet-predictions