<jupyter_start><jupyter_text>PIBIC ImagesGerando imagens que serão usadas no artigo. Importando bibliotecas<jupyter_code>import numpy as np
import pandas as pd
import seaborn as sns

from pywt import wavedec
from zipfile import ZipFile
from matplotlib import pyplot as plt

sns.set(
  # style='darkgrid',
  rc={'figure.figsize':(8, 6)}
)<jupyter_output><empty_output><jupyter_text>Figura 2 EEG do sinal 0 do paciente 11. versão sem crise2. versão com crise<jupyter_code>with ZipFile(f'chb01/chb01.zip', mode='r') as file:
    positive = next(file_name for file_name in file.namelist() if 'positive' in file_name)
    negative = next(file_name for file_name in file.namelist() if 'negative' in file_name)

    with file.open(positive) as pos, file.open(negative) as neg:
        pos_df = pd.Series(data=np.load(pos)[0])
        neg_df = pd.Series(data=np.load(neg)[0])
        
        sns.lineplot(data=pos_df).set(ylim=(-5, 6), ylabel='mV')
        plt.show()
        sns.lineplot(data=neg_df).set(ylim=(-5, 6), ylabel='mV')<jupyter_output><empty_output><jupyter_text>Figura 3 Coeficientes obtidos da DWT do sinal sem crise da figura 21. coeficiente de aproximação2. coeficiente de detalhe<jupyter_code>aprox, detail = wavedec(data=neg_df, wavelet='db2', level=1)

sns.lineplot(data=aprox).set(ylim=(-5, 7), ylabel='mV')
plt.show()
sns.lineplot(data=detail).set(ylim=(-5, 7), ylabel='mV')<jupyter_output><empty_output><jupyter_text>Figura 5 Boxplot de acurácias do SVM de todos os canais vs alguns<jupyter_code>svm_acc_df = pd.read_csv(filepath_or_buffer='csvs/svc-oneVSall.csv')
svm_acc_df.pop('chb')
svm_acc_df
svm_acc_df\
    .boxplot(rot=5)\
        .set(
            xticklabels=['todos os canais', 'canais 2, 3, 6, 7, 14, 15', 'canais 1, 2, 3, 5, 6, 7, 14, 15'],
            ylabel='acurácia'
        )

svm_acc_df.describe()<jupyter_output><empty_output><jupyter_text>Figura ```boxplot_knn_canais```<jupyter_code>acc_canais_df = pd.read_csv('./csvs/02-ranks.csv', index_col=0).transpose()
acc_canais_df
acc_canais_df.boxplot().set(ylabel='acurácia', xlabel='canais')
plt.axhline(y=0.885)
acc_canais_df.describe()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1386046511627907, 'fraction_numerical': 0.025116279069767444, 'mean_word_length': 5.181034482758621, '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': '43237', 'license': 'MIT', 'n_tokens_mistral': 922, 'n_tokens_neox': 870, 'n_words': 172, 'path': 'ML/f02-chb/14-pibic_images.ipynb', 'repo_name': 'newtmagalhaes/Machine-Learning', 'size': '2150'}