Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Kmeans clustering exception #259

@khan990

Description

@khan990

I am getting the following exception
I believe my input is totally correct. I was computing cosine similarity over documents with TFIDF algorithm.

input to cluster.compute() is double[][] where 0>= input[i][j] <= 1
int[] index = cluster.Compute(inputs);

using https://github.com/primaryobjects/TFIDF for tfidf

System.InvalidOperationException was unhandled
HResult=-2146233079
Message=Generated value is not between 0 and 1.
Source=Accord.Statistics
StackTrace:
at Accord.Statistics.Distributions.Univariate.GeneralDiscreteDistribution.Random(Double[] probabilities)
at Accord.MachineLearning.KMeans.Randomize(Double[][] points, Boolean useSeeding)
at Accord.MachineLearning.KMeans.Compute(Double[][] data, Double threshold, Boolean computeInformation)
at TFIDFExample.Program.Main(String[] args) in C:\Users\jasim\Documents\Visual Studio 2015\Projects\TFIDF_TwitterClustering\TFIDFExample\Program.cs:line 49
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions