Make error message uniform when calling `get_feature_names_out` before `fit`

While working #24838, we found out that we are not consistent with the error type and message when calling `get_feature_names_out` before `fit`.

From @jpangas:
> Here is the updated list of the estimators that raise inconsistent errors when `get_feature_names_out` is called before `fit`. Currently, these estimators have been whitelisted. Before we submit any PR for a particular estimator, we can remove the estimator from the list and run the test in #25223 to check if the code we submitted has raised the correct `NotFittedError`.

> Remember to add your estimator and PR in the same change log entry in `v1.3.rst` introduced in #25294.
Please link the PRs you'll make with this issue so that I can update this list for all of us to know which estimators have been worked on:

- [x] AdditiveChi2Sampler() #25291 
- [x] Binarizer()  #25294
- [x] MaxAbsScaler() #25294
- [x] MinMaxScaler() #25294
- [x] Normalizer()  #25294
- [x] OrdinalEncoder()  #25294
- [x] PowerTransformer() #25294
- [x] QuantileTransformer()  #25294
- [x] RobustScaler() #25294
- [x] StackingClassifier() #25324
- [x] StackingRegressor() #25324
- [x] StandardScaler() #25294
- [x] TfidfTransformer()  #25294
- [x] VotingClassifier() #25324 
- [x] VotingRegressor() #25324
- [x] GaussianRandomProjection() #25308
- [x] GenericUnivariateSelect() #25308
- [x] IterativeImputer() #25367 
- [x] RFE() #25308
- [x] RFECV() #25308 
- [x] SelectFdr() #25308 
- [x] SelectFpr() #25308
- [x] SelectFromModel() #25308
- [x] SelectFwe() #25308
- [x] SelectKBest() #25308
- [x] SelectPercentile() #25308 
- [x] SequentialFeatureSelector() #25308  
- [x] SparseRandomProjection()  #25308
- [x] VarianceThreshold() #25308
- [x] KNNImputer() #25367
- [x] SimpleImputer() #25367 
- [x] SplineTransformer() #25402
- [x] DictVectorizer() #25402
- [x] KBinsDiscretizer() #25402
- [x] MissingIndicator() #25402
- [x] IsotonicRegression()

<details>

