sasctl.utils.pyml2ds package#
Submodules#
sasctl.utils.pyml2ds.pyml2ds module#
Translate a gradient boosting model and write SAS scoring code to file.
Supported models are: xgboost, lightgbm and pmml gradient boosting.
- param in_file:
Pickled object to translate. String is assumed to be a path to a picked file, file-like is assumed to be an open file handle to a pickle object, and bytes is assumed to be the raw pickled bytes.
- type in_file:
str or bytes or file-like
- param out_var_name:
Output variable name.
- type out_var_name:
str (optional)
- returns:
str – A SAS Data Step program implementing the model.
Examples
Generate SAS code from an XGBoost model.
>>> from xgboost.sklearn import XGBRegressor
>>> xgb = XGBRegressor()
>>> xgb.fit(X, y)
>>> pkl = pickle.dumps(xgb)
>>> sas_code = pyml2ds(pkl)
Warning
This method is experimental and may be modified or removed without warning.