|
Algorithm 2. Variable selection pseudocode. |
|
input: List of all explanatory variables , distance function , correlation matrix (), target variable () |
|
output: List of the best explanatory variables () |
| 1: create empty cluster list
|
| 2: for each
= 1 to
do
|
| 3: create a cluster for each variable
|
| 4: end
|
| 5: calculate distance matrix as
|
| 6: repeat
|
| 7: = find smallest element in for all
|
| 8: if
then
|
| 9: break repeat
|
| 10: end
|
| 11: merge cluster and cluster
|
| 12: update distance matrix
|
| 13: end
|
| 14: create empty
|
| 15: for each
= 1 to
do
|
| 16: = estimate mean square error of -th variable for prediction of
|
| 17: update based on
|
| 18: end
|
| 19: for each
do
|
| 20: select variable based on the and add to
|
| 21: end
|
| 22: return
|