INNER CODE UNIT · Python

X_miss_mcar

SalvatoreRa/tutorial · machine learning/scripts/MNAR.py:119

        X_miss_mcar = produce_NA(df.iloc[:, :-1], p_miss=perc, 
                                 mecha="MNAR", opt="logistic", p_obs=0.5) 
        X_miss_mcar = X_miss_mcar['X_incomp'].detach().numpy()
        X_miss_mcar = np.where(X_miss_mcar=='nan', np.nan, X_miss_mcar )

        kf = KFold(n_splits=fold_splits)
        

        for train_index, test_index in kf.split(X_miss_mcar):
            
            
            
            X_train, X_test = X_miss_mcar[train_index], X_miss_mcar[test_index]
            y_train, y_test = y[train_index], y[test_index]
            
            # we are starting now the process of imputation
            # for each case we will measure the score
            # the score represents the accuracy in this case

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…