def get_phi(self, scalar=None):
<EOL>if ((not self._scalar_stats and not scalar and self._num_classes > <NUM_LIT:2>) or<EOL>((scalar is False or self._scalar_stats is False) and self._num_classes > <NUM_LIT:1>)):<EOL><INDENT>phi = PrettyDict()<EOL>for pos_label in self.columns:<EOL><INDENT>tp, tn, fp, fn = dataframe_tptnfpfn(self, pos_label=pos_label, labels=self.columns)<EOL>phi[pos_label] = tptnfpfn_mcc(tp=tp, tn=tn, fp=fp, fn=fn)<EOL><DEDENT>return pd.Series(phi)<EOL><DEDENT>return tptnfpfn_mcc(self._tp, self._tn, self._fp, self._fn)<EOL>
Phi (φ) Coefficient -- lack of confusion
        Arguments:
          scalar (bool or None): Whether to return a scalar Phi coefficient
          (assume binary classification) rather than a multiclass vector
        Measure of the lack of confusion in a single value
        References:
          [MCC on wikipedia](https://en.wikipedia.org/wiki/Matthews_correlation_coefficient)
          [docs on R implementation](http://www.personality-project.org/r/html/phi.html)
        φ =   (TP*TN - FP*FN) / sqrt((TP+FP) * (TP+FN) * (TN+FP) * (TN+FN))
        mcc = (tp*tn - fp*fn) / sqrt((tp+fp) * (tp+fn) * (tn+fp) * (tn+fn))