Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created July 8, 2018 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/72507dc112fd3a8fbc4c87cfa36dda76 to your computer and use it in GitHub Desktop.
Save NMZivkovic/72507dc112fd3a8fbc4c87cfa36dda76 to your computer and use it in GitHub Desktop.
[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