/** * Runs the derivator on the specified interval and assigns all points having * a distance less then the standard deviation of the derivator model to the * model to this model. * * @param relation the database containing the parameterization functions * @param ids the ids to build the model * @param dimensionality the dimensionality of the subspace * @return a basis of the found subspace */ private LinearEquationSystem runDerivator(Relation<ParameterizationFunction> relation, int dimensionality, DBIDs ids) { try { // build database for derivator Database derivatorDB = buildDerivatorDB(relation, ids); ListParameterization parameters = new ListParameterization(); parameters.addParameter(PCAFilteredRunner.Parameterizer.PCA_EIGENPAIR_FILTER, FirstNEigenPairFilter.class.getName()); parameters.addParameter(FirstNEigenPairFilter.Parameterizer.EIGENPAIR_FILTER_N, Integer.toString(dimensionality)); DependencyDerivator<DoubleVector> derivator = null; Class<DependencyDerivator<DoubleVector>> cls = ClassGenericsUtil.uglyCastIntoSubclass(DependencyDerivator.class); derivator = parameters.tryInstantiate(cls); CorrelationAnalysisSolution<DoubleVector> model = derivator.run(derivatorDB); LinearEquationSystem les = model.getNormalizedLinearEquationSystem(null); return les; } catch(NonNumericFeaturesException e) { throw new IllegalStateException("Error during normalization" + e); } }
/** * Runs the derivator on the specified interval and assigns all points having * a distance less then the standard deviation of the derivator model to the * model to this model. * * @param relation the database containing the parameterization functions * @param ids the ids to build the model * @param dimensionality the dimensionality of the subspace * @return a basis of the found subspace */ private LinearEquationSystem runDerivator(Relation<ParameterizationFunction> relation, int dimensionality, DBIDs ids) { try { // build database for derivator Database derivatorDB = buildDerivatorDB(relation, ids); PCARunner pca = new PCARunner(new StandardCovarianceMatrixBuilder()); EigenPairFilter filter = new FirstNEigenPairFilter(dimensionality); DependencyDerivator<DoubleVector> derivator = new DependencyDerivator<>(null, FormatUtil.NF4, pca, filter, 0, false); CorrelationAnalysisSolution<DoubleVector> model = derivator.run(derivatorDB); LinearEquationSystem les = model.getNormalizedLinearEquationSystem(null); return les; } catch(NonNumericFeaturesException e) { throw new IllegalStateException("Error during normalization" + e); } }
Database derivatorDB = buildDerivatorDB(relation, interval);
Database derivatorDB = buildDerivatorDB(relation, interval);