title: Numpy array format for fit_transform(image) TSNE method
body: <p>I'm using Scikit-learn for tSNE to interrogate around 1000 scatterplots, but I appear to require a 2D numpy array to access the fit_transform method. I'm new to Python.</p>
  
  <p>My code,</p>
  
  <pre><code>from sklearn.manifold import TSNE
  import numpy as np
  import cv2
  mypath='/Path/to/files/scatterplots/'
  onlyfiles = [ f for f in listdir(mypath) if isfile(join(mypath,f)) ]
  photos = np.empty(len(onlyfiles), dtype=object)
  for n in range(0, len(onlyfiles)):
    photos[n] = cv2.imread( join(mypath,onlyfiles[n]) )
  
  fig, axes = plt.subplots(2, 2, figsize=(10,10), subplot_kw={'xticks':(), 'yticks':()})
  for ax, img in zip(axes.ravel(), photos):
     ax.imshow(img)
  </code></pre>
  
  <p><strong>output</strong>
  <a href="https://i.stack.imgur.com/rYMu6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rYMu6.png" alt="enter image description here"></a></p>
  
  <p><strong>Problem code</strong></p>
  
  <pre><code>tsne = TSNE(random_state=50)
  digits_tsne = tsne.fit_transform (photos.data)
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <p>ValueError Traceback (most recent call last)
   in </p>
  
  <p>/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sklearn/manifold/t_sne.py in fit_transform(self, X, y)</p>
  
  <pre><code>892             Embedding of the training data in low-dimensional space.
  893         """
  </code></pre>
  
  <p>--> 894         embedding = self._fit(X)</p>
  
  <ul>
  <li>3 further lines of error output within t_sne.py</li>
  </ul>
  
  <p>I believe the fit_transform method requires a 2D numpy array, e.g. </p>
  
  <pre><code>'target': array([0, 1, 2, 3])
  </code></pre>
  
  <p>where 0-3 refer to the different data (parasites) behind each of the scatterplots 1-4.</p>
  
  <p><strong>Request</strong>
  <em>How do I combine the target array into image numpy array so fit_transform can see it and process it?</em></p>