{"id":23514,"library":"datarobot-predict","title":"DataRobot Predict","description":"A lightweight Python library for scoring predictions with DataRobot models. It provides a simple API to interact with DataRobot's prediction server, supporting both REST and batch predictions. Current version: 1.13.5, maintained by DataRobot. Release cadence is irregular.","status":"active","version":"1.13.5","language":"python","source_language":"en","source_url":"https://github.com/datarobot/datarobot-predict","tags":["prediction","machine learning","datarobot","scoring"],"install":[{"cmd":"pip install datarobot-predict","lang":"bash","label":"core"},{"cmd":"pip install datarobot-predict[examples]","lang":"bash","label":"with examples"}],"dependencies":[],"imports":[{"note":"Top-level 'datarobot' is a different library (DataRobot API client). Use 'datarobot_predict' for prediction client.","wrong":"from datarobot import ScoreClient","symbol":"ScoreClient","correct":"from datarobot_predict import ScoreClient"}],"quickstart":{"code":"from datarobot_predict import ScoreClient\n\nclient = ScoreClient(\n    endpoint='https://example.datarobot.com/predApi/v1.0/deployments/<deployment_id>/predictions',\n    api_key=os.environ.get('DATAROBOT_API_KEY', ''),\n    max_prediction_time=30\n)\n# Single prediction\nresponse = client.predict(data={'feature1': 'value1', 'feature2': 123})\nprint(response)\n\n# Batch predictions\nbatch_data = [{'feature1': 'a', 'feature2': 1}, {'feature1': 'b', 'feature2': 2}]\nbatch_response = client.predict_batch(batch_data)\nprint(batch_response)","lang":"python","description":"Creates a ScoreClient and makes a single prediction or batch predictions. Endpoint includes deployment ID. API key should be set in environment."},"warnings":[{"fix":"Construct endpoint URL as 'https://app.datarobot.com/predApi/v1.0/deployments/{deployment_id}/predictions' and pass it as 'endpoint' parameter.","message":"In v1.12+, the 'ScoreClient' no longer accepts 'deployment_id' as a separate argument; you must include the full endpoint URL with deployment ID. Old code that passed deployment_id separately will break.","severity":"breaking","affected_versions":">=1.12.0"},{"fix":"Use 'api_key' parameter instead of 'username' and 'password'.","message":"In v1.10+, the default authentication method changed to use 'api_key' parameter. The old 'username' and 'password' parameters are deprecated and will raise an error if used.","severity":"breaking","affected_versions":">=1.10.0"},{"fix":"Use 'response.json()' to get a dict or access attributes directly.","message":"The 'predict' method returns a 'PredictionResponse' object, not a dict. Access fields like 'response.predictions' or convert with 'response.json()'.","severity":"gotcha","affected_versions":"all"},{"fix":"For single prediction: client.predict(data={'feature1': 'value'}). For multiple: client.predict_batch([{'feature1': 'value1'}, ...])","message":"If you pass a single row as a list, the library might misinterpret it as multiple rows. Always wrap a single row in a list or use 'predict' for a single dict.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Verify your API key and endpoint URL. Ensure the API key is set correctly, e.g., export DATAROBOT_API_KEY='your_key'","cause":"Invalid or missing API key, or incorrect endpoint URL.","error":"datarobot_predict.exceptions.PredictionError: 401 Client Error: Unauthorized for url: https://..."},{"fix":"Include deployment ID directly in the endpoint URL, not as a separate parameter.","cause":"Using deployment_id parameter that was removed in v1.12+.","error":"TypeError: __init__() got an unexpected keyword argument 'deployment_id'"},{"fix":"Run: pip install datarobot-predict","cause":"Installed the wrong package (e.g., 'datarobot' instead of 'datarobot-predict').","error":"ModuleNotFoundError: No module named 'datarobot_predict'"},{"fix":"Ensure your data is a dict with feature names as keys, values should be proper types (strings, numbers).","cause":"The input data format is incorrect. DataRobot expects a JSON object with keys matching model features.","error":"datarobot_predict.exceptions.PredictionError: 422 Client Error: Unprocessable Entity"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}