Created
July 28, 2022 14:32
-
-
Save kylegallatin/0e7b767dbb88a419d92bc9ac5b26aa82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_latest_model() -> sklearn.pipeline.Pipeline: | |
latest_model_path = pd.read_csv("metadata_store.csv").query("timestamp == timestamp.max()")["model_path"].values[0] | |
loaded_model = joblib.load(latest_model_path) | |
return loaded_model | |
def model_predict(user_id: str) -> float: | |
model = load_latest_model() | |
features = feature_store.get_user_feature(user_id) | |
return model.predict([[v for k,v in features.items() if k != "target"]]) | |
model_predict("a27b0912-0cf8-11ed-899e-b29c4abd48f4") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment