Skip to content

Commit 89694dc

Browse files
author
GOEddieUK
committed
changes after feedback
1 parent 01d40f8 commit 89694dc

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/csharp/Microsoft.Spark.E2ETest/IpcTests/ML/Feature/BucketizerTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public void TestBucketizer()
2828
var expectedSplits =
2929
new double[] { double.MinValue, 0.0, 10.0, 50.0, double.MaxValue };
3030

31-
string expectedHandle = "skip";
32-
string expectedUid = "uid";
33-
string expectedInputCol = "input_col";
34-
string expectedOutputCol = "output_col";
31+
const string expectedHandle = "skip";
32+
const string expectedUid = "uid";
33+
const string expectedInputCol = "input_col";
34+
const string expectedOutputCol = "output_col";
3535

3636
var bucketizer = new Bucketizer(expectedUid);
3737
bucketizer.SetInputCol(expectedInputCol)

src/csharp/Microsoft.Spark.E2ETest/IpcTests/ML/Feature/FeatureBaseTests.cs

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ namespace Microsoft.Spark.E2ETest.IpcTests.ML.Feature
1010
{
1111
public static class FeatureBaseTests<T>
1212
{
13+
/// <summary>
14+
/// Tests the common functionality across all ML.Feature classes.
15+
/// </summary>
16+
/// <param name="testObject">The object that implemented FeatureBase</param>
17+
/// <param name="paramName">The name of a parameter that can be set on this object</param>
18+
/// <param name="paramValue">A parameter value that can be set on this object</param>
1319
internal static void TestBase(
1420
FeatureBase<T> testObject,
1521
string paramName,

src/csharp/Microsoft.Spark.E2ETest/IpcTests/ML/Feature/FeatureHasherTests.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ public FeatureHasherTests(SparkFixture fixture)
2020
{
2121
_spark = fixture.Spark;
2222
}
23-
23+
24+
/// <summary>
25+
/// Create a <see cref="DataFrame"/>, create a <see cref="FeatureHasher"/> and test the
26+
/// available methods. Test the FeatureBase methods using <see cref="FeatureBaseTests"/>.
27+
/// </summary>
2428
[Fact]
2529
public void TestFeatureHasher()
2630
{

src/csharp/Microsoft.Spark/ML/Feature/FeatureHasher.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public FeatureHasher SetCategoricalCols(IEnumerable<string> value) =>
6161
/// Gets the columns that the <see cref="FeatureHasher"/> should read from and convert into
6262
/// hashes. This would have been set by SetInputCol.
6363
/// </summary>
64-
/// <returns>IEnumerable&lt;string&gt;, the input columns</returns>
64+
/// <returns>List of the input columns, set by SetInputCols</returns>
6565
public IEnumerable<string> GetInputCols() => (string[])_jvmObject.Invoke("getInputCols");
6666

6767
/// <summary>
@@ -88,7 +88,7 @@ public FeatureHasher SetInputCols(IEnumerable<string> value) =>
8888
/// the numFeatures parameter; otherwise the features will not be mapped evenly to the
8989
/// columns.
9090
/// </summary>
91-
/// <param name="value">int</param>
91+
/// <param name="value">int value of number of features</param>
9292
/// <returns>New <see cref="FeatureHasher"/> object</returns>
9393
public FeatureHasher SetNumFeatures(int value) =>
9494
WrapAsFeatureHasher(_jvmObject.Invoke("setNumFeatures", value));
@@ -101,8 +101,7 @@ public FeatureHasher SetNumFeatures(int value) =>
101101
public string GetOutputCol() => (string)_jvmObject.Invoke("getOutputCol");
102102

103103
/// <summary>
104-
/// The <see cref="FeatureHasher"/> will create a new column in the DataFrame, this is the
105-
/// name of the new column.
104+
/// Sets the name of the new column in the <see cref="DataFrame"/> created by Transform.
106105
/// </summary>
107106
/// <param name="value">The name of the new column which will contain the hash</param>
108107
/// <returns>New <see cref="FeatureHasher"/> object</returns>
@@ -122,7 +121,7 @@ public DataFrame Transform(DataFrame value) =>
122121
/// Check transform validity and derive the output schema from the input schema.
123122
///
124123
/// This checks for validity of interactions between parameters during Transform and
125-
/// raises an exception if any parameter value is invalid.
124+
/// raises an exception if any parameter value is invalid.
126125
///
127126
/// Typical implementation should first conduct verification on schema change and parameter
128127
/// validity, including complex parameter interaction checks.

0 commit comments

Comments
 (0)