@Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);

      FileParameter fileP = new FileParameter(FILE_ID, FileParameter.FileType.INPUT_FILE);
      if (config.grab(fileP)) {
        file = fileP.getValue();
      }

      PatternParameter idP = new PatternParameter(ID_ID, ID_PATTERN_DEFAULT);
      if (config.grab(idP)) {
        idpattern = idP.getValue();
      }

      PatternParameter scoreP = new PatternParameter(SCORE_ID);
      if (config.grab(scoreP)) {
        scorepattern = scoreP.getValue();
      }

      Flag inverstedF = new Flag(INVERTED_ID);
      if (config.grab(inverstedF)) {
        inverted = inverstedF.getValue();
      }

      ObjectParameter<ScalingFunction> scalingP =
          new ObjectParameter<>(SCALING_ID, ScalingFunction.class, IdentityScaling.class);
      if (config.grab(scalingP)) {
        scaling = scalingP.instantiateClass(config);
      }
    }
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      PatternParameter positiveClassNameP = new PatternParameter(POSITIVE_CLASS_NAME_ID);
      positiveClassNameP.setOptional(true);
      if (config.grab(positiveClassNameP)) {
        positiveClassName = positiveClassNameP.getValue();
      }

      IntParameter binsP = new IntParameter(BINS_ID, 50);
      binsP.addConstraint(CommonConstraints.GREATER_THAN_ONE_INT);
      if (config.grab(binsP)) {
        bins = binsP.getValue();
      }

      ObjectParameter<ScalingFunction> scalingP =
          new ObjectParameter<>(SCALING_ID, ScalingFunction.class, IdentityScaling.class);
      if (config.grab(scalingP)) {
        scaling = scalingP.instantiateClass(config);
      }

      Flag splitfreqF = new Flag(SPLITFREQ_ID);
      if (config.grab(splitfreqF)) {
        splitfreq = splitfreqF.getValue();
      }
    }
Exemple #3
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      DoubleParameter deltaP = new DoubleParameter(DELTA_ID);
      if (config.grab(deltaP)) {
        delta = deltaP.doubleValue();
      }
      deltaP.addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_DOUBLE);

      IntParameter nP = new IntParameter(N_ID, 1);
      nP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
      if (config.grab(nP)) {
        n = nP.intValue();
      }

      DoubleParameter alphaP = new DoubleParameter(ALPHA_ID, 1.);
      alphaP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_DOUBLE);
      if (config.grab(alphaP)) {
        alpha = alphaP.doubleValue();
      }

      ObjectParameter<Distribution> distP =
          new ObjectParameter<>(DIST_ID, Distribution.class, UniformDistribution.class);
      if (config.grab(distP)) {
        dist = distP.instantiateClass(config);
      }
    }
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);

      ObjectParameter<NumberVectorDistanceFunction<?>> distanceFunctionP =
          new ObjectParameter<>(
              EvaluateSilhouette.Parameterizer.DISTANCE_ID,
              NumberVectorDistanceFunction.class,
              EuclideanDistanceFunction.class);
      if (config.grab(distanceFunctionP)) {
        distance = distanceFunctionP.instantiateClass(config);
      }

      EnumParameter<NoiseHandling> noiseP =
          new EnumParameter<NoiseHandling>(
              EvaluateSilhouette.Parameterizer.NOISE_ID,
              NoiseHandling.class,
              NoiseHandling.TREAT_NOISE_AS_SINGLETONS);
      if (config.grab(noiseP)) {
        noiseOption = noiseP.getValue();
      }

      if (noiseOption == NoiseHandling.IGNORE_NOISE) {
        Flag penalizeP = new Flag(EvaluateSilhouette.Parameterizer.NO_PENALIZE_ID);
        if (config.grab(penalizeP)) {
          penalize = penalizeP.isFalse();
        }
      }
    }
Exemple #5
0
      @Override
      protected void makeOptions(Parameterization config) {
        super.makeOptions(config);
        ObjectParameter<EarthModel> modelP =
            new ObjectParameter<>(
                EarthModel.MODEL_ID, EarthModel.class, SphericalVincentyEarthModel.class);
        if (config.grab(modelP)) {
          model = modelP.instantiateClass(config);
        }

        ObjectParameter<IndexFactory<O, ?>> innerP =
            new ObjectParameter<>(
                ProjectedIndex.Factory.Parameterizer.INDEX_ID, IndexFactory.class);
        if (config.grab(innerP)) {
          inner = innerP.instantiateClass(config);
        }

        Flag materializeF = new Flag(ProjectedIndex.Factory.Parameterizer.MATERIALIZE_FLAG);
        if (config.grab(materializeF)) {
          materialize = materializeF.isTrue();
        }

        Flag norefineF = new Flag(ProjectedIndex.Factory.Parameterizer.DISABLE_REFINE_FLAG);
        if (config.grab(norefineF)) {
          norefine = norefineF.isTrue();
        }
      }
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   DoubleArrayListParameter meansP = new DoubleArrayListParameter(INITIAL_MEANS);
   if (config.grab(meansP)) {
     initialMeans = meansP.getValue().toArray(new double[0][]);
   }
 }
