コード例 #1
0
 public void GitHubUserGetUserIssuesTestSuccess()
 {
     // npm
     const string githubUsername = "******";
     var data = new GitHubIssueData();
     var repos = data.GetUserIssues(githubUsername);
     foreach (var githubRepo in repos)
     {
         // flexbox, chrome dev, remy sharp
         Debug.WriteLine("github: " + githubRepo.Title);
     }
     Assert.IsNotEmpty(repos);
 }
コード例 #2
0
ファイル: Program2.cs プロジェクト: dommyrock/TestMLConsole
        private static void PredictIssue()
        {
            //Load the saved model into your application
            ITransformer loadedModel = _mlContext.Model.Load(_modelPath, out var modelInputSchema);
            //Add a GitHub issue to test the trained model's prediction
            GitHubIssueData singleIssue = new GitHubIssueData()
            {
                Title = "Entity Framework crashes", Description = "When connecting to the database, EF is crashing"
            };

            _predEngine = _mlContext.Model.CreatePredictionEngine <GitHubIssueData, IssuePrediction>(loadedModel);
            var prediction = _predEngine.Predict(singleIssue);

            Console.WriteLine($"=============== Single Prediction - Result: {prediction.Area} ===============");
        }
コード例 #3
0
ファイル: Program2.cs プロジェクト: dommyrock/TestMLConsole
        /// <summary>
        /// Returns the model.
        /// </summary>
        /// <param name="trainingDataView"></param>
        /// <param name="pipeline"></param>
        /// <returns></returns>
        public static IEstimator <ITransformer> BuildAndTrainModel(IDataView trainingDataView, IEstimator <ITransformer> pipeline)
        {
            var trainingPipeline = pipeline.Append(_mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy("Label", "Features"))
                                   .Append(_mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));

            Console.WriteLine("------transforming the dataset and applying the training.--------");
            _trainedModel = trainingPipeline.Fit(trainingDataView);//Fit()method trains your model by transforming the dataset and applying the training.

            _predEngine = _mlContext.Model.CreatePredictionEngine <GitHubIssueData, IssuePrediction>(_trainedModel);

            GitHubIssueData issue = new GitHubIssueData()
            {
                Title       = "WebSockets communication is slow in my machine",
                Description = "The WebSockets communication used under the covers by SignalR looks like is going slow in my development machine.."
            };

            var prediction = _predEngine.Predict(issue);// Predict() function makes a prediction on a single row of data:

            Console.WriteLine($"=============== Single Prediction just-trained-model - Result: {prediction.Area} ===============");
            return(trainingPipeline);
        }
コード例 #4
0
 public void GitHubUserHaveRepositoryTestSuccess()
 {
     var data = new GitHubIssueData();
     var repos = data.GetUserRepos(this.userName);
     Assert.IsNotEmpty(repos);
 }
コード例 #5
0
 private void ButtonUpdate_Click(object sender, RoutedEventArgs e)
 {
     var gi = new GitHubIssueData();
     var repos = gi.GetUserRepos("kedde");
     MessageBox.Show("Update data grid with issues: " + repos.Count);
 }