Last active
February 29, 2020 22:37
-
-
Save comtom/8f4a56d4edc3fdce7769be7a37a778b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from predict import predict | |
def make_predictions(filename): | |
result = [] | |
for i in range(3): | |
result.append(predict(filename, model=i)) | |
print(result) | |
return result | |
def find_winner(result_vector): | |
winning_class = 0 | |
counter = 0 | |
for i in result_vector: | |
curr_frequency = result_vector.count(i) | |
if (curr_frequency >= counter): | |
counter = curr_frequency | |
winning_class = i | |
return winning_class | |
if __name__ == '__main__': | |
filename = sys.argv[1] | |
result_vector = make_predictions(filename) | |
winner = find_winner(result_vector) | |
print(f'La prediccion del ensamble es clase: {winner}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment