def stats_per_second(self, *args):
     superstats = []
     for game_log, matrix in args:
         cstats = corestats.Stats()
         stats = {}
         mode = cstats.mode(matrix)
         stats['mode'] = mode[0][0]
         stats['modenext'] = mode[1][0]
         stats['mean'] = cstats.mean(matrix)
         stats['median'] = cstats.median(matrix)
         #stats['harmonicmean'] = mstats.harmonicmean(matrix)
         stats['variance'] = cstats.variance(matrix)
         stats['stddeviation'] = stats['variance'] ** 0.5
         stats['3sigma'] = 3*stats['stddeviation']
         stats['cumfreq'] = mstats.cumfreq(matrix)
         stats['itemfreq'] = mstats.itemfreq(matrix) # frequency of each item (each item being the count of the occurrencies for each number of lines per second)
         stats['min'] = min(matrix)
         stats['max'] = max(matrix)
         stats['samplespace'] = stats['max'] - stats['min']
         stats['count'] = len(matrix)
         stats['kurtosis'] = mstats.kurtosis(matrix)
         stats['perfectvalue'] = int(math.ceil(stats['3sigma'] + stats['mean']))
         stats['perfectscore'] = cstats.percentileforvalue(matrix, math.ceil(stats['3sigma'] + stats['mean']))
         scorepercentiles = [10, 30, 50, 70, 80, 85, 90, 95, 99, 99.9, 99.99]
         stats['itemscore'] = [(percentile, cstats.valueforpercentile(matrix, percentile)) for percentile in scorepercentiles]
         stats['skew'] = mstats.skew(matrix) # if positive, there are more smaller than higher values from the mean. If negative, there are more higher than smaller values from the mean.
         if stats['skew'] > 0:
             stats['skewmeaning'] = 'There exist more smaller values from the mean than higher'
         else:
             stats['skewmeaning'] = 'There exist more higher values from the mean than smaller'
         superstats.append( (game_log, stats) )
     return superstats
 def stats_per_second(self, *args):
     superstats = []
     for game_log, matrix in args:
         cstats = corestats.Stats()
         stats = {}
         mode = cstats.mode(matrix)
         stats['mode'] = mode[0][0]
         stats['modenext'] = mode[1][0]
         stats['mean'] = cstats.mean(matrix)
         stats['median'] = cstats.median(matrix)
         #stats['harmonicmean'] = mstats.harmonicmean(matrix)
         stats['variance'] = cstats.variance(matrix)
         stats['stddeviation'] = stats['variance']**0.5
         stats['3sigma'] = 3 * stats['stddeviation']
         stats['cumfreq'] = mstats.cumfreq(matrix)
         stats['itemfreq'] = mstats.itemfreq(
             matrix
         )  # frequency of each item (each item being the count of the occurrencies for each number of lines per second)
         stats['min'] = min(matrix)
         stats['max'] = max(matrix)
         stats['samplespace'] = stats['max'] - stats['min']
         stats['count'] = len(matrix)
         stats['kurtosis'] = mstats.kurtosis(matrix)
         stats['perfectvalue'] = int(
             math.ceil(stats['3sigma'] + stats['mean']))
         stats['perfectscore'] = cstats.percentileforvalue(
             matrix, math.ceil(stats['3sigma'] + stats['mean']))
         scorepercentiles = [
             10, 30, 50, 70, 80, 85, 90, 95, 99, 99.9, 99.99
         ]
         stats['itemscore'] = [
             (percentile, cstats.valueforpercentile(matrix, percentile))
             for percentile in scorepercentiles
         ]
         stats['skew'] = mstats.skew(
             matrix
         )  # if positive, there are more smaller than higher values from the mean. If negative, there are more higher than smaller values from the mean.
         if stats['skew'] > 0:
             stats[
                 'skewmeaning'] = 'There exist more smaller values from the mean than higher'
         else:
             stats[
                 'skewmeaning'] = 'There exist more higher values from the mean than smaller'
         superstats.append((game_log, stats))
     return superstats
Esempio n. 3
0
      stats.geometricmean(a), stats.geometricmean(af))
print('harmonicmean:', stats.harmonicmean(l), stats.harmonicmean(lf),
      stats.harmonicmean(a), stats.harmonicmean(af))
print('mean:', stats.mean(l), stats.mean(lf), stats.mean(a), stats.mean(af))
print('median:', stats.median(l), stats.median(lf), stats.median(a),
      stats.median(af))
print('medianscore:', stats.medianscore(l), stats.medianscore(lf),
      stats.medianscore(a), stats.medianscore(af))
print('mode:', stats.mode(l), stats.mode(a))

print('\nMOMENTS')
print('moment:', stats.moment(l), stats.moment(lf), stats.moment(a),
      stats.moment(af))
print('variation:', stats.variation(l), stats.variation(a),
      stats.variation(lf), stats.variation(af))
