private TypedDatasetBuilder <Iris, float, IrisLabel> CreateBuilderTyped() { var datasetBuilder = new TypedDatasetBuilder <Iris, float, IrisLabel>(iris => iris.Label, GetSelectedOrdering(OverallDefaultOrdering), null); datasetBuilder.Configure() .Ordering() .Attribute(iris => iris.SepalLength, GetSelectedOrdering(SepalLengthDefaultOrdering)) .Attribute(iris => iris.SepalWidth, GetSelectedOrdering(SepalWidthDefaultOrdering)) .Attribute(iris => iris.PetalLength, GetSelectedOrdering(PetalLengthDefaultOrdering)) .Attribute(iris => iris.PetalWidth, GetSelectedOrdering(PetalWidthDefaultOrdering)) .Label(IrisLabel.Setosa) .Attribute(p => p.SepalLength, (float)SetosaSepalLengthMin.Value, (float)SetosaSepalLengthMax.Value, GetSelectedOrdering(SetosaSepalLengthOrdering)) .Attribute(p => p.SepalWidth, (float)SetosaSepalWidthMin.Value, (float)SetosaSepalWidthMax.Value, GetSelectedOrdering(SetosaSepalWidthOrdering)) .Attribute(p => p.PetalLength, (float)SetosaPetalLengthMin.Value, (float)SetosaPetalLengthMax.Value, GetSelectedOrdering(SetosaPetalLengthOrdering)) .Attribute(p => p.PetalWidth, (float)SetosaPetalWidthMin.Value, (float)SetosaPetalWidthMax.Value, GetSelectedOrdering(SetosaPetalWidthOrdering)) .Label(IrisLabel.Versicolor) .Attribute(p => p.SepalLength, (float)VersicolorSepalLengthMin.Value, (float)VersicolorSepalLengthMax.Value, GetSelectedOrdering(VersicolorSepalLengthOrdering)) .Attribute(p => p.SepalWidth, (float)VersicolorSepalWidthMin.Value, (float)VersicolorSepalWidthMax.Value, GetSelectedOrdering(VersicolorSepalWidthOrdering)) .Attribute(p => p.PetalLength, (float)VersicolorPetalLengthMin.Value, (float)VersicolorPetalLengthMax.Value, GetSelectedOrdering(VersicolorPetalLengthOrdering)) .Attribute(p => p.PetalWidth, (float)VersicolorPetalWidthMin.Value, (float)VersicolorPetalWidthMax.Value, GetSelectedOrdering(VersicolorPetalWidthOrdering)) .Label(IrisLabel.Virginica) .Attribute(p => p.SepalLength, (float)VirginicaSepalLengthMin.Value, (float)VirginicaSepalLengthMax.Value, GetSelectedOrdering(VirginicaSepalLengthOrdering)) .Attribute(p => p.SepalWidth, (float)VirginicaSepalWidthMin.Value, (float)VirginicaSepalWidthMax.Value, GetSelectedOrdering(VirginicaSepalWidthOrdering)) .Attribute(p => p.PetalLength, (float)VirginicaPetalLengthMin.Value, (float)VirginicaPetalLengthMax.Value, GetSelectedOrdering(VirginicaPetalLengthOrdering)) .Attribute(p => p.PetalWidth, (float)VirginicaPetalWidthMin.Value, (float)VirginicaPetalWidthMax.Value, GetSelectedOrdering(VirginicaPetalWidthOrdering)); return(datasetBuilder); }
private TypedDataset <Iris> GenerateTyped(TypedDatasetBuilder <Iris, float, IrisLabel> datasetBuilder) { var dataset = datasetBuilder.Generate((int)TrainingSamplesCount.Value, (int)ValidationSamplesCount.Value, (int)TestSamplesCount.Value); return(dataset); }