Parcourir la source

Merge branch 'release/v0.0.2'

Jérôme BUISINE il y a 4 ans
Parent
commit
9d398c17c2
1 fichiers modifiés avec 8 ajouts et 5 suppressions
  1. 8 5
      extractions/calibration_errors.py

+ 8 - 5
extractions/calibration_errors.py

@@ -50,19 +50,22 @@ def main():
         user_id = user_data['userId']
 
         experiment_user_thresholds = []
+        experiment_user_zone = []
         experiment_error_thresholds = []
         for val in user_data['msg']['extracts']:
-            threshold_id = int(val['index'])
+            zone_id = int(val['zone']) - 1
             experiment_user_thresholds.append(val['quality'])
-            error = (val['quality'] - threshold_img[threshold_id])
+            error = (val['quality'] - threshold_img[zone_id])
             error_squared = error * error
+            experiment_user_zone.append(zone_id)
             experiment_error_thresholds.append(error_squared)
 
         print('----------------------------------------------')
         print('User', user_id)
-        print(experiment_user_thresholds)
-        print(list(map(lambda x: str('%.2f' % x), experiment_error_thresholds)))
-        print(np.mean(experiment_error_thresholds))
+        print('zone id', experiment_user_zone)
+        print('Estimated', experiment_user_thresholds)
+        print('Squared error', list(map(lambda x: str('%.2f' % x), experiment_error_thresholds)))
+        print('Mean squared error', np.mean(experiment_error_thresholds))
 
 if __name__== "__main__":
     main()