<jupyter_start><jupyter_text>RF model<jupyter_code>from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import pandas as pd<jupyter_output><empty_output><jupyter_text>Load data<jupyter_code>iris = load_iris()
X = iris.data
y = iris.target<jupyter_output><empty_output><jupyter_text>Split data<jupyter_code>X_train, X_test, y_train, y_test = train_test_split(X, y, random_state = 42, test_size=0.5)<jupyter_output><empty_output><jupyter_text>Model<jupyter_code>model = RandomForestClassifier(n_estimators = 10)
model.fit(X_train, y_train)
predicted = model.predict(X_test)
print(accuracy_score(predicted, y_test))<jupyter_output>0.96<jupyter_text>Pickle<jupyter_code>import pickle
with open('./model/rf.pkl', 'wb') as rf_pkl:
    pickle.dump(model, rf_pkl)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10554951033732318, 'fraction_numerical': 0.009793253536452665, 'mean_word_length': 10.645569620253164, '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': '560692', 'license': 'MIT', 'n_tokens_mistral': 371, 'n_tokens_neox': 361, 'n_words': 52, 'path': 'udemy_course/iris_flower/iris_rf.ipynb', 'repo_name': 'Nempickaxe/flask_learn', 'size': '919'}