<jupyter_start><jupyter_text>Importing data<jupyter_code>data=pd.read_csv('Social_Network_Ads.csv')
print(data.head())
data.describe()<jupyter_output><empty_output><jupyter_text>Checking null values<jupyter_code>data.isnull().sum()<jupyter_output><empty_output><jupyter_text>Splitting data<jupyter_code>from sklearn.model_selection import train_test_split
x=data.iloc[:,:-1].values
y=data.iloc[:,-1].values.reshape(-1,1)
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.25,random_state=0)<jupyter_output><empty_output><jupyter_text>Feature Scaling<jupyter_code>from sklearn.preprocessing import StandardScaler
sc=StandardScaler()
x_train=sc.fit_transform(x_train)
x_test=sc.transform(x_test)<jupyter_output><empty_output><jupyter_text>Model Build and Train<jupyter_code>from sklearn.ensemble import RandomForestClassifier
rmc=RandomForestClassifier(n_estimators=100,criterion='entropy',random_state=0)
rmc.fit(x_train,y_train)
rmc.score(x_train,y_train)<jupyter_output><empty_output><jupyter_text>prediction using model<jupyter_code>y_pred=rmc.predict(x_test).reshape(-1,1)
print(np.concatenate((y_test,y_pred),axis=1))<jupyter_output>[[0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [0 1]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 1]
 [0 1]
 [0 0]
 [1 1]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [1 1]
 [0 0]
 [1 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [1 0]
 [1 1]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [1 1]
 [1 1]
 [0 0]
 [0 0]
 [0 0]
 [1 1]
 [1 1]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [1 1]
 [0 0]
 [1 1]
 [0 0]
 [0 0]
 [0 0]
 [0 1]
 [1 1]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [0 0]
 [0 0]
 [0 0]
 [1 1]
 [1 1]
 [1 1]
 [0 1]
 [0 0]
 [0 0]
 [1 1]
 [1 0]
 [0 0]
 [1 1]
 [1 1]
 [0 0]
 [0 0]
 [1 1]
 [0 0]
 [0 0]
 [0 0]
 [1 0]
 [0 0]
 [1 1]
 [1 1]
 [1 1]]<jupyter_text>Model Accuracy<jupyter_code>from sklearn.metrics import accuracy_score
accuracy_score(y_test,y_pred)<jupyter_output><empty_output><jupyter_text>Confusion Matrix<jupyter_code>from sklearn.metrics import confusion_matrix
confusion_matrix(y_test,y_pred)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17732151189920672, 'fraction_numerical': 0.10032664489034064, 'mean_word_length': 4.826086956521739, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '82591', 'license': 'Apache-2.0', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1068, 'n_words': 241, 'path': 'RandomForest_Classifier.ipynb', 'repo_name': 'Legolas1086/Random_Forest_Classifier', 'size': '2143'}