sassoftware / python-sasctl

Python package and CLI for user-friendly integration with SAS Viya
https://sassoftware.github.io/python-sasctl
Apache License 2.0
45 stars 40 forks source link

writeModelStats not working #146

Closed kangfucius closed 1 year ago

kangfucius commented 1 year ago

After upgrading sasctl to 1.8.0 I tried to run through pzmmModelImportExample.ipynb. it seems pzmm.JSONFiles has changed and breaks the notebook code:

1) in cell No. 43, the line J.createRequirementsJSON(zipFolder) needed to change to new signature, J.create_requirements_json(zipFolder). This was an easy fix.

2) this one is trickier, and hence raising the issue: the line in cell No. 45, J.calculateFitStat(trainData=trainData, testData=testData, jPath=zipFolder) doesn't work and throws the below exception


~/anaconda3/lib/python3.9/site-packages/sasctl/pzmm/write_json_files.py in calculateFitStat(cls, validateData, trainData, testData, jPath) 560 fitStats["MCLL"] = MCLL 561 --> 562 KS = max(math.fabs(fpr - tpr)) 563 fitStats["KS"] = KS 564

TypeError: only size-1 arrays can be converted to Python scalars

smlindauer commented 1 year ago

Thanks @kangfucius.

I think this got caught up prematurely in a refactor of the json/python file generation in the pzmm submodule. This should be shifted to a CAS action in the future and not be dependent upon user modules.

I'll take a look at the calculateFitStats error and see where the logic changed.

smlindauer commented 1 year ago

Both issues have been cleaned up and pushed out in v1.8.1, which is available on PyPI.