diff --git a/src/python/docs/docstrings/PrefixColumnConcatenator.txt b/src/python/docs/docstrings/PrefixColumnConcatenator.txt new file mode 100644 index 00000000..aac3d116 --- /dev/null +++ b/src/python/docs/docstrings/PrefixColumnConcatenator.txt @@ -0,0 +1,44 @@ + """ + + Combines several columns into a single vector-valued column by prefix. + + .. remarks:: + ``PrefixColumnConcatenator`` creates a single vector-valued column from + multiple + columns. It can be performed on data before training a model. The + concatenation + can significantly speed up the processing of data when the number of + columns + is as large as hundreds to thousands. + + :param columns: a dictionary of key-value pairs, where key is the output + column name and value is a list of input column names. + + * Only one key-value pair is allowed. + * Input column type: numeric or string. + * Output column type: + `Vector Type `_. + + The << operator can be used to set this value (see + `Column Operator `_) + + For example + * ColumnConcatenator(columns={'features': ['age', 'parity', + 'induced']}) + * ColumnConcatenator() << {'features': ['age', 'parity', + 'induced']}) + + For more details see `Columns `_. + + .. seealso:: + :py:class:`ColumnDropper + `, + :py:class:`ColumnSelector + `. + + .. index:: transform, schema + + Example: + .. literalinclude:: /../nimbusml/examples/PrefixColumnConcatenator.py + :language: python + """ diff --git a/src/python/nimbusml/internal/core/preprocessing/schema/prefixcolumnconcatenator.py b/src/python/nimbusml/internal/core/preprocessing/schema/prefixcolumnconcatenator.py index d202e947..003e909f 100644 --- a/src/python/nimbusml/internal/core/preprocessing/schema/prefixcolumnconcatenator.py +++ b/src/python/nimbusml/internal/core/preprocessing/schema/prefixcolumnconcatenator.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------------------------- +# - Generated by tools/entrypoint_compiler.py: do not edit by hand """ PrefixColumnConcatenator """ @@ -15,10 +16,12 @@ from ...base_pipeline_item import BasePipelineItem, DefaultSignature -class PrefixColumnConcatenator(BasePipelineItem, DefaultSignature): +class PrefixColumnConcatenator( + BasePipelineItem, + DefaultSignature): """ - Combines several columns into a single vector-valued column by prefix + Combines several columns into a single vector-valued column by prefix. .. remarks:: ``PrefixColumnConcatenator`` creates a single vector-valued column from diff --git a/src/python/nimbusml/preprocessing/schema/prefixcolumnconcatenator.py b/src/python/nimbusml/preprocessing/schema/prefixcolumnconcatenator.py index 9a3aa443..6e0662e1 100644 --- a/src/python/nimbusml/preprocessing/schema/prefixcolumnconcatenator.py +++ b/src/python/nimbusml/preprocessing/schema/prefixcolumnconcatenator.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------------------------- +# - Generated by tools/entrypoint_compiler.py: do not edit by hand """ PrefixColumnConcatenator """ @@ -17,7 +18,10 @@ from ...internal.utils.utils import trace -class PrefixColumnConcatenator(core, BaseTransform, TransformerMixin): +class PrefixColumnConcatenator( + core, + BaseTransform, + TransformerMixin): """ Combines several columns into a single vector-valued column by prefix. diff --git a/src/python/tools/code_fixer.py b/src/python/tools/code_fixer.py index 21b6d1f4..3aa233ac 100644 --- a/src/python/tools/code_fixer.py +++ b/src/python/tools/code_fixer.py @@ -247,12 +247,18 @@ def fix_code(class_name, filename): all_args['output_for_sub_graph'] = {'Model' : \ all_args['predictor_model']}""" +prefixcolumnconcatenator_1 = "output_columns = input_columns" +prefixcolumnconcatenator_1_correct = """raise ValueError( + "'None' output passed when it cannot be none.")""" + signature_fixes_core = { 'NGramFeaturizer': (textTransform_1, textTransform_1_correct), 'ColumnConcatenator': [(concatColumns_1, concatColumns_1_correct)], 'ColumnSelector': [(columnselector_1, columnselector_1_correct)], 'OneVsRestClassifier': [ (onevsrestclassifier_1, onevsrestclassifier_1_correct)], + 'PrefixColumnConcatenator': (prefixcolumnconcatenator_1, + prefixcolumnconcatenator_1_correct) } diff --git a/src/python/tools/manifest_diff.json b/src/python/tools/manifest_diff.json index 68ab2fa5..a8cd262e 100644 --- a/src/python/tools/manifest_diff.json +++ b/src/python/tools/manifest_diff.json @@ -785,6 +785,12 @@ "NewName": "TypeConverter", "Module": "preprocessing.schema", "Type": "Transform" + }, + { + "Name": "Transforms.PrefixColumnConcatenator", + "NewName": "PrefixColumnConcatenator", + "Module": "preprocessing.schema", + "Type": "Transform" } ], "Components": [