pyproteonet.imputation.r.pca_methods.impute_local_least_squares

pyproteonet.imputation.r.pca_methods.impute_local_least_squares(dataset: Dataset, molecule: str, column: str, k: int = 10, correlation: Literal['pearson', 'kendall', 'spearman'] = 'pearson', all_variables: bool = True, maxSteps=100, result_column: str | None = None)

Apply local least squares imputation as implemented by the pcaMethods R package. See https://rdrr.io/bioc/pcaMethods/man/llsImpute.html for more details.

Args:

dataset (Dataset): Dataset to impute. molecule (str): Molecule type to impute (e.g. protein, peptide etc.). column (str): Name of the value column to impute. k (int, optional): Number of neighbors to use for imputation. Defaults to 10. correlation (Literal[‘pearson’, ‘kendall’, ‘spearman’], optional): Correlation measure to use for neighbor search. Defaults to “pearson”. all_variables (bool, optional): Whether to use all variables for imputation or only the k nearest neighbors. Defaults to True. maxSteps ([type], optional): Maximum number of iterations. Defaults to 100. result_column (Optional[str], optional): If given, name of the value column to store the imputed values in. Defaults to None.

Returns:

pd.Series: The imputed values.