removeRareFeatures function

A function that removes rare features from the data