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