# Self-organizing map using weighted non-euclidean distance to minimize variance of predictions

Let's say I have a dataset, each item/row of which has $$\mathit{X + 1}$$ characteristics where the last characteristic (i.e., the $$\mathit{1}$$) represents the some value I want to predict, $$\mathit{Y}$$, based on a SOM trained on the $$\mathit{X}$$ characteristics. I want to organize the dataset into groups such that each group has a small variance among the respective $$\mathit{Y}$$ values. I believe I could do this by using a non-Euclidean distance to find the Best Matching Unit (BMU) based on applying weights to each dimension.

For example, given a node at (0,0) and weights for dimension $$\mathit{x}$$ of 1 and dimension $$\mathit{y}$$ of 2, a data point at (3,2) would have a weighted distance of 5 from the node, calculated as follows:

$$\sqrt{\mathit{(1 * (3 - 0)) ^ 2 + (2 * (2 - 0)) ^ 2}}$$

I don't think a simple linear regression would work to determine the weights because it would not take advantage of clustering.

The goal would be, for a new data point, to approximate a probability distribution of outcomes based on similarly-profiled data points in the training set (i.e., retrieve all of the training results with the same BMU and analyze the results). I think this might essentially just be replicating a deep feedforward network, but I'd like to try it.

Is there a way I could achieve this by modifying a SOM model or using a similar technique?