public void calculate()
    {
	accuracy = (TP + TN) / (TP + FP + FN + TN);
	//accuracy = accuracy * 100; // present as %

	precision = (TP) / (TP+FP);

	recall = (TP) / (TP + FN);

	specificity = (TN) / (FP+TN);

	negativePredictiveValue = (TN) / (FN + TN);

	matthewsCorrelation = ((TP * TN) - (FP * FN)) / Math.sqrt((TP+FP) * (TP+FN) * (TN+FP) * (TN+FN));

	fScore = 2 * ((precision * recall) / (precision + recall));
	
	if(Double.isNaN(accuracy))
	    accuracy = 0.0;
	
	if(Double.isNaN(precision))
	    precision = 0.0;
	
	if(Double.isNaN(recall))
	    recall = 0.0;
	
	if(Double.isNaN(specificity))
	    specificity = 0.0;
	
	if(Double.isNaN(negativePredictiveValue))
	    negativePredictiveValue = 0.0;
	
	if(Double.isNaN(matthewsCorrelation))
	    matthewsCorrelation = 0.0;
	
	if(Double.isNaN(fScore))
	    fScore = 0.0;
    }