<jupyter_start><jupyter_text>Logistic<jupyter_code>model1=LogisticRegression()
model1.fit(x_train,y_train)
y_pred=model1.predict(x_test)
ac1=accuracy_score(y_test,y_pred)
ac1<jupyter_output><empty_output><jupyter_text>KNN<jupyter_code>model2=KNeighborsClassifier(n_neighbors=5)
model2.fit(x_train,y_train)
y_pred=model2.predict(x_test)
ac2=accuracy_score(y_test,y_pred)
ac2<jupyter_output><empty_output><jupyter_text>Random Forest<jupyter_code>model3=RandomForestClassifier(n_estimators=500)
model3.fit(x_train,y_train)
y_pred=model3.predict(x_test)
ac3=accuracy_score(y_test,y_pred)
ac3<jupyter_output><empty_output><jupyter_text>SVM<jupyter_code>model4=SVC(C=1,kernel="rbf")
model4.fit(x_train,y_train)
y_pred=model4.predict(x_test)
ac4=accuracy_score(y_test,y_pred)
ac4<jupyter_output><empty_output><jupyter_text>Multi Layer Perceptron Neural Network<jupyter_code>model5=MLPClassifier(alpha=0.01,hidden_layer_sizes=(2),random_state=1,activation="logistic")
model5.fit(x_train,y_train)
y_pred=model5.predict(x_test)
ac5=accuracy_score(y_test,y_pred)
ac5<jupyter_output><empty_output><jupyter_text>PCA<jupyter_code>pc=PCA(n_components=11)
pc.fit(x)
pc.explained_variance_
pc.explained_variance_ratio_.cumsum()
sns.lineplot(range(1,1+pc.explained_variance_.shape[0]),pc.explained_variance_)
plt.show()
pc=PCA(n_components=7)
x=pc.fit_transform(x)
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.2,random_state=0)
model6=LogisticRegression()
model6.fit(x_train,y_train)
y_pred=model6.predict(x_test)
ac6=accuracy_score(y_test,y_pred)
ac6<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13092979127134724, 'fraction_numerical': 0.03099304237824162, 'mean_word_length': 24.11111111111111, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '546208', 'license': 'BSL-1.0', 'n_tokens_mistral': 732, 'n_tokens_neox': 719, 'n_words': 39, 'path': 'AIML - Project 10.ipynb', 'repo_name': 'ranmuni345/My-Python-Project', 'size': '1581'}