changeset 1022:b7689372c0ec

renamed quantile to centile
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 06 Jun 2018 10:35:06 -0400
parents 16932cefabc1
children a13f47c8931d
files classifier.cfg python/storage.py python/utils.py scripts/classify-objects.py
diffstat 4 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/classifier.cfg	Tue Jun 05 17:02:28 2018 -0400
+++ b/classifier.cfg	Wed Jun 06 10:35:06 2018 -0400
@@ -16,12 +16,12 @@
 hog-ncells-block = 2
 # block normalization method (L1, L1-sqrt, L2, L2-Hys)
 hog-block-norm = L1-sqrt
-# method to aggregate road user speed
+# method to aggregate road user speed: mean, median or any (per)centile
 speed-aggregation-method = median
 # number of frames to ignore at both ends of a series (noisy)
 nframes-ignore-at-ends = 2
-# quantile for the speed aggregation, if quantile is chosen
-speed-aggregation-quantile = 50
+# centile for the speed aggregation, if centile is chosen
+speed-aggregation-centile = 50
 # speed value below which all classes are equiprobable (distributions give odd values there) (km/h)
 min-speed-equiprobable = 3.33
 # maximum proportion of the instants with unknow appearance classification to use speed information
--- a/python/storage.py	Tue Jun 05 17:02:28 2018 -0400
+++ b/python/storage.py	Wed Jun 06 10:35:06 2018 -0400
@@ -1296,7 +1296,7 @@
         
         self.speedAggregationMethod = config.get(self.sectionHeader, 'speed-aggregation-method')
         self.nFramesIgnoreAtEnds = config.getint(self.sectionHeader, 'nframes-ignore-at-ends')
-        self.speedAggregationQuantile = config.getint(self.sectionHeader, 'speed-aggregation-quantile')
+        self.speedAggregationCentile = config.getint(self.sectionHeader, 'speed-aggregation-centile')
         self.minSpeedEquiprobable = config.getfloat(self.sectionHeader, 'min-speed-equiprobable')
         self.maxPercentUnknown = config.getfloat(self.sectionHeader, 'max-prop-unknown-appearance')
         self.maxPedestrianSpeed = config.getfloat(self.sectionHeader, 'max-ped-speed')
--- a/python/utils.py	Tue Jun 05 17:02:28 2018 -0400
+++ b/python/utils.py	Wed Jun 06 10:35:06 2018 -0400
@@ -426,8 +426,6 @@
         if plotFigure:
             plt.figure()
             plt.boxplot([tmp.loc[tmp[independentVariable] == x, dependentVariable] for x in independentVariableValues])
-            #q25, q75 = tmp[dependentVariable].quantile([.25, .75])
-            #plt.ylim(ymax = q75+1.5*(q75-q25))
             plt.xticks(range(1,len(independentVariableValues)+1), independentVariableValues)
             plt.title('{} vs {}'.format(dependentVariable, independentVariable))
             if filenamePrefix is not None:
--- a/scripts/classify-objects.py	Tue Jun 05 17:02:28 2018 -0400
+++ b/scripts/classify-objects.py	Wed Jun 06 10:35:06 2018 -0400
@@ -29,8 +29,8 @@
     speedAggregationFunc = np.median
 elif classifierParams.speedAggregationMethod == 'mean':
     speedAggregationFunc = np.mean
-elif classifierParams.speedAggregationMethod == 'quantile':
-    speedAggregationFunc = lambda speeds: np.percentile(speeds, args.speedAggregationQuantile)
+elif classifierParams.speedAggregationMethod == 'centile':
+    speedAggregationFunc = lambda speeds: np.percentile(speeds, args.speedAggregationCentile)
 else:
     print('Unknown speed aggregation method: {}. Exiting'.format(classifierParams.speedAggregationMethod))
     sys.exit()