Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BACKPORT] Implements mars.learn.preprocessing.{LabelBinarizer, label_binarize} (#2415) #2421

Merged
merged 1 commit into from
Sep 3, 2021
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
272 changes: 178 additions & 94 deletions docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/reference.po

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions docs/source/reference/learn/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,21 @@ Ensemble Methods
ensemble.BlockwiseVotingClassifier
ensemble.BlockwiseVotingRegressor

.. _linear_model_ref:

Linear Models
=============

Classical linear regressors
---------------------------

.. currentmodule:: mars.learn

.. autosummary::
:toctree: generated/

linear_model.LinearRegression

.. _metrics_ref:

Metrics
Expand Down Expand Up @@ -198,8 +213,10 @@ Preprocessing and Normalization
.. autosummary::
:toctree: generated/

preprocessing.LabelBinarizer
preprocessing.MinMaxScaler
preprocessing.minmax_scale
preprocessing.label_binarize
preprocessing.normalize

.. _semi_supervised_ref:
Expand Down
8 changes: 4 additions & 4 deletions mars/learn/contrib/tensorflow/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
@require_not_none(tf)
class MarsDataset:
def __init__(self, tensors,
output_shapes=None,
output_types=None,
output_shapes: Tuple[int, ...]=None,
output_types: Tuple[np.dtype, ...]=None,
fetch_kwargs=None):

self._context = get_context()
Expand Down Expand Up @@ -123,8 +123,8 @@ def make_generator(): # pragma: no cover


def gen_tensorflow_dataset(tensors,
output_shapes=None,
output_types=None,
output_shapes: Tuple[int, ...]=None,
output_types: Tuple[np.dtype, ...]=None,
fetch_kwargs=None):
"""
convert mars data type to tf.data.Dataset. Note this is based tensorflow 2.0
Expand Down
9 changes: 3 additions & 6 deletions mars/learn/preprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

try:
from ._data import MinMaxScaler
from ._data import minmax_scale
except ImportError: # pragma: no cover
# sklearn not installed
pass
from ._data import MinMaxScaler
from ._data import minmax_scale
from ._label import LabelBinarizer, label_binarize
from .normalize import normalize
Loading