freeuse / app.py
Concrete123's picture
Update app.py
1663863
import numpy as np
import pandas as pd
import xgboost as xgb
import pandas as pd
import gradio as gr
from tabgan.sampler import OriginalGenerator, GANGenerator
import random
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split,cross_val_score
from sklearn.ensemble import RandomForestClassifier,RandomForestRegressor
from sklearn.metrics import classification_report,confusion_matrix,accuracy_score
from sklearn.neighbors import KNeighborsClassifier,KNeighborsRegressor
from sklearn.svm import SVC,SVR
from sklearn import datasets
import random
from sklearn.model_selection import train_test_split
df_CS=pd.read_csv("data_strength1.csv")
x_strength=df_CS.iloc[:,:-1]
y_strength=df_CS.iloc[:,-1]
x_train, x_test, y_train, y_test=train_test_split(x_strength,y_strength, test_size=0.2, random_state=20)
# ε°† y_train 转捒为 DataFrame
df_y_train = pd.DataFrame({'target_column': y_train})
new_train1, new_target1 = GANGenerator().generate_data_pipe(x_train, df_y_train, x_test, )
clf = xgb.XGBRegressor(learning_rate=0.13928589384419077, max_depth=6,n_estimators=238,
subsample= 1.0, min_child_weight=0.11155893909323567, colsample_bytree=0.5950862773143536)
clf.fit(new_train1, new_target1)