<jupyter_start><jupyter_text>id= test['transaction_id']y = train['target']train = train.drop(['transaction_id', 'target'], axis=1)test = test.drop(['transaction_id'], axis=1)  MODEL<jupyter_code>from sklearn.model_selection import cross_val_predict<jupyter_output><empty_output><jupyter_text>1.Random Classifier<jupyter_code>forest_clf=RandomForestClassifier(random_state=1)

y_probas_forest = cross_val_predict(forest_clf, train, y, cv=3, method='predict_proba')
y_scores_forest = y_probas_forest[:, 1]

roc_auc_score(y, y_scores_forest)
forest_clf.fit(train, y)
preds = forest_clf.predict_proba(test)[:,1]
sub = pd.DataFrame({'transaction_id': id, 'target': preds})
sub = sub[['transaction_id','target']]    

filename='sub_pfr.csv'
sub.to_csv(filename, index=False)<jupyter_output><empty_output><jupyter_text>2.Extre<jupyter_code>from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
log_clf=LogisticRegression()

y_probas_log = cross_val_predict(log_clf, train, y, cv=3, method='predict_proba')
y_scores_log = y_probas_log[:, 1]

roc_auc_score(y, y_scores_log)
log_clf.fit(train,y)
pred_log=log_clf.predict_proba(test)[:,1]

sub_log = pd.DataFrame({'transaction_id': id, 'target': pred_log})
sub_log = sub_log[['transaction_id','target']]    

filename='sub_log.csv'
sub_log.to_csv(filename, index=False)
knn = KNeighborsClassifier(n_neighbors=5)

knn.fit(train,y)
pred_knn=knn.predict_proba(test)[:,1]


sub_knn= pd.DataFrame({'transaction_id': id, 'target': pred_knn})
sub_knn = sub_knn[['transaction_id','target']]  
sub_knn.to_csv('sub_knn.csv',index=False)
svc = SVC()

svc.fit(train,y)
pred_svc=svc.predict_proba(test)[:,1]


sub_svc= pd.DataFrame({'transaction_id': id, 'target': pred_svc})
sub_svc = sub_svc[['transaction_id','target']]  
sub_svc.to_csv('sub_svc.csv',index=False)
from sklearn.tree import DecisionTreeClassifier
des=DecisionTreeClassifier()
des.fit(train,y)
pred_des=predict_proba(test)[:,1]
sub_des=pd.DataFrame({'transaction_id':id,'target':predict_des})
sub_des = sub_des[['transaction_id','target']]  
sub_des.to_csv('sub_des.csv',index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1543747136967476, 'fraction_numerical': 0.006871278057718736, 'mean_word_length': 10.741935483870968, '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': '625198', 'license': 'MIT', 'n_tokens_mistral': 896, 'n_tokens_neox': 879, 'n_words': 108, 'path': 'BrainWaves-2017-18/Predict Fraudulent Transactions/PFR.ipynb', 'repo_name': 'sahilrider/ML-Competitions', 'size': '2183'}