Created
June 7, 2022 08:12
-
-
Save randyphoa/f7b719a68fe434f05468543480ef0275 to your computer and use it in GitHub Desktop.
Deploy R in online mode - batch job to deploy R model
This file contains 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
config = { | |
"function_name": "lead scoring", | |
"script": "lead_scoring.R", | |
"required_assets": ["products.csv", "transactions.rds", "xgboost.rds", "mssql-jdbc-10.2.1.jre11.jar"], | |
"r_packages": ["dplyr", "RJDBC", "xgboost"], | |
} | |
payload = {"scoring": {"input_data": [{"values": [config]}]}, "deployment": {"id": deployment_id}, "space_id": SPACE_ID, "name": "lead_scoring_deployment"} | |
headers = {"Content-Type": "application/json", "Accept": "application/json", "Authorization": wml_client._get_headers()["Authorization"]} | |
params = {"version": "2021-06-24", "space_id": SPACE_ID} | |
requests.post( | |
url="https://cpd-cpd.itzroks-550003aw18-72fhj7-6ccd7f378ae819553d37d5f2ee142bd6-0000.au-syd.containers.appdomain.cloud/ml/v4/deployment_jobs", | |
headers=headers, | |
params=params, | |
json=payload, | |
verify=False | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment