Skip to content

Instantly share code, notes, and snippets.

View rleonid's full-sized avatar
🎯
What does it all mean?

Leonid Rozenberg rleonid

🎯
What does it all mean?
View GitHub Profile
# let pred =
Array.init 100 (fun r ->
let a = n1 () in
let b = n1 () in
let c = a +. b in (* Makes the third column/predictor redundant and our data collinear! *)
[|a;b;c|]) ;;
val pred : float array array =
[|[|2.1000; 0.9001; 3.0001|]; [|1.7343; 2.9934; 4.7277|]; [|2.7644; 4.0290; 6.7935|];
[|0.7972; 2.6754; 3.4726|]; [|0.6089; 2.7250; 3.3340|]; [|0.7870; 2.7721; 3.5592|];
...|]
open Lacaml.D
let capture_failure_of_list = function
| [] -> Mat.empty
| (h :: _) as lst ->
let m = List.length lst in
let n = List.length h in
let mat = Mat.create m n in
let rec loop i = function
| [] -> mat