def main(): X_train = pd.read_csv("../Datos/Train_TP2_Datos_2020-2C.csv") X_test = pd.read_csv("../Datos/Test_TP2_Datos_2020-2C.csv") X_train = X_train.loc[(X_train["Stage"] == "Closed Won") | (X_train["Stage"] == "Closed Lost"), :] X_train["Stage"] = X_train['Stage'].apply(lambda x: 1 if x == 'Closed Won' else 0) X = X_train.loc[X_train["TRF"] == 0, :] X = X.drop_duplicates(subset="Opportunity_ID") print(X["Stage"].value_counts()) pipe = MyPipeline(X_train, X_test) preprocess(pipe, X_train) set_xgb_model(pipe, xgb_params) pipe.set_time_folds(10) pipe.preprocess() pipe.train_xgb(verbose=True) #pipe.predict() pipe.score_xgb(verbose=True) pipe.output() #pipe.submit() print("TODO OK")
def main(): X_train = pd.read_csv("../Datos/Train_TP2_Datos_2020-2C.csv") X_test = pd.read_csv("../Datos/Test_TP2_Datos_2020-2C.csv") X_train = X_train.loc[(X_train["Stage"] == "Closed Won") | (X_train["Stage"] == "Closed Lost"), :] X_train["Stage"] = X_train['Stage'].apply(lambda x: 1 if x == 'Closed Won' else 0) pipe = MyPipeline(X_train, X_test) preprocess(pipe, X_train) pipe.set_model( RandomForestClassifier(max_depth=21, max_features=13, n_estimators=31, random_state=123)) pipe.set_folds(10) pipe.preprocess() pipe.train() pipe.predict() #pipe.score(verbose=True) #pipe.output() #pipe.submit() print("TODO OK")
def main(): X_train = pd.read_csv("../Datos/Train_TP2_Datos_2020-2C.csv") X_test = pd.read_csv("../Datos/Test_TP2_Datos_2020-2C.csv") X_train = X_train.loc[(X_train["Stage"] == "Closed Won")|(X_train["Stage"] == "Closed Lost"),:] X_train["Stage"] = X_train['Stage'].apply(lambda x: 1 if x == 'Closed Won' else 0) pipe = MyPipeline(X_train, X_test) preprocess(pipe, X_train) set_xgb_model(pipe, xgb_params) pipe.preprocess() pipe.train_xgb(verbose=True) #pipe.predict() pipe.score_xgb(verbose=True) pipe.output() #pipe.submit() print("TODO OK")