def get_specificity(self, scalar=None):
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>spec = PrettyDict()<EOL>for pos_label in self.columns:<EOL><INDENT>neg_labels = [label for label in self.columns if label != pos_label]<EOL>tn = sum(self[label][label] for label in neg_labels)<EOL>fp = self.loc[neg_labels].sum()[pos_label]<EOL>assert(self[pos_label][neg_labels].sum() == fp)<EOL>spec[pos_label] = float(tn) / (tn + fp)<EOL><DEDENT>return pd.Series(spec)<EOL><DEDENT>return self._binary_specificity<EOL>
True_Negative / (True_Negative + False_Positive)