def perform_experiment(self, engine_list):
<EOL>result = []<EOL>for endine_idx, engine in enumerate(engine_list):<EOL><INDENT>print('<STR_LIT>' % (endine_idx, len(engine_list)))<EOL>engine.clean_all_buckets()<EOL>avg_recall = <NUM_LIT:0.0><EOL>avg_precision = <NUM_LIT:0.0><EOL>avg_search_time = <NUM_LIT:0.0><EOL>for index, v in enumerate(self.vectors):<EOL><INDENT>engine.store_vector(v, '<STR_LIT>' % index)<EOL><DEDENT>for index in self.query_indices:<EOL><INDENT>real_nearest = set(self.closest[index])<EOL>search_time_start = time.time()<EOL>nearest = engine.neighbours(self.vectors[index])<EOL>search_time = time.time() - search_time_start<EOL>nearest = set([self.__index_of_vector(x[<NUM_LIT:0>]) for x in nearest])<EOL>nearest.remove(index)<EOL>if len(nearest) == <NUM_LIT:0>:<EOL><INDENT>recall = <NUM_LIT:0.0><EOL>precision = <NUM_LIT:0.0><EOL><DEDENT>else:<EOL><INDENT>inter_count = float(len(real_nearest & nearest))<EOL>recall = inter_count/float(len(real_nearest))<EOL>precision = inter_count/float(len(nearest))<EOL><DEDENT>avg_recall += recall<EOL>avg_precision += precision<EOL>avg_search_time += search_time<EOL><DEDENT>avg_recall /= float(len(self.query_indices))<EOL>avg_precision /= float(len(self.query_indices))<EOL>avg_search_time = avg_search_time / float(len(self.query_indices))<EOL>avg_search_time /= self.exact_search_time_per_vector<EOL>print('<STR_LIT>' % (avg_recall,<EOL>avg_precision,<EOL>avg_search_time))<EOL>result.append((avg_recall, avg_precision, avg_search_time))<EOL><DEDENT>return result<EOL>
Performs nearest neighbour recall experiments with custom vector data
for all engines in the specified list.

Returns self.result contains list of (recall, precision, search_time)
tuple. All are the averaged values over all request vectors.
search_time is the average retrieval/search time compared to the
average exact search time.