@@ -165,7 +165,7 @@ def write_var_json(
165
165
166
166
@staticmethod
167
167
def generate_variable_properties (
168
- input_data : Union [DataFrame , Series ]
168
+ input_data : Union [DataFrame , Series ],
169
169
) -> List [dict ]:
170
170
"""
171
171
Generate a list of dictionaries of variable properties given an input dataframe.
@@ -1192,7 +1192,6 @@ def bias_dataframes_to_json(
1192
1192
def calculate_model_statistics (
1193
1193
cls ,
1194
1194
target_value : Union [str , int , float ],
1195
- prob_value : Union [int , float , None ] = None ,
1196
1195
validate_data : Union [DataFrame , List [list ], Type ["numpy.ndarray" ]] = None ,
1197
1196
train_data : Union [DataFrame , List [list ], Type ["numpy.ndarray" ]] = None ,
1198
1197
test_data : Union [DataFrame , List [list ], Type ["numpy.ndarray" ]] = None ,
@@ -1211,8 +1210,7 @@ def calculate_model_statistics(
1211
1210
Datasets must contain the actual and predicted values and may optionally contain
1212
1211
the predicted probabilities. If no probabilities are provided, a dummy
1213
1212
probability dataset is generated based on the predicted values and normalized by
1214
- the target value. If a probability threshold value is not provided, the
1215
- threshold value is set at 0.5.
1213
+ the target value.
1216
1214
1217
1215
Datasets can be provided in the following forms, with the assumption that data
1218
1216
is ordered as `actual`, `predict`, and `probability` respectively:
@@ -1229,9 +1227,6 @@ def calculate_model_statistics(
1229
1227
----------
1230
1228
target_value : str, int, or float
1231
1229
Target event value for model prediction events.
1232
- prob_value : int or float, optional
1233
- The threshold value for model predictions to indicate an event occurred. The
1234
- default value is 0.5.
1235
1230
validate_data : pandas.DataFrame, list of list, or numpy.ndarray, optional
1236
1231
Dataset pertaining to the validation data. The default value is None.
1237
1232
train_data : pandas.DataFrame, list of list, or numpy.ndarray, optional
@@ -1284,30 +1279,33 @@ def calculate_model_statistics(
1284
1279
continue
1285
1280
1286
1281
data = cls .stat_dataset_to_dataframe (data , target_value , target_type )
1282
+ data ["predict_proba2" ] = 1 - data ["predict_proba" ]
1287
1283
1288
1284
conn .upload (
1289
1285
data ,
1290
- casout = {"name " : "assess_dataset " , "replace " : True , "caslib " : "Public" },
1286
+ casout = {"caslib " : "Public " , "name " : "assess_dataset" , "replace " : True },
1291
1287
)
1288
+
1292
1289
if target_type == "classification" :
1293
1290
conn .percentile .assess (
1294
1291
table = {"name" : "assess_dataset" , "caslib" : "Public" },
1295
- response = "predict" ,
1296
- pVar = "predict_proba" ,
1297
- event = str (target_value ),
1298
- pEvent = str (prob_value ) if prob_value else str (0.5 ),
1299
- inputs = "actual" ,
1292
+ inputs = "predict_proba" ,
1293
+ response = "actual" ,
1294
+ event = "1" ,
1295
+ pvar = "predict_proba2" ,
1296
+ pevent = "0" ,
1297
+ includeLift = True ,
1300
1298
fitStatOut = {"name" : "FitStat" , "replace" : True , "caslib" : "Public" },
1301
1299
rocOut = {"name" : "ROC" , "replace" : True , "caslib" : "Public" },
1302
1300
casout = {"name" : "Lift" , "replace" : True , "caslib" : "Public" },
1303
1301
)
1304
1302
else :
1305
1303
conn .percentile .assess (
1306
1304
table = {"name" : "assess_dataset" , "caslib" : "Public" },
1307
- response = "predict " ,
1308
- inputs = "actual " ,
1309
- fitStatOut = {"name " : "FitStat " , "replace " : True , "caslib " : "Public" },
1310
- casout = {"name " : "Lift " , "replace " : True , "caslib " : "Public" },
1305
+ response = "actual " ,
1306
+ inputs = "predict " ,
1307
+ fitStatOut = {"caslib " : "Public " , "name " : "FitStat" , "replace " : True },
1308
+ casout = {"caslib " : "Public " , "name " : "Lift" , "replace " : True },
1311
1309
)
1312
1310
1313
1311
fitstat_dict = (
0 commit comments