Geometric Approaches to Statistical Defect Prediction and Learning