title: PLS-DA algorithm in python
body: <p>Partial Least Squares (PLS) algorithm is implemented in the scikit-learn library, as documented here:
  <a href="http://scikit-learn.org/0.12/auto_examples/plot_pls.html" rel="noreferrer">http://scikit-learn.org/0.12/auto_examples/plot_pls.html</a>
  In the case where y is a binary vector, a variant of this algorithm is being used, the Partial least squares Discriminant Analysis (PLS-DA) algorithm. 
  Does the PLSRegression module in sklearn.pls implements also this binary case? If not, where can I find a python implementation for it?
  In my binary case, I'm trying to use the PLSRegression:</p>
  
  <pre><code>pls = PLSRegression(n_components=10)
  pls.fit(x, y)
  x_r, y_r = pls.transform(x, y, copy=True)
  </code></pre>
  
  <p>In the transform function, the code gets exception in this line:</p>
  
  <pre><code>y_scores = np.dot(Yc, self.y_rotations_)
  </code></pre>
  
  <p>The error message is "ValueError: matrices are not aligned". Yc is the normalized y vector, and self.y_rotations_ = [1.]. 
  In the fit function, self.y_rotations_ = np.ones(1) if the original y is a univariate vector (y.shape<a href="http://scikit-learn.org/0.12/auto_examples/plot_pls.html" rel="noreferrer">1</a>=1).</p>