Exemple #7
0
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   final DoubleParameter param = new DoubleParameter(D_ID);
   if (config.grab(param)) {
     eps = param.getValue();
   }
 }
Exemple #8
0
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   final Flag flag = new Flag(INVERT_ID);
   if (config.grab(flag)) {
     invert = flag.getValue();
   }
 }
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   ObjectParameter<DistanceFunction<? super O>> distanceFunctionP =
       makeParameterDistanceFunction(EuclideanDistanceFunction.class, DistanceFunction.class);
   if (config.grab(distanceFunctionP)) {
     distanceFunction = distanceFunctionP.instantiateClass(config);
   }
 }
Exemple #10
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);

      {
        DoubleParameter param =
            new DoubleParameter(ALPHA_ID, 0.2) //
                .addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_DOUBLE) //
                .addConstraint(CommonConstraints.LESS_EQUAL_ONE_DOUBLE);
        if (config.grab(param)) {
          alpha = param.getValue();
        }
      }

      {
        DoubleParameter param =
            new DoubleParameter(BETA_ID, 0.8) //
                .addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE) //
                .addConstraint(CommonConstraints.LESS_THAN_ONE_DOUBLE);
        if (config.grab(param)) {
          beta = param.getValue();
        }
      }

      {
        DoubleParameter param =
            new DoubleParameter(W_ID, 0.05) //
                .addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_DOUBLE);
        if (config.grab(param)) {
          w = param.getValue();
        }
      }

      {
        Flag param = new Flag(HEURISTICS_ID);
        if (config.grab(param)) {
          heuristics = param.getValue();
        }
      }

      if (heuristics) {
        IntParameter param =
            new IntParameter(D_ZERO_ID, 5) //
                .addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
        if (config.grab(param)) {
          d_zero = param.getValue();
        }
      }

      {
        RandomParameter param = new RandomParameter(RANDOM_ID);
        if (config.grab(param)) {
          random = param.getValue();
        }
      }
    }
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   final IntParameter dimP =
       new IntParameter(DIM_ID) //
           .addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_INT);
   if (config.grab(dimP)) {
     dim = dimP.getValue();
   }
 }
Exemple #12
0
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   IntParameter portP = new IntParameter(PORT_ID, port);
   portP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
   portP.addConstraint(new LessEqualConstraint(65535));
   if (config.grab(portP)) {
     this.port = portP.getValue();
   }
 }
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      final FileParameter MATRIX_PARAM =
          new FileParameter(MATRIX_ID, FileParameter.FileType.INPUT_FILE);
      if (config.grab(MATRIX_PARAM)) {
        matrixfile = MATRIX_PARAM.getValue();
      }

      final ObjectParameter<DistanceParser> PARSER_PARAM =
          new ObjectParameter<>(PARSER_ID, DistanceParser.class, AsciiDistanceParser.class);
      if (config.grab(PARSER_PARAM)) {
        parser = PARSER_PARAM.instantiateClass(config);
      }
    }
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   DoubleParameter probP =
       new DoubleParameter(PROB_ID) //
           .addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_DOUBLE) //
           .addConstraint(CommonConstraints.LESS_EQUAL_ONE_DOUBLE);
   if (config.grab(probP)) {
     prob = probP.getValue().doubleValue();
   }
   RandomParameter rndP = new RandomParameter(SEED_ID);
   if (config.grab(rndP)) {
     rnd = rndP.getValue();
   }
 }
