mscore 26.1.3__tar.gz → 26.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. {mscore-26.1.3 → mscore-26.1.6}/PKG-INFO +171 -168
  2. {mscore-26.1.3 → mscore-26.1.6}/README.md +145 -142
  3. mscore-26.1.6/mscore/__init__.py +9 -0
  4. mscore-26.1.6/mscore/__init__.pye +27 -0
  5. mscore-26.1.6/mscore/data_variables/__init__.py +0 -0
  6. mscore-26.1.6/mscore/data_variables/__init__.pye +12 -0
  7. mscore-26.1.6/mscore/data_variables/hcc_descriptors.pye +1068 -0
  8. mscore-26.1.6/mscore/data_variables/hierarchies.pye +441 -0
  9. mscore-26.1.6/mscore/data_variables/variable_dict.pye +1986 -0
  10. mscore-26.1.6/mscore/demography_builder.pye +867 -0
  11. mscore-26.1.6/mscore/demography_vars_applicator.pye +413 -0
  12. mscore-26.1.6/mscore/endpoints.pye +80 -0
  13. mscore-26.1.6/mscore/file_handler.pye +774 -0
  14. mscore-26.1.6/mscore/hcc_handler.pye +467 -0
  15. mscore-26.1.6/mscore/ram_models.pye +528 -0
  16. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2221CW.TXT +9697 -9697
  17. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2222CW.TXT +9719 -9719
  18. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2223CW.TXT +0 -0
  19. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2224CW.TXT +9905 -9905
  20. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2225CW.TXT +9979 -9979
  21. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2226CW.TXT +9979 -9979
  22. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2421CW.TXT +9856 -9856
  23. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2422CW.TXT +9875 -9875
  24. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2423CW.TXT +0 -0
  25. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2424CW.TXT +10137 -10137
  26. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2425CW.TXT +10211 -10211
  27. mscore-26.1.6/mscore/reference_data/Crosswalks/F2825CW.TXT +8183 -0
  28. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2826CW.TXT +8183 -8183
  29. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2021_CMS-HCC_V22.csv +2 -2
  30. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2021_CMS-HCC_V222179O1.csv +2 -2
  31. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2021_CMS-HCC_V24.csv +2 -2
  32. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2021_CMS-HCC_V242186P1.csv +2 -2
  33. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2022_CMS-HCC_V22.csv +2 -2
  34. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2022_CMS-HCC_V222279O1.csv +2 -2
  35. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2022_CMS-HCC_V24.csv +2 -2
  36. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2022_CMS-HCC_V242286P1.csv +2 -2
  37. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2023_CMS-HCC_V22.csv +2 -2
  38. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2023_CMS-HCC_V24.csv +2 -2
  39. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2024_CMS-HCC_V22.csv +2 -2
  40. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2024_CMS-HCC_V24.csv +2 -2
  41. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2024_CMS-HCC_V28.csv +2 -2
  42. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2025_CMS-HCC_V22.csv +2 -2
  43. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2025_CMS-HCC_V24.csv +2 -2
  44. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2025_CMS-HCC_V28.csv +2 -2
  45. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2026_CMS-HCC_V22.csv +2 -2
  46. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Model_Coefficients/2026_CMS-HCC_V28.csv +2 -2
  47. mscore-26.1.6/mscore/reference_data/Model_Coefficients/2027_CMS-HCC_V28.csv +2 -0
  48. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/application_tables/application_format_fact.parquet +0 -0
  49. mscore-26.1.6/mscore/reference_data/application_tables/application_model_dimension.parquet +0 -0
  50. mscore-26.1.6/mscore/scoring_handler.pye +812 -0
  51. mscore-26.1.6/mscore/utilities/__init__.py +1 -0
  52. mscore-26.1.6/mscore/utilities/__init__.pye +13 -0
  53. mscore-26.1.6/mscore/utilities/authentication.pye +499 -0
  54. mscore-26.1.6/mscore/utilities/context.pye +220 -0
  55. mscore-26.1.6/mscore/utilities/data_models.pye +122 -0
  56. mscore-26.1.6/mscore/utilities/data_validation.pye +578 -0
  57. mscore-26.1.6/mscore/utilities/log_handler.pye +89 -0
  58. mscore-26.1.6/mscore/utilities/user_models.pye +42 -0
  59. mscore-26.1.6/mscore/version.pye +13 -0
  60. {mscore-26.1.3 → mscore-26.1.6}/mscore.egg-info/PKG-INFO +171 -168
  61. {mscore-26.1.3 → mscore-26.1.6}/mscore.egg-info/SOURCES.txt +7 -3
  62. {mscore-26.1.3 → mscore-26.1.6}/pyproject.toml +55 -55
  63. {mscore-26.1.3 → mscore-26.1.6}/setup.cfg +4 -4
  64. mscore-26.1.3/mscore/__init__.pye +0 -62
  65. mscore-26.1.3/mscore/data_variables/__init__.pye +0 -7
  66. mscore-26.1.3/mscore/data_variables/hcc_descriptors.pye +0 -998
  67. mscore-26.1.3/mscore/data_variables/hierarchies.pye +0 -410
  68. mscore-26.1.3/mscore/data_variables/variable_dict.pye +0 -1858
  69. mscore-26.1.3/mscore/demography_builder.pye +0 -802
  70. mscore-26.1.3/mscore/demography_vars_applicator.pye +0 -383
  71. mscore-26.1.3/mscore/file_handler.pye +0 -722
  72. mscore-26.1.3/mscore/hcc_handler.pye +0 -434
  73. mscore-26.1.3/mscore/ram_models.pye +0 -491
  74. mscore-26.1.3/mscore/reference_data/application_tables/application_model_dimension.parquet +0 -0
  75. mscore-26.1.3/mscore/scoring_handler.pye +0 -757
  76. mscore-26.1.3/mscore/utilities/__init__.pye +0 -45
  77. mscore-26.1.3/mscore/utilities/authentication.pye +0 -460
  78. mscore-26.1.3/mscore/utilities/cli.pye +0 -314
  79. mscore-26.1.3/mscore/utilities/context.pye +0 -202
  80. mscore-26.1.3/mscore/utilities/data_models.pye +0 -110
  81. mscore-26.1.3/mscore/utilities/data_validation.pye +0 -538
  82. mscore-26.1.3/mscore/utilities/file_organizer.pye +0 -95
  83. mscore-26.1.3/mscore/utilities/licensing.pye +0 -404
  84. mscore-26.1.3/mscore/utilities/log_handler.pye +0 -78
  85. mscore-26.1.3/mscore/utilities/user_models.pye +0 -36
  86. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/Crosswalks/F2824CW.TXT +0 -0
  87. /mscore-26.1.3/mscore/reference_data/Crosswalks/F2825CW.TXT → /mscore-26.1.6/mscore/reference_data/Crosswalks/F2827CW.TXT +0 -0
  88. {mscore-26.1.3 → mscore-26.1.6}/mscore/reference_data/application_tables/application_model_coefficient.parquet +0 -0
  89. {mscore-26.1.3 → mscore-26.1.6}/mscore.egg-info/dependency_links.txt +0 -0
  90. {mscore-26.1.3 → mscore-26.1.6}/mscore.egg-info/entry_points.txt +0 -0
  91. {mscore-26.1.3 → mscore-26.1.6}/mscore.egg-info/requires.txt +0 -0
  92. {mscore-26.1.3 → mscore-26.1.6}/mscore.egg-info/top_level.txt +0 -0
