## 5 The Strategy of Initial Learning of Categories with Prototypes
### Definition of the Strategy and Extended Computational Example  
The category learning steps discussed above are integrated in the form of a strategy which is presented below as Algorithm 1. The input data is given as a learning set \(Exp_{c}\in\hat{\Pi}(T^{c})\) and the algorithm consists of the following:  
* preparatory steps (lines 2-4) that define a variable \(o_{c}^{\star}\) used to evaluate a STOP condition of the algorithm, determine sets of objects confirmed as \(c\) (the set \(E_{c}^{+}(Exp_{c})\)) and rejected as \(c\) (the set \(E_{c}^{-}(Exp_{c})\)) within the learning experience,
* preparation of a set of candidates (line 5) using _extractCandidates_ function,
* a general evaluation loop for candidates (condition in line 6),
* evaluation of distance values and potential radii values, and _Core/Boundary/Outer_ for a particular candidate (lines 7-25),
* the final condition check (line 26) and an eventual choice of the prototype (line 27). An exhaustive list of potential adjustments and (both interpretation-related and computational) modifications to the strategy introduced above can be found in [64]. We can give the following extended example of how the strategy works:  
**Example 4**. : _Let the agent be equipped with a basic mental space \(O=V_{a_{1}}\times V_{a_{2}}\times V_{a_{3}}\times V_{a_{4}}=\{o_{1},\ldots,o_{2 4}\}\), where domains of assumed attributes are given as \(V_{a_{1}}=V_{a_{2}}=V_{a_{3}}=\{0,1\}\) and \(V_{a_{4}}=\{0,1,2\}\) (see Definition4). Thus, the basic mental space cognitively available to the agent is a set of vectors of the fixed length \(n=4\), e.g., \(o_{1}=[0000]\), \(o_{2}=[0001]\), \(o_{3}=[0002]\), \(o_{4}=[0010]\), \(o_{5}=[0011]\), \(o_{6}=[0012]\), \(o_{7}=[0100]\), \(o_{8}=[0101]\), \(o_{9}=[0102]\), \(o_{10}=[0110]\), \(o_{11}=[0111]\), \(o_{12}=[0112]\), \(o_{13}=[1000]\), \(o_{14}=[1001]\), \(o_{15}=[1002]\), \(o_{16}=[1010]\), \(o_{17}=[1011]\), \(o_{18}=[1012]\), \(o_{19}=[1100]\), \(o_{20}=[1101]\), \(o_{21}=[1102]\), \(o_{22}=[1110]\), \(o_{23}=[1111]\), \(o_{24}=[1112]\)._  
_Let us also assume that the basic mental space is enriched with the classic Hamming distance \(f_{H}:O\times O\to\mathbb{N}\), such that \(\forall o_{i},o_{j}\in O\;f_{H}(o_{i},o_{j})=\sum_{a\in A}f_{\
eq}(o_{i}|a),o_{ j}|a)\), where: \(f_{\
eq}(v,w)= \begin{cases}0\;\Leftrightarrow\;v=w\\ 1\;\Leftrightarrow\;v\
eq w.\end{cases} \)_  
_Let the Hamming distance \(f_{H}\) be the chosen function \(f\) in this example use of Algorithm 1, i.e., \(f=f_{H}\)._Finally, let the following set of learning examples be given as \(Exp_{c}=\{1(o_{1},\text{is-}c),1(o_{5},\text{is-}c),\)\(1(o_{6},\text{not-}c),2(o_{7},\text{is-}c),2(o_{15},\text{not-}c),2(o_{16},\text{is-}c),1(o_{17}, \text{not-}c),1(o_{18},\text{not-}c)\}\). ```
Input:\(\,\)cognitive model \(m_{c}\) of the category \(c\),  set of episodes \(Episodes(t)\). Output:updated cognitive model \(m_{c}\). 1\(Exp_{c}:=Preprocess(Episodes(t))\);
2 initialize a chosen prototype as \(o_{c}^{*}:=NULL\);
3\(E^{+}:=E_{c}^{+}(Exp_{c})\);
4\(E^{-}:=E_{c}^{-}(Exp_{c})\);
5 compute the set \(Candidates:=extractCandidates(\hat{E}_{c}^{+}(Exp_{c}))\);
6 whileCandidates \(\
eq\varnothing\wedge o_{c}^{*}=NULL\)do
7 choose a prototype candidate \(o\in Candidates\);
8\(Candidates:=Candidates\setminus\{o\}\);
9 compute distance values \(f(o^{+},o)\) for \(o^{+}\in E^{+}\);
10 compute distance values \(f(o^{-},o)\) for \(o^{-}\in E^{-}\);
11\(f_{\text{min}}^{-}(o):=\min\limits_{o^{+}\in E^{+}}\{f(o^{-},o)\}\);
12\(f_{\text{max}}^{+}(o):=\max\limits_{o^{+}\in E^{+}}\{f(o^{+},o)\}\);
13\(F^{+}:=\{f(o^{+},o):o^{+}\in E^{+}\wedge f(o^{+},o)<f_{\text{min}}^{-}(o)\}\);
14 compute a radius of the core \(\tau_{c}^{+}:= \begin{cases}\max\{f\in F^{+}\}&F^{+}\
eq\varnothing\\ NULL&F^{+}=\varnothing\end{cases} \);
15\(F^{-}:=\{f(o^{-},o):o^{-}\in E^{-}\wedge f(o^{-},o)>f_{\text{max}}^{+}(o)\}\);
16 compute a radius of the boundary \(\tau_{c}^{-}:= \begin{cases}\min\{f\in F^{-}\}&F^{-}\
eq\varnothing\\ NULL&F^{-}=\varnothing\end{cases} \); // Compute acore of potential \(c\).