Created
July 12, 2019 13:42
-
-
Save NMZivkovic/b1ae20243175eb30917b96b6107cb4d0 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
public void BuildAndFit() | |
{ | |
var pipeline = _mlContext.Transforms.CopyColumns(inputColumnName: "Count", outputColumnName: "Label") | |
.Append(_mlContext.Transforms.Categorical.OneHotEncoding("Season")) | |
.Append(_mlContext.Transforms.Categorical.OneHotEncoding("Year")) | |
.Append(_mlContext.Transforms.Categorical.OneHotEncoding("Holiday")) | |
.Append(_mlContext.Transforms.Categorical.OneHotEncoding("Weather")) | |
.Append(_mlContext.Transforms.Concatenate("Features", | |
"Season", | |
"Year", | |
"Month", | |
"Hour", | |
"Weekday", | |
"Weather", | |
"Temperature", | |
"Humidity", | |
"Windspeed", | |
"Casual")) | |
.Append(_mlContext.Transforms.NormalizeMinMax("Features", "Features")) | |
.AppendCacheCheckpoint(_mlContext) | |
.Append(_algorythim); | |
_trainedModel = pipeline.Fit(_trainingDataView); | |
_predictionEngine = _mlContext.Model.CreatePredictionEngine<BikeSharingDemandSample, BikeSharingDemandPrediction>(_trainedModel); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment