def perform_experiment(self, engine_list):
<EOL>result = []<EOL>for engine in engine_list:<EOL><INDENT>print('<STR_LIT>' % (engine_list.index(engine),<EOL>len(engine_list)))<EOL>engine.clean_all_buckets()<EOL>avg_distance_ratio = <NUM_LIT:0.0><EOL>avg_result_size = <NUM_LIT:0.0><EOL>avg_search_time = <NUM_LIT:0.0><EOL>for index in range(self.vectors.shape[<NUM_LIT:1>]):<EOL><INDENT>engine.store_vector(self.vectors[:, index],<EOL>'<STR_LIT>' % index)<EOL><DEDENT>for index in self.query_indices:<EOL><INDENT>search_time_start = time.time()<EOL>nearest = engine.neighbours(self.vectors[:, index])<EOL>search_time = time.time() - search_time_start<EOL>distance_ratio = <NUM_LIT:0.0><EOL>for n in nearest:<EOL><INDENT>if n[<NUM_LIT:2>] > self.nearest_radius[index]:<EOL><INDENT>d = (n[<NUM_LIT:2>] - self.nearest_radius[index])<EOL>d /= self.nearest_radius[index]<EOL>distance_ratio += d<EOL><DEDENT><DEDENT>distance_ratio /= len(nearest)<EOL>avg_distance_ratio += distance_ratio<EOL>avg_result_size += len(nearest)<EOL>avg_search_time += search_time<EOL><DEDENT>avg_distance_ratio /= float(len(self.query_indices))<EOL>avg_result_size /= 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_distance_ratio,<EOL>avg_result_size,<EOL>avg_search_time))<EOL>result.append((avg_distance_ratio, avg_result_size, avg_search_time))<EOL><DEDENT>return result<EOL>
Performs nearest neighbour experiments with custom vector data
for all engines in the specified list.

Returns self.result contains list of (distance_ratio, 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.