@@ -115,53 +115,53 @@ def create_performance_definition(
115
115
cas_server = None ,
116
116
trace = False ,
117
117
):
118
- """Create the performance task definition in the model project to
119
- monitor model performance.
120
- Test
118
+ """Create the performance task definition in the model project to monitor model performance. In order to
119
+ execute the performance task definition, run the execute_performance_definition function with the output from
120
+ this function.
121
+
122
+ Note that the performance task definition cannot be created if the project is not a valid form of model, or if
123
+ targetVariable or targetLevel are not defined.
124
+
121
125
Parameters
122
126
----------
123
127
table_prefix : str
124
- The name used for the performance data.
125
- project : str
126
- Name or ID of the project
127
- models : str, list, or dict
128
+ The name used for the prefix of the performance data.
129
+ project : str, optional
130
+ Name or ID of the project. If no project is specified, it is inferred from the models argument. Defaults to
131
+ None.
132
+ models : str, list, or dict, optional
128
133
The name or id of the model(s), or a dictionary representation of the model(s). For
129
- multiple models, input list of model names, or list of dictionaries. If None, will take
130
- all models in specified project ID .
134
+ multiple models, input a list of model names, or a list of dictionaries. If no models are specified, all
135
+ models in the project specified will be used. Defaults to None .
131
136
library_name : str
132
137
The library containing the input data, default is 'Public'.
133
- name : str
134
- The name of the performance task.
135
- description : str
136
- The description of the performance task, default is 'Performance
137
- monitoring for model' + model.name.
138
- monitor_champion : bool
139
- Indicates to monitor the project champion model.
140
- monitor_challenger : bool
141
- Indicates to monitor challenger models.
142
- max_bins : int
143
- The maximum bins number, Must be >= 2. Defaults to 10.
144
- scoring_required : bool
145
- Whether model scoring must be performed on the input data before
146
- performance results can be computed. Should be `False` if target
147
- values are included in the `table_prefix` tables.
148
- all_data : bool
138
+ name : str, optional
139
+ The name of the performance task, default is None.
140
+ description : str, optional
141
+ The description of the performance task, default is None.
142
+ monitor_champion : bool, optional
143
+ Indicates to monitor the project champion model, default is None.
144
+ monitor_challenger : bool, optional
145
+ Indicates to monitor challenger models, default is None.
146
+ max_bins : int, optional
147
+ The maximum bins number. Must be >= 2. Defaults to 10.
148
+ scoring_required : bool, optional
149
+ Whether model scoring must be performed on the input data before performance results can be computed.
150
+ Should be `False` if target values are included in the `table_prefix` tables. Defaults to `False`.
151
+ all_data : bool, optional
149
152
Whether to run the performance job against all matching data tables
150
153
in `library_name` or just the new tables. Defaults to `False`.
151
- save_output : bool
152
- Whether to save the computed results to a table in `output_library`.
153
- Defaults to True.
154
- output_library : str
155
- Name of a CASLIB where computed results should be saved. Defaults to
156
- 'ModelPerformanceData'.
157
- autoload_output : bool
158
- Whether computed results should automatically be re-loaded
159
- after a CAS server restart.
160
- cas_server : str
154
+ save_output : bool, optional
155
+ Whether to save the computed results to a table in `output_library`. Defaults to True.
156
+ output_library : str, optional
157
+ Name of a CASLIB where computed results should be saved. Defaults to 'ModelPerformanceData'.
158
+ autoload_output : bool, optional
159
+ Whether computed results should automatically be re-loaded after a CAS server restart, defaults to False.
160
+ cas_server : str, optional
161
161
The CAS Server for the monitoring task, default is 'cas-shared-default'.
162
- trace : bool
163
- Whether to enable trace messages in the SAS job log when
164
- executing the performance definition .
162
+ trace : bool, optional
163
+ Whether to enable trace messages in the SAS job log when executing the performance definition, defaults to
164
+ False .
165
165
166
166
Returns
167
167
-------
@@ -186,12 +186,11 @@ def create_performance_definition(
186
186
187
187
if not project and not models :
188
188
raise ValueError (
189
- "No project or model specified for performance definition creation"
190
- "Please specifiy at least one of the two values."
189
+ "No project or model specified for performance definition creation. \n "
190
+ "Please specify at least one of the two values."
191
191
)
192
192
193
- mr = ModelRepository ()
194
-
193
+ # If no models were specified, search the supplied project for all models
195
194
if not models :
196
195
project = mr .get_project (project )
197
196
models = mr .list_models (parentId = project .id )
@@ -202,8 +201,7 @@ def create_performance_definition(
202
201
if not project :
203
202
project = mr .get_project (models [0 ].projectId )
204
203
205
- # Performance data cannot be captured unless certain project properties
206
- # have been configured.
204
+ # Performance data cannot be captured unless certain project properties have been configured.
207
205
for required in ["targetVariable" , "targetLevel" ]:
208
206
if getattr (project , required , None ) is None :
209
207
raise ValueError (
0 commit comments