@Test public void testRandomProjection() { System.out.println("regular random projection"); RandomProjection instance = RandomProjection.of(128, 40); Matrix p = instance.getProjection(); Matrix t = p.aat(); System.out.println(p.toString(true)); for (int i = 0; i < 40; i++) { assertEquals(1.0, t.get(i, i), 1E-10); for (int j = 0; j < 40; j++) { if (i != j) { assertEquals(0.0, t.get(i, j), 1E-10); } } } }
public RandomProjection(Matrix projection) { this.projection = projection; }
RandomProjection implements LinearProjection, Serializable { public RandomProjection(Matrix projection) { this.projection = projection; } }
RandomProjection implements LinearProjection, Serializable { public RandomProjection(Matrix projection) { this.projection = projection; } RandomProjection(Matrix projection); }
RandomProjection implements LinearProjection, Serializable { public RandomProjection(Matrix projection) { this.projection = projection; } RandomProjection(Matrix projection); static RandomProjection of(int n, int p); static RandomProjection sparse(int n, int p); @Override Matrix getProjection(); }
RandomProjection implements LinearProjection, Serializable { public RandomProjection(Matrix projection) { this.projection = projection; } RandomProjection(Matrix projection); static RandomProjection of(int n, int p); static RandomProjection sparse(int n, int p); @Override Matrix getProjection();  }