Skip to content

Commit cd2082b

Browse files
committed
Tentative updates to CHANGELOG.md and __init__.py, as well as fixing example in write_score_code.py.
1 parent cb4975b commit cd2082b

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ Unreleased
55
- Add `model_info` class to better capture model information.
66
- Test `/examples` Jupyter notebooks within normal test suite.
77

8+
v1.10.1 (2023-08-24)
9+
----------
10+
**Improvements**
11+
- Introduced ability to specify the target index of a binary model when creating score code.
12+
- index can be specified in `pzmm.import_model.ImportModel.import_model()`
13+
14+
**Bugfixes**
15+
- Reworked `write_score_code.py` to allow for proper execution of single line scoring.
16+
817
v1.10 (2023-08-31)
918
----------
1019
**Improvements**

src/sasctl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
55
# SPDX-License-Identifier: Apache-2.0
66

7-
__version__ = "1.10.0"
7+
__version__ = "1.10.1"
88
__author__ = "SAS"
99
__credits__ = [
1010
"Yi Jian Ching",

src/sasctl/pzmm/write_score_code.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,11 +1453,16 @@ def _binary_target(
14531453
)
14541454
"""
14551455
if input_array.shape[0] == 1:
1456-
return prediction[1][0], float(prediction[1][2])
1456+
if prediction[1][1] > 0.5:
1457+
Classification = '1'
1458+
else:
1459+
Classification = '0'
1460+
return EM_CLASSIFICATION, float(prediction[1][1])
14571461
else:
1458-
output_table = prediction.drop(prediction.columns[1], axis=1)
1459-
output_table.columns = ['Classification', 'Probability']
1460-
return output_table
1462+
output_table = prediction.drop(prediction.columns[2], axis=1)
1463+
classifications = np.where(prediction[prediction.columns[1]] > 0.5, '0', '1')
1464+
output_table.columns = ['EM_CLASSIFICATION', 'EM_EVENTPROBABILITY']
1465+
output_table['EM_CLASSIFICATION'] = classifications
14611466
"""
14621467
# Calculate the classification; return the classification and probability
14631468
elif sum(returns) == 0 and len(returns) == 1:
@@ -1787,7 +1792,7 @@ def _nonbinary_targets(
17871792
elif len(returns) == 1:
17881793
cls.score_code += (
17891794
f"{'':4}if input_array.shape[0] == 1:\n"
1790-
f"{'':8}return prediction[0]\n"
1795+
f"{'':8}return prediction[0][0]\n"
17911796
f"{'':4}else:\n"
17921797
f"{'':8}return pd.DataFrame({{'{metrics}': prediction}})"
17931798
)

0 commit comments

Comments
 (0)