1. Kota UENISHI
  2. ollio

Source

ollio / main.ml


let get_input_filename default = 
  if Array.length Sys.argv > 1 then 
    Array.get Sys.argv 1
  else default;;

let _ =
  let w = Oll.train "PA" (get_input_filename "test.data") in
  let r = Oll.test w "PA" "somefile" in
  Oll.print_result r;;

(*
  INPUT: aggressiveness parameter C > 0
  INITIALIZE: w1 = (0,...,0)
  For	t = 1,2,...
    • receive instance: xt ∈ Rn
    • predict: yˆt = sign(wt · xt )
    • receive correct label: yt ∈ {−1, +1}
    • suffer loss: lt = max{0 , 1−yt(wt ·xt)}
  • update:
    1. set:
       τt = lt / |x_t|^2	(PA) ∥xt∥
       τt =min C, lt/∥xt∥2	(PA-I)
       τ= lt / (|xt|^2 + 1/2C)  (PA-II)
    2.update: wt+1=wt+τtytxt
*)