public static double loss(double pred,double y){
  return Math.max(0,1 - y * pred);
}

public static double loss ( double pred , double y ) { return Math . max ( 0 , 1 - y * pred ) ; }
computes the hingeloss loss
