<jupyter_start><jupyter_text>Lendo base de dados<jupyter_code>import pandas as pd

df = pd.read_csv('../dataset/ml-100k/u.item', sep='|', header=None)
df.head()<jupyter_output><empty_output><jupyter_text>Criando metadados de itens<jupyter_code>df_gen = df.iloc[:,4:]

metadata = []
for row in df_gen.iterrows():
    for g, gen in enumerate(row[1]):
        item = df[0][row[0]]
        if gen != 0:
            metadata.append((item, g))
    

gen_df = pd.DataFrame(metadata)

gen_df.to_csv('../dataset/ml-100k/item_metadata.dat', header=None, sep='\t', index=False)<jupyter_output><empty_output><jupyter_text>Lendo arquivo de interações e substituindo id por nome do filme<jupyter_code>df_rating = pd.read_csv('../dataset/ml-100k/u.data', sep='\t', header=None)
df_rating[1] = df_rating[1].map(df.set_index(0)[1])
df_rating[df_rating[0] == 1]<jupyter_output><empty_output><jupyter_text>Gerando Recomendações<jupyter_code># rank = '/home/fortesarthur/Documentos/dataset/ml-100k/my/folds/0/output.dat'

# df_rank = pd.read_csv(rank, sep='\t', header=None)
# print(df_rank[df_rank[0] == 1])
# # df_rank[1] = df[1][df[0]==df_rank[1]]

# df_rank[1] = df_rank[1].map(df.set_index(0)[1])
# df_rank[df_rank[0] == 1]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18497576736672053, 'fraction_numerical': 0.029079159935379646, 'mean_word_length': 5.733695652173913, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '470018', 'license': 'MIT', 'n_tokens_mistral': 543, 'n_tokens_neox': 525, 'n_words': 71, 'path': 'dataset/Workshop_RecSys_SciPyLa2018-master/notebooks/Base de Filmes.ipynb', 'repo_name': 'VitorPaes/hackathon_stn', 'size': '1238'}