<jupyter_start><jupyter_text>Ensemble (voting)<jupyter_code>from si.data import Dataset, summary
from si.util import CrossValidationScore
import os
DIR = os.path.dirname(os.path.realpath('.'))
filename = os.path.join(DIR, 'datasets/breast-bin.data')
dataset = Dataset.from_data(filename)
summary(dataset)
dataset.toDataframe()
# Use accuracy as scorring function
from si.util import accuracy_score<jupyter_output><empty_output><jupyter_text>Decision Tree<jupyter_code>from si.supervised import DecisionTree
dt = DecisionTree()
cv = CrossValidationScore(dt,dataset,score=accuracy_score)
cv.run()
cv.toDataframe()<jupyter_output><empty_output><jupyter_text>Logistic regression<jupyter_code>from si.supervised import LogisticRegression
logreg = LogisticRegression()

cv = CrossValidationScore(logreg,dataset,score=accuracy_score)
cv.run()
cv.toDataframe()<jupyter_output><empty_output><jupyter_text>KNN<jupyter_code>from si.supervised import KNN
knn = KNN(7)
cv = CrossValidationScore(knn,dataset,score=accuracy_score)
cv.run()
cv.toDataframe()<jupyter_output><empty_output><jupyter_text>Ensemble<jupyter_code>from si.supervised import Ensemble, majority
en = Ensemble([dt,logreg,knn], majority, accuracy_score)
cv = CrossValidationScore(en,dataset,score=accuracy_score)
cv.run()
cv.toDataframe()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11489040060468632, 'fraction_numerical': 0.0007558578987150416, 'mean_word_length': 10.927927927927929, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '357908', 'license': 'Apache-2.0', 'n_tokens_mistral': 469, 'n_tokens_neox': 459, 'n_words': 71, 'path': 'scripts/eval3.ipynb', 'repo_name': 'pg42862/Sistemas_Inteligentes_para_a_MBIONF', 'size': '1323'}