@@ -1,168 +1,171 @@
1
- Metadata-Version: 2.4
2
- Name: mscore
3
- Version: 26.1.3
4
- Summary: MScore: Risk Scores Made Easy
5
- Home-page: https://github.com/elevendatacorp/mscore.git
6
- Author: RAM Development Team
7
- Author-email: RAM Development Team <dev@riskadjustmentmodel.com>
8
- Project-URL: Homepage, https://riskadjustmentmodel.com/mscore-product
9
- Project-URL: Bug Tracker, https://github.com/elevendatacorp/mscore/issues
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.10
13
- Description-Content-Type: text/markdown
14
- Requires-Dist: pandas
15
- Requires-Dist: pyarrow
16
- Requires-Dist: numpy
17
- Requires-Dist: requests
18
- Requires-Dist: getmac
19
- Requires-Dist: cython
20
- Requires-Dist: pydantic
21
- Requires-Dist: cryptography
22
- Requires-Dist: sourcedefender
23
- Dynamic: author
24
- Dynamic: home-page
25
-
26
- <p align="center">
27
- <a href="https://www.riskadjustmentmodel.com/" target="_blank">
28
- <img src="https://ram-site-assets-pub.s3.us-east-1.amazonaws.com/images/mscore_registered_logo_updated_subtitle.png">
29
- </a>
30
- </p>
31
-
32
- ---
33
-
34
- M<span style="font-size:.8em;">SCORE<sup>®</sup></span> is a python package designed to streamline the CMS-HCC model risk score calculation process for health plans and providers participating in Medicare Advantage and value-based care. It provides a SAS®-free alternative to produce HCCs and risk scores. It streamlines your data processing for enhanced accessibility and allows you to keep your data secure in-house, so you can focus on execution of your risk adjustment strategy.
35
-
36
- ## Benefits
37
- - **Implement Anywhere**: M<span style="font-size:.8em;">SCORE<sup>®</sup></span> unlocks multiple integration opportunities including real-time scoring, embedding in EHR or enterprise data warehouse, incorporating into cloud applications, and traditional batch scoring.
38
- - **SAS<sup><span style="font-size:.8em;">&reg;</span></sup>-Free**: Create HCC and risk scores without SAS<sup><span style="font-size:.8em;">&reg;</span></sup> software, reduce software license costs and the headache of recoding and maintaining the software in another programming language.
39
- - **Enhanced Output**: M<span style="font-size:.8em;">SCORE<sup>®</sup></span> provides the numeric relative factor value for each HCC assigned to a person allowing for a deeper understanding of how each factor contributes to an individual's overall risk score.
40
- - **Reliable**: Validated on over 1 million plus enrollees. M<span style="font-size:.8em;">SCORE<sup>®</sup></span> is rigorously tested and updated with each HCC model release.
41
- - **CMS-HCC Model Support**: Supports HCC models V22 for payment years 2021-2026, V24 for payment years 2021 - 2025, and V28 for payment years 2024 - 2026, with upgrades for each release from CMS (Initial, Mid-Year, Final).
42
- - **Easy to Set Up & Maintain**: Easily installed and upgraded using pip, Python's standard package manager.
43
- - **Platform Compatibility**: Compatible with Windows, Mac, and Linux operating systems.
44
- - **Optimized Performance**: Efficient processing with fast runtimes, ensuring quick and accurate risk score calculations.
45
- - **Improved Data Security**: Securely process personal health information within your organization's IT infrastructure.
46
-
47
-
48
- ## Installation
49
-
50
- pip install mscore
51
-
52
- ## Registration
53
-
54
- Registration is required to use the <code>mscore</code> package. Please visit https://riskadjustmentmodel.com/registration to create user account and obtain a license key.
55
-
56
- > **<span style="color:orange">_NOTE:_</span>** Your 30-day free trial begins upon account registration.
57
-
58
- ## Subscribe
59
-
60
- To use M<span style="font-size:.8em;">SCORE<sup>®</sup></span> beyond the 30-day trial period, please see our licensing and pricing section on <a href="https://riskadjustmentmodel.com/" taget="_blank">riskadjustmentmodel.com</a>. Please <a href="https://riskadjustmentmodel.com/contact-us" taget="_blank">contact us</a> for assistance if you have questions about licensing.
61
-
62
- ## Basic Use
63
-
64
- Before you can run your scores, you will need to generate an authorization token object.
65
-
66
- ```python
67
- import sourcedefender #This package is required at the top
68
- from mscore import AuthorizeLicense, MScore
69
-
70
- auth = AuthorizeLicense(staging_key).validate()
71
- ```
72
- > **<span style="color:orange">_NOTE:_</span>** You must import sourcedefender at the top of every package that imports MScore.
73
-
74
- The <code>mscore</code> class requires 7 arguments in order to run with 1 optional argument.
75
-
76
- ### Required
77
- * <code>authorizer</code> - The authorization token obtained when <code>AuthorizeLicense</code> is ran
78
- * <code>year</code>
79
- * <code>version</code>
80
- * <code>model</code>
81
- * <code>person_data</code> (Pandas DataFrame, csv, or parquet file)
82
- * <code>diag_data</code> (Pandas DataFrame, csv, or parquet file)
83
- * <code>columns</code>
84
-
85
- **_NOTE:_** The example below assumes you already have a [Pandas](https://pandas.pydata.org/) DataFrame generated for your person and diagnosis datasets.
86
- If you don't have this data yet and want to test <code>mscore</code>, download our synthetic data files here:
87
- * [Person File](https://mph-static-site.s3.amazonaws.com/static/tutorial-files/person.csv)
88
- * [Diagnosis File](https://mph-static-site.s3.amazonaws.com/static/tutorial-files/diag.csv)
89
-
90
-
91
- ```python
92
- import sourcedefender
93
- import pandas as pd
94
- from mscore import AuthorizeLicense, MScore
95
-
96
- # Generate DataFrames if using our test files
97
- person_df = pd.read_csv('person.csv')
98
- diag_df = pd.read_csv('diag.csv')
99
-
100
- auth = AuthorizeLicense(staging_key).validate()
101
-
102
- model = MScore(
103
- authorizer = auth,
104
- year = '2026',
105
- version = 'V28',
106
- model = 'CMS-HCC',
107
- person_data = person_df,
108
- diag_data = diag_df,
109
- columns = 'all-fields',
110
- )
111
-
112
- scores = model.score_mscore()
113
-
114
- risk_scores = scores.risk_scores
115
- ```
116
- The resulting 'scores' output is a data model object of pandas.DataFrames. You can access your risk scores or relative factors data sets by calling the respective model name from the grouped data model.
117
- - <span style="font-family:courier-new">scores.risk_scores</span>
118
- - <span style="font-family:courier-new">scores.relative_factors</span>
119
-
120
- From here you can proceed to use the risk score or relative factor DataFrames for further downstream processing or utilize the [Pandas](https://pandas.pydata.org/docs/user_guide/index.html) built-in methods to save to a file type of your choosing.
121
-
122
- ### Features
123
- #### relative_factors (attribute)
124
- MScore offers the ability to view the relative factors for each person run through M<span style="font-size:.8em;">SCORE<sup>®</sup></span>. To access this data, you simply access the <code>relative_factors</code> attribute of the <code>mscore</code> output. The relative factors are the individual contributions (from the variables in the model) to the risk score. M<span style="font-size:.8em;">SCORE's<sup>®</sup></span> <code>relative_factors</code> output contains these values with 1 row per person scored, and each relative factor in the output as the columns.
125
-
126
- To leverage this feature, you would do the following:
127
- ```python
128
- relative_factors = scores.relative_factors
129
- ```
130
- #### get_disease_scores (method)
131
- For users wanting to compute the disease contribution to a person's risk score, you can do this in MScore by using the <code>get_disease_score</code> method of <code>mscore</code>. After instantiating your <code>mscore</code> object, you can use <code>get_disease_score</code> and pass the <code>mscore</code> output as a parameter. This will create a new dataframe containing only the portion of the risk score that comes from disease factors. Alternatively, if you would like this data appended to your MScore risk score output, you can use <code>join_scores</code> parameter to do this. NOTE: Disease interactions with DISABLED variables are not included in the disease score.
132
-
133
- You can use the <code>get_disease_score</code> method as here:
134
- ```python
135
- disease_scores = model.get_disease_scores(scores)
136
- ```
137
-
138
- Or using the <code>join_scores</code> parameter:
139
- ```python
140
- disease_scores = model.get_disease_scores(scores, join_scores=True)
141
- ```
142
-
143
- ### Supported Data
144
- The <code>mscore</code> class attributes, <code>person_data</code> and <code>diag_data</code>, will accept a Pandas.DataFrame object, CSV or Parquet filepath directly without the need to load your input data to DataFrame first. The resulting outputs will be a Pandas DataFrame object.
145
-
146
- ### Supported Environments
147
-
148
- M<span style="font-size:.8em;">SCORE<sup>®</sup></span> is designed to be universally compatible, ensuring seamless integration across various platforms.
149
-
150
- - Operating Systems: Windows, macOS, Linux
151
- - Python Versions: 3.10 or greater (both 32-bit and 64-bit architectures)
152
-
153
- If your required environment is not listed, please contact us as support@riskadjustmentmodel.com for an alternate solution.
154
-
155
- ## User Resources
156
- For a more in-depth dive into all available model options, arguments, and reference documents, visit our [User Guides](https://riskadjustmentmodel.com/resources/user-guides).
157
-
158
- ## Support
159
-
160
- We are experts in Risk Adjustment and we're here to help. Whether it's general questions, billing, or integration support, please [contact us](https://riskadjustmentmodel.com/contact-us)📧. We are here to make risk scoring easy.
161
-
162
- ## Stay Connected
163
-
164
- Please [subscribe](https://riskadjustmentmodel.com/articles#userEmail) to our newsletter, to receive updates on new M<span style="font-size:.8em;">SCORE<sup>®</sup></span> features, model releases, tutorials, and to stay up-to-date on the latest news in risk adjustment.
165
-
166
- ## Legal
167
-
168
- To review the M<span style="font-size:.8em;">SCORE<sup>®</sup></span> license agreement, please visit [EULA](https://riskadjustmentmodel.com/legal/eula) webpage.
1
+ Metadata-Version: 2.4
2
+ Name: mscore
3
+ Version: 26.1.6
4
+ Summary: MScore: Risk Scores Made Easy
5
+ Home-page: https://github.com/elevendatacorp/mscore.git
6
+ Author: RAM Development Team
7
+ Author-email: RAM Development Team <dev@riskadjustmentmodel.com>
8
+ Project-URL: Homepage, https://riskadjustmentmodel.com/mscore-product
9
+ Project-URL: Bug Tracker, https://github.com/elevendatacorp/mscore/issues
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: pandas
15
+ Requires-Dist: pyarrow
16
+ Requires-Dist: numpy
17
+ Requires-Dist: requests
18
+ Requires-Dist: getmac
19
+ Requires-Dist: cython
20
+ Requires-Dist: pydantic
21
+ Requires-Dist: cryptography
22
+ Requires-Dist: sourcedefender
23
+ Dynamic: author
24
+ Dynamic: home-page
25
+
26
+ <p align="center">
27
+ <a href="https://www.riskadjustmentmodel.com/" target="_blank">
28
+ <img src="https://ram-site-assets-pub.s3.us-east-1.amazonaws.com/images/mscore_registered_logo_updated_subtitle.png">
29
+ </a>
30
+ </p>
31
+
32
+ ---
33
+
34
+ M<span style="font-size:.8em;">SCORE<sup>®</sup></span> is a python package designed to streamline the CMS-HCC model risk score calculation process for health plans and providers participating in Medicare Advantage and value-based care. It provides a SAS®-free alternative to produce HCCs and risk scores. It streamlines your data processing for enhanced accessibility and allows you to keep your data secure in-house, so you can focus on execution of your risk adjustment strategy.
35
+
36
+ ## Benefits
37
+ - **Implement Anywhere**: M<span style="font-size:.8em;">SCORE<sup>®</sup></span> unlocks multiple integration opportunities including real-time scoring, embedding in EHR or enterprise data warehouse, incorporating into cloud applications, and traditional batch scoring.
38
+ - **SAS<sup><span style="font-size:.8em;">&reg;</span></sup>-Free**: Create HCC and risk scores without SAS<sup><span style="font-size:.8em;">&reg;</span></sup> software, reduce software license costs and the headache of recoding and maintaining the software in another programming language.
39
+ - **Enhanced Output**: M<span style="font-size:.8em;">SCORE<sup>®</sup></span> provides the numeric relative factor value for each HCC assigned to a person allowing for a deeper understanding of how each factor contributes to an individual's overall risk score.
40
+ - **Reliable**: Validated on over 1 million plus enrollees. M<span style="font-size:.8em;">SCORE<sup>®</sup></span> is rigorously tested and updated with each HCC model release.
41
+ - **CMS-HCC Model Support**: Supports HCC models V22 for payment years 2021-2027(Proposed), V24 for payment years 2021 - 2026, and V28 for payment years 2024 - 2027(Proposed), with upgrades for each release from CMS (Initial, Mid-Year, Final).
42
+
43
+ - **<span style="color:orange">_NOTE:_</span>** 2027 Proposed is set with an 'as of' date in year 2025
44
+
45
+ - **Easy to Set Up & Maintain**: Easily installed and upgraded using pip, Python's standard package manager.
46
+ - **Platform Compatibility**: Compatible with Windows, Mac, and Linux operating systems.
47
+ - **Optimized Performance**: Efficient processing with fast runtimes, ensuring quick and accurate risk score calculations.
48
+ - **Improved Data Security**: Securely process personal health information within your organization's IT infrastructure.
49
+
50
+
51
+ ## Installation
52
+
53
+ pip install mscore
54
+
55
+ ## Registration
56
+
57
+ Registration is required to use the <code>mscore</code> package. Please visit https://riskadjustmentmodel.com/registration to create user account and obtain a license key.
58
+
59
+ > **<span style="color:orange">_NOTE:_</span>** Your 30-day free trial begins upon account registration.
60
+
61
+ ## Subscribe
62
+
63
+ To use M<span style="font-size:.8em;">SCORE<sup>®</sup></span> beyond the 30-day trial period, please see our licensing and pricing section on <a href="https://riskadjustmentmodel.com/" taget="_blank">riskadjustmentmodel.com</a>. Please <a href="https://riskadjustmentmodel.com/contact-us" taget="_blank">contact us</a> for assistance if you have questions about licensing.
64
+
65
+ ## Basic Use
66
+
67
+ Before you can run your scores, you will need to generate an authorization token object.
68
+
69
+ ```python
70
+ import sourcedefender #This package is required at the top
71
+ from mscore import AuthorizeLicense, MScore
72
+
73
+ auth = AuthorizeLicense(staging_key).validate()
74
+ ```
75
+ > **<span style="color:orange">_NOTE:_</span>** You must import sourcedefender at the top of every package that imports MScore.
76
+
77
+ The <code>mscore</code> class requires 7 arguments in order to run with 1 optional argument.
78
+
79
+ ### Required
80
+ * <code>authorizer</code> - The authorization token obtained when <code>AuthorizeLicense</code> is ran
81
+ * <code>year</code>
82
+ * <code>version</code>
83
+ * <code>model</code>
84
+ * <code>person_data</code> (Pandas DataFrame, csv, or parquet file)
85
+ * <code>diag_data</code> (Pandas DataFrame, csv, or parquet file)
86
+ * <code>columns</code>
87
+
88
+ **_NOTE:_** The example below assumes you already have a [Pandas](https://pandas.pydata.org/) DataFrame generated for your person and diagnosis datasets.
89
+ If you don't have this data yet and want to test <code>mscore</code>, download our synthetic data files here:
90
+ * [Person File](https://mph-static-site.s3.amazonaws.com/static/tutorial-files/person.csv)
91
+ * [Diagnosis File](https://mph-static-site.s3.amazonaws.com/static/tutorial-files/diag.csv)
92
+
93
+
94
+ ```python
95
+ import sourcedefender
96
+ import pandas as pd
97
+ from mscore import AuthorizeLicense, MScore
98
+
99
+ # Generate DataFrames if using our test files
100
+ person_df = pd.read_csv('person.csv')
101
+ diag_df = pd.read_csv('diag.csv')
102
+
103
+ auth = AuthorizeLicense(staging_key).validate()
104
+
105
+ model = MScore(
106
+ authorizer = auth,
107
+ year = '2026',
108
+ version = 'V28',
109
+ model = 'CMS-HCC',
110
+ person_data = person_df,
111
+ diag_data = diag_df,
112
+ columns = 'all-fields',
113
+ )
114
+
115
+ scores = model.score_mscore()
116
+
117
+ risk_scores = scores.risk_scores
118
+ ```
119
+ The resulting 'scores' output is a data model object of pandas.DataFrames. You can access your risk scores or relative factors data sets by calling the respective model name from the grouped data model.
120
+ - <span style="font-family:courier-new">scores.risk_scores</span>
121
+ - <span style="font-family:courier-new">scores.relative_factors</span>
122
+
123
+ From here you can proceed to use the risk score or relative factor DataFrames for further downstream processing or utilize the [Pandas](https://pandas.pydata.org/docs/user_guide/index.html) built-in methods to save to a file type of your choosing.
124
+
125
+ ### Features
126
+ #### relative_factors (attribute)
127
+ MScore offers the ability to view the relative factors for each person run through M<span style="font-size:.8em;">SCORE<sup>®</sup></span>. To access this data, you simply access the <code>relative_factors</code> attribute of the <code>mscore</code> output. The relative factors are the individual contributions (from the variables in the model) to the risk score. M<span style="font-size:.8em;">SCORE's<sup>®</sup></span> <code>relative_factors</code> output contains these values with 1 row per person scored, and each relative factor in the output as the columns.
128
+
129
+ To leverage this feature, you would do the following:
130
+ ```python
131
+ relative_factors = scores.relative_factors
132
+ ```
133
+ #### get_disease_scores (method)
134
+ For users wanting to compute the disease contribution to a person's risk score, you can do this in MScore by using the <code>get_disease_score</code> method of <code>mscore</code>. After instantiating your <code>mscore</code> object, you can use <code>get_disease_score</code> and pass the <code>mscore</code> output as a parameter. This will create a new dataframe containing only the portion of the risk score that comes from disease factors. Alternatively, if you would like this data appended to your MScore risk score output, you can use <code>join_scores</code> parameter to do this. NOTE: Disease interactions with DISABLED variables are not included in the disease score.
135
+
136
+ You can use the <code>get_disease_score</code> method as here:
137
+ ```python
138
+ disease_scores = model.get_disease_scores(scores)
139
+ ```
140
+
141
+ Or using the <code>join_scores</code> parameter:
142
+ ```python
143
+ disease_scores = model.get_disease_scores(scores, join_scores=True)
144
+ ```
145
+
146
+ ### Supported Data
147
+ The <code>mscore</code> class attributes, <code>person_data</code> and <code>diag_data</code>, will accept a Pandas.DataFrame object, CSV or Parquet filepath directly without the need to load your input data to DataFrame first. The resulting outputs will be a Pandas DataFrame object.
148
+
149
+ ### Supported Environments
150
+
151
+ M<span style="font-size:.8em;">SCORE<sup>®</sup></span> is designed to be universally compatible, ensuring seamless integration across various platforms.
152
+
153
+ - Operating Systems: Windows, macOS, Linux
154
+ - Python Versions: 3.10 or greater (both 32-bit and 64-bit architectures)
155
+
156
+ If your required environment is not listed, please contact us as support@riskadjustmentmodel.com for an alternate solution.
157
+
158
+ ## User Resources
159
+ For a more in-depth dive into all available model options, arguments, and reference documents, visit our [User Guides](https://riskadjustmentmodel.com/resources/user-guides).
160
+
161
+ ## Support
162
+
163
+ We are experts in Risk Adjustment and we're here to help. Whether it's general questions, billing, or integration support, please [contact us](https://riskadjustmentmodel.com/contact-us)📧. We are here to make risk scoring easy.
164
+
165
+ ## Stay Connected
166
+
167
+ Please [subscribe](https://riskadjustmentmodel.com/articles#userEmail) to our newsletter, to receive updates on new M<span style="font-size:.8em;">SCORE<sup>®</sup></span> features, model releases, tutorials, and to stay up-to-date on the latest news in risk adjustment.
168
+
169
+ ## Legal
170
+
171
+ To review the M<span style="font-size:.8em;">SCORE<sup>®</sup></span> license agreement, please visit [EULA](https://riskadjustmentmodel.com/legal/eula) webpage.