Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions src/python/nimbusml/base_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ def fit_transform(self, X, y=None, as_binary_data_stream=False,
:param X: array-like with shape=[n_samples, n_features] or else
:py:class:`nimbusml.FileDataStream`
:param y: array-like with shape=[n_samples]
:return: pandas.DataFrame
:param as_binary_data_stream: If ``True`` then output an IDV file.
See `here <https://github.com/dotnet/machinelearning/blob/master/docs/code/IDataViewImplementation.md>`_
for more information.
:param params: Additional arguments.
If ``as_csr=True`` and ``as_binary_data_stream=False`` then
return the transformed data in CSR (sparse matrix) format.
If ``as_binary_data_stream`` is also true then that
parameter takes precedence over ``as_csr`` and the output will
be an IDV file.

:return: Returns a pandas DataFrame if no other output format
is specified. See ``as_binary_data_stream`` and ``as_csr``
for other available output formats.
"""
pipeline = Pipeline([self])
try:
Expand Down Expand Up @@ -88,8 +100,20 @@ def transform(self, X, as_binary_data_stream=False, **params):
Applies transform to data.

:param X: array-like with shape=[n_samples, n_features] or else
:py:class:`nimbusml.FileDataStream`
:return: pandas.DataFrame
:py:class:`nimbusml.FileDataStream`
:param as_binary_data_stream: If ``True`` then output an IDV file.
See `here <https://github.com/dotnet/machinelearning/blob/master/docs/code/IDataViewImplementation.md>`_
for more information.
:param params: Additional arguments.
If ``as_csr=True`` and ``as_binary_data_stream=False`` then
return the transformed data in CSR (sparse matrix) format.
If ``as_binary_data_stream`` is also true then that
parameter takes precedence over ``as_csr`` and the output will
be an IDV file.

:return: Returns a pandas DataFrame if no other output format
is specified. See ``as_binary_data_stream`` and ``as_csr``
for other available output formats.
"""
# Check that the input is of the same shape as the one passed
# during
Expand Down
27 changes: 26 additions & 1 deletion src/python/nimbusml/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,19 @@ def fit_transform(
:param X: {array-like [n_samples, n_features],
:py:func:`FileDataStream <nimbusml.FileDataStream>` }
:param y: {array-like [n_samples]}
:param as_binary_data_stream: If ``True`` then output an IDV file.
See `here <https://github.com/dotnet/machinelearning/blob/master/docs/code/IDataViewImplementation.md>`_
for more information.
:param params: Additional arguments.
If ``as_csr=True`` and ``as_binary_data_stream=False`` then
return the transformed data in CSR (sparse matrix) format.
If ``as_binary_data_stream`` is also true then that
parameter takes precedence over ``as_csr`` and the output will
be an IDV file.

:return: Returns a pandas DataFrame if no other output format
is specified. See ``as_binary_data_stream`` and ``as_csr``
for other available output formats.
"""
self.fit(
X,
Expand Down Expand Up @@ -2447,7 +2460,19 @@ def transform(
:param X: {array-like [n_samples, n_features],
:py:class:`nimbusml.FileDataStream` }
:param y: {array-like [n_samples]}

:param as_binary_data_stream: If ``True`` then output an IDV file.
See `here <https://github.com/dotnet/machinelearning/blob/master/docs/code/IDataViewImplementation.md>`_
for more information.
:param params: Additional arguments.
If ``as_csr=True`` and ``as_binary_data_stream=False`` then
return the transformed data in CSR (sparse matrix) format.
If ``as_binary_data_stream`` is also true then that
parameter takes precedence over ``as_csr`` and the output will
be an IDV file.

:return: Returns a pandas DataFrame if no other output format
is specified. See ``as_binary_data_stream`` and ``as_csr``
for other available output formats.
"""
# start the clock!
start_time = time.time()
Expand Down