The viewpoint selection package - mtpearce/idyom GitHub Wiki
The top-level idyom:idyom
function supports viewpoint selection (see above), i.e. searching a space of viewpoints. This uses two functions: run-hill-climber
and run-best-first
, which take 4 arguments:
- a list of viewpoints: the algorithm searches through the space of combinations of these viewpoints
- a start state (usually nil, the empty viewpoint system)
- an evaluation function returning a numeric performance metric: e.g., the mean information content of the dataset returned by
dataset-prediction
- a symbol describing which way to optimise the metric:
:desc
mean lower values are better:asc
mean greater values are better
Here is an example:
CL-USER> (viewpoint-selection:run-hill-climber
'(:cpitch :cpintfref :cpint :contour)
nil
#'(lambda (viewpoints)
(utils:round-to-nearest-decimal-place
(resampling:output-information-content
(resampling:dataset-prediction 0 '(cpitch) viewpoints :k 10 :models :both+)
1)
2))
:desc)
=============================================================================
System Score
-----------------------------------------------------------------------------
NIL NIL
(CPITCH) 2.52
(CPINT CPITCH) 2.43
(CPINTFREF CPINT CPITCH) 2.38
=============================================================================
#S(VIEWPOINT-SELECTION::RECORD :STATE (:CPINTFREF :CPINT :CPITCH) :WEIGHT 2.38)
Since this can be quite a time consuming process, there are also functions for caching the results.
(initialise-vs-cache)
(load-vs-cache filename package)
(store-vs-cache filename package)