Skip to content

Commit 4cd6397

Browse files
committed
fix review comments
1 parent a4f9ee8 commit 4cd6397

File tree

4 files changed

+20
-32
lines changed

4 files changed

+20
-32
lines changed

docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/Categorical/OneHotEncoding.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public static void Example()
1616
// Get a small dataset as an IEnumerable.
1717
var samples = new List<DataPoint>()
1818
{
19-
new DataPoint(){ Label = 0, Education = "0-5yrs", ZipCode = "98005" },
20-
new DataPoint(){ Label = 1, Education = "0-5yrs", ZipCode = "98052" },
21-
new DataPoint(){ Label = 45, Education = "6-11yrs", ZipCode = "98005" },
22-
new DataPoint(){ Label = 50, Education = "6-11yrs", ZipCode = "98052" },
23-
new DataPoint(){ Label = 50, Education = "11-15yrs", ZipCode = "98005" },
19+
new DataPoint(){ Education = "0-5yrs" },
20+
new DataPoint(){ Education = "0-5yrs" },
21+
new DataPoint(){ Education = "6-11yrs" },
22+
new DataPoint(){ Education = "6-11yrs" },
23+
new DataPoint(){ Education = "11-15yrs" },
2424
};
2525

2626
// Convert training data to IDataView.
@@ -71,11 +71,7 @@ private static void PrintDataColumn(IDataView transformedData, string columnName
7171
}
7272
private class DataPoint
7373
{
74-
public float Label { get; set; }
75-
7674
public string Education { get; set; }
77-
78-
public string ZipCode { get; set; }
7975
}
8076
}
8177
}

docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/Categorical/OneHotEncodingMultiColumn.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public static void Example()
1414
// Get a small dataset as an IEnumerable.
1515
var samples = new List<DataPoint>()
1616
{
17-
new DataPoint(){ Label = 0, Education = "0-5yrs", ZipCode = "98005" },
18-
new DataPoint(){ Label = 1, Education = "0-5yrs", ZipCode = "98052" },
19-
new DataPoint(){ Label = 45, Education = "6-11yrs", ZipCode = "98005" },
20-
new DataPoint(){ Label = 50, Education = "6-11yrs", ZipCode = "98052" },
21-
new DataPoint(){ Label = 50, Education = "11-15yrs", ZipCode = "98005" },
17+
new DataPoint(){ Education = "0-5yrs", ZipCode = "98005" },
18+
new DataPoint(){ Education = "0-5yrs", ZipCode = "98052" },
19+
new DataPoint(){ Education = "6-11yrs", ZipCode = "98005" },
20+
new DataPoint(){ Education = "6-11yrs", ZipCode = "98052" },
21+
new DataPoint(){ Education = "11-15yrs", ZipCode = "98005" },
2222
};
2323

2424
// Convert training data to IDataView.
@@ -49,8 +49,6 @@ public static void Example()
4949

5050
private class DataPoint
5151
{
52-
public float Label { get; set; }
53-
5452
public string Education { get; set; }
5553

5654
public string ZipCode { get; set; }

docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/Categorical/OneHotHashEncoding.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ public static void Example()
1616
// Get a small dataset as an IEnumerable.
1717
var samples = new List<DataPoint>()
1818
{
19-
new DataPoint(){ Label = 0, Education = "0-5yrs", ZipCode = "98005" },
20-
new DataPoint(){ Label = 1, Education = "0-5yrs", ZipCode = "98052" },
21-
new DataPoint(){ Label = 45, Education = "6-11yrs", ZipCode = "98005" },
22-
new DataPoint(){ Label = 50, Education = "6-11yrs", ZipCode = "98052" },
23-
new DataPoint(){ Label = 50, Education = "11-15yrs", ZipCode = "98005" },
19+
new DataPoint(){ Education = "0-5yrs" },
20+
new DataPoint(){ Education = "0-5yrs" },
21+
new DataPoint(){ Education = "6-11yrs" },
22+
new DataPoint(){ Education = "6-11yrs" },
23+
new DataPoint(){ Education = "11-15yrs" },
2424
};
2525

2626
// Convert training data to IDataView.
@@ -77,11 +77,7 @@ private static void PrintDataColumn(IDataView transformedData, string columnName
7777

7878
private class DataPoint
7979
{
80-
public float Label { get; set; }
81-
8280
public string Education { get; set; }
83-
84-
public string ZipCode { get; set; }
8581
}
8682
}
8783
}

docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/Categorical/OneHotHashEncodingMultiColumn.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public static void Example()
1414
// Get a small dataset as an IEnumerable.
1515
var samples = new List<DataPoint>()
1616
{
17-
new DataPoint(){ Label = 0, Education = "0-5yrs", ZipCode = "98005" },
18-
new DataPoint(){ Label = 1, Education = "0-5yrs", ZipCode = "98052" },
19-
new DataPoint(){ Label = 45, Education = "6-11yrs", ZipCode = "98005" },
20-
new DataPoint(){ Label = 50, Education = "6-11yrs", ZipCode = "98052" },
21-
new DataPoint(){ Label = 50, Education = "11-15yrs", ZipCode = "98005" },
17+
new DataPoint(){ Education = "0-5yrs", ZipCode = "98005" },
18+
new DataPoint(){ Education = "0-5yrs", ZipCode = "98052" },
19+
new DataPoint(){ Education = "6-11yrs", ZipCode = "98005" },
20+
new DataPoint(){ Education = "6-11yrs", ZipCode = "98052" },
21+
new DataPoint(){ Education = "11-15yrs", ZipCode = "98005" },
2222
};
2323

2424
// Convert training data to IDataView.
@@ -49,8 +49,6 @@ public static void Example()
4949

5050
private class DataPoint
5151
{
52-
public float Label { get; set; }
53-
5452
public string Education { get; set; }
5553

5654
public string ZipCode { get; set; }

0 commit comments

Comments
 (0)