Skip to content

Commit 3769398

Browse files
committed
Merge branch 'master' into scrub-hash-ngrams
2 parents 97469bc + abc2d63 commit 3769398

File tree

59 files changed

+1044
-949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1044
-949
lines changed

docs/code/MlNetCookBook.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ var pipeline =
512512
// Convert each categorical feature into one-hot encoding independently.
513513
mlContext.Transforms.Categorical.OneHotEncoding("CategoricalOneHot", "CategoricalFeatures")
514514
// Convert all categorical features into indices, and build a 'word bag' of these.
515-
.Append(mlContext.Transforms.Categorical.OneHotEncoding("CategoricalBag", "CategoricalFeatures", OneHotEncodingTransformer.OutputKind.Bag))
515+
.Append(mlContext.Transforms.Categorical.OneHotEncoding("CategoricalBag", "CategoricalFeatures", OneHotEncodingEstimator.OutputKind.Bag))
516516
// One-hot encode the workclass column, then drop all the categories that have fewer than 10 instances in the train set.
517517
.Append(mlContext.Transforms.Categorical.OneHotEncoding("WorkclassOneHot", "Workclass"))
518518
.Append(mlContext.Transforms.FeatureSelection.SelectFeaturesBasedOnCount("WorkclassOneHotTrimmed", "WorkclassOneHot", count: 10));

docs/samples/Microsoft.ML.Samples/Dynamic/KeyToValueValueToKey.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public static void Example()
3434
.Append(ml.Transforms.Conversion.MapValueToKey(defaultColumnName, "Review"));
3535

3636
// Another pipeline, that customizes the advanced settings of the ValueToKeyMappingEstimator.
37-
// We can change the maxNumTerm to limit how many keys will get generated out of the set of words,
38-
// and condition the order in which they get evaluated by changing sort from the default Occurence (order in which they get encountered)
37+
// We can change the maximumNumberOfKeys to limit how many keys will get generated out of the set of words,
38+
// and condition the order in which they get evaluated by changing keyOrdinality from the default ByOccurence (order in which they get encountered)
3939
// to value/alphabetically.
4040
string customizedColumnName = "CustomizedKeys";
4141
var customized_pipeline = ml.Transforms.Text.TokenizeWords("Review")
42-
.Append(ml.Transforms.Conversion.MapValueToKey(customizedColumnName, "Review", maxNumKeys: 10, sort: ValueToKeyMappingEstimator.SortOrder.Value));
42+
.Append(ml.Transforms.Conversion.MapValueToKey(customizedColumnName, "Review", maximumNumberOfKeys: 10, keyOrdinality: ValueToKeyMappingEstimator.KeyOrdinality.ByValue));
4343

4444
// The transformed data.
4545
var transformedData_default = default_pipeline.Fit(trainData).Transform(trainData);

docs/samples/Microsoft.ML.Samples/Dynamic/TensorFlow/TextClassification.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static void Example()
6969
};
7070

7171
var engine = mlContext.Transforms.Text.TokenizeWords("TokenizedWords", "Sentiment_Text")
72-
.Append(mlContext.Transforms.Conversion.ValueMap(lookupMap, "Words", "Ids", new ColumnOptions[] { ("VariableLenghtFeatures", "TokenizedWords") }))
72+
.Append(mlContext.Transforms.Conversion.MapValue(lookupMap, "Words", "Ids", new ColumnOptions[] { ("VariableLenghtFeatures", "TokenizedWords") }))
7373
.Append(mlContext.Transforms.CustomMapping(ResizeFeaturesAction, "Resize"))
7474
.Append(tensorFlowModel.ScoreTensorFlowModel(new[] { "Prediction/Softmax" }, new[] { "Features" }))
7575
.Append(mlContext.Transforms.CopyColumns(("Prediction", "Prediction/Softmax")))

docs/samples/Microsoft.ML.Samples/Dynamic/TextTransform.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void Example()
3636
KeepPunctuations = false,
3737
KeepNumbers = false,
3838
OutputTokens = true,
39-
TextLanguage = TextFeaturizingEstimator.Language.English, // supports English, French, German, Dutch, Italian, Spanish, Japanese
39+
Language = TextFeaturizingEstimator.Language.English, // supports English, French, German, Dutch, Italian, Spanish, Japanese
4040
}, "SentimentText");
4141

4242
// The transformed data for both pipelines.

docs/samples/Microsoft.ML.Samples/Dynamic/ValueMapping.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static void Example()
5555
};
5656

5757
// Constructs the ValueMappingEstimator making the ML.net pipeline
58-
var pipeline = mlContext.Transforms.Conversion.ValueMap(educationKeys, educationValues, ("EducationCategory", "Education"));
58+
var pipeline = mlContext.Transforms.Conversion.MapValue(educationKeys, educationValues, ("EducationCategory", "Education"));
5959

6060
// Fits the ValueMappingEstimator and transforms the data converting the Education to EducationCategory.
6161
IDataView transformedData = pipeline.Fit(trainData).Transform(trainData);

docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingFloatToString.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void Example()
4646
};
4747

4848
// Constructs the ValueMappingEstimator making the ML.net pipeline
49-
var pipeline = mlContext.Transforms.Conversion.ValueMap(temperatureKeys, classificationValues, ("TemperatureCategory", "Temperature"));
49+
var pipeline = mlContext.Transforms.Conversion.MapValue(temperatureKeys, classificationValues, ("TemperatureCategory", "Temperature"));
5050

5151
// Fits the ValueMappingEstimator and transforms the data adding the TemperatureCategory column.
5252
IDataView transformedData = pipeline.Fit(trainData).Transform(trainData);

docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToArray.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void Example()
4949
};
5050

5151
// Constructs the ValueMappingEstimator making the ML.net pipeline
52-
var pipeline = mlContext.Transforms.Conversion.ValueMap<string, int>(educationKeys, educationValues, ("EducationFeature", "Education"));
52+
var pipeline = mlContext.Transforms.Conversion.MapValue<string, int>(educationKeys, educationValues, ("EducationFeature", "Education"));
5353

5454
// Fits the ValueMappingEstimator and transforms the data adding the EducationFeature column.
5555
IDataView transformedData = pipeline.Fit(trainData).Transform(trainData);

docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToKeyType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static void Example()
5555
// Generate the ValueMappingEstimator that will output KeyTypes even though our values are strings.
5656
// The KeyToValueMappingEstimator is added to provide a reverse lookup of the KeyType, converting the KeyType value back
5757
// to the original value.
58-
var pipeline = mlContext.Transforms.Conversion.ValueMap<string, string>(educationKeys, educationValues, true, ("EducationKeyType", "Education"))
58+
var pipeline = mlContext.Transforms.Conversion.MapValue<string, string>(educationKeys, educationValues, true, ("EducationKeyType", "Education"))
5959
.Append(mlContext.Transforms.Conversion.MapKeyToValue(("EducationCategory", "EducationKeyType")));
6060

6161
// Fits the ValueMappingEstimator and transforms the data adding the EducationKeyType column.

0 commit comments

Comments
 (0)