src/main/java/pt/it/av/tnav/ml/tm/dp/DPWC.java
public static <P extends DPPoint<P>> DPWC buildDPWC_no_affinity(final DPW dpw, final List<Cluster<P>> clusters) {
    List<Cluster<P>> validClusters = new ArrayList<>();

    // Remove empyt clusters
    for (Cluster<P> cluster : clusters) {
      if (cluster.size() > 0) {
        validClusters.add(cluster);
      }
    }

    // Build the DPWC
    List<DPWC.Category> categories = new ArrayList<>();
    for (Cluster<P> cluster : validClusters) {
      List<DPW.DpDimension> dpDimensions = new ArrayList<>();
      for (P point : cluster) {
        dpDimensions.add(filter(dpw, point));
      }
      categories.add(new DPWC.Category(dpDimensions, 1.0));
    }

    return new DPWC(dpw.term(), categories);
  }
/**
   * Returns a {@link DPWC} built using a {@link DPW} and a set of clusters.
   * Assumes equal affinity for each word category.
   *
   * @param dpw
   * @param clusters
   * @param <P>
   * @return
   */
Returns a  DPWC built using a  DPW and a set of clusters.
Assumes equal affinity for each word category.


Returns a DPWC built using a DPW and a set of clusters . Assumes equal affinity for each word category .
public static <P extends DPPoint<P>> DPWC buildDPWC_no_affinity(final DPW dpw, final List<Cluster<P>> clusters) {
    List<Cluster<P>> validClusters = new ArrayList<>();
    for (Cluster<P> cluster : clusters) {
      if (cluster.size() > 0) {
        validClusters.add(cluster);
      }
    }
    List<DPWC.Category> categories = new ArrayList<>();
    for (Cluster<P> cluster : validClusters) {
      List<DPW.DpDimension> dpDimensions = new ArrayList<>();
      for (P point : cluster) {
        dpDimensions.add(filter(dpw, point));
      }
      categories.add(new DPWC.Category(dpDimensions, 1.0));
    }
    return new DPWC(dpw.term(), categories);
  }
public static < P extends DPPoint < P > > DPWC buildDPWC_no_affinity ( final DPW dpw , final List < Cluster < P > > clusters ) { List < Cluster < P > > validClusters = new ArrayList < > ( ) ; for ( Cluster < P > cluster : clusters ) { if ( cluster . size ( ) > 0 ) { validClusters . add ( cluster ) ; } } List < DPWC . Category > categories = new ArrayList < > ( ) ; for ( Cluster < P > cluster : validClusters ) { List < DPW . DpDimension > dpDimensions = new ArrayList < > ( ) ; for ( P point : cluster ) { dpDimensions . add ( filter ( dpw , point ) ) ; } categories . add ( new DPWC . Category ( dpDimensions , 1.0 ) ) ; } return new DPWC ( dpw . term ( ) , categories ) ; }
Returns a {@link DPWC} built using a {@link DPW} and a set of clusters.
Returns a { @link DPWC } built using a { @link DPW } and a set of clusters .
// Remove empyt clusters // Build the DPWC