Issue 1:
In a number of places, sklearn controls flow according to the existence of some method on an estimator. For example: *SearchCV.score checks for score on the estimator; Scorer and multiclass functions check for decision_function; and it is used for validation in AdaBoostClassifier.fit, multiclass._check_estimator and Pipeline; and for testing in test_common.

Meta-estimators such as *SearchCV, Pipeline, RFECV, etc. should respond to such hasattrs in agreement with their underlying estimators (or else the hasattr approach should be avoided).

This is possible by implementing such methods with a property that returns the correct method from the sub-estimator (or a closure around it), or raises AttributeError if the sub-estimator is found lacking (see #1801). hasattr would then function correctly. Caveats: the code would be less straightforward in some cases; help()/pydoc won't show the methods as methods (with an argument list, etc.), though the property's docstring will show.

Issue 2:
Describe the bug

For some samples and requested n_clusters MiniBatchKMeans does not return a proper clustering in terms of the number of clusters and consecutive labels.

The example given below shows, that when requesting 11 clusters the result only consists of 9 and requesting 12 results in 11 clusters. Requesting 13 clusters then yields only 10 clusters.

When using KMeans instead of MiniBatchKMeans there is no such issue.

Steps/Code to Reproduce

import numpy as np
from sklearn.cluster import MiniBatchKMeans

points = [
[-2636.705, 892.6364, 239.4284], [-2676.219, 922.741, 227.3839], [-2628.628, 902.6482, 245.5609], [-2612.497, 860.9032, 248.924],
[-2639.552, 993.8482, 211.2253], [-2602.453, 958.7801, 211.5786], [-2598.118, 1032.398, 177.4023], [-2582.155, 972.5088, 203.5048],
[-2548.377, 803.9934, 279.4388], [-2550.095, 979.9586, 222.6467], [-2746.966, 1021.456, 188.8456], [-2745.181, 984.1931, 199.6674],
[-2729.113, 973.8251, 201.8876], [-2720.765, 1014.262, 205.0213], [-2747.317, 1099.313, 146.2305], [-2739.32, 1005.173, 200.297]
]

for numClusters in range(7, 17):
model = MiniBatchKMeans(n_clusters=numClusters, random_state=0)
clusters = model.fit_predict(points)

unique = np.unique(clusters)
print("requested", str(numClusters).rjust(2), "clusters and result has", str(len(unique)).rjust(2), "clusters with labels", unique)

Expected Results

requested 7 clusters and result has 7 clusters with labels [ 0 1 2 3 4 5 6]
requested 8 clusters and result has 8 clusters with labels [ 0 1 2 3 4 5 6 7]
requested 9 clusters and result has 9 clusters with labels [ 0 1 2 3 4 5 6 7 8]
requested 10 clusters and result has 10 clusters with labels [ 0 1 2 3 4 5 6 7 8 9]
requested 11 clusters and result has 11 clusters with labels [ 0 1 2 3 4 5 6 7 8 9 10]
requested 12 clusters and result has 12 clusters with labels [ 0 1 2 3 4 5 6 7 8 9 10 11]
requested 13 clusters and result has 13 clusters with labels [ 0 1 2 3 4 5 6 7 8 9 10 11 12]
requested 14 clusters and result has 14 clusters with labels [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13]
requested 15 clusters and result has 15 clusters with labels [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14]
requested 16 clusters and result has 16 clusters with labels [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]

Actual Results

requested 7 clusters and result has 7 clusters with labels [ 0 1 2 3 4 5 6]
requested 8 clusters and result has 7 clusters with labels [ 0 1 3 4 5 6 7]
requested 9 clusters and result has 9 clusters with labels [ 0 1 2 3 4 5 6 7 8]
requested 10 clusters and result has 10 clusters with labels [ 0 1 2 3 4 5 6 7 8 9]
requested 11 clusters and result has 9 clusters with labels [ 0 1 2 3 5 6 7 8 9]
requested 12 clusters and result has 11 clusters with labels [ 1 2 3 4 5 6 7 8 9 10 11]
requested 13 clusters and result has 10 clusters with labels [ 0 2 4 5 6 7 9 10 11 12]
requested 14 clusters and result has 12 clusters with labels [ 1 2 3 4 5 6 7 8 9 10 11 12]
requested 15 clusters and result has 11 clusters with labels [ 0 1 3 4 6 7 8 10 11 12 14]
requested 16 clusters and result has 13 clusters with labels [ 0 1 3 4 5 6 7 9 10 11 12 13 15]

Versions

System:
python: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:16) [MSC v.1916 64 bit (AMD64)]
executable: C:\Users\USER\.conda\envs\sklearn-env\python.exe
machine: Windows-10-10.0.22000-SP0

Python dependencies:
pip: 21.3.1
setuptools: 58.5.3
sklearn: 1.0.1
numpy: 1.21.4
scipy: 1.7.2
Cython: None
pandas: None
matplotlib: 3.4.3
joblib: 1.1.0
threadpoolctl: 3.0.0

Built with OpenMP: True