forked from barko/dawg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
feat_utils.mli
27 lines (23 loc) · 1.04 KB
/
feat_utils.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
val array_of_afeature : Feat.afeature ->
[ `Float of (int * float) array
| `Int of (int * int) array
| `String of (int * string) array
| `StringAnon of (int * string option) array ]
open Dog_t
val id_of_feature : ('a, 'b) feature -> feature_id
val name_of_feature : ('a, 'b) feature -> feature_name option
val cardinality_of_feature : ('a, 'b) feature -> int
val vector_of_feature : ('a, 'b) feature -> ('a, 'b) Dog_t.vector
val folds_of_feature : n:int -> num_folds:int -> Feat.afeature ->
[ `Folds of int array
| `TooManyCategoricalFolds of int
| `TooManyOrdinalFolds of int
]
(* [folds_of_feature ~n:num_observations ~num_folds feature] returns
an array of fold memberships, assigning each observation to a fold.
For categorical features, [num_folds] must match the cardinality of
the feature exactly. *)
val i_to_a : (int -> Vec.t) -> Feat.ifeature -> Feat.afeature
type feature_descr = [ `Name of string | `Id of int ]
val string_of_feature_descr : feature_descr -> string
val feature_descr_of_string : string -> feature_descr option