import os
from xgboost import Booster
from xgboost import XGBClassifier
from malware_ml.prepare_data import prepare

    
def load_model(model_path):
    clf = XGBClassifier()
    booster = Booster()
    booster.load_model(model_path)
    clf._Booster = booster
    return clf


def apply_model_to_json(model, json_data):
    X = prepare(json_data)
    return model.predict_proba(X)
