sassoftware / sassoftware/python-sasctl
EM_PREDICTION = prediction[0][0] TypeError: 'float' object is not subscribable
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 52
- 派生
- 45
- 平均合并
- 23 小时 38 分钟
- 30 天内合并 PR
- 2
描述
Describe the issue
We are trying to register the model with pzmm sasctl (1.10.1) and MAS in Viya 3.5. When we try to score, it fails with the error: "EM_PREDICTION = prediction[0][0] TypeError: 'float' object is not subscribable" Error: pm.execute failed. resultCode= -1958744061
So far, we found out that if the input data shape =1, then the result must be a scalar value prediction[0][0]. Our model returns an array of floats and fails because of this.
Is it possible to have a model input as a row but the output as a table?
To Reproduce
Attaching notebook and SAS MM log file from GUI score button.
MAS_PYMAS_ERROR_FLOAT.txt
register_model.txt
Expected behavior
When I use a single row to score as a dictionary using the below code it should return a predicted value:-
from sasctl.services import microanalytic_score as mas
score_obj = dict(data_to_score.iloc[0,:][slump_col])
mas_obj = mas.execute_module_step("slump0min", "score", **score_obj)
for key, value in mas_obj.items():
print(f"{key}: {value}")
resultCode: -1958743884.0
EM_PREDICTION: None
When I use the score GUI from SAS MM using a data table stored in PUBLIC lib with more than one row, it should give me the scored regression output from catboost model
Stack Trace
ERROR: Line 301: Traceback (most recent call last):
File "/opt/sas/viya/home/SASFoundation/misc/embscoreeng/mas2py.py", line 942, in invoke
out = up[1].get(func)0(*args)
File "/tmp/tmprluhpq0f/model_exec_932ed736-60cf-4a85-8edf-4097d9741c44.py", line 55, in score
EM_PREDICTION = prediction[0][0] TypeError: 'float' object is not subscribable
Version
sasctl (1.10.1)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从附带的 MAS_PYMAS_ERROR_FLOAT.txt 和 register_model.txt 日志开始,然后跟踪 mas.execute_module_step("slump0min", "score", ...) 入口点,以及堆栈跟踪中显示的生成 score 函数。确定标量或数组的预期输出契约;单行和多行评分都能在没有 TypeError 的情况下返回预测值即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100