@Override
	public double score(NewsEvent event, long forecast) {
		String content = event.getContent();
		
		Matrix pdv = index.getPseudoDocumentVector(tokenizer.tokenize(content));
		Matrix similarity = matrix.mtimes(pdv);
		
		Matrix delta = MatrixFactory.dense(1, news.size());
		for(int i = 0; i < news.size(); i++) {
			NewsEvent comp = news.get(i);
			double price = ticker.getPrice(comp.getDate());
			double nextPrice = ticker.getPrice(comp.getDate() + forecast);
			double change = nextPrice - price;
			delta.setAsDouble(change, 0, i);
		}
		
		LinkedList<Double> bestValues = new LinkedList<Double>();
		LinkedList<Integer> bestIndexes = new LinkedList<Integer>();
		
		for(int i = 0; i < similarity.getRowCount(); i++) {
			double value = similarity.getAsDouble(i,0);
			
			int j = 0;
			for(; j < bestValues.size(); j++)
				if(bestValues.get(j) > value)
					break;
			
			bestValues.add(j, value);
			bestIndexes.add(j, i);
			
			if(bestValues.size() > k) {
				bestValues.remove(0);
				bestIndexes.remove(0);
			}
		}
		
		if(avg) {
			double sum = 0;
			for(int index : bestIndexes)
				sum += delta.getAsDouble(0,index);
			
			return sum / k;
		}
		else {
			int numPos = 0;
			for(int index : bestIndexes)
				if(delta.getAsDouble(0,index) > 0)
					numPos++;
			double prop = numPos / (double) k;
			return 2 * prop - 1;
		}
	}