nussl/evaluation/evaluation_base.py
def evaluate(self):
        """
        This function encapsulates the main functionality of all evaluation classes.
        It performs the following steps, some of which must be implemented in subclasses
        of EvaluationBase.

            1. Preprocesses the data somehow into numpy arrays that get passed into your
               evaluation function.
            2. Gets all possible candidates that will be evaluated in your evaluation function.
            3. For each candidate, runs the evaluation function (must be implemented in subclass).
            4. Finds the results from the best candidate.
            5. Returns a dictionary containing those results.

        Steps 1 and 3 must be implemented by the subclass while the others are implemented
        by EvaluationBase.
        
        Returns:
            A dictionary containing the scores for each source for the best candidate.

        """
        references, estimates = self.preprocess()
        combos, orderings = self.get_candidates()
        
        best_permutation_key = self.best_permutation_key
        scores = []
        metrics = []

        for k, combo in enumerate(combos):
            _estimates = estimates[..., combo]
            for o, order in enumerate(orderings):
                _scores = self.evaluate_helper(
                    references[..., order], _estimates, **self.eval_args)

                if not best_permutation_key or best_permutation_key not in _scores[0]:
                    best_permutation_key = sorted(_scores[0].keys())[0]

                _metrics = []
                for _score in _scores:
                    _metrics.extend(_score[best_permutation_key])

                metrics.append(np.mean(_metrics))
                scores.append((combo, order, _scores))
            
        best_idx = np.argmax(metrics)
        combo, order, score = scores[best_idx]
        results = {
            'combination': combo,
            'permutation': order
        }

        for i, o in enumerate(order):
            results[self.source_labels[o]] = score[i]
        self._scores = results

        return results

        This function encapsulates the main functionality of all evaluation classes.
        It performs the following steps, some of which must be implemented in subclasses
        of EvaluationBase.

            1. Preprocesses the data somehow into numpy arrays that get passed into your
               evaluation function.
            2. Gets all possible candidates that will be evaluated in your evaluation function.
            3. For each candidate, runs the evaluation function (must be implemented in subclass).
            4. Finds the results from the best candidate.
            5. Returns a dictionary containing those results.

        Steps 1 and 3 must be implemented by the subclass while the others are implemented
        by EvaluationBase.
        
        Returns:
            A dictionary containing the scores for each source for the best candidate.

        
This function encapsulates the main functionality of all evaluation classes.
It performs the following steps, some of which must be implemented in subclasses
of EvaluationBase.

1. Preprocesses the data somehow into numpy arrays that get passed into your
evaluation function.
2. Gets all possible candidates that will be evaluated in your evaluation function.
3. For each candidate, runs the evaluation function (must be implemented in subclass).
4. Finds the results from the best candidate.
5. Returns a dictionary containing those results.

Steps 1 and 3 must be implemented by the subclass while the others are implemented
by EvaluationBase.
This function encapsulates the main functionality of all evaluation classes . It performs the following steps some of which must be implemented in subclasses of EvaluationBase . 1 . Preprocesses the data somehow into numpy arrays that get passed into your evaluation function . 2 . Gets all possible candidates that will be evaluated in your evaluation function . 3 . For each candidate runs the evaluation function ( must be implemented in subclass ) . 4 . Finds the results from the best candidate . 5 . Returns a dictionary containing those results . Steps 1 and 3 must be implemented by the subclass while the others are implemented by EvaluationBase .
def evaluate(self):
        references, estimates = self.preprocess()
        combos, orderings = self.get_candidates()
        best_permutation_key = self.best_permutation_key
        scores = []
        metrics = []
        for k, combo in enumerate(combos):
            _estimates = estimates[..., combo]
            for o, order in enumerate(orderings):
                _scores = self.evaluate_helper(
                    references[..., order], _estimates, **self.eval_args)
                if not best_permutation_key or best_permutation_key not in _scores[0]:
                    best_permutation_key = sorted(_scores[0].keys())[0]
                _metrics = []
                for _score in _scores:
                    _metrics.extend(_score[best_permutation_key])
                metrics.append(np.mean(_metrics))
                scores.append((combo, order, _scores))
        best_idx = np.argmax(metrics)
        combo, order, score = scores[best_idx]
        results = {
            'combination': combo,
            'permutation': order
        }
        for i, o in enumerate(order):
            results[self.source_labels[o]] = score[i]
        self._scores = results
        return results
def evaluate ( self ) : references , estimates = self . preprocess ( ) combos , orderings = self . get_candidates ( ) best_permutation_key = self . best_permutation_key scores = [ ] metrics = [ ] for k , combo in enumerate ( combos ) : _estimates = estimates [ ... , combo ] for o , order in enumerate ( orderings ) : _scores = self . evaluate_helper ( references [ ... , order ] , _estimates , ** self . eval_args ) if not best_permutation_key or best_permutation_key not in _scores [ 0 ] : best_permutation_key = sorted ( _scores [ 0 ] . keys ( ) ) [ 0 ] _metrics = [ ] for _score in _scores : _metrics . extend ( _score [ best_permutation_key ] ) metrics . append ( np . mean ( _metrics ) ) scores . append ( ( combo , order , _scores ) ) best_idx = np . argmax ( metrics ) combo , order , score = scores [ best_idx ] results = { 'combination' : combo , 'permutation' : order } for i , o in enumerate ( order ) : results [ self . source_labels [ o ] ] = score [ i ] self . _scores = results return results
This function encapsulates the main functionality of all evaluation classes.
This function encapsulates the main functionality of all evaluation classes .
"""
        This function encapsulates the main functionality of all evaluation classes.
        It performs the following steps, some of which must be implemented in subclasses
        of EvaluationBase.

            1. Preprocesses the data somehow into numpy arrays that get passed into your
               evaluation function.
            2. Gets all possible candidates that will be evaluated in your evaluation function.
            3. For each candidate, runs the evaluation function (must be implemented in subclass).
            4. Finds the results from the best candidate.
            5. Returns a dictionary containing those results.

        Steps 1 and 3 must be implemented by the subclass while the others are implemented
        by EvaluationBase.
        
        Returns:
            A dictionary containing the scores for each source for the best candidate.

        """
A dictionary containing the scores for each source for the best candidate.
A dictionary containing the scores for each source for the best candidate .
self