fitzgeraldja / stc_unicef_cpi

MIT License
0 stars 0 forks source link

Finish script to use pretrained model to extrapolate for unseen areas #40

Open github-actions[bot] opened 2 years ago

github-actions[bot] commented 2 years ago

https://github.com/fitzgeraldja/stc_unicef_cpi/blob/574dd5cd9685df0d5b68674c359d7803c4a338be/src/stc_unicef_cpi/models/predict_model.py#L1


# TODO: Finish script to use pretrained model to extrapolate for unseen areas

import argparse
import pickle
import sys

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        "High-res multi-dim CPI pretrained model predictions"
    )
    parser.add_argument(
        "--country",
        type=str,
        help="Choice of which country to predict for - options are 'all', 'nigeria' or 'senegal'",
        choices=["all", "nigeria", "senegal"],
    )
    parser.add_argument(
        "--model",
        type=str,
        help="Pathway to pretrained model",
    )

    try:
        args = parser.parse_args()
    except argparse.ArgumentError:
        parser.print_help()
        sys.exit(0)

    with open(args.model, "rb") as f:
        model = pickle.load(f)