Commits

Anonymous committed 1c463cb

cosme

Comments (0)

Files changed (1)

   Printf.printf "Accuracy %f%% (%d/%d)\n" acc hit (wrong+hit);
   Printf.printf "(Answer, Predict): (p,p):%d (p,n):%d (n,p):%d (n,n):%d\n"
     r.pos_pos r.pos_neg r.neg_pos r.neg_neg;;
-(*  Printf.printf "TP: %d  TN: %d\n" r.pos_pos r.neg_neg;
-  Printf.printf "FP: %d  FN: %d\n" r.neg_pos r.pos_neg;;*)
 
 (* w x -> 1 | -1 *)
 let predict w x =
   | "PA" ->  pa;
   | "PA1" -> pa1 1.0;
   | "PA2" -> pa2 1.0;
-  | _ -> raise Unknown;;
+  | _ -> raise (Invalid_argument "PA/PA1/PA2 is only accepted as learning algorithm");;
 
 let loss y_t w x =
   let v = 1.0 -. (Vector.prod w x) *. (float_of_int y_t) in