Liking cljdoc? Tell your friends :D

fogus.rv.learn.vs

Version spaces are a binary classification, empirical learning algorithm. The approach, as described in 'Version spaces: a candidate elimination approach to rule learning' by Tom Mitchel (1977) takes training examples (currently Tuples of a like-arity) and manages a 'version space'. A version space is a map containing two 'boundaries' :S and :G. The :G boundary contains 'hypotheses' corresponding to the most general versions of the training data that are consistent and :S is the most specific versions. When a version space is presented with a new example it runs a 'candidate elimination' algorithm to modify the boundaries :S and :G accordingly. Examples can be marked as 'positive' examples, meaning that they are preferred instances. Anything not marked as 'positive' are taken as negative examples. Once trained, a version space can classify new examples as ::positive or ::negative. If new examples are not covered by the existing hypotheses in either boundary then they are classified as ::ambiguous instead.

Version spaces are a binary classification, empirical learning algorithm.
The approach, as described in 'Version spaces: a candidate elimination approach
to rule learning' by Tom Mitchel (1977) takes training examples (currently
Tuples of a like-arity) and manages a 'version space'. A version space is a
map containing two 'boundaries' `:S` and `:G`. The `:G` boundary contains 'hypotheses'
corresponding to the most general versions of the training data that are consistent
and `:S` is the most specific versions. When a version space is presented with a new
example it runs a 'candidate elimination' algorithm to modify the boundaries `:S`
and `:G` accordingly. Examples can be marked as 'positive' examples, meaning
that they are preferred instances. Anything not marked as 'positive' are taken as
negative examples. Once trained, a version space can  classify new examples as
`::positive` or `::negative`. If new examples are not covered by the existing hypotheses
in either boundary then they are classified as `::ambiguous` instead.
raw docstring

??clj


?Gclj


?Sclj


applicable?clj

(applicable? vs example)
(applicable? vs example positive?)

Returns true if at least one hypothesis in the version space vs is consistent with the example and false otherwise.

Returns true if at least one hypothesis in the version space `vs` is consistent
with the `example` and false otherwise.
raw docstring

arity-vecclj

(arity-vec n)

Returns a vector template for arity n.

Returns a vector template for arity n.
raw docstring

best-fitclj

(best-fit vs example)

Returns the best-fit hypothesis coverage analysis (see explain) for a given version space vs and compatible example. The metadata of the best fit return will have a mapping of ::fit-from -> :S or :G pertaining to which boundary set the fit came from.

Returns the best-fit hypothesis coverage analysis (see `explain`) for a given
version space `vs` and compatible `example`. The metadata of the best fit return will
have a mapping of `::fit-from` -> `:S` or `:G` pertaining to which boundary set the
fit came from.
raw docstring

classifyclj

(classify vs example)

Attempts to classify an example using the given version space vs. Returns ::positive, ::negative, or ::ambiguous if the boundaries G and S are incongruent.

Attempts to classify an `example` using the given version space `vs`.
Returns `::positive`, `::negative`, or `::ambiguous` if the boundaries
G and S are incongruent.
raw docstring

collapsed?clj

(collapsed? vs)
(collapsed? g s)

Returns if a version space vs or boundaries g and s have collapsed. That is, training data have caused the hypotheses to become inconsistent, making further classification impossible.

Returns if a version space `vs` or boundaries `g` and `s` have collapsed.
That is, training data have caused the hypotheses to become inconsistent,
making further classification impossible.
raw docstring

consistent?clj

(consistent? vs example)
(consistent? vs example positive?)

Returns true if all hypotheses in the version space vs's general and specific boundaries are consistent with the example features and classification.

Returns `true` if all hypotheses in the version space `vs`'s general and specific
boundaries are consistent with the `example` features and classification.
raw docstring

converged?clj

(converged? vs)
(converged? g s)

Returns if a version space vs or boundaries g and s have converged. That is, training has caused the boundaries to converge to a single case.

Returns if a version space `vs` or boundaries `g` and `s` have
converged. That is, training has caused the boundaries to converge to a single
case.
raw docstring

covers?clj

(covers? hypothesis example)

Takes a hypothesis from a version space and returns if the example is consistent with it.

Takes a `hypothesis` from a version space and returns if the `example` is
consistent with it.
raw docstring

explainclj

(explain vs example)

Returns a structure explaining how the classifier reaches a conclusion, given a version space vs and a compatible example.

The map returned contains the mappings:

  • :explain/classification -> the result of the call to classify
  • :explain/example -> the example given
  • explain/G -> a sequence of hypotheses coverage analysis structures in the G boundary
  • explain/S -> a sequence of hypotheses coverage analysis structures in the S boundary

The hypotheses coverage analyses contain the mappings:

  • :hypothesis -> The hypothesis inspected
  • :covers? -> true or false if the hypothesis covers the example
  • :similarity -> A ratio of hypothesis coverages over its arity
  • :mismatched-features -> a sequence of the features of the hypothesis that do not match the example

A mismatched feature of a hypothesis has the mappings:

  • :position -> the position of the feature in the hypothesis
  • :constraint -> the value or wildcard at that position

The information provided is sufficient for informing human-in-the-loop learning interactions.

Returns a structure explaining how the classifier reaches a conclusion,
given a version space `vs` and a compatible `example`.

The map returned contains the mappings:

- `:explain/classification` -> the result of the call to `classify`
- `:explain/example` -> the example given
- `explain/G` -> a sequence of hypotheses coverage analysis structures in the G boundary
- `explain/S` -> a sequence of hypotheses coverage analysis structures in the S boundary

The hypotheses coverage analyses contain the mappings:

- `:hypothesis` -> The hypothesis inspected
- `:covers?` -> true or false if the hypothesis covers the example
- `:similarity` -> A ratio of hypothesis coverages over its arity
- `:mismatched-features` -> a sequence of the features of the hypothesis that do not match the example

A mismatched feature of a hypothesis has the mappings:

- `:position` -> the position of the feature in the hypothesis
- `:constraint` -> the value or wildcard at that position

The information provided is sufficient for informing human-in-the-loop learning
interactions.
raw docstring

refineclj

(refine vs example)
(refine vs example positive?)

Given a version space vs and an example, returns a new version space with boundaries adjusted according to the given example's features and classification. An example is marked as positive by attaching a metadata mapping :positive? -> boolean or by passing a boolean as the last argument. The explicit classification argument will always dominate the metadata classification.

Given a version space `vs` and an `example`, returns a new version space
with boundaries adjusted according to the given example's features and
classification. An example is marked as positive by attaching a metadata mapping
`:positive?` -> boolean or by passing a boolean as the last argument. The
explicit classification argument will always dominate the metadata
classification.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close