Examples of valueSparse()


Examples of weka.core.Instance.valueSparse()

        temp = 0.0;
        temp2 = 0.0;
     
        if (firstI == secondI) {
          j = firstI;
          temp = difference(j, inst.valueSparse(p1), cmp.valueSparse(p2));
          p1++;p2++;
        } else if (firstI > secondI) {
          j = secondI;
          temp = difference(j, 0, cmp.valueSparse(p2));
          p2++;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

          j = firstI;
          temp = difference(j, inst.valueSparse(p1), cmp.valueSparse(p2));
          p1++;p2++;
        } else if (firstI > secondI) {
          j = secondI;
          temp = difference(j, 0, cmp.valueSparse(p2));
          p2++;
        } else {
          j = firstI;
          temp = difference(j, inst.valueSparse(p1), 0);
          p1++;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

          p2++; continue;
        }
        if (firstI == secondI) {
          i = firstI;
          temp_diff = difference(i, inst.valueSparse(p1),
                                 cmp.valueSparse(p2));
          p1++;p2++;
        } else if (firstI > secondI) {
          i = secondI;
          temp_diff = difference(i, 0, cmp.valueSparse(p2));
          p2++;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

          temp_diff = difference(i, inst.valueSparse(p1),
                                 cmp.valueSparse(p2));
          p1++;p2++;
        } else if (firstI > secondI) {
          i = secondI;
          temp_diff = difference(i, 0, cmp.valueSparse(p2));
          p2++;
        } else {
          i = firstI;
          temp_diff = difference(i, inst.valueSparse(p1), 0);
          p1++;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

                p2++; continue;
              }
              if (firstI == secondI) {
                i = firstI;
                temp_diff = difference(i, inst.valueSparse(p1),
                                       cmp.valueSparse(p2));
                p1++;p2++;
              } else if (firstI > secondI) {
                i = secondI;
                temp_diff = difference(i, 0, cmp.valueSparse(p2));
                p2++;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

                temp_diff = difference(i, inst.valueSparse(p1),
                                       cmp.valueSparse(p2));
                p1++;p2++;
              } else if (firstI > secondI) {
                i = secondI;
                temp_diff = difference(i, 0, cmp.valueSparse(p2));
                p2++;
              } else {
                i = firstI;
                temp_diff = difference(i, inst.valueSparse(p1), 0);
                p1++;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

  private Matrix getTransposedMatrix(Instances data) {
    double[][] temp = new double[data.numAttributes()][data.numInstances()];
    for (int i = 0; i < data.numInstances(); i++) {
      Instance inst = data.instance(i);
      for (int v = 0; v < inst.numValues(); v++) {
  temp[inst.index(v)][i] = inst.valueSparse(v);
      }
    }
    Matrix My_x = new Matrix(temp);
    return My_x;
  }
View Full Code Here

Examples of weka.core.Instance.valueSparse()

  for(int i=0; i<fv.size(); i++) {
    Instance inst = (Instance) fv.elementAt(i);
    double docLength = 0;
    for(int j=0; j<inst.numValues(); j++) {
      if(inst.index(j)>=firstCopy) {
        docLength += inst.valueSparse(j) * inst.valueSparse(j);
      }
    }       
    m_AvgDocLength += Math.sqrt(docLength);
  }
  m_AvgDocLength /= m_NumInstances;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

  for(int i=0; i<fv.size(); i++) {
    Instance inst = (Instance) fv.elementAt(i);
    double docLength = 0;
    for(int j=0; j<inst.numValues(); j++) {
      if(inst.index(j)>=firstCopy) {
        docLength += inst.valueSparse(j) * inst.valueSparse(j);
      }
    }       
    m_AvgDocLength += Math.sqrt(docLength);
  }
  m_AvgDocLength /= m_NumInstances;
View Full Code Here

Examples of weka.core.Instance.valueSparse()

  private Matrix getTransposedMatrix(Instances data) {
    double[][] temp = new double[data.numAttributes()][data.numInstances()];
    for (int i = 0; i < data.numInstances(); i++) {
      Instance inst = data.instance(i);
      for (int v = 0; v < inst.numValues(); v++) {
  temp[inst.index(v)][i] = inst.valueSparse(v);
      }
    }
    Matrix My_x = new Matrix(temp);
    return My_x;
  }
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.