Exemplo n.º 1
0
    @Override
    protected void makeOptions(Parameterization config) {
      super.makeOptions(config);

      DoubleParameter quantileP =
          new DoubleParameter(QUANTILE_ID, 0.1) //
              .addConstraint(CommonConstraints.GREATER_EQUAL_ZERO_DOUBLE) //
              .addConstraint(CommonConstraints.LESS_EQUAL_ONE_DOUBLE);
      if (config.grab(quantileP)) {
        quantile = quantileP.doubleValue();
      }

      DoubleParameter samplingP =
          new DoubleParameter(SAMPLING_ID) //
              .addConstraint(CommonConstraints.GREATER_THAN_ZERO_DOUBLE);
      if (config.grab(samplingP)) {
        sampling = samplingP.doubleValue();
      }

      Flag nozerosF = new Flag(NOZEROS_ID);
      if (config.grab(nozerosF)) {
        nozeros = nozerosF.isTrue();
      }

      RandomParameter randP = new RandomParameter(SEED_ID);
      if (config.grab(randP)) {
        rand = randP.getValue();
      }
    }
Exemplo n.º 2
0
    @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);
      }
    }
Exemplo n.º 3
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);

      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();
        }
      }
    }
Exemplo n.º 5
0
    @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();
      }
    }
Exemplo n.º 6
0
 @Override
 protected void makeOptions(Parameterization config) {
   super.makeOptions(config);
   final Flag flag = new Flag(INVERT_ID);
   if (config.grab(flag)) {
     invert = flag.getValue();
   }
 }
Exemplo n.º 7
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();
        }
      }
    }
Exemplo n.º 8
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();
      }
    }