Exemple #15
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      ObjectParameter<DistributionEstimator<D>> innerP =
          new ObjectParameter<>(INNER_ID, DistributionEstimator.class);
      if (config.grab(innerP)) {
        inner = innerP.instantiateClass(config);
      }

      DoubleParameter trimP = new DoubleParameter(TRIM_ID);
      trimP.addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
      trimP.addConstraint(CommonConstraints.LESS_THAN_HALF_DOUBLE);
      if (config.grab(trimP)) {
        trim = trimP.doubleValue();
      }
    }
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      ObjectParameter<PrimitiveDistanceFunction<NumberVector>> distanceFunctionP =
          new ObjectParameter<>(
              DISTANCE_ID, PrimitiveDistanceFunction.class, EuclideanDistanceFunction.class);
      if (config.grab(distanceFunctionP)) {
        distance = distanceFunctionP.instantiateClass(config);
      }

      EnumParameter<NoiseHandling> noiseP =
          new EnumParameter<NoiseHandling>(
              NOISE_ID, NoiseHandling.class, NoiseHandling.TREAT_NOISE_AS_SINGLETONS);
      if (config.grab(noiseP)) {
        noiseHandling = noiseP.getValue();
      }
    }
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      DoubleParameter palphaP = new DoubleParameter(EIGENPAIR_FILTER_PALPHA, DEFAULT_PALPHA);
      palphaP.addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
      palphaP.addConstraint(CommonConstraints.LESS_THAN_ONE_DOUBLE);
      if (config.grab(palphaP)) {
        palpha = palphaP.getValue();
      }

      DoubleParameter walphaP =
          new DoubleParameter(
              WeakEigenPairFilter.Parameterizer.EIGENPAIR_FILTER_WALPHA, DEFAULT_WALPHA);
      walphaP.addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_DOUBLE);
      if (config.grab(walphaP)) {
        walpha = walphaP.getValue();
      }
    }
Exemple #18
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      ObjectParameter<ClusteringAlgorithm<?>> referencealgP =
          new ObjectParameter<>(
              REFERENCE_ID, ClusteringAlgorithm.class, ByLabelOrAllInOneClustering.class);
      if (config.grab(referencealgP)) {
        referencealg = referencealgP.instantiateClass(config);
      }

      Flag noiseSpecialHandlingF = new Flag(NOISE_ID);
      if (config.grab(noiseSpecialHandlingF)) {
        noiseSpecialHandling = noiseSpecialHandlingF.getValue();
      }

      Flag selfPairingF = new Flag(SELFPAIR_ID);
      if (config.grab(selfPairingF)) {
        selfPairing = selfPairingF.getValue();
      }
    }
Exemple #19
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      EnumParameter<ScalingReference> scalingReferenceP =
          new EnumParameter<>(
              SCALINGREFERENCE_ID, ScalingReference.class, ScalingReference.UNITCUBE);
      if (config.grab(scalingReferenceP)) {
        scalingreference = scalingReferenceP.getValue();
      }
      EnumParameter<NoiseDistribution> noisedistributionP =
          new EnumParameter<>(
              NOISEDISTRIBUTION_ID, NoiseDistribution.class, NoiseDistribution.UNIFORM);
      if (config.grab(noisedistributionP)) {
        noisedistribution = noisedistributionP.getValue();
      }
      DoubleParameter percentageP = new DoubleParameter(PERCENTAGE_ID, .01);
      percentageP.addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
      percentageP.addConstraint(CommonConstraints.LESS_EQUAL_ONE_DOUBLE);
      if (config.grab(percentageP)) {
        percentage = percentageP.getValue();
      }
      LongParameter seedP = new LongParameter(SEED_ID);
      seedP.setOptional(true);
      if (config.grab(seedP)) {
        seed = seedP.getValue();
      }
      DoubleListParameter minimaP = new DoubleListParameter(MINIMA_ID);
      minimaP.setOptional(true);
      if (config.grab(minimaP)) {
        minima = minimaP.getValue().clone();
      }
      DoubleListParameter maximaP = new DoubleListParameter(MAXIMA_ID);
      maximaP.setOptional(true);
      if (config.grab(maximaP)) {
        maxima = maximaP.getValue().clone();
      }

      config.checkConstraint(new AllOrNoneMustBeSetGlobalConstraint(minimaP, maximaP));
      config.checkConstraint(new EqualSizeGlobalConstraint(minimaP, maximaP));
    }
Exemple #20
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);
      ObjectParameter<DimensionSelectingSubspaceDistanceFunction<V>> param =
          new ObjectParameter<>(
              DISTANCE_FUNCTION_ID,
              DimensionSelectingSubspaceDistanceFunction.class,
              SubspaceEuclideanDistanceFunction.class);
      if (config.grab(param)) {
        distance = param.instantiateClass(config);
      }

      DoubleParameter epsilonP = new DoubleParameter(EPSILON_ID);
      if (config.grab(epsilonP)) {
        epsilon = epsilonP.getValue();
      }

      IntParameter minptsP = new IntParameter(MINPTS_ID);
      minptsP.addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT);
      if (config.grab(minptsP)) {
        minpts = minptsP.getValue();
      }
    }
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   format = ClassGenericsUtil.parameterizeOrAbort(CSVReaderFormat.class, config);
 }