package modelkit

  1. Overview
  2. Docs
Portable classical machine learning workflows for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

modelkit-0.5.0.tbz
sha256=1fe8fa7c7f904dd098a21a2ca30fd69230750b8cf8aa2ae481b97a16531b47b4
sha512=c946cd1ac014726f4d21791e14d806a205680e6edfa2f80ed8d3680f24f48ca3c5a2f89d5afa68c11eac4053ead448b6381fb3d06dc8ff129097af6c69b262fb

doc/modelkit/Modelkit/Dataset/index.html

Module Modelkit.Dataset

An admitted immutable dense dataset and its zero-copy row selections.

Admission validates alignment and the declared feature finiteness policy. create reuses already-immutable ModelKit values. view stores only row indices; materialize packs a view into new row-aligned buffers.

type finiteness =
  1. | Require_finite
  2. | Allow_nan
type data_access =
  1. | Copy
  2. | View
type access_report = {
  1. feature_access : data_access;
  2. target_access : data_access;
  3. sample_weight_access : data_access option;
  4. group_access : data_access option;
}
type 'kind t
type 'kind view
val create : finiteness:finiteness -> ?feature_names:Feature_names.t -> ?sample_weight:Sample_weight.t -> ?groups:Groups.t -> x:Matrix.t -> y:'kind Target.t -> unit -> ('kind t, Data_error.t) result
val sample_count : _ t -> int
val feature_count : _ t -> int
val features : _ t -> Matrix.t
val target : 'kind t -> 'kind Target.t
val sample_weight : _ t -> Sample_weight.t option
val groups : _ t -> Groups.t option
val feature_schema : _ t -> Feature_schema.t
val schema_fingerprint : _ t -> Schema_fingerprint.t
val finiteness : _ t -> finiteness
val access_report : _ t -> access_report
val all : 'kind t -> 'kind view
val view : 'kind t -> Row_view.t -> ('kind view, Data_error.t) result
val view_sample_count : _ view -> int
val row_view : _ view -> Row_view.t
val view_access_report : _ view -> access_report
val source_row : _ view -> int -> int

Raises Invalid_argument if the view position is out of bounds.

val feature : _ view -> row:int -> column:int -> float

feature view ~row ~column addresses logical rows in the view. Raises Invalid_argument if either index is out of bounds.

val regression_target : Target.regression view -> int -> float
val classification_target : Target.classification view -> int -> int
val sample_weight_value : _ view -> int -> float option
val group : _ view -> int -> int option
val materialize : 'kind view -> ('kind t, Data_error.t) result

materialize view copies selected row-aligned buffers. Feature names and the immutable schema are reused.