INNER CODE UNIT · Python
_make_label
AnotherSamWilson/miceforest · miceforest/imputation_kernel.py:561
def _make_label(self, variable: str, seed: int):
"""
Returns a reproducible subset of the non-missing values of a variable.
"""
# Don't subset at all if data_subset == 0 or we want more than there are candidates
subset_index = self._get_nonmissing_subset_index(variable=variable, seed=seed)
label = self.working_data.loc[subset_index, variable].copy()
return label
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[