Skip to content

Commit

Permalink
Older filter benchmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanovnik committed Aug 19, 2016
1 parent 5f56aaf commit b3bd338
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion benchmark/bench_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
from Orange.preprocess import Discretize
from Orange.preprocess.discretize import EqualFreq

# noinspection PyBroadException
try:
from Orange.data.filter import FilterContinuous, FilterDiscrete, Values
except:
# legacy only
pass


# noinspection PyStatementEffect
class BenchBasic(Benchmark):
Expand Down Expand Up @@ -33,9 +40,17 @@ def bench_adult_create_X(self):

@pandas_only
@benchmark(number=20)
def bench_adult_filter(self):
def bench_adult_filter_pandas(self):
self.adult[(self.adult.age > 30) & (self.adult.workclass == 'Private')]

@non_pandas_only
@benchmark(number=20)
def bench_adult_filter_pre_pandas(self):
age_filter = FilterContinuous(self.adult.domain["age"], FilterContinuous.Greater, 30)
workclass_filter = FilterDiscrete(self.adult.domain["workclass"], [0])
combined = Values([age_filter, workclass_filter])
combined(self.adult)

@benchmark(number=50)
def bench_iris_basic_stats(self):
self.iris._compute_basic_stats()
Expand Down

0 comments on commit b3bd338

Please sign in to comment.