22856afbd44b8179199f7629a54dea13043cdd5d,niftynet/evaluation/classification_evaluations.py,accuracy,layer_op,#accuracy#Any#Any#,19
Before Change
metric_name = "accuracy_"
if self.app_param.output_prob:
inferred_label = np.amax(data["inferred"][0,0,0,0,:])
metric_value = (inferred_label, data["label"][0,0,0,0,0])
else:
metric_value = (data["inferred"][0,0,0,0,0],
data["label"][0,0,0,0,0])
results_dict = ResultsDictionary()
results_dict[("subject_id",)] = [{"subject_id":subject_id,
metric_name:metric_value}]
return results_dict
def get_aggregations(self):
def agg_func(values):
//print(values)
After Change
inferred_label = np.amax(data["inferred"][0,0,0,0,:])
else:
inferred_label = data["inferred"][0,0,0,0,0]
pdf = pd.DataFrame.from_records([{"subject_id":subject_id,
"acc_i":inferred_label,
"acc_l":data["label"][0,0,0,0,0]}],
index=("subject_id",))
return ResultsDictionary(pdf)
def aggregate(self, df):
agg = pd.DataFrame.from_records([{"accuracy":(df.acc_i==df.acc_l).mean()}])
print(agg)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: NifTK/NiftyNet
Commit Name: 22856afbd44b8179199f7629a54dea13043cdd5d
Time: 2018-02-16
Author: eli.gibson@gmail.com
File Name: niftynet/evaluation/classification_evaluations.py
Class Name: accuracy
Method Name: layer_op
Project Name: NifTK/NiftyNet
Commit Name: 22856afbd44b8179199f7629a54dea13043cdd5d
Time: 2018-02-16
Author: eli.gibson@gmail.com
File Name: niftynet/evaluation/segmentation_evaluations.py
Class Name: PerComponentEvaluation
Method Name: layer_op
Project Name: NifTK/NiftyNet
Commit Name: 22856afbd44b8179199f7629a54dea13043cdd5d
Time: 2018-02-16
Author: eli.gibson@gmail.com
File Name: niftynet/evaluation/classification_evaluations.py
Class Name: accuracy
Method Name: layer_op
Project Name: NifTK/NiftyNet
Commit Name: 22856afbd44b8179199f7629a54dea13043cdd5d
Time: 2018-02-16
Author: eli.gibson@gmail.com
File Name: niftynet/evaluation/regression_evaluations.py
Class Name: BaseRegressionEvaluation
Method Name: layer_op