Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

modeling.py 525 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  1. from sklearn.ensemble import RandomForestClassifier
  2. from sklearn.metrics import roc_auc_score
  3. import pandas as pd
  4. from src.const import *
  5. print(M_MOD_INIT,'\n'+M_MOD_LOAD_DATA)
  6. X_train = pd.read_csv(X_TRAIN_PATH)
  7. X_test = pd.read_csv(X_TEST_PATH)
  8. y_train = pd.read_csv(Y_TRAIN_PATH)
  9. y_test = pd.read_csv(Y_TEST_PATH)
  10. print(M_MOD_RFC)
  11. rfc = RandomForestClassifier(n_estimators=1, random_state=0)
  12. rfc.fit(X_train, y_train.values.ravel())
  13. y_pred = rfc.predict(X_test)
  14. print(M_MOD_SCORE, round(roc_auc_score(y_test, y_pred),3))
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...