public static String getClassificationBTR(Vector<NearestNeighbour> nn)
    {
	// The nearest neighbour will be first in the list.

	int posCount = 0;
	int negCount = 0;
	int unknownCount = 0;

	for(int i =0; i < nn.size();i++)
	{
	    String classification = nn.get(i).getNeighbourClassificationBTR();
	    if(classification.equals(Constants.PULSAR))
		posCount++;
	    else if(classification.equals(Constants.RFI))
		negCount++;
	    else
		unknownCount++;

	    System.out.println("neighbour: "+ i + " class:"+ classification);
	} 

	System.out.println("+: "+ posCount + " -:"+ negCount + " unknown:"+unknownCount);

	// Whichever is greater decides the classification label
	// in the case of a tie, randomly choose.
	if( negCount > posCount ) 	
	    return Constants.RFI;
	else if( posCount > negCount  ) 
	    return Constants.PULSAR;
	else if( posCount == negCount )
	{
	    Random r = new Random();
	    double d = r.nextDouble();// generate number between 0.0-1.0
	    double split = 0.5;

	    // Just in case d is equal to the split point.
	    while(Double.compare(d, split) == 0)
		d = r.nextDouble();

	    if(Double.compare(d, split) > 0)// d greater than 0.5
		return Constants.PULSAR; 
	    else
		return Constants.RFI;
	}
	else // label unknown
	    return Constants.UNKNOWN;

    }