## 5 The Strategy of Initial Learning of Categories with Prototypes
### Definition of the Strategy and Extended Computational Example
17 if\(\tau_{c}^{+}\
eq NULL\)then
18\(Core_{c}(o):=\{o^{+}:o^{+}\in E^{+}\wedge f(o^{+},o)\leq\tau_{c}^{+}\}\)
19 else
20\(Core_{c}(o):=\varnothing\);
21 // Compute an outer of potential \(c\). 22 if\(\tau_{c}^{-}\
eq NULL\)then
23\(Outer_{c}(o):=\{o^{-}:o^{-}\in E^{-}\wedge f(o^{-},o)\geq\tau_{c}^{-}\}\)
24 else
25\(Outer_{c}(o):=\varnothing\);
26 // Compute a boundary of potential \(c\). 27\(Boundary_{c}(o):=(E^{+}\cup E^{-})\setminus(Core_{c}(o)\cup Outer_{c}(o))\);
28 if\(|Core_{c}(o)|\geq|Boundary_{c}(o)\cap E^{+}|\)then
29 assign \(o_{c}^{*}:=o\);
30 add a category \(c\) with a prototype \(o_{c}^{*}\) and \(\tau_{c}^{+},\tau_{c}^{-}\) to the ontological knowledge base of the agent;
31 if\(o_{c}^{*}=NULL\)then
32 the model \(m_{c}\) is ill-defined and has not been learned;
```  
**Algorithm 1**Prototype-based strategy of learning categories. Execution of the strategy for the given input and the given assumptions leads to the following results:  
Initial computationsAccording to definitions from previous sections:  
* \(E^{+}=E_{c}^{+}(Exp_{c})=\{o_{1},o_{5},o_{7},o_{16}\}\),
* \(E^{-}=E_{c}^{-}(Exp_{c})=\{o_{6},o_{15},o_{17},o_{18}\}\),* \(\hat{E}_{c}^{+}(Exp_{c})=\{1_{0},1_{0},2_{0},2_{0},2_{16}\}\)_._ _Let us assume that the centroids of_ \(\hat{E}_{c}^{+}(Exp_{c})\) _are considered as the candidates for prototype. Thus, they need to satisfy the condition given by Equation (_14_). The set of such objects is as follows:_
* \(\quad\)_Candidates_ \(=\{o_{1},o_{4}\}\)_._  
_Iteration 1_  
_Let_ \(o_{4}\in Candidates\) _be chosen as a candidate for the prototype, i.e.,_ \(o=o_{4}\) _and_ \(Candidates=\{o_{1}\}\)_. Next, Hamming distance values_ \(f_{H}(o_{4},o^{+})\) _for all_ \(o^{+}\in E^{+}\) _and_ \(f_{H}(o_{4},o^{-})\) _for all_ \(o^{-}\in E^{-}\) _are computed, i.e.,_  
* \(f_{H}(o_{4},o_{1})=1,f_{H}(o_{4},o_{5})=1,f_{H}(o_{4},o_{7})=2,f_{H}(o_{4},o_{16 })=1\)_,_
* \(f_{H}(o_{4},o_{6})=1,f_{H}(o_{4},o_{15})=3,f_{H}(o_{4},o_{17})=2,f_{H}(o_{4},o_ {18})=2\)_._ _On this basis, we determine in turn_ \(f_{\min}^{-}(o_{4})=1\)_,_ \(f_{\max}^{+}(o_{4})=2\)_,_ \(F^{+}=\varnothing\)_,_ \(\tau_{c}^{+}=NULL\)_,_ \(F^{-}=\{3\}\)_, and_ \(\tau_{c}^{-}=3\)_, which leads to the following:_
* \(\quad\)_Boundary_\(c_{(}o_{4})=\{o_{1},o_{5},o_{6},o_{7},o_{16},o_{17},o_{18}\}\)_._ _The results achieved do not meet the condition for category_ \(c\) _to be accepted because_ \(|\)_Core_\(c_{(}o_{4})|=0<4=|\)_Boundary_\(c_{(}o_{4})\cap E^{+}|\)_. Since the set Candidates is not empty, the next iteration is possible._  
_Iteration 2_  
_Let the only object_ \(o_{1}\in Candidates\) _be chosen as a candidate for the prototype, i.e.,_ \(o=o_{1}\) _and_ \(Candidates=\varnothing\)_. Again, Hamming distance values_ \(f_{H}(o_{1},o^{+})\) _for all_ \(o^{+}\in E^{+}\) _and_ \(f_{H}(o_{1},o^{-})\) _for all_ \(o^{-}\in E^{-}\) _are computed, i.e.,_  
* \(f_{H}(o_{1},o_{1})=0,f_{H}(o_{1},o_{5})=2,f_{H}(o_{1},o_{7})=1,f_{H}(o_{1},o_{ 16})=2\)_,_
* \(f_{H}(o_{1},o_{6})=2,f_{H}(o_{1},o_{15})=2,f_{H}(o_{1},o_{17})=3,f_{H}(o_{1},o_ {18})=3\)_._  
_On this basis, we determine in turn_ \(f_{\min}^{-}(o_{1})=2\)_,_ \(f_{\max}^{+}(o_{1})=2\)_,_ \(F^{+}=\{0,1\}\)_,_ \(\tau_{c}^{+}=1\)_,_ \(F^{-}=\{3\}\)_, and_ \(\tau_{c}^{-}=3\)_, which leads to the following:_  
* \(\quad\)_Core_\(c_{(}o_{1})=\{o_{1},o_{7}\}\)_,_
* \(\quad\)_Outer_\(c_{(}o_{1})=\{o_{17},o_{18}\}\)_,_
* \(\quad\)_Boundary_\(c_{(}o_{1})=\{o_{5},o_{6},o_{15},o_{16}\}\)_._  
_In this case, the results achieved meet the condition for category_ \(c\) _to be accepted because_ \(|\)_Core_\(c_{(}o_{1})|=2\geq 2=|\)_Boundary_\(c_{(}o_{1})\cap E^{+}|\)_. In consequence, the object_ \(o_{4}\) _is assigned as the prototype_ \(o_{4}^{*}\) _to the properly established category_ \(c\) _with_ \(\tau_{c}^{+}\) _and_ \(\tau_{c}^{-}\) _as the category's thresholds. The category_ \(c\) _can be integrated with the ontological knowledge base._