code: private double calculateC(ExampleSet data) //throws Exception
  	{
  		String svmCost = parameter.getProperty("svm-cost");
  		if (svmCost != null)
  			return Integer.parseInt(svmCost);
  
  		logger.info("calculate default SVM cost parameter C");
  
  		//double c = 1;
  		double avr = 0;
  
  		// the example set is normalized
  		// all vectors have the same norm
  		for (int i=0;i<data.size();i++)
  		{
  			Vector v = (Vector) data.x(i);
  			double norm = v.norm();
  			//logger.info(i + ", norm = " + norm);
  			//if (norm > c)
  			//	c = norm;
  			avr += norm;
  		} // end for i
  
  		return 1/Math.pow(avr / data.size(), 2);
  	}
docs: generalize well