A general stochastic clustering method for automatic cluster discovery