예제 #1
0
 def test_run_multiclass(self):
     data = dsutils.load_glass_uci()
     conf = deeptable.ModelConfig(
         # dnn_units=((256, 0, False), (128, 0, False)),
         # dnn_activation='relu',
         fixed_embedding_dim=False,
         embeddings_output_dim=0,
         apply_gbm_features=False,
         auto_discrete=False,
     )
     bt = batch_trainer.BatchTrainer(
         data,
         'x_10',
         eval_size=0.2,
         validation_size=0.2,
         eval_metrics=['AUC', 'accuracy', 'recall', 'precision', 'f1'],
         # AUC/recall/precision/f1/mse/mae/msle/rmse/r2
         dt_config=conf,
         verbose=0,
         dt_epochs=1,
         # seed=9527,
         cross_validation=True,
         stratified=False,
         num_folds=5,
     )
     ms = bt.start()
     assert ms.leaderboard().shape[1], 7
예제 #2
0
 def test_load_data(self):
     df_adult = dsutils.load_adult()
     df_glass = dsutils.load_glass_uci()
     df_hd = dsutils.load_heart_disease_uci()
     df_bank = dsutils.load_bank()
     df_boston = dsutils.load_boston()
     assert df_adult.shape, (32561, 15)
     assert df_glass.shape, (214, 11)
     assert df_hd.shape, (303, 14)
     assert df_bank.shape, (108504, 18)
     assert df_boston.shape, (506, 14)
예제 #3
0
    def setup_class(self):
        setup_dask(self)

        print("Loading datasets...")
        data = dd.from_pandas(dsutils.load_glass_uci(), npartitions=2)
        self.y = data.pop(10).values
        self.X = data

        conf = deeptable.ModelConfig(metrics=['AUC'], apply_gbm_features=False, )
        self.dt = deeptable.DeepTable(config=conf)
        self.X_train, self.X_test, self.y_train, self.y_test = \
            [t.persist() for t in get_tool_box(data).train_test_split(self.X, self.y, test_size=0.2, random_state=42)]
        self.model, self.history = self.dt.fit(self.X_train, self.y_train, batch_size=32, epochs=3)
    def setup_class(self):
        print("Loading datasets...")
        data = dsutils.load_glass_uci()
        self.y = data.pop(10).values
        self.X = data

        conf = deeptable.ModelConfig(
            metrics=['AUC'],
            apply_gbm_features=False,
        )
        self.dt = deeptable.DeepTable(config=conf)
        self.X_train, \
        self.X_test, \
        self.y_train, \
        self.y_test = train_test_split(self.X, self.y, test_size=0.2, random_state=42)
        self.model, self.history = self.dt.fit(self.X_train,
                                               self.y_train,
                                               epochs=1)
예제 #5
0
def run_glass_uci():
    df = dsutils.load_glass_uci()
    df.columns = [f'col_{c}' if c != 10 else 'y' for c in df.columns.to_list()]
    # train(df, 'y', 'Recall')
    train(df, 'y', 'AUC')