Created
July 8, 2018 12:33
-
-
Save NMZivkovic/72507dc112fd3a8fbc4c87cfa36dda76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public IActionResult Predict( | |
float season, | |
float year, | |
float month, | |
DateTime hour, | |
bool holiday, | |
float weekday, | |
float weather, | |
float temperature, | |
float normalizedTemperature, | |
float humidity, | |
float windspeed) | |
{ | |
var justHour = hour.Hour; | |
var input = new BikeSharingDemandSample() | |
{ | |
Season = season, | |
Year = year, | |
Month = month, | |
Hour = justHour, | |
Holiday = holiday, | |
Weekday = weekday, | |
Weather = weather, | |
Temperature = temperature, | |
NormalizedTemperature = normalizedTemperature, | |
Humidity = humidity, | |
Windspeed = windspeed, | |
Count = 0 | |
}; | |
var prediction = _machineLearningModel.Predict(input); | |
ViewData.Add("prediction", prediction.PredictedCount); | |
return View(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment