<jupyter_start><jupyter_text>train test split<jupyter_code>from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test = train_test_split(x,y,test_size=0.3,random_state=0)<jupyter_output><empty_output><jupyter_text>Random forest_Clasifier<jupyter_code>from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier()
classifier.fit(x_train,y_train)<jupyter_output><empty_output><jupyter_text>prediction<jupyter_code>y_pred = classifier.predict(x_test)<jupyter_output><empty_output><jupyter_text>check accuracy<jupyter_code>from sklearn.metrics import accuracy_score
score = accuracy_score(y_test,y_pred)
score<jupyter_output><empty_output><jupyter_text>create pickle %%file<jupyter_code>import pickle
pickle_out = open("classifier.pkl","wb")
pickle.dump(classifier, pickle_out)
pickle_out.close()
import numpy as np

classifier.predict([[1,3,4,1]])<jupyter_output>C:\Users\Tarek\anaconda3\envs\myenv\lib\site-packages\sklearn\base.py:445: UserWarning: X does not have valid feature names, but RandomForestClassifier was fitted with feature names
  warnings.warn(
{'fraction_non_alphanumeric': 0.1045045045045045, 'fraction_numerical': 0.00990990990990991, 'mean_word_length': 12.548780487804878, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '171310', 'license': 'MIT', 'n_tokens_mistral': 415, 'n_tokens_neox': 408, 'n_words': 52, 'path': 'bna.ipynb', 'repo_name': 'jamiltarek550/Dockers_demo', 'size': '1110'}