-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIrisModel.cs
36 lines (34 loc) · 904 Bytes
/
IrisModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Microsoft.ML.Runtime.Api;
namespace ml_iris
{
class IrisData
{
[Column("0")]
public float SepalLength;
[Column("1")]
public float SepalWidth;
[Column("2")]
public float PetalLength;
[Column("3")]
public float PetalWidth;
[Column("4", name: "Label")]
public string type;
//Default
public IrisData(){}
//For Processing CSV Line Feed
public IrisData(string csvLine)
{
var items = csvLine.Split(',');
SepalLength = float.Parse(items[0]);
SepalWidth = float.Parse(items[1]);
PetalLength = float.Parse(items[2]);
PetalWidth = float.Parse(items[3]);
type = items[4];
}
}
class IrisPrediction
{
[ColumnName("PredictedLabel")]
public string PredictedLabels;
}
}