A general model for plane-based clustering with loss function