Skip to content

ToDatetime does not implement get_feature_names_out #1663

Description

@auguste-probabl

Describe the bug

I believe this is the case for other single-column transformers, as discussed here.

Context is probabl-ai/skore#2042: get_feature_names_out is used to get the feature names before the last step of a sklearn Pipeline.

Steps/Code to Reproduce

import pandas as pd
from sklearn.utils.validation import check_is_fitted
from skrub import ToDatetime

login = pd.Series(["2024-05-13T12:05:36", None, "2024-05-15T13:46:02"], name="login")
encoder = ToDatetime()
encoder.fit_transform(login)
encoder.get_feature_names_out()

Expected Results

["login"]

Actual Results

AttributeError: 'ToDatetime' object has no attribute 'get_feature_names_out'

Versions

System:
    python: 3.12.8 (main, Dec  3 2024, 18:42:41) [GCC 13.3.0]
executable: /home/auguste/Desktop/work/skore/.venv/bin/python3
   machine: Linux-6.12.29-x86_64-with-glibc2.40

Python dependencies:
      sklearn: 1.7.2
          pip: 24.3.1
   setuptools: 80.7.1
        numpy: 2.1.3
        scipy: 1.15.3
       Cython: None
       pandas: 2.2.3
   matplotlib: 3.10.3
       joblib: 1.5.2
threadpoolctl: 3.6.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 12
         prefix: libscipy_openblas
       filepath: /home/auguste/Desktop/work/skore/.venv/lib/python3.12/site-packages/numpy.libs/libscipy_openblas64_-ff651d7f.so
        version: 0.3.27
threading_layer: pthreads
   architecture: Haswell

       user_api: blas
   internal_api: openblas
    num_threads: 12
         prefix: libscipy_openblas
       filepath: /home/auguste/Desktop/work/skore/.venv/lib/python3.12/site-packages/scipy.libs/libscipy_openblas-68440149.so
        version: 0.3.28
threading_layer: pthreads
   architecture: Haswell

       user_api: openmp
   internal_api: openmp
    num_threads: 12
         prefix: libgomp
       filepath: /home/auguste/Desktop/work/skore/.venv/lib/python3.12/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
0.6.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions