module Problem:sig
..end
type
t
val create : x:Lacaml.D.mat -> y:Lacaml.D.vec -> t
create x y
constructs a problem from a feature matrix x
and target
vector y
. Each row of x
is a feature vector of a training
instance.val create_k : k:Lacaml.D.mat -> y:Lacaml.D.vec -> t
create_k k y
constructs a problem from a matrix k
and target vector
y
. The matrix k
has to be of the following form:
1 K(x1,x1) K(x1,x2) ... K(x1,xL)
2 K(x2,x1) K(x2,x2) ... K(x2,xL)
...
L K(xL,x1) K(xL,x2) ... K(xL,xL)
where L denotes the number of training instances and K(x,y) is the
precomputed kernel value of the two training instances x and y.
val get_n_samples : t -> int
get_n_samples prob
val get_n_feats : t -> int
get_n_feats prob
val get_targets : t -> Lacaml.D.vec
get_targets prob
val load : string -> t
load filename
loads a problem from the file filename
.Failure
if an error occured during parsing of filename
.val output : t -> Pervasives.out_channel -> unit
output prob oc
outputs the problem prob
to an output channel oc
.
NOTE: the function does not close the output channel.val save : t -> string -> unit
save prob filename
saves the problem prob
to the file filename
.val min_max_feats : t -> [ `Min of Lacaml.D.vec ] * [ `Max of Lacaml.D.vec ]
min_max_feats prob
val scale : ?lower:float ->
?upper:float ->
t ->
min_feats:Lacaml.D.vec -> max_feats:Lacaml.D.vec -> t
scale ?lower ?upper prob min_feats max_feats
lower
,upper
]. The default range is [-1,1].val print : t -> unit
print prob
prints the internal representation of a problem.
It is mainly used for debugging purposes.