GUDHI / gudhi-devel

The GUDHI library is a generic open source C++ library, with a Python interface, for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.
https://gudhi.inria.fr/
MIT License
245 stars 65 forks source link

sklearn set_output #1015

Open mglisse opened 6 months ago

mglisse commented 6 months ago

Since version 1.2, scikit-learn has a set_output API that can make transformers output pandas dataframes.

mglisse commented 1 week ago

@martinroyer suggests adding to RipsPersistence

def get_feature_names_out(self):
    return [f"H{i}" for i in self.homology_dimensions]

so that RipsPersistence(homology_dimensions=[0, 2]).set_output(transform="pandas").fit_transform([X]) can output a pandas dataframe with column labels "H0" and "H2".