EM_PREDICTION = prediction[0][0] TypeError: 'float' object is not subscribable
還沒有人認領這個 Issue。
評估
研究方向
先從附帶的 MAS_PYMAS_ERROR_FLOAT.txt 和 register_model.txt 日誌開始,然後追蹤 mas.execute_module_step("slump0min", "score", ...) 進入點,以及堆疊追蹤中顯示的產生 score 函式。確定純量或陣列的預期輸出契約;單列和多列評分都能在沒有 TypeError 的情況下傳回預測值,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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)
- 主要語言
- Python
- 星號
- 52
- 分支
- 45
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
sassoftware/python-sasctl 的其他 Issue
-
enhancement
難度 4/5 3-5 天 新手友好度 35/100
sassoftware/python-sasctl#224 ·
-
enhancement
難度 4/5 3-5 天 新手友好度 25/100
sassoftware/python-sasctl#216 ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
sassoftware/python-sasctl#207 · 1 個 reaction ·
-
bug
難度 3/5 1-2 天 新手友好度 45/100
sassoftware/python-sasctl#202 ·
-
bug
難度 4/5 3-5 天 新手友好度 30/100
sassoftware/python-sasctl#193 ·
查看 sassoftware/python-sasctl 的全部 Issue
相似的 Issue
-
follow-up needs-triage S3: minor
難度 2/5 1-3 小時 新手友好度 72/100
manaflow-ai/cmux#36856 · 1 則留言 ·
維護者通常 1 天內回覆
-
documentation good first issue help wanted
難度 1/5 1-3 小時 新手友好度 90/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 73/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
-
Shell framework build fails at "copy the shader libraries": the iOS shader libraries are now one file b-<chain>.img可能已有人在做 @xiaofeng-han 今天認領。 未關閉build ios
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