From c47effa96b2d13eb320714c3b0be0d14b56e31db Mon Sep 17 00:00:00 2001 From: ks1990cn Date: Sun, 29 Nov 2020 11:42:45 +0530 Subject: [PATCH] Changes on getting garbage result value by model,still need to click twice on check to get result: issue with training --- .../Controllers/PredictionController.cs | 3 +- .../Views/Prediction/Price.cshtml | 113 ++++++++++-------- 2 files changed, 68 insertions(+), 48 deletions(-) diff --git a/Price Prediction/Controllers/PredictionController.cs b/Price Prediction/Controllers/PredictionController.cs index 1fd0c16..68f31cb 100644 --- a/Price Prediction/Controllers/PredictionController.cs +++ b/Price Prediction/Controllers/PredictionController.cs @@ -16,7 +16,8 @@ public IActionResult Price(ModelInput input) // Try model on sample data to predict fair price ModelOutput result = predEngine.Predict(input); - + if (input.Passenger_count == 0 && input.Trip_distance == 0 && input.Trip_time_in_secs == 0) + result.Score = 0; ViewBag.Price = result.Score; return View(input); } diff --git a/Price Prediction/Views/Prediction/Price.cshtml b/Price Prediction/Views/Prediction/Price.cshtml index 24be863..6e111d9 100644 --- a/Price Prediction/Views/Prediction/Price.cshtml +++ b/Price Prediction/Views/Prediction/Price.cshtml @@ -1,54 +1,73 @@ @model PricePredictionML.Model.DataModels.ModelInput - @{ ViewData["Title"] = "Price Prediction Using ML.NET"; } - -

Price Prediction using ML.NET

- -
-
-
-
-
- -
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
-
-
- @if(ViewBag.Price!=null) - { -

Result

-

Fare Price:@ViewBag.Price

- } -
-
- @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} } + + + + + + + + + + +

Price Prediction using ML.NET

+ +
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+
+
+
+ +

Result :

+
+
+ + + \ No newline at end of file