title: All intermediate steps should be transformers and implement fit and transform or be the string 'passthrough'
body: <p>Using pipeline with sklearn I want to combine every clustering method in the same pipe. For some reason can't use DBSCAN in the same. Always gives me the error in the title. Can you detect anything wrong?</p>
  <p><strong>Error output:</strong></p>
  <blockquote>
  <p>TypeError: All intermediate steps should be transformers and implement fit and transform or be the string 'passthrough' 'AgglomerativeClustering(compute_distances=True, compute_full_tree=True)' (type &lt;class 'sklearn.cluster._agglomerative.AgglomerativeClustering'&gt;) doesn't</p>
  </blockquote>
  <p><strong>CODE</strong></p>
  <pre><code>def create_pipe(n_cluster = 8, epsilon = 0.5, min_samp = 5):
      
      #Preprocessor for data
      preprocessor = Pipeline(
          [
              (&quot;pca&quot;, PCA(n_components=3, random_state=42)),
          ]
      )
  
      #Clustering Algorithms to use 
      clusterer = Pipeline(
          [
              (
                  &quot;kmeans&quot;,
                  KMeans(
                      n_clusters= n_cluster,
                      init=&quot;k-means++&quot;,
                      n_init = N_INIT,
                      max_iter = MAX_ITER,
                      random_state = RANDOM_STATE,
                  ),
              ),
              
              (
                  &quot;agglo&quot;,
                  AgglomerativeClustering(
                      affinity='euclidean', 
                      linkage='ward', 
                      compute_full_tree = True, 
                      compute_distances = True
                  ),
              ),
              
              (
                  &quot;dbscan&quot;,
                  DBSCAN(
                      eps = epsilon,
                      min_samples = min_samp
                  ),
              ),
          ]
      )
  
      #Pipe
      pipe = Pipeline(
          [
              ('preprocessor', preprocessor),
              ('clusterer', clusterer)
          ]
      )
      
      return pipe
  </code></pre>