示例#1
0
def load_saved_attributes():
    global model

    model = XGBRegressor()
    booster = Booster()
    booster.load_model('./ny_taxi_fare')
    model._Booster = booster
def load_saved_attributes():

    global host_response_time_values
    global neighbourhood_values
    global property_type_values
    global room_type_values
    global cancellation_policy_values
    global model

    with open("columns.json", "r") as f:
        resp = json.load(f)
        host_response_time_values = resp["host_response_time"]
        neighbourhood_values = resp["neighbourhood"]
        property_type_values = resp["property_type"]
        room_type_values = resp["room_type"]
        cancellation_policy_values = resp["cancellation_policy"]

    model = XGBRegressor()
    booster = Booster()
    booster.load_model('airbnb_price_predictor')
    model._Booster = booster
示例#3
0
def sklearn_regressor(booster, params, num_round):
    reg = XGBRegressor(n_estimators=num_round, missing=-999,
                       **_complete_params(params))
    reg._Booster = booster
    return reg