Beispiel #1
0
        static void Main(string[] args)
        {
            #region Combine path

            string folder   = ".\\..\\..\\..\\Data";
            string fileName = "example.xlsx";
            string path     = Path.Combine(folder, fileName);

            #endregion

            IKMeansBuilder kMeansBuilder = new KMeansBuilder();
            IKMeans        kMeans;

            kMeans = kMeansBuilder
                     .Init(new KMeansInitialization())
                     .SetNumberOfClusters(2)
                     .Build();

            IDataView data = DataReaderExcel.ReadDataFromExcel(
                path: path,
                hasHeader: true,
                worksheet: 3,
                startColumn: 2);

            var clustered = kMeans.FitPredict(data);

            IQualityMeasurement qualityMeasurementAlgorithm = new IndexC();

            var res = qualityMeasurementAlgorithm.EvaluateQuality(clustered, new EuclideanDistance());

            Console.WriteLine(res);

            Console.Read();
        }
        public ActionResult <float> EvaluateClustering(DataViewClustered dataViewClustered)
        {
            IQualityMeasurement evaluator = new IndexC();
            var res = evaluator.EvaluateQuality(dataViewClustered, new EuclideanDistance());

            return(Ok(res));
        }
Beispiel #3
0
    void Start()
    {
        Regex         rg        = new Regex(regex, RegexOptions.Multiline | RegexOptions.Singleline);
        List <IndexC> indexList = new List <IndexC>();
        Match         match     = rg.Match(result);

        Debug.LogError(match.Value);
        while (match.Success)
        {
            IndexC icc = new IndexC();
            icc.startIndex = match.Index;
            icc.endIndex   = match.Index + match.Length;
            indexList.Add(icc);
            match = match.NextMatch();
        }
        for (int i = 0, maxi = indexList.Count; i < maxi; ++i)
        {
            Debug.LogError("S_index : " + indexList[i].startIndex + "  E_index" + indexList[i].endIndex);
        }
    }