Package edu.ucla.sspace.similarity

Examples of edu.ucla.sspace.similarity.CosineSimilarity


        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);
View Full Code Here


    /**
     * Creates this {@code SimpleNearestNeighborFinder} with as many threads as
     * processors, and using the cosine similarity for word comparisons.
     */
    public SimpleNearestNeighborFinder(SemanticSpace sspace) {
        this(sspace, new CosineSimilarity(),
             Runtime.getRuntime().availableProcessors());
    }
View Full Code Here

    /**
     * Creates this {@code SimpleNearestNeighborFinder} with the specified
     * number of threads, using the cosine similarity for word comparisons.
     */
    public SimpleNearestNeighborFinder(SemanticSpace sspace, int numThreads) {
        this(sspace, new CosineSimilarity(), numThreads);
    }
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

    public static SimilarityFunction getSimilarityFunction(
            SimType similarityType) {
        switch (similarityType) {
            case COSINE:
                return new CosineSimilarity();
            case PEARSON_CORRELATION:
                return new PearsonCorrelation();
            case EUCLIDEAN:
                return new EuclideanSimilarity();
            case SPEARMAN_RANK_CORRELATION:
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);
View Full Code Here

     * Creates a {@link NeighborChainAgglomerativeClustering} with no minimum
     * similarity threshold.  When using this constructor, you must specifcy the
     * number of clusters or the results will be undefined.
     */
    public NeighborChainAgglomerativeClustering() {
        this(ClusterLink.MEAN_LINK, new CosineSimilarity());
    }
View Full Code Here

TOP

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

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.