<jupyter_start><jupyter_text>Template for you to use develop your model Copy this template cells to load in the filtered dataset that will be used to do CountVectorizer and TfidfTransformer REFERENCE NAIVE BAYES MODEL OR SVM NOTEBOOK FOR HELP DON'T COPY AND PASTE, TRY TO UNDERSTAND WHAT'S GOING ON Suggested steps for developing your model1. Load in the filtered title data into a DF --> These cells below2. Create a CountVectorizer and fit_transform it to the x_train dataset --> you will need to import the correct package        a. Save the outputted value --> this is the vectorized matrix of our dataset3. Repeat with the x_test dataset but use transform instead        a. Save as well4. Create a TfidfTransformer and fit_transform it to the vectorized training data from CountVectorizer        a. Save the outputted values --> this is the normalized vectorized maxtrix of our dataset5. Repeat (3) for TfidfTransformer6. Now create and train your model        a. THIS MAY DIFFER FROM HOW NAIVE BAYES AND SVM IS DONE --> DO YOUR RESEARCH        b. In most cases this step will only be a couple of lines7. Analyze the results        a. sklearn's metrics is a good tool<jupyter_code># Import necessary packages

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import metrics
from sklearn.metrics import accuracy_score
# Loads the filtered dataset and looks at the first 5 elements

df_titles_info = pd.read_csv('./output/US_count_vectorizer_dataset.csv')
df_titles_info.head()
# Split dataset into inputs(df_x) and outputs(df_y)
df_x = df_titles_info['filter_title']
df_y = df_titles_info['category_id']

# Buckets that we want to map to
target_names = list(df_titles_info['category_id'].unique())
# Split the datset 80% training, 20% testing
x_train, x_test, y_train, y_test = train_test_split(df_x, df_y, test_size=0.2, random_state=117)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.05392670157068063, 'fraction_numerical': 0.009424083769633508, 'mean_word_length': 4.587719298245614, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '184154', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 576, 'n_tokens_neox': 549, 'n_words': 250, 'path': 'Predictive Model Template.ipynb', 'repo_name': 'Vic-the-Legend/yt-trends', 'size': '1910'}