I have a set of labeled samples each containing up to 300 different objects. For every object I have a set of features describing the object.
- Sample with label '1': 50 objects of type 1, 20 of type 2 (=70 total)
- Sample with label '2': 100 objects of type 1, 30 of type 3 (=130 total)
Now I want to find the best clustering that results in highest accuracy after classification. And I don't know how many object-types I should use and how these types should be described.
Current workflow is like that:
- find the clusters for all objects from all samples (300 in our example) using self-organized maps using the features I have for each object.
- Calculate the cluster representation of each sample by finding the best matching unit and make a 2d-histogram (kind of a 'hit-map' for the SOM)
- Train a random-forest model with the cluster representation (from step 2) and get the accuracy of a validation set.
- start over at step 1
My Problem is that step 1 is independent from step 3. So the self-organized maps find clusters that might or might not lead to a better classification in step 3. I need a way to feed the accuracy of step 4 into the SOM training algorithm.
Any suggestions how to do that?