How was the accuracy of the classifier head in the autoencoder? It would perform a similar task as the LGBM model, i.e. using the latent tensors to classify the samples.

@ptrblck  I am lost here , i have binary classification problem. Total number of features are 111 which i want to decrease to 100 using autoencoder , then these 100 latent space will be fed into LGBM model.
Autoencoder
class Autoencoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.encoder = nn.Sequential(
            nn.Linear(111,480),
            nn.ReLU(),
            nn.BatchNorm1d(480),

            nn.Linear(480,100),
            nn.BatchNorm1d(100),
            nn.ReLU()
        )
        self.decoder = nn.Sequential(
            nn.Linear(100,480),
            nn.ReLU())
        self.decoder_recon = nn.Linear(480,111)
        self.decoder_classifier = nn.Linear(480,111)
    
    def forward(self,x):
        x = self.encoder(x)
        x = self.decoder(x)
        reconstruction = self.decoder_recon(x)
        logits = self.decoder_classifier(x)
        return reconstruction,logits
    
    def get_encoder_state(self,x):
        encoded = self.encoder(x)
        return encoded

After training Autoencoder i grab the latent space on training data
X_train = torch.from_numpy(pd.DataFrame(X_nums).to_numpy(np.float32)).to(device)
X_train_encoded = autoencoder.get_encoder_state(X_train)
X = pd.DataFrame(X_train_encoded.cpu().detach().numpy())
X.shape
(912512, 100)

Then i train this latent space as an input for LGBM
best_params = {'n_estimators': 1000, 
               'subsample': 0.4, 
               'learning_rate': 0.01, 
               'num_leaves': 70, 
               'is_unbalance':False,
               'device': 'gpu'}

gbm = lgb.LGBMClassifier(**best_params)

scores = list()
kfold = StratifiedKFold(n_splits=5,shuffle=True,random_state=42)
frequent_labels_cat_dict={}

for train_idx, test_idx in kfold.split(X,y):

    train_X, test_X = X.loc[train_idx,:], X.loc[test_idx,:]
    train_y, test_y = y.loc[train_idx], y.loc[test_idx]
    gbm.fit(train_X, train_y)

    pred = gbm.predict_proba(test_X)[:, 1] # This grabs the positive class prediction
    cv_score  = roc_auc_score(test_y, pred)
    
    scores.append(cv_score)
    print('> ', cv_score)

mean_s, std_s = np.mean(scores), np.std(scores)
print('Mean: %.5f, Standard Deviation: %.5f' % (mean_s, std_s))

Please let me know what you need more? And what i am missing?