6b4fac6310432e138dea049ee8b606dca5c61d50,dlpy/metrics.py,,accuracy_score,#Any#Any#Any#Any#,26
Before Change
matched_colname = "matched"
conn = castable.get_connection()
// check whether matched_colname is already in the castable,
// to avoid duplication or overwrite when creating computedvars.
while matched_colname in castable.columns:
After Change
"""
check_results = _check_inputs(y_true, y_pred, castable=castable,
return_target_dtype=False)
y_true = check_results[0]
y_pred = check_results[1]
castable = check_results[2]
conn = check_results[3]
tmp_table_created = check_results[4]
matched_colname = "matched"
// check whether matched_colname is already in the castable,
// to avoid duplication or overwrite when creating computedvars.
while matched_colname in castable.columns:
matched_colname = random_name(name="matched_")
castbl_params = {}
castbl_params["computedvars"] = [{"name":matched_colname}]
code = "if {0}={1} then {2}=1;else {2}=0".format(y_true, y_pred, matched_colname)
castbl_params["computedvarsprogram"] = code
castable = conn.CASTable(castable.name, **castbl_params)
if normalize:
score = castable[matched_colname].mean()
else:
score = castable[matched_colname].sum()
if tmp_table_created: // if tmp_table_created, tbl_name referes to the temporary table name
conn.retrieve("table.droptable", _messagelevel="error", name=castable.name)
return score
def confusion_matrix(y_true, y_pred, castable=None, labels=None):
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 19
Instances Project Name: sassoftware/python-dlpy
Commit Name: 6b4fac6310432e138dea049ee8b606dca5c61d50
Time: 2019-03-09
Author: rui.li@sas.com
File Name: dlpy/metrics.py
Class Name:
Method Name: accuracy_score
Project Name: sassoftware/python-dlpy
Commit Name: 6b4fac6310432e138dea049ee8b606dca5c61d50
Time: 2019-03-09
Author: rui.li@sas.com
File Name: dlpy/metrics.py
Class Name:
Method Name: mean_squared_error
Project Name: sassoftware/python-dlpy
Commit Name: 6b4fac6310432e138dea049ee8b606dca5c61d50
Time: 2019-03-09
Author: rui.li@sas.com
File Name: dlpy/metrics.py
Class Name:
Method Name: mean_absolute_error
Project Name: sassoftware/python-dlpy
Commit Name: 6b4fac6310432e138dea049ee8b606dca5c61d50
Time: 2019-03-09
Author: rui.li@sas.com
File Name: dlpy/metrics.py
Class Name:
Method Name: accuracy_score
Project Name: sassoftware/python-dlpy
Commit Name: 6b4fac6310432e138dea049ee8b606dca5c61d50
Time: 2019-03-09
Author: rui.li@sas.com
File Name: dlpy/metrics.py
Class Name:
Method Name: mean_squared_log_error
Project Name: sassoftware/python-dlpy
Commit Name: 6b4fac6310432e138dea049ee8b606dca5c61d50
Time: 2019-03-09
Author: rui.li@sas.com
File Name: dlpy/metrics.py
Class Name:
Method Name: explained_variance_score