Stateful interface
ComputerAdaptiveTesting.Stateful
— ModuleThis module defines the interface for a stateful CAT as well as an implementation in terms of CatRules. The interface is meant to enable polymorphic use of different CAT implementations.
Interface
ComputerAdaptiveTesting.Stateful.StatefulCat
— Typeabstract type StatefulCat
Abstract supertype for implementation of the stateful CAT interface.
ComputerAdaptiveTesting.Stateful.next_item
— Functionnext_item(config::StatefulCat) -> IndexT
Returns the index of the best next item according to the CAT.
Ideally IndexT
will be an integer and the return type a 1-based index, however it should at least be the same type as accepted by add_response!.
ComputerAdaptiveTesting.Stateful.ranked_items
— Functionranked_items(config::StatefulCat) -> AbstractVector{IndexT}
Return a vector of indices of the sorted from best to worst item according to the CAT.
ComputerAdaptiveTesting.Stateful.item_criteria
— Functionitem_criteria(config::StatefulCat) -> AbstractVector{CriteriaT}
Returns a vector of criteria values for each item in the item bank.
The criteria can vary, but should attempt to interoperate with ComputerAdaptiveTesting.jl.
ComputerAdaptiveTesting.Stateful.add_response!
— Functionjulia add_response!(config::StatefulCat, index::IndexT, response::ResponseT)
`
The exact response type ResponseT
depends on the item bank. It should be chosen to interoperate with any equivalent item bank according to the implementation in ComputerAdaptiveTesting.jl
.
ComputerAdaptiveTesting.Stateful.rollback!
— Functionrollback!(config::StatefulCat)
Rollback the last response added with add_response!.
Some CAT implementations may not support this operation in which case they will throw an error.
ComputerAdaptiveTesting.Stateful.reset!
— Functionreset!(config::StatefulCat)
Reset the CAT to its initial state, removing all responses.
ComputerAdaptiveTesting.Stateful.set_item_bank!
— Functionset_item_bank!(config::StatefulCat, item_bank::AbstractItemBank)
Set the current item bank of the CAT. This will also reset the CAT to its initial state, removing all responses.
Some CAT implementations may not support this operation in which case they will throw an error.
ComputerAdaptiveTesting.Stateful.get_responses
— Functionget_responses(config::StatefulCat) -> Tuple{AbstractVector{IndexT}, AbstractVector{ResponseT}}
Returns a tuple of the indices and responses of the items that have been added to the CAT with add_response! so far.
ComputerAdaptiveTesting.Stateful.get_ability
— Functionget_ability(config::StatefulCat) -> AbilityT
Return the current ability estimate according to the CAT. The type of the ability estimate AbilityT
depends on the CAT implementation but should attempt to interoperate with ComputerAdaptiveTesting.jl.
CatRules implementation
There is an implementation in terms of CatRules:
ComputerAdaptiveTesting.Stateful.StatefulCatConfig
— Typestruct StatefulCatConfig{TrackedResponsesT<:ComputerAdaptiveTesting.Aggregators.TrackedResponses} <: ComputerAdaptiveTesting.Stateful.StatefulCat
This is a the StatefulCat
implementation in terms of CatRules
. It is also the de-facto standard for the behavior of the interface.
Usage
Just as CatLoopConfig can wrap CatRules, you can also use it with any implementor of Stateful.StatefulCat, and run using Sim.run_cat.