python/methylnet/interpretation_classes.py
def feature_select(self, methyl_array, n_top_features):
        """Perform feature selection based on the best overall SHAP scores across all samples.

        Parameters
        ----------
        methyl_array : type
            MethylationArray to run feature selection on.
        n_top_features : type
            Number of CpGs to select.

        Returns
        -------
        MethylationArray
            Subsetted by top overall CpGs, overall positive contributions to prediction. May need to update.

        """
        cpgs = methyl_array.return_cpgs()
        print(cpgs)
        cpgs=cpgs[np.argsort(self.cpg_global_shapley_scores*-1)[:n_top_features]]
        print(cpgs)
        return methyl_array.subset_cpgs(cpgs)
Perform feature selection based on the best overall SHAP scores across all samples.

        Parameters
        ----------
        methyl_array : type
            MethylationArray to run feature selection on.
        n_top_features : type
            Number of CpGs to select.

        Returns
        -------
        MethylationArray
            Subsetted by top overall CpGs, overall positive contributions to prediction. May need to update.

        
Perform feature selection based on the best overall SHAP scores across all samples.
Parameters

methyl_array : type
MethylationArray to run feature selection on.
n_top_features : type
Number of CpGs to select.

Returns

MethylationArray
Subsetted by top overall CpGs, overall positive contributions to prediction. May need to update.
Perform feature selection based on the best overall SHAP scores across all samples . Parameters methyl_array : type MethylationArray to run feature selection on . n_top_features : type Number of CpGs to select . Returns MethylationArray Subsetted by top overall CpGs overall positive contributions to prediction . May need to update .
def feature_select(self, methyl_array, n_top_features):
        cpgs = methyl_array.return_cpgs()
        print(cpgs)
        cpgs=cpgs[np.argsort(self.cpg_global_shapley_scores*-1)[:n_top_features]]
        print(cpgs)
        return methyl_array.subset_cpgs(cpgs)
def feature_select ( self , methyl_array , n_top_features ) : cpgs = methyl_array . return_cpgs ( ) print ( cpgs ) cpgs = cpgs [ np . argsort ( self . cpg_global_shapley_scores * - 1 ) [ : n_top_features ] ] print ( cpgs ) return methyl_array . subset_cpgs ( cpgs )
Perform feature selection based on the best overall SHAP scores across all samples.
Perform feature selection based on the best overall SHAP scores across all samples .
"""Perform feature selection based on the best overall SHAP scores across all samples.

        Parameters
        ----------
        methyl_array : type
            MethylationArray to run feature selection on.
        n_top_features : type
            Number of CpGs to select.

        Returns
        -------
        MethylationArray
            Subsetted by top overall CpGs, overall positive contributions to prediction. May need to update.

        """
self
methyl_array
n_top_features