public void Vote(string votes, string period)
    {
        var vote = new Voting()
        {
            period = period,
            vote   = votes,
            userID = deviceID
        };

        StartCoroutine(PostVote(urlV, vote));
        Debug.Log("Votings" + vote.userID + vote.ToString());
    }
Beispiel #2
0
        // Evaluate K Nearest Neigbors
        public void EvaluateKNN(int k, DistanceChoice distance_choice, Voting voting)
        {
            Console.WriteLine("Evaluating KNN, k = " + k + " using " + distance_choice.ToString() + " distance (" + voting.ToString() + ")...");
            Console.WriteLine(DateTime.Now.ToLongTimeString());

            DataManager dm = new DataManager();

            // get training recipes
            Data[] train_data = dm.GetRecipes(ModelChoice.KNN, DataPurpose.TRAIN);
            // get test recipes
            Data[]   test_data = dm.GetRecipes(ModelChoice.KNN, DataPurpose.TEST);
            string[] ingrNames = dm.GetFeatures();

            // evaluate KNN and get results
            Results results = GetKNNResults(k, test_data, ingrNames, distance_choice, train_data, voting);

            // display results
            results.ShowResults();
            Console.WriteLine(DateTime.Now.ToLongTimeString());
            Console.WriteLine();
        }