zeeguu/core/word_scheduling/arts/tools/algo_parameter_approximator.py
def __calc_algorithm_result_stats(self, bookmark_exercises, verbose=False):
        """
        Calculate statistics based on the created AverageBookmarkExercise (list)
        """
        # get the amount of iterations run
        iterations = max(
            [max(
                map(lambda x: x[0], c.priorities)
                , default=0)
                for c in bookmark_exercises]
        ) + 1

        words_in_parallel = [0 for _ in range(0, iterations)]
        repetition_correct = []  # bookmark, iterations
        repetition_incorrect = []
        for bookmark_exercise in bookmark_exercises:
            # for words_in_parallel
            for priority_iteration in bookmark_exercise.priorities:
                if priority_iteration[1] != self.removed_bookmark_priority:
                    words_in_parallel[priority_iteration[0]] += 1

            # for repetition_correct_mean, repetition_incorrect_mean
            for i in range(0, len(bookmark_exercise.exercises_iteration) - 1):
                repetition_after = bookmark_exercise.exercises_iteration[i + 1] - \
                                   bookmark_exercise.exercises_iteration[i]
                if bookmark_exercise.exercises[i].outcome.correct:
                    repetition_correct.append(repetition_after)
                else:
                    repetition_incorrect.append(repetition_after)

        # remove all words that have not been covered at all
        words_in_parallel = list(filter((0).__ne__, words_in_parallel))

        words_in_parallel_mean = mean(words_in_parallel)
        repetition_correct_mean = mean(repetition_correct)
        repetition_incorrect_mean = mean(repetition_incorrect)

        if verbose:
            print('Concurrent words on average                        {:.4}, in raw: {:}'
                  .format(words_in_parallel_mean, words_in_parallel))

            print('Repetition of correct words on average for every   {:.4}, in raw: {:}'
                  .format(repetition_correct_mean, repetition_correct))

            print('Repetition of incorrect words on average for every {:.4}, in raw: {:}'
                  .format(repetition_incorrect_mean, repetition_incorrect))

        return [words_in_parallel_mean, repetition_correct_mean, repetition_incorrect_mean]

        Calculate statistics based on the created AverageBookmarkExercise (list)
        
Calculate statistics based on the created AverageBookmarkExercise (list)
Calculate statistics based on the created AverageBookmarkExercise ( list )
def __calc_algorithm_result_stats(self, bookmark_exercises, verbose=False):
        iterations = max(
            [max(
                map(lambda x: x[0], c.priorities)
                , default=0)
                for c in bookmark_exercises]
        ) + 1
        words_in_parallel = [0 for _ in range(0, iterations)]
        repetition_correct = []  
        repetition_incorrect = []
        for bookmark_exercise in bookmark_exercises:
            for priority_iteration in bookmark_exercise.priorities:
                if priority_iteration[1] != self.removed_bookmark_priority:
                    words_in_parallel[priority_iteration[0]] += 1
            for i in range(0, len(bookmark_exercise.exercises_iteration) - 1):
                repetition_after = bookmark_exercise.exercises_iteration[i + 1] - \
                                   bookmark_exercise.exercises_iteration[i]
                if bookmark_exercise.exercises[i].outcome.correct:
                    repetition_correct.append(repetition_after)
                else:
                    repetition_incorrect.append(repetition_after)
        words_in_parallel = list(filter((0).__ne__, words_in_parallel))
        words_in_parallel_mean = mean(words_in_parallel)
        repetition_correct_mean = mean(repetition_correct)
        repetition_incorrect_mean = mean(repetition_incorrect)
        if verbose:
            print('Concurrent words on average                        {:.4}, in raw: {:}'
                  .format(words_in_parallel_mean, words_in_parallel))
            print('Repetition of correct words on average for every   {:.4}, in raw: {:}'
                  .format(repetition_correct_mean, repetition_correct))
            print('Repetition of incorrect words on average for every {:.4}, in raw: {:}'
                  .format(repetition_incorrect_mean, repetition_incorrect))
        return [words_in_parallel_mean, repetition_correct_mean, repetition_incorrect_mean]
def __calc_algorithm_result_stats ( self , bookmark_exercises , verbose = False ) : iterations = max ( [ max ( map ( lambda x : x [ 0 ] , c . priorities ) , default = 0 ) for c in bookmark_exercises ] ) + 1 words_in_parallel = [ 0 for _ in range ( 0 , iterations ) ] repetition_correct = [ ] repetition_incorrect = [ ] for bookmark_exercise in bookmark_exercises : for priority_iteration in bookmark_exercise . priorities : if priority_iteration [ 1 ] != self . removed_bookmark_priority : words_in_parallel [ priority_iteration [ 0 ] ] += 1 for i in range ( 0 , len ( bookmark_exercise . exercises_iteration ) - 1 ) : repetition_after = bookmark_exercise . exercises_iteration [ i + 1 ] - bookmark_exercise . exercises_iteration [ i ] if bookmark_exercise . exercises [ i ] . outcome . correct : repetition_correct . append ( repetition_after ) else : repetition_incorrect . append ( repetition_after ) words_in_parallel = list ( filter ( ( 0 ) . __ne__ , words_in_parallel ) ) words_in_parallel_mean = mean ( words_in_parallel ) repetition_correct_mean = mean ( repetition_correct ) repetition_incorrect_mean = mean ( repetition_incorrect ) if verbose : print ( 'Concurrent words on average                        {:.4}, in raw: {:}' . format ( words_in_parallel_mean , words_in_parallel ) ) print ( 'Repetition of correct words on average for every   {:.4}, in raw: {:}' . format ( repetition_correct_mean , repetition_correct ) ) print ( 'Repetition of incorrect words on average for every {:.4}, in raw: {:}' . format ( repetition_incorrect_mean , repetition_incorrect ) ) return [ words_in_parallel_mean , repetition_correct_mean , repetition_incorrect_mean ]
Calculate statistics based on the created AverageBookmarkExercise (list)
Calculate statistics based on the created AverageBookmarkExercise ( list )
"""
        Calculate statistics based on the created AverageBookmarkExercise (list)
        """ # get the amount of iterations run # bookmark, iterations # for words_in_parallel # for repetition_correct_mean, repetition_incorrect_mean # remove all words that have not been covered at all
self
bookmark_exercises
verbose