Package edu.ucla.sspace.similarity

Examples of edu.ucla.sspace.similarity.SimilarityFunction


        AffinityMatrixCreator creator = ReflectionUtil.getObjectInstance(
                argOptions.getStringOption('e'));
        if (argOptions.hasOption("edgeTypeParam"))
            creator.setParams(argOptions.getIntOption("edgeTypeParam"));

        SimilarityFunction edgeSim = new CosineSimilarity();
        SimilarityFunction kernelSim = ReflectionUtil.getObjectInstance(
                argOptions.getStringOption("edgeWeighting"));
        if (argOptions.hasOption("edgeWeighting"))
            kernelSim.setParams(argOptions.getIntOption("edgeWeightingParam"));
        creator.setFunctions(edgeSim, kernelSim);

        return new LocalityPreservingCooccurrenceSpace(creator);
    }
View Full Code Here


        this.creator = creator;
        this.linkCluster = new LinkClustering();
    }

    public static AffinityMatrixCreator createDefaultAffinityMatrixCreator() {
        SimilarityFunction simFunc = new CosineSimilarity();
        AffinityMatrixCreator creator =
            new NearestNeighborAffinityMatrixCreator();
        creator.setParams(10);
        creator.setFunctions(simFunc, simFunc);
        return creator;
View Full Code Here

            } catch (NumberFormatException nfe) {
                throw new IllegalArgumentException("Invalid beta", nfe);
            }
        }

        SimilarityFunction simFunc = DEFAULT_SIMILARITY_FUNCTION;
        String simFuncProp = props.getProperty(SIMILARITY_FUNCTION_PROPERTY);
        if (simFuncProp != null) {
            try {
                SimilarityFunction sf = ReflectionUtil
                    .<SimilarityFunction>getObjectInstance(simFuncProp);
                simFunc = sf;
            } catch (Error e) {
                throw new IllegalArgumentException(
                    "Invalid similarity function class", e);
View Full Code Here

        AffinityMatrixCreator creator = ReflectionUtil.getObjectInstance(
                argOptions.getStringOption('e'));
        if (argOptions.hasOption("edgeTypeParam"))
            creator.setParams(argOptions.getIntOption("edgeTypeParam"));

        SimilarityFunction edgeSim = new CosineSimilarity();
        SimilarityFunction kernelSim = ReflectionUtil.getObjectInstance(
                argOptions.getStringOption("edgeWeighting"));
        if (argOptions.hasOption("edgeWeighting"))
            kernelSim.setParams(argOptions.getIntOption("edgeWeightingParam"));
        creator.setFunctions(edgeSim, kernelSim);

        try {
            return new LocalityPreservingSemanticAnalysis(creator);
        } catch (IOException ioe) {
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.similarity.SimilarityFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.