```pytb
> pytest -vsl sklearn/tests/test_common.py -k error_get_feature_names_out
==================================================================================== test session starts ====================================================================================
platform darwin -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0 -- /Users/glemaitre/mambaforge/envs/dev/bin/python3.10
cachedir: .pytest_cache
rootdir: /Users/glemaitre/Documents/packages/scikit-learn, configfile: setup.cfg
plugins: xdist-3.0.2, anyio-3.6.2
collected 9473 items / 9275 deselected / 198 selected                                                                                                                                       

sklearn/tests/test_common.py::test_estimators[ARDRegression()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[AdaBoostClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[AdaBoostRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[AdditiveChi2Sampler()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[AffinityPropagation()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[AgglomerativeClustering()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[BaggingClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[BaggingRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[BayesianGaussianMixture()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[BayesianRidge()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[BernoulliNB()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[BernoulliRBM()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This BernoulliRBM instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[Binarizer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[Birch()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This Birch instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[BisectingKMeans()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This BisectingKMeans instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[CCA()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This CCA instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[CalibratedClassifierCV(estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[CategoricalNB()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[ComplementNB()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[DBSCAN()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[DecisionTreeClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[DecisionTreeRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[DictionaryLearning()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This DictionaryLearning instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[DummyClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[DummyRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[ElasticNet()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[ElasticNetCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[EllipticEnvelope()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[EmpiricalCovariance()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[ExtraTreeClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[ExtraTreeRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[ExtraTreesClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[ExtraTreesRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[FactorAnalysis()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This FactorAnalysis instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[FastICA()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This FastICA instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[FeatureAgglomeration()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This FeatureAgglomeration instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[FunctionTransformer()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GammaRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GaussianMixture()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GaussianNB()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GaussianProcessClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GaussianProcessRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GaussianRandomProjection()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GenericUnivariateSelect()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[GradientBoostingClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GradientBoostingRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GraphicalLasso()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[GraphicalLassoCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[HistGradientBoostingClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[HistGradientBoostingRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[HuberRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[IncrementalPCA()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This IncrementalPCA instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[IsolationForest()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[Isomap()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This Isomap instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[KBinsDiscretizer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[KMeans()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This KMeans instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[KNNImputer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[KNeighborsClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[KNeighborsRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[KNeighborsTransformer()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This KNeighborsTransformer instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[KernelCenterer()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This KernelCenterer instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[KernelDensity()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[KernelPCA()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This KernelPCA instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[KernelRidge()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LabelPropagation()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LabelSpreading()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[Lars()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LarsCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[Lasso()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LassoCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LassoLars()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LassoLarsCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LassoLarsIC()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LatentDirichletAllocation()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This LatentDirichletAllocation instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[LedoitWolf()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LinearDiscriminantAnalysis()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This LinearDiscriminantAnalysis instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[LinearRegression()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LinearSVC()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LinearSVR()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LocalOutlierFactor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LocallyLinearEmbedding()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This LocallyLinearEmbedding instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[LogisticRegression()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[LogisticRegressionCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MDS()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MLPClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MLPRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MaxAbsScaler()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[MeanShift()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MinCovDet()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MinMaxScaler()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[MiniBatchDictionaryLearning()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This MiniBatchDictionaryLearning instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[MiniBatchKMeans()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This MiniBatchKMeans instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[MiniBatchNMF()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This MiniBatchNMF instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[MiniBatchSparsePCA()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This MiniBatchSparsePCA instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[MissingIndicator()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[MultiOutputRegressor(estimator=Ridge())-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MultiTaskElasticNet()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MultiTaskElasticNetCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MultiTaskLasso()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MultiTaskLassoCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[MultinomialNB()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[NMF()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This NMF instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[NearestCentroid()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[NearestNeighbors()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[NeighborhoodComponentsAnalysis()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This NeighborhoodComponentsAnalysis instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[Normalizer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[NuSVC()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[NuSVR()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[Nystroem()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This Nystroem instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[OAS()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[OPTICS()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[OneClassSVM()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[OneVsOneClassifier(estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[OneVsRestClassifier(estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[OrthogonalMatchingPursuit()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[OrthogonalMatchingPursuitCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[OutputCodeClassifier(estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[PCA()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This PCA instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[PLSCanonical()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This PLSCanonical instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[PLSRegression()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This PLSRegression instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[PLSSVD()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This PLSSVD instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[PassiveAggressiveClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[PassiveAggressiveRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[Perceptron()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[PoissonRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[PolynomialCountSketch()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This PolynomialCountSketch instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[PolynomialFeatures()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This PolynomialFeatures instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[PowerTransformer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[QuadraticDiscriminantAnalysis()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[QuantileRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[QuantileTransformer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[RANSACRegressor(estimator=LinearRegression())-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RBFSampler()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This RBFSampler instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[RFE(estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[RFECV(estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[RadiusNeighborsClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RadiusNeighborsRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RadiusNeighborsTransformer()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This RadiusNeighborsTransformer instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[RandomForestClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RandomForestRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RandomTreesEmbedding()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This RandomTreesEmbedding instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[RegressorChain(base_estimator=Ridge())-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[Ridge()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RidgeCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RidgeClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RidgeClassifierCV()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[RobustScaler()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SGDClassifier()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SGDOneClassSVM()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SGDRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SVC()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SVR()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SelectFdr()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SelectFpr()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SelectFromModel(estimator=SGDRegressor(random_state=0))-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SelectFwe()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SelectKBest()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SelectPercentile()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SelfTrainingClassifier(base_estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SequentialFeatureSelector(estimator=LogisticRegression(C=1))-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[ShrunkCovariance()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SimpleImputer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[SkewedChi2Sampler()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This SkewedChi2Sampler instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[SparsePCA()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This SparsePCA instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[SparseRandomProjection()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SpectralBiclustering()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SpectralClustering()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SpectralCoclustering()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SpectralEmbedding()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[SplineTransformer()-check_error_get_feature_names_out_not_fitted] 

<class 'AttributeError'>
'SplineTransformer' object has no attribute 'bsplines_'

PASSED
sklearn/tests/test_common.py::test_estimators[StackingClassifier(estimators=[('est1',LogisticRegression(C=0.1)),('est2',LogisticRegression(C=1))])-check_error_get_feature_names_out_not_fitted] 

<class 'AttributeError'>
'StackingClassifier' object has no attribute '_n_feature_outs'

PASSED
sklearn/tests/test_common.py::test_estimators[StackingRegressor(estimators=[('est1',Ridge(alpha=0.1)),('est2',Ridge(alpha=1))])-check_error_get_feature_names_out_not_fitted] 

<class 'AttributeError'>
'StackingRegressor' object has no attribute '_n_feature_outs'

PASSED
sklearn/tests/test_common.py::test_estimators[StandardScaler()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[TSNE()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[TfidfTransformer()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[TheilSenRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[TransformedTargetRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[TruncatedSVD()-check_error_get_feature_names_out_not_fitted] 

<class 'sklearn.exceptions.NotFittedError'>
This TruncatedSVD instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

PASSED
sklearn/tests/test_common.py::test_estimators[TweedieRegressor()-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[VarianceThreshold()-check_error_get_feature_names_out_not_fitted] 

<class 'ValueError'>
Unable to generate feature names without n_features_in_

PASSED
sklearn/tests/test_common.py::test_estimators[VotingClassifier(estimators=[('est1',LogisticRegression(C=0.1)),('est2',LogisticRegression(C=1))])-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_estimators[VotingRegressor(estimators=[('est1',Ridge(alpha=0.1)),('est2',Ridge(alpha=1))])-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[GridSearchCV(cv=2,estimator=Ridge(),param_grid={'alpha':[0.1,1.0]})-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[GridSearchCV(cv=2,estimator=LogisticRegression(),param_grid={'C':[0.1,1.0]})-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingGridSearchCV(cv=2,estimator=Ridge(),min_resources='smallest',param_grid={'alpha':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted0] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingGridSearchCV(cv=2,estimator=LogisticRegression(),min_resources='smallest',param_grid={'C':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted0] PASSED
sklearn/tests/test_common.py::test_search_cv[RandomizedSearchCV(cv=2,estimator=Ridge(),param_distributions={'alpha':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[RandomizedSearchCV(cv=2,estimator=LogisticRegression(),param_distributions={'C':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingGridSearchCV(cv=2,estimator=Ridge(),min_resources='smallest',param_grid={'alpha':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted1] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingGridSearchCV(cv=2,estimator=LogisticRegression(),min_resources='smallest',param_grid={'C':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted1] PASSED
sklearn/tests/test_common.py::test_search_cv[GridSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('ridge',Ridge())]),param_grid={'ridge__alpha':[0.1,1.0]})-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[GridSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('logisticregression',LogisticRegression())]),param_grid={'logisticregression__C':[0.1,1.0]})-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingGridSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('ridge',Ridge())]),min_resources='smallest',param_grid={'ridge__alpha':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingGridSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('logisticregression',LogisticRegression())]),min_resources='smallest',param_grid={'logisticregression__C':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[RandomizedSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('ridge',Ridge())]),param_distributions={'ridge__alpha':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[RandomizedSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('logisticregression',LogisticRegression())]),param_distributions={'logisticregression__C':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingRandomSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('ridge',Ridge())]),param_distributions={'ridge__alpha':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
sklearn/tests/test_common.py::test_search_cv[HalvingRandomSearchCV(cv=2,error_score='raise',estimator=Pipeline(steps=[('pca',PCA()),('logisticregression',LogisticRegression())]),param_distributions={'logisticregression__C':[0.1,1.0]},random_state=0)-check_error_get_feature_names_out_not_fitted] PASSED
```

</details>

I assume that the most adequate error should be a `NotFittedError` asking to fit the estimator.

@scikit-learn/core-devs WDYT?

COMMENT:
Update: The test that checks and ensures a `NotFittedError` is raised was successfully merged in PR #25223 . We can now work on the estimators that produce inconsistent errors @Kshitij68 @albuzenet

Labels: New Feature, Enhancement, help wanted, Meta-issue