def _maybe_classify(self, y, k, cutoffs):
rows, cols = y.shape<EOL>if cutoffs is None:<EOL><INDENT>if self.fixed:<EOL><INDENT>mcyb = mc.Quantiles(y.flatten(), k=k)<EOL>yb = mcyb.yb.reshape(y.shape)<EOL>cutoffs = mcyb.bins<EOL>k = len(cutoffs)<EOL>return yb, cutoffs[:-<NUM_LIT:1>], k<EOL><DEDENT>else:<EOL><INDENT>yb = np.array([mc.Quantiles(y[:, i], k=k).yb for i in<EOL>np.arange(cols)]).transpose()<EOL>return yb, None, k<EOL><DEDENT><DEDENT>else:<EOL><INDENT>cutoffs = list(cutoffs) + [np.inf]<EOL>cutoffs = np.array(cutoffs)<EOL>yb = mc.User_Defined(y.flatten(), np.array(cutoffs)).yb.reshape(<EOL>y.shape)<EOL>k = len(cutoffs)<EOL>return yb, cutoffs[:-<NUM_LIT:1>], k<EOL><DEDENT>
Helper method for classifying continuous data.