converting generator object to a list object (#1602)

* converting generator object to a list object

* Refactor: converting generator object to a list object

* fixup! Format Python code with psf/black push
This commit is contained in:
ELNS 2019-11-28 19:51:34 +03:30 committed by Christian Clauss
parent 4baf3972e1
commit f4a7c5066c

View File

@ -295,10 +295,10 @@ def main():
print("-" * 100) print("-" * 100)
# Calculating the value of probabilities for each class # Calculating the value of probabilities for each class
# An empty list to store values of probabilities for each class probabilities = [
probabilities = (
calculate_probabilities(counts[i], sum(counts)) for i in range(n_classes) calculate_probabilities(counts[i], sum(counts)) for i in range(n_classes)
) ]
# for loop iterates over number of elements in 'probabilities' list and print # for loop iterates over number of elements in 'probabilities' list and print
# out them in separated line # out them in separated line
for i, probability in enumerate(probabilities, 1): for i, probability in enumerate(probabilities, 1):