Package de.lmu.ifi.dbs.elki.data

Examples of de.lmu.ifi.dbs.elki.data.SparseFloatVector


  }

  @Override
  protected SimpleTypeInformation<? super SparseFloatVector> convertedType(SimpleTypeInformation<SparseFloatVector> in) {
    final TIntFloatHashMap emptyMap = new TIntFloatHashMap();
    return new VectorFieldTypeInformation<SparseFloatVector>(SparseFloatVector.class, getDimensionality(), new SparseFloatVector(emptyMap, getDimensionality()));
  }
View Full Code Here


    BitSet b = featureVector.getNotNullMask();
    Map<Integer, Float> vals = new HashMap<Integer, Float>();
    for(int i = b.nextSetBit(0); i >= 0; i = b.nextSetBit(i + 1)) {
      vals.put(i, (float) (featureVector.doubleValue(i) * idf.get(i).doubleValue()));
    }
    return new SparseFloatVector(vals, featureVector.getDimensionality());
  }
View Full Code Here

    BitSet b = featureVector.getNotNullMask();
    Map<Integer, Float> vals = new HashMap<Integer, Float>();
    for(int i = b.nextSetBit(0); i >= 0; i = b.nextSetBit(i + 1)) {
      vals.put(i, (float) (featureVector.doubleValue(i) / idf.get(i).doubleValue()));
    }
    return new SparseFloatVector(vals, featureVector.getDimensionality());
  }
View Full Code Here

  }

  @Override
  protected SimpleTypeInformation<? super SparseFloatVector> convertedType(SimpleTypeInformation<SparseFloatVector> in) {
    final Map<Integer, Float> emptyMap = Collections.emptyMap();
    return new VectorFieldTypeInformation<SparseFloatVector>(SparseFloatVector.class, getDimensionality(), new SparseFloatVector(emptyMap, getDimensionality()));
  }
View Full Code Here

      }
      else {
        labels.add(entries.get(i));
      }
    }
    return new Pair<SparseFloatVector, LabelList>(new SparseFloatVector(values, dimensionality), labels);
  }
View Full Code Here

  }

  @Override
  protected VectorFieldTypeInformation<SparseFloatVector> getTypeInformation(int dimensionality) {
    final Map<Integer, Float> emptyMap = Collections.emptyMap();
    return new VectorFieldTypeInformation<SparseFloatVector>(SparseFloatVector.class, dimensionality, new SparseFloatVector(emptyMap, dimensionality));
  }
View Full Code Here

            break;
          }
          double v = (Double) key.getValue();
          f.put(i - s + 1, (float) v);
        }
        data[out] = new SparseFloatVector(f, dimsize[out]);
      }
      else if(elkitypes[out] == TypeUtil.LABELLIST) {
        // Build a label list out of successive labels
        LabelList ll = new LabelList();
        for(Entry<Integer, Object> key : map.entrySet()) {
View Full Code Here

          VectorFieldTypeInformation<DoubleVector> type = new VectorFieldTypeInformation<DoubleVector>(DoubleVector.class, dimsize[out], labels, new DoubleVector(new double[dimsize[out]]));
          bundle.appendColumn(type, new ArrayList<DoubleVector>());
        }
        else {
          Map<Integer, Float> empty = Collections.emptyMap();
          VectorFieldTypeInformation<SparseFloatVector> type = new VectorFieldTypeInformation<SparseFloatVector>(SparseFloatVector.class, dimsize[out], labels, new SparseFloatVector(empty, dimsize[out]));
          bundle.appendColumn(type, new ArrayList<SparseFloatVector>());
        }
      }
      else if(etyp[out] == TypeUtil.LABELLIST) {
        String label = names.get(out);
View Full Code Here

          iter.setValue((float) (iter.value() / len));
        }
      }
    }

    curvec = new SparseFloatVector(values, maxdim);
    curlbl = labels;
  }
View Full Code Here

    curlbl = labels;
  }

  @Override
  protected VectorFieldTypeInformation<SparseFloatVector> getTypeInformation(int dimensionality) {
    return new VectorFieldTypeInformation<SparseFloatVector>(SparseFloatVector.class, dimensionality, new SparseFloatVector(SparseFloatVector.EMPTYMAP, dimensionality));
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.data.SparseFloatVector

Copyright © 2018 www.massapicom. 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.