<jupyter_start><jupyter_text>**Import dependencies and mount google drive to access data**---<jupyter_code>from google.colab import drive 
drive.mount('/content/gdrive')
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn import tree
import pandas as pd<jupyter_output><empty_output><jupyter_text>**Read in csv file from Gdrive** **Analyzed the data**data was preprocessed before importing due to size of file. Original file had 90+ columns and many null/NaN values.  Team discussed the importance of the extra columns for the purpose of this code and decided it didn't have an impact on our objective.<jupyter_code># read the csv data into dataframe
df = pd.read_csv("/content/gdrive/MyDrive/usda_data.csv", index_col=None)
df.head()
df.dtypes
df.dropna<jupyter_output><empty_output><jupyter_text>**Start building our model**<jupyter_code># define our target
target = df["LILATracts_1And10"]
# create data set without target data
data = df.drop("LILATracts_1And10", axis=1)
feature_names = data.columns
data.head
# split data for training and testing
X_train, X_test, y_train, y_test = train_test_split(data, target, random_state=42)
# create decision tree model
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X_train, y_train)
clf.score(X_test, y_test)
# create random forest model
rf = RandomForestClassifier(n_estimators=200)
rf = rf.fit(X_train, y_train)
rf.score(X_test, y_test)
sorted(zip(rf.feature_importances_, feature_names), reverse=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08670181605155243, 'fraction_numerical': 0.008201523140011716, 'mean_word_length': 6.907407407407407, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '298047', 'license': 'MIT', 'n_tokens_mistral': 564, 'n_tokens_neox': 549, 'n_words': 167, 'path': 'data/test.ipynb', 'repo_name': 'ML-Final-UCF-Bootcamp-062021/ml-final-project', 'size': '1707'}