def setUp(self): self.ev = Evaluator()
sys.exit(1) ############################## # Online document clustering # ############################## # Reduce dimension for visualization logging.info("Initializing incremental PCA...") ipca = IncrementalPCA(n_components=2) # Init visualizers graph_visualizer = GraphVisualizer() # Init evaluator logging.info("Initializing evaluator...") evaluator = Evaluator(ground_truth_file, language=language) # Iterate over heldout/test corpora for t, docs_metadata in enumerate(corpora): logging.info("Testing corpus at time #%d." % t) docs, metadata = zip(*docs_metadata) # Update model model.update(docs) # Get vector representation docs = model[docs] # Cluster new data clustering.add_documents(docs, metadata)