ktrain/vision/predictor.py
def analyze_valid(self, generator, print_report=True, multilabel=None):
        """
        Makes predictions on validation set and returns the confusion matrix.
        Accepts as input a genrator (e.g., DirectoryIterator, DataframeIterator)
        representing the validation set.


        Optionally prints a classification report.
        Currently, this method is only supported for binary and multiclass 
        problems, not multilabel classification problems.

        """
        if multilabel is None:
            multilabel = U.is_multilabel(generator)
        if multilabel:
            warnings.warn('multilabel_confusion_matrix not yet supported - skipping')
            return

        y_true = generator.classes
        y_pred = self.model.predict_generator(generator)
        y_pred = np.argmax(y_pred, axis=1)
        if print_report:
            print(classification_report(y_true, y_pred, target_names=self.c))
        if not multilabel:
            cm_func = confusion_matrix
            cm =  cm_func(y_true,  y_pred)
        else:
            cm = None
        return cm

        Makes predictions on validation set and returns the confusion matrix.
        Accepts as input a genrator (e.g., DirectoryIterator, DataframeIterator)
        representing the validation set.


        Optionally prints a classification report.
        Currently, this method is only supported for binary and multiclass 
        problems, not multilabel classification problems.

        
Makes predictions on validation set and returns the confusion matrix.
Accepts as input a genrator
representing the validation set.

Optionally prints a classification report.
Currently, this method is only supported for binary and multiclass
problems, not multilabel classification problems.
Makes predictions on validation set and returns the confusion matrix . Accepts as input a genrator representing the validation set . Optionally prints a classification report . Currently this method is only supported for binary and multiclass problems not multilabel classification problems .
def analyze_valid(self, generator, print_report=True, multilabel=None):
        if multilabel is None:
            multilabel = U.is_multilabel(generator)
        if multilabel:
            warnings.warn('multilabel_confusion_matrix not yet supported - skipping')
            return
        y_true = generator.classes
        y_pred = self.model.predict_generator(generator)
        y_pred = np.argmax(y_pred, axis=1)
        if print_report:
            print(classification_report(y_true, y_pred, target_names=self.c))
        if not multilabel:
            cm_func = confusion_matrix
            cm =  cm_func(y_true,  y_pred)
        else:
            cm = None
        return cm
def analyze_valid ( self , generator , print_report = True , multilabel = None ) : if multilabel is None : multilabel = U . is_multilabel ( generator ) if multilabel : warnings . warn ( 'multilabel_confusion_matrix not yet supported - skipping' ) return y_true = generator . classes y_pred = self . model . predict_generator ( generator ) y_pred = np . argmax ( y_pred , axis = 1 ) if print_report : print ( classification_report ( y_true , y_pred , target_names = self . c ) ) if not multilabel : cm_func = confusion_matrix cm = cm_func ( y_true , y_pred ) else : cm = None return cm
Makes predictions on validation set and returns the confusion matrix.
Makes predictions on validation set and returns the confusion matrix .
"""
        Makes predictions on validation set and returns the confusion matrix.
        Accepts as input a genrator (e.g., DirectoryIterator, DataframeIterator)
        representing the validation set.


        Optionally prints a classification report.
        Currently, this method is only supported for binary and multiclass 
        problems, not multilabel classification problems.

        """
self
generator
print_report
multilabel