22856afbd44b8179199f7629a54dea13043cdd5d,niftynet/evaluation/classification_evaluations.py,accuracy,layer_op,#accuracy#Any#Any#,19

Before Change


        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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: f98d8886d3ee70765debc6ab06ed71ef891a91bd
Time: 2018-02-16
Author: yipenghu@gmail.com
File Name: niftynet/contrib/evaluation/segmentation_evaluations.py
Class Name: ErrorMapsCC
Method Name: layer_op


Project Name: NifTK/NiftyNet
Commit Name: f98d8886d3ee70765debc6ab06ed71ef891a91bd
Time: 2018-02-16
Author: yipenghu@gmail.com
File Name: niftynet/evaluation/base_evaluator.py
Class Name: BaseEvaluator
Method Name: evaluate_from_generator