Skip to content

Commit

Permalink
Tentative updates to CHANGELOG.md and __init__.py, as well as fixing …
Browse files Browse the repository at this point in the history
…example in write_score_code.py.
  • Loading branch information
djm21 committed Oct 24, 2023
1 parent cb4975b commit cd2082b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ Unreleased
- Add `model_info` class to better capture model information.
- Test `/examples` Jupyter notebooks within normal test suite.

v1.10.1 (2023-08-24)
----------
**Improvements**
- Introduced ability to specify the target index of a binary model when creating score code.
- index can be specified in `pzmm.import_model.ImportModel.import_model()`

**Bugfixes**
- Reworked `write_score_code.py` to allow for proper execution of single line scoring.

v1.10 (2023-08-31)
----------
**Improvements**
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

__version__ = "1.10.0"
__version__ = "1.10.1"
__author__ = "SAS"
__credits__ = [
"Yi Jian Ching",
Expand Down
15 changes: 10 additions & 5 deletions src/sasctl/pzmm/write_score_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -1453,11 +1453,16 @@ def _binary_target(
)
"""
if input_array.shape[0] == 1:
return prediction[1][0], float(prediction[1][2])
if prediction[1][1] > 0.5:
Classification = '1'
else:
Classification = '0'
return EM_CLASSIFICATION, float(prediction[1][1])
else:
output_table = prediction.drop(prediction.columns[1], axis=1)
output_table.columns = ['Classification', 'Probability']
return output_table
output_table = prediction.drop(prediction.columns[2], axis=1)
classifications = np.where(prediction[prediction.columns[1]] > 0.5, '0', '1')
output_table.columns = ['EM_CLASSIFICATION', 'EM_EVENTPROBABILITY']
output_table['EM_CLASSIFICATION'] = classifications
"""
# Calculate the classification; return the classification and probability
elif sum(returns) == 0 and len(returns) == 1:
Expand Down Expand Up @@ -1787,7 +1792,7 @@ def _nonbinary_targets(
elif len(returns) == 1:
cls.score_code += (
f"{'':4}if input_array.shape[0] == 1:\n"
f"{'':8}return prediction[0]\n"
f"{'':8}return prediction[0][0]\n"
f"{'':4}else:\n"
f"{'':8}return pd.DataFrame({{'{metrics}': prediction}})"
)
Expand Down

0 comments on commit cd2082b

Please sign in to comment.