Package weka.core.matrix

Examples of weka.core.matrix.Matrix.times()


     
      // X_new = X*W*(P^T*W)^-1
      X_new = getX(instances).times(tmp);
     
      // factor = W*(P^T*W)^-1 * b_hat
      m_PLS1_RegVector = tmp.times(b_hat);
  
      // save matrices
      m_PLS1_P     = P;
      m_PLS1_W     = W;
      m_PLS1_b_hat = b_hat;
View Full Code Here


      T          = X.times(m_SIMPLS_W);
      X_new      = T;
      m_SIMPLS_B = W.times(Q.transpose());
     
      if (getPerformPrediction())
  y = T.times(P.transpose()).times(m_SIMPLS_B);
      else
  y = getY(instances);

      result = toInstances(getOutputFormat(), X_new, y);
    }
View Full Code Here

  private double normalKernel(double x) {
   
    Matrix thisPoint = new Matrix(1, 2);
    thisPoint.set(0, 0, x);
    thisPoint.set(0, 1, m_ConstDelta);
    return Math.exp(-thisPoint.times(m_CovarianceInverse).
        times(thisPoint.transpose()).get(0, 0)
        / 2) / (Math.sqrt(TWO_PI) * m_Determinant);
  }
 
  /**
 
View Full Code Here

      newValues[m_outputNumAttributes - 1] = instance.classValue();
    }
    double [][] oldInstanceValues = new double[1][m_numAttributes];
    oldInstanceValues[0] = tempInstance.toDoubleArray();
    Matrix instanceVector = new Matrix(oldInstanceValues); // old attribute values
    instanceVector = instanceVector.times(m_transformationMatrix); // new attribute values
    for (int i = 0; i < m_actualRank; i++) {
      newValues[i] = instanceVector.get(0, i);
    }
   
    // return newly transformed instance
View Full Code Here

  private double normalKernel(double x) {
   
    Matrix thisPoint = new Matrix(1, 2);
    thisPoint.set(0, 0, x);
    thisPoint.set(0, 1, m_ConstDelta);
    return Math.exp(-thisPoint.times(m_CovarianceInverse).
        times(thisPoint.transpose()).get(0, 0)
        / 2) / (Math.sqrt(TWO_PI) * m_Determinant);
  }
 
  /**
 
View Full Code Here

      newValues[m_outputNumAttributes - 1] = instance.classValue();
    }
    double [][] oldInstanceValues = new double[1][m_numAttributes];
    oldInstanceValues[0] = tempInstance.toDoubleArray();
    Matrix instanceVector = new Matrix(oldInstanceValues); // old attribute values
    instanceVector = instanceVector.times(m_transformationMatrix); // new attribute values
    for (int i = 0; i < m_actualRank; i++) {
      newValues[i] = instanceVector.get(0, i);
    }
   
    // return newly transformed instance
View Full Code Here

     
      // X_new = X*W*(P^T*W)^-1
      X_new = getX(instances).times(tmp);
     
      // factor = W*(P^T*W)^-1 * b_hat
      m_PLS1_RegVector = tmp.times(b_hat);
  
      // save matrices
      m_PLS1_P     = P;
      m_PLS1_W     = W;
      m_PLS1_b_hat = b_hat;
View Full Code Here

      T          = X.times(m_SIMPLS_W);
      X_new      = T;
      m_SIMPLS_B = W.times(Q.transpose());
     
      if (getPerformPrediction())
  y = T.times(P.transpose()).times(m_SIMPLS_B);
      else
  y = getY(instances);

      result = toInstances(getOutputFormat(), X_new, y);
    }
View Full Code Here

  private double normalKernel(double x) {
   
    Matrix thisPoint = new Matrix(1, 2);
    thisPoint.set(0, 0, x);
    thisPoint.set(0, 1, m_ConstDelta);
    return Math.exp(-thisPoint.times(m_CovarianceInverse).
        times(thisPoint.transpose()).get(0, 0)
        / 2) / (Math.sqrt(TWO_PI) * m_Determinant);
  }
 
  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.