Spaces:
Build error
Build error
Commit
·
47ac3a1
1
Parent(s):
6355556
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,19 @@ import pandas as pd
|
|
| 3 |
import xgboost as xgb
|
| 4 |
import pandas as pd
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
df_strength=pd.read_csv("data_strength.csv")
|
| 7 |
|
| 8 |
import random
|
|
@@ -11,9 +24,13 @@ x_strength=df_strength.iloc[:,:-1]
|
|
| 11 |
y_strength=df_strength.iloc[:,-1]
|
| 12 |
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
clf = xgb.XGBRegressor(learning_rate=0.1788, max_depth=27, subsample=0.5146, n_estimators=100)
|
| 16 |
-
clf.fit(
|
| 17 |
|
| 18 |
|
| 19 |
|
|
|
|
| 3 |
import xgboost as xgb
|
| 4 |
import pandas as pd
|
| 5 |
|
| 6 |
+
import random
|
| 7 |
+
import numpy as np
|
| 8 |
+
import pandas as pd
|
| 9 |
+
from sklearn.model_selection import train_test_split,cross_val_score
|
| 10 |
+
from sklearn.ensemble import RandomForestClassifier,RandomForestRegressor
|
| 11 |
+
from sklearn.metrics import classification_report,confusion_matrix,accuracy_score
|
| 12 |
+
from sklearn.neighbors import KNeighborsClassifier,KNeighborsRegressor
|
| 13 |
+
from sklearn.svm import SVC,SVR
|
| 14 |
+
from sklearn import datasets
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
df_strength=pd.read_csv("data_strength.csv")
|
| 20 |
|
| 21 |
import random
|
|
|
|
| 24 |
y_strength=df_strength.iloc[:,-1]
|
| 25 |
|
| 26 |
|
| 27 |
+
x_strength=df_strength.iloc[:,:-1]
|
| 28 |
+
y_strength=df_strength.iloc[:,-1]
|
| 29 |
+
from sklearn.model_selection import train_test_split
|
| 30 |
+
x_train, x_test, y_train, y_test=train_test_split(x_strength,y_strength, test_size=0.15, random_state=2)
|
| 31 |
|
| 32 |
clf = xgb.XGBRegressor(learning_rate=0.1788, max_depth=27, subsample=0.5146, n_estimators=100)
|
| 33 |
+
clf.fit(x_train, y_train)
|
| 34 |
|
| 35 |
|
| 36 |
|