INNER CODE UNIT · Python

_make_features_label

AnotherSamWilson/miceforest · miceforest/imputation_kernel.py:571

    def _make_features_label(self, variable: str, seed: int):
        """
        Makes a reproducible set of features and
        target needed to train a lightgbm model.
        """
        subset_index = self._get_nonmissing_subset_index(variable=variable, seed=seed)
        predictor_columns = self.variable_schema[variable]
        features = self.working_data.loc[
            subset_index, predictor_columns + [variable]
        ].copy()
        label = features.pop(variable)
        return features, label

    @staticmethod
    def _mean_match_nearest_neighbors(
        mean_match_candidates: int,
        bachelor_preds: DataFrame,
        candidate_preds: DataFrame,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…