Esempio n. 1
0
        public Model(MLContext mlContext, ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictor>, IPredictor> algorythm)
        {
            _mlContext  = mlContext;
            _algorythim = algorythm;

            _textLoader = _mlContext.Data.CreateTextLoader(new TextLoader.Arguments()
            {
                Separators = new[] { ';' },
                HasHeader  = true,
                Column     = new[]
                {
                    new TextLoader.Column("FixedAcidity", DataKind.R4, 0),
                    new TextLoader.Column("VolatileAcidity", DataKind.R4, 1),
                    new TextLoader.Column("CitricAcid", DataKind.R4, 2),
                    new TextLoader.Column("ResidualSugar", DataKind.R4, 3),
                    new TextLoader.Column("Chlorides", DataKind.R4, 4),
                    new TextLoader.Column("FreeSulfurDioxide", DataKind.R4, 5),
                    new TextLoader.Column("TotalSulfurDioxide", DataKind.R4, 6),
                    new TextLoader.Column("Density", DataKind.R4, 7),
                    new TextLoader.Column("Ph", DataKind.R4, 8),
                    new TextLoader.Column("Sulphates", DataKind.R4, 9),
                    new TextLoader.Column("Alcohol", DataKind.R4, 10),
                    new TextLoader.Column("Label", DataKind.Text, 11)
                }
            });

            Name = algorythm.GetType().ToString().Split('.').Last();
        }
Esempio n. 2
0
        public Model(MLContext mlContext, ITrainerEstimator <ISingleFeaturePredictionTransformer <IPredictor>, IPredictor> algorythm)
        {
            _mlContext  = mlContext;
            _algorythim = algorythm;
            _textLoader = _mlContext.Data.CreateTextLoader(new TextLoader.Arguments()
            {
                Separators = new[] { ',' },
                HasHeader  = true,
                Column     = new[]
                {
                    new TextLoader.Column("Season", DataKind.R4, 2),
                    new TextLoader.Column("Year", DataKind.R4, 3),
                    new TextLoader.Column("Month", DataKind.R4, 4),
                    new TextLoader.Column("Hour", DataKind.R4, 5),
                    new TextLoader.Column("Holiday", DataKind.Bool, 6),
                    new TextLoader.Column("Weekday", DataKind.R4, 7),
                    new TextLoader.Column("Weather", DataKind.R4, 8),
                    new TextLoader.Column("Temperature", DataKind.R4, 9),
                    new TextLoader.Column("NormalizedTemperature", DataKind.R4, 10),
                    new TextLoader.Column("Humidity", DataKind.R4, 11),
                    new TextLoader.Column("Windspeed", DataKind.R4, 12),
                    new TextLoader.Column("Count", DataKind.R4, 16),
                }
            });

            Name = algorythm.GetType().ToString().Split('.').Last();
        }