print('skew:', stats.skew(l), stats.skew(lf), stats.skew(a), stats.skew(af))
print('kurtosis:', stats.kurtosis(l), stats.kurtosis(lf), stats.kurtosis(a),
      stats.kurtosis(af))
print('tmean:', stats.tmean(a, (5, 17)), stats.tmean(af, (5, 17)))
print('tvar:', stats.tvar(a, (5, 17)), stats.tvar(af, (5, 17)))
print('tstdev:', stats.tstdev(a, (5, 17)), stats.tstdev(af, (5, 17)))
print('tsem:', stats.tsem(a, (5, 17)), stats.tsem(af, (5, 17)))
print('describe:')
print(stats.describe(l))
print(stats.describe(lf))
print(stats.describe(a))
print(stats.describe(af))

print('\nFREQUENCY')
print('freqtable:')
print('itemfreq:')
af = N.array(lf)
ll = [l]*5
aa = N.array(ll)

print '\nCENTRAL TENDENCY'
print 'geometricmean:',stats.geometricmean(l), stats.geometricmean(lf), stats.geometricmean(a), stats.geometricmean(af)
print 'harmonicmean:',stats.harmonicmean(l), stats.harmonicmean(lf), stats.harmonicmean(a), stats.harmonicmean(af)
print 'mean:',stats.mean(l), stats.mean(lf), stats.mean(a), stats.mean(af)
print 'median:',stats.median(l),stats.median(lf),stats.median(a),stats.median(af)
print 'medianscore:',stats.medianscore(l),stats.medianscore(lf),stats.medianscore(a),stats.medianscore(af)
print 'mode:',stats.mode(l),stats.mode(a)

print '\nMOMENTS'
print 'moment:',stats.moment(l),stats.moment(lf),stats.moment(a),stats.moment(af)
print 'variation:',stats.variation(l),stats.variation(a),stats.variation(lf),stats.variation(af)
print 'skew:',stats.skew(l),stats.skew(lf),stats.skew(a),stats.skew(af)
print 'kurtosis:',stats.kurtosis(l),stats.kurtosis(lf),stats.kurtosis(a),stats.kurtosis(af)
print 'tmean:',stats.tmean(a,(5,17)),stats.tmean(af,(5,17))
print 'tvar:',stats.tvar(a,(5,17)),stats.tvar(af,(5,17))
print 'tstdev:',stats.tstdev(a,(5,17)),stats.tstdev(af,(5,17))
print 'tsem:',stats.tsem(a,(5,17)),stats.tsem(af,(5,17))
print 'describe:'
print stats.describe(l)
print stats.describe(lf)
print stats.describe(a)
print stats.describe(af)

print '\nFREQUENCY'
print 'freqtable:'
print 'itemfreq:'
print stats.itemfreq(l)
Esempio n. 5
0
 def test_skew(self):
     "Testing skew"
     data = [self.L, self.LF, self.A, self.AF]
     for d in data:
         self.assertEqual(stats.skew(d), 0.0)
Esempio n. 6
0
 def test_skew(self):
     "Testing skew"
     data = [ self.L, self.LF, self.A, self.AF ]
     for d in data:
         self.assertEqual( stats.skew( d ), 0.0 )
Esempio n. 7
0
    lf), stats.geometricmean(a), stats.geometricmean(af)
print 'harmonicmean:', stats.harmonicmean(l), stats.harmonicmean(
    lf), stats.harmonicmean(a), stats.harmonicmean(af)
print 'mean:', stats.mean(l), stats.mean(lf), stats.mean(a), stats.mean(af)
print 'median:', stats.median(l), stats.median(lf), stats.median(
    a), stats.median(af)
print 'medianscore:', stats.medianscore(l), stats.medianscore(
    lf), stats.medianscore(a), stats.medianscore(af)
print 'mode:', stats.mode(l), stats.mode(a)

print '\nMOMENTS'
print 'moment:', stats.moment(l), stats.moment(lf), stats.moment(
    a), stats.moment(af)
print 'variation:', stats.variation(l), stats.variation(a), stats.variation(
    lf), stats.variation(af)
print 'skew:', stats.skew(l), stats.skew(lf), stats.skew(a), stats.skew(af)
print 'kurtosis:', stats.kurtosis(l), stats.kurtosis(lf), stats.kurtosis(
    a), stats.kurtosis(af)
print 'tmean:', stats.tmean(a, (5, 17)), stats.tmean(af, (5, 17))
print 'tvar:', stats.tvar(a, (5, 17)), stats.tvar(af, (5, 17))
print 'tstdev:', stats.tstdev(a, (5, 17)), stats.tstdev(af, (5, 17))
print 'tsem:', stats.tsem(a, (5, 17)), stats.tsem(af, (5, 17))
print 'describe:'
print stats.describe(l)
print stats.describe(lf)
print stats.describe(a)
print stats.describe(af)

print '\nFREQUENCY'
print 'freqtable:'
print 'itemfreq:'
 def evaluate(self, *args, **params):
     return _stats.skew(*args, **params)