diff --git a/README.rst b/README.rst index 6a59e48a5c..c8491e44a5 100644 --- a/README.rst +++ b/README.rst @@ -141,7 +141,7 @@ Mars learn provides a familiar interface like scikit-learn. Mars learn also integrates with many libraries: - `TensorFlow `_ -- PyTorch +- `PyTorch `_ - `XGBoost `_ - `LightGBM `_ - `Joblib `_ diff --git a/docs/source/getting_started/learn.rst b/docs/source/getting_started/learn.rst index d84982f69f..941bbe5419 100644 --- a/docs/source/getting_started/learn.rst +++ b/docs/source/getting_started/learn.rst @@ -33,9 +33,9 @@ For implemented learn API, refer to :ref:`learn API reference `. Mars learn can integrate with XGBoost, LightGBM, TensorFlow and PyTorch. -- For XGBoost, refer to :ref:`integrate_xgboost`. -- For LightGBM, refer to :ref:`integrate_lightgbm`. -- For TensorFlow, refer to :ref:`integrate_tensorflow`. -- For PyTorch, doc is coming soon. -- For Joblib, refer to :ref:`integrate_joblib`. -- For Statsmodels, refer to :ref:`integrate_statsmodels`. +- :ref:`XGBoost `. +- :ref:`LightGBM `. +- :ref:`TensorFlow `. +- :ref:`PyTorch `. +- :ref:`Joblib `. +- :ref:`Statesmodels `. diff --git a/docs/source/index.rst b/docs/source/index.rst index 059057d919..2157719c46 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -114,8 +114,14 @@ Mars learn provides a familiar interface like scikit-learn. | | | +---------------------------------------------+----------------------------------------------------+ -Mars learn has also integrated many libraries, including :ref:`tensorflow`, -:ref:`xgboost`, :ref:`lightgbm`, :ref:`joblib` and :ref:`statsmodels`. +Mars learn also integrates with many libraries: + +- :ref:`TensorFlow ` +- :ref:`PyTorch ` +- :ref:`XGBoost ` +- :ref:`LightGBM ` +- :ref:`Joblib ` +- :ref:`Statsmodels ` Mars remote ----------- diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/getting_started/learn.po b/docs/source/locale/zh_CN/LC_MESSAGES/getting_started/learn.po index 38895fb57b..6b1326f2d2 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/getting_started/learn.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/getting_started/learn.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.5.0a2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-03 18:42+0800\n" +"POT-Creation-Date: 2021-08-20 11:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,18 +53,25 @@ msgid "Mars learn can integrate with XGBoost, LightGBM, TensorFlow and PyTorch." msgstr "Mars learn 能和 XGBoost、LightGBM、TensorFlow 以及 PyTorch 集成。" #: ../../source/getting_started/learn.rst:36 -msgid "For XGBoost, refer to :ref:`xgboost`." -msgstr "XGBoost 参考 :ref:`xgboost`。" +msgid ":ref:`XGBoost `." +msgstr "" #: ../../source/getting_started/learn.rst:37 -msgid "For LightGBM, refer to :ref:`lightgbm`." -msgstr "LightGBM 参考 :ref:`lightgbm`。" +msgid ":ref:`LightGBM `." +msgstr "" #: ../../source/getting_started/learn.rst:38 -msgid "For TensorFlow, refer to :ref:`tensorflow`." -msgstr "TensorFlow 参考 :ref:`tensorflow`。" +msgid ":ref:`TensorFlow `." +msgstr "" #: ../../source/getting_started/learn.rst:39 -msgid "For PyTorch, doc is coming soon." -msgstr "PyTorch 集成的文档尚在编写中。" +msgid ":ref:`PyTorch `." +msgstr "" +#: ../../source/getting_started/learn.rst:40 +msgid ":ref:`Joblib `." +msgstr "" + +#: ../../source/getting_started/learn.rst:41 +msgid ":ref:`Statesmodels `." +msgstr "" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/index.po b/docs/source/locale/zh_CN/LC_MESSAGES/index.po index 1e8609757c..90c9f4d9d7 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/index.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mars \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-03 18:42+0800\n" +"POT-Creation-Date: 2021-08-20 11:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,8 +25,9 @@ msgstr "Mars 文档" msgid "" "Mars is a tensor-based unified framework for large-scale data computation" " which scales numpy, pandas, scikit-learn and many other libraries." -msgstr "Mars 是基于张量的,用于进行大规模数据计算的统一计算框架," -"它可以用来并行和分布式 numpy、pandas、scikit-learn 以及众多其他 Python 库。" +msgstr "" +"Mars 是基于张量的,用于进行大规模数据计算的统一计算框架,它可以用来并行和" +"分布式 numpy、pandas、scikit-learn 以及众多其他 Python 库。" #: ../../source/index.rst:11 msgid "Architecture Overview" @@ -111,32 +112,50 @@ msgid "**Mars learn**" msgstr "**Mars learn**" #: ../../source/index.rst:117 -msgid "" -"Mars learn has also integrated many libraries, including " -":ref:`tensorflow`, :ref:`xgboost`, :ref:`lightgbm`, :ref:`joblib` and " -":ref:`statsmodels`." +msgid "Mars learn also integrates with many libraries:" +msgstr "Mars learn 也集成了许多库:" + +#: ../../source/index.rst:119 +msgid ":ref:`TensorFlow `" +msgstr "" + +#: ../../source/index.rst:120 +msgid ":ref:`PyTorch `" msgstr "" -"Mars learn 还集成了很多库,包括 " -":ref:`tensorflow`, :ref:`xgboost`, :ref:`lightgbm`, :ref:`joblib` and " -":ref:`statsmodels`." #: ../../source/index.rst:121 -msgid "Mars remote" +msgid ":ref:`XGBoost `" +msgstr "" + +#: ../../source/index.rst:122 +msgid ":ref:`LightGBM `" msgstr "" #: ../../source/index.rst:123 +msgid ":ref:`Joblib `" +msgstr "" + +#: ../../source/index.rst:124 +msgid ":ref:`Statsmodels `" +msgstr "" + +#: ../../source/index.rst:127 +msgid "Mars remote" +msgstr "" + +#: ../../source/index.rst:129 msgid ":doc:`documentation `" msgstr ":doc:`文档 `" -#: ../../source/index.rst:125 +#: ../../source/index.rst:131 msgid "Mars remote allows users to execute functions in parallel." msgstr "Mars remote 允许用户并行执行函数。" -#: ../../source/index.rst:161 +#: ../../source/index.rst:167 msgid "Easy to scale in and scale out" msgstr "适应各种数据规模" -#: ../../source/index.rst:163 +#: ../../source/index.rst:169 msgid "" "Mars can scale in to a single machine, and scale out to a cluster with " "hundreds of machines. Both the local and distributed version share the " @@ -147,23 +166,23 @@ msgstr "" "两种环境下可使用相同的代码。因此,Mars 可以方便地从单台机器迁移到集群,以" "处理更多数据或者获得更好的性能。" -#: ../../source/index.rst:168 +#: ../../source/index.rst:174 msgid "Mars can run in a few ways:" msgstr "Mars 能以若干种方式运行:" -#: ../../source/index.rst:170 +#: ../../source/index.rst:176 msgid ":ref:`Local scheduling `" msgstr ":ref:`本地执行 `" -#: ../../source/index.rst:171 +#: ../../source/index.rst:177 msgid ":ref:`Run on cluster `" msgstr ":ref:`在集群中运行 `" -#: ../../source/index.rst:172 +#: ../../source/index.rst:178 msgid ":ref:`Run on Kubernetes `" msgstr ":ref:`在 Kubernetes 中部署 `" -#: ../../source/index.rst:173 +#: ../../source/index.rst:179 msgid ":ref:`Run on Yarn `" msgstr ":ref:`在 Yarn 中部署 `" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/frame.po b/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/frame.po index 18d190e3e7..439695267d 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/frame.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/frame.po @@ -1192,6 +1192,14 @@ msgstr "" msgid "Create a scatter plot with varying marker point size and color." msgstr "" +#: ../../source/reference/dataframe/frame.rst:244::1 +msgid ":obj:`DataFrame.boxplot `\\" +msgstr "" + +#: ../../source/reference/dataframe/frame.rst:244::1 +msgid ":obj:`DataFrame.hist `\\" +msgstr "" + #: ../../source/reference/dataframe/frame.rst:248 msgid "Serialization / IO / conversion" msgstr "序列化、IO 和转换" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/indexing.po b/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/indexing.po index 8cd08563cd..a8704fce09 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/indexing.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/indexing.po @@ -35,6 +35,14 @@ msgstr "" msgid "Properties" msgstr "属性" +#: ../../source/reference/dataframe/indexing.rst:28::1 +msgid ":obj:`Index.dtype `\\" +msgstr "" + +#: ../../source/reference/dataframe/indexing.rst:28::1 +msgid ":obj:`Index.inferred_type `\\" +msgstr "" + #: ../../source/reference/dataframe/indexing.rst:28::1 msgid ":obj:`Index.is_monotonic `\\" msgstr "" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/series.po b/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/series.po index 410a48099c..3e61e353e5 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/series.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/reference/dataframe/series.po @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.5.0a2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-04 16:55+0800\n" +"POT-Creation-Date: 2021-08-03 18:42+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.9.1\n" +"Generated-By: Babel 2.7.0\n" #: ../../source/reference/dataframe/series.rst:3 msgid "Series" @@ -1462,6 +1462,10 @@ msgstr "" "``Series.str`` 可被用于以字符串方式访问 Series,并应用若干方法。这些功能" "可通过 ``Series.str.`` 来调用。" +#: ../../source/reference/dataframe/series.rst:371::1 +msgid ":obj:`Series.str.cgeneratedtalize `\\" +msgstr "" + #: ../../source/reference/dataframe/series.rst:371::1 msgid ":obj:`Series.str.casefold `\\ \\(\\)" msgstr "" @@ -1893,6 +1897,10 @@ msgstr "" msgid ":obj:`Series.str.isspace `\\ \\(\\)" msgstr "" +#: ../../source/reference/dataframe/series.rst:371::1 +msgid "Check whether all characters in each string are whitespace." +msgstr "" + #: ../../source/reference/dataframe/series.rst:371::1 msgid ":obj:`Series.str.islower `\\ \\(\\)" msgstr "" @@ -2039,6 +2047,10 @@ msgstr "" msgid "Generate a pie plot." msgstr "" +#: ../../source/reference/dataframe/series.rst:413::1 +msgid ":obj:`Series.hist `\\" +msgstr "" + #: ../../source/reference/dataframe/series.rst:415 msgid "Serialization / IO / conversion" msgstr "序列化、IO 和转换" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.po b/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.po index c892de6431..36491a0fb5 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.5.0a2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-16 16:57+0800\n" +"POT-Creation-Date: 2021-08-20 11:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,3 +21,34 @@ msgstr "" msgid "mars.learn.contrib.pytorch.MarsDataset" msgstr "" +#: mars.learn.contrib.pytorch.MarsDataset:1 of +msgid "" +"MarsDataset that inherit from torch.utils.data.Dataset. It converts from " +"Mars basic datatype such as Tensor, DataFrame, Series. Additionally, it's" +" constructor can receive np.ndarray, pd.DataFrame, pd.Series type." +msgstr "" + +#: mars.learn.contrib.pytorch.MarsDataset.__init__:1 of +msgid "Initialize self. See help(type(self)) for accurate signature." +msgstr "" + +#: ../../source/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.rst:13 +msgid "Methods" +msgstr "" + +#: ../../source/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.rst:17::1 +msgid "" +":obj:`__init__ `\\ " +"\\(\\*tileables\\[\\, fetch\\_kwargs\\]\\)" +msgstr "" + +#: ../../source/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.rst:17::1 +msgid "Initialize self." +msgstr "" + +#: ../../source/reference/learn/generated/mars.learn.contrib.pytorch.MarsDataset.rst:17::1 +msgid "" +":obj:`get_data `\\ " +"\\(t\\, index\\)" +msgstr "" + diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/reference.po b/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/reference.po index 07490175ae..5f745027bb 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/reference.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/reference/learn/reference.po @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.5.0a2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-04 16:55+0800\n" +"POT-Creation-Date: 2021-08-20 11:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.9.1\n" +"Generated-By: Babel 2.7.0\n" #: ../../source/reference/learn/reference.rst:5 msgid "Mars Learn" @@ -400,105 +400,198 @@ msgstr "LightGBM 集成" #: ../../source/reference/learn/reference.rst:222::1 msgid "" ":obj:`contrib.lightgbm.LGBMClassifier " -"`\\ \\(\\*\\_\\, " -"\\*\\*\\_\\_\\)" +"`\\ \\(\\*args\\, " +"\\*\\*kwargs\\)" msgstr "" #: ../../source/reference/learn/reference.rst:222::1 msgid "" ":obj:`contrib.lightgbm.LGBMRegressor " -"`\\ \\(\\*\\_\\, " -"\\*\\*\\_\\_\\)" +"`\\ \\(\\*args\\, " +"\\*\\*kwargs\\)" msgstr "" #: ../../source/reference/learn/reference.rst:222::1 msgid "" ":obj:`contrib.lightgbm.LGBMRanker " -"`\\ \\(\\*\\_\\, \\*\\*\\_\\_\\)" +"`\\ \\(\\*args\\, \\*\\*kwargs\\)" msgstr "" #: ../../source/reference/learn/reference.rst:226 msgid "PyTorch Integration" msgstr "PyTorch 集成" -#: ../../source/reference/learn/reference.rst:241::1 +#: ../../source/reference/learn/reference.rst:243::1 msgid "" ":obj:`contrib.pytorch.run_pytorch_script " "`\\ \\(script\\, ...\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:241::1 +#: ../../source/reference/learn/reference.rst:243::1 msgid "Run PyTorch script in Mars cluster." msgstr "" -#: ../../source/reference/learn/reference.rst:245 +#: ../../source/reference/learn/reference.rst:243::1 +msgid "" +":obj:`contrib.pytorch.MarsDataset " +"`\\ \\(\\*tileables\\[\\, " +"...\\]\\)" +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "MarsDataset that inherit from torch.utils.data.Dataset." +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "" +":obj:`contrib.pytorch.SequentialSampler " +"`\\ \\(data\\_source\\)" +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "\"Samples elements sequentially, always in the same order." +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "" +":obj:`contrib.pytorch.RandomSampler " +"`\\ \\(data\\_source\\[\\, " +"...\\]\\)" +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "\"" +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "" +":obj:`contrib.pytorch.SubsetRandomSampler " +"`\\ \\(indices\\)" +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "" +"Samples elements randomly from a given list of indices, without " +"replacement." +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "" +":obj:`contrib.pytorch.DistributedSampler " +"`\\ \\(dataset\\)" +msgstr "" + +#: ../../source/reference/learn/reference.rst:243::1 +msgid "Sampler that restricts data loading to a subset of the dataset." +msgstr "" + +#: ../../source/reference/learn/reference.rst:247 #, fuzzy msgid "StatsModels Integration" msgstr "XGBoost 集成" -#: ../../source/reference/learn/reference.rst:258::1 +#: ../../source/reference/learn/reference.rst:260::1 msgid "" ":obj:`contrib.statsmodels.MarsDistributedModel " "`\\ \\(\\[...\\]\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:258::1 +#: ../../source/reference/learn/reference.rst:260::1 msgid "" ":obj:`contrib.statsmodels.MarsResults " "`\\ \\(model\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:262 +#: ../../source/reference/learn/reference.rst:264 msgid "TensorFlow Integration" msgstr "TensorFlow 集成" -#: ../../source/reference/learn/reference.rst:274::1 +#: ../../source/reference/learn/reference.rst:276::1 msgid "" ":obj:`contrib.tensorflow.run_tensorflow_script " "`\\ \\(...\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:274::1 +#: ../../source/reference/learn/reference.rst:276::1 msgid "Run TensorFlow script in Mars cluster." msgstr "" -#: ../../source/reference/learn/reference.rst:278 +#: ../../source/reference/learn/reference.rst:280 msgid "XGBoost Integration" msgstr "XGBoost 集成" -#: ../../source/reference/learn/reference.rst:293::1 +#: ../../source/reference/learn/reference.rst:295::1 msgid "" ":obj:`contrib.xgboost.MarsDMatrix " "`\\ \\(data\\[\\, label\\, " "...\\]\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:293::1 +#: ../../source/reference/learn/reference.rst:295::1 msgid "" ":obj:`contrib.xgboost.train `\\ " "\\(params\\, dtrain\\[\\, evals\\]\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:293::1 +#: ../../source/reference/learn/reference.rst:295::1 msgid "Train XGBoost model in Mars manner." msgstr "" -#: ../../source/reference/learn/reference.rst:293::1 +#: ../../source/reference/learn/reference.rst:295::1 msgid "" ":obj:`contrib.xgboost.predict `\\ " "\\(model\\, data\\[\\, ...\\]\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:293::1 +#: ../../source/reference/learn/reference.rst:295::1 msgid "" ":obj:`contrib.xgboost.XGBClassifier " -"`\\ \\(\\*\\_\\, " -"\\*\\*\\_\\_\\)" +"`\\ \\(\\[max\\_depth\\, " +"...\\]\\)" msgstr "" -#: ../../source/reference/learn/reference.rst:293::1 +#: ../../source/reference/learn/reference.rst:295::1 +msgid "Implementation of the scikit-learn API for XGBoost classification." +msgstr "" + +#: ../../source/reference/learn/reference.rst:295::1 msgid "" ":obj:`contrib.xgboost.XGBRegressor " -"`\\ \\(\\*\\_\\, \\*\\*\\_\\_\\)" +"`\\ \\(\\[max\\_depth\\, " +"...\\]\\)" msgstr "" +#: ../../source/reference/learn/reference.rst:295::1 +msgid "Implementation of the scikit-learn API for XGBoost regressor." +msgstr "" + +#~ msgid "" +#~ ":obj:`contrib.lightgbm.LGBMClassifier " +#~ "`\\ \\(\\*\\_\\, " +#~ "\\*\\*\\_\\_\\)" +#~ msgstr "" + +#~ msgid "" +#~ ":obj:`contrib.lightgbm.LGBMRegressor " +#~ "`\\ \\(\\*\\_\\, " +#~ "\\*\\*\\_\\_\\)" +#~ msgstr "" + +#~ msgid "" +#~ ":obj:`contrib.lightgbm.LGBMRanker " +#~ "`\\ \\(\\*\\_\\, " +#~ "\\*\\*\\_\\_\\)" +#~ msgstr "" + +#~ msgid "" +#~ ":obj:`contrib.xgboost.XGBClassifier " +#~ "`\\ \\(\\*\\_\\, " +#~ "\\*\\*\\_\\_\\)" +#~ msgstr "" + +#~ msgid "" +#~ ":obj:`contrib.xgboost.XGBRegressor " +#~ "`\\ \\(\\*\\_\\, " +#~ "\\*\\*\\_\\_\\)" +#~ msgstr "" + diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/set.po b/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/set.po index bcf620bc57..c6c333ee0d 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/set.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/set.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.5.0a2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-16 16:57+0800\n" +"POT-Creation-Date: 2021-08-20 11:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,19 +25,29 @@ msgstr "集合函数" msgid "Boolean operations" msgstr "布尔运算" -#: ../../source/reference/tensor/set.rst:12::1 +#: ../../source/reference/tensor/set.rst:13::1 +msgid ":obj:`mars.tensor.in1d `" +msgstr "" + +#: ../../source/reference/tensor/set.rst:13::1 +msgid "" +"Test whether each element of a 1-D tensor is also present in a second " +"tensor." +msgstr "" + +#: ../../source/reference/tensor/set.rst:13::1 msgid ":obj:`mars.tensor.isin `" msgstr "" -#: ../../source/reference/tensor/set.rst:12::1 +#: ../../source/reference/tensor/set.rst:13::1 msgid "Calculates `element in test_elements`, broadcasting over `element` only." msgstr "" -#: ../../source/reference/tensor/set.rst:12::1 +#: ../../source/reference/tensor/set.rst:13::1 msgid ":obj:`mars.tensor.union1d `" msgstr "" -#: ../../source/reference/tensor/set.rst:12::1 +#: ../../source/reference/tensor/set.rst:13::1 msgid "Find the union of two tensors." msgstr "" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/statistics.po b/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/statistics.po index 4c4d0d7bbb..f09b852451 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/statistics.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/reference/tensor/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.5.0a2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-03 18:42+0800\n" +"POT-Creation-Date: 2021-08-20 11:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -185,55 +185,71 @@ msgstr "" msgid "Statistical tests" msgstr "统计检验" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid ":obj:`mars.tensor.stats.chisquare `" msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "Calculate a one-way chi-square test." msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 +msgid ":obj:`mars.tensor.stats.ks_1samp `" +msgstr "" + +#: ../../source/reference/tensor/statistics.rst:71::1 +msgid "Performs the one-sample Kolmogorov-Smirnov test for goodness of fit." +msgstr "" + +#: ../../source/reference/tensor/statistics.rst:71::1 +msgid ":obj:`mars.tensor.stats.ks_2samp `" +msgstr "" + +#: ../../source/reference/tensor/statistics.rst:71::1 +msgid "Compute the Kolmogorov-Smirnov statistic on 2 samples." +msgstr "" + +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "" ":obj:`mars.tensor.stats.power_divergence " "`" msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "Cressie-Read power divergence statistic and goodness of fit test." msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid ":obj:`mars.tensor.stats.ttest_1samp `" msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "Calculate the T-test for the mean of ONE group of scores." msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid ":obj:`mars.tensor.stats.ttest_ind `" msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "Calculate the T-test for the means of *two independent* samples of scores." msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "" ":obj:`mars.tensor.stats.ttest_ind_from_stats " "`" msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "T-test for means of two independent samples from descriptive statistics." msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid ":obj:`mars.tensor.stats.ttest_rel `" msgstr "" -#: ../../source/reference/tensor/statistics.rst:69::1 +#: ../../source/reference/tensor/statistics.rst:71::1 msgid "Calculate the t-test on TWO RELATED samples of scores, a and b." msgstr "" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/contrib/dask.po b/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/contrib/dask.po index 37e620243a..5b61d23571 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/contrib/dask.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/contrib/dask.po @@ -8,26 +8,30 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.8.0a1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-16 21:57+0800\n" +"POT-Creation-Date: 2021-08-20 11:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.9.1\n" +"Generated-By: Babel 2.7.0\n" #: ../../source/user_guide/contrib/dask.rst:5 msgid "Dask on Mars" msgstr "Dask on Mars" #: ../../source/user_guide/contrib/dask.rst:7 +msgid "New in version 0.8.0a2" +msgstr "自 0.8.0a2 起支持" + +#: ../../source/user_guide/contrib/dask.rst:9 msgid "" "Dask-on-Mars provides a simple way to execute the entire Dask ecosystem " "on top of Mars." msgstr "Dask-on-Mars 使得用户能通过简单的 API 调用,在 Mars 中运行大部分 Dask 任务" -#: ../../source/user_guide/contrib/dask.rst:9 +#: ../../source/user_guide/contrib/dask.rst:11 msgid "" "`Dask `__ is a flexible library for parallel computing" " in Python, geared towards scaling analytics and scientific computing " @@ -38,7 +42,7 @@ msgstr "" "`Dask `__ 是一个用于并行计算的 Python 库,旨在为大规模" "数据的分析和科学计算提供并行的计算解决方案。" -#: ../../source/user_guide/contrib/dask.rst:15 +#: ../../source/user_guide/contrib/dask.rst:17 msgid "" "For execution on Mars, you should *not* use the `Dask.distributed " "`__ client, " @@ -48,11 +52,11 @@ msgstr "" "distributed.dask.org/en/latest/quickstart.html>`__ 相关特性,只需使用普通" "的 Dask 特性和功能" -#: ../../source/user_guide/contrib/dask.rst:20 +#: ../../source/user_guide/contrib/dask.rst:22 msgid "Scheduler" msgstr "使用 Dask 调度器" -#: ../../source/user_guide/contrib/dask.rst:22 +#: ../../source/user_guide/contrib/dask.rst:24 msgid "" "The main API for Dask-on-Mars is :meth:`mars.contrib.dask.mars_scheduler`" ". It uses Dask’s scheduler API, which allows you to specify any callable" @@ -63,11 +67,11 @@ msgstr "" "兼容了 Dask 的 scheduler 接口,这使得用户可以直接指定使用 mars_scheduler " "来调度执行 Dask 任务。" -#: ../../source/user_guide/contrib/dask.rst:39 +#: ../../source/user_guide/contrib/dask.rst:41 msgid "Convert Dask Collections" msgstr "将 Dask 任务转变为 Mars 任务" -#: ../../source/user_guide/contrib/dask.rst:41 +#: ../../source/user_guide/contrib/dask.rst:43 msgid "" ":meth:`mars.contrib.dask.convert_dask_collection` can be used when user " "needs to manipulate dask collections with :ref:`Mars remote API `" @@ -80,7 +84,7 @@ msgstr "" "将 Dask 任务转变为 Mars 任务。这一函数返回的 Mars 对象与 :meth:`mars." "remote.spawn` 返回的对象类型一致。" -#: ../../source/user_guide/contrib/dask.rst:63 +#: ../../source/user_guide/contrib/dask.rst:65 msgid "" "Dask-on-Mars is an ongoing project. Please open an issue if you find that" " one of these dask functionalities doesn’t run on Mars." diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/learn/pytorch.po b/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/learn/pytorch.po index 058b944ada..0e65a209fd 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/learn/pytorch.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/user_guide/learn/pytorch.po @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: mars 0.8.0a1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-18 16:11+0800\n" +"POT-Creation-Date: 2021-08-20 11:13+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.9.1\n" +"Generated-By: Babel 2.7.0\n" #: ../../source/user_guide/learn/pytorch.rst:5 msgid "Integrate with PyTorch" @@ -25,8 +25,7 @@ msgstr "和Pytorch集成" msgid "" "This introduction will give a brief tour about how to integrate `PyTorch " "`_ in Mars." -msgstr "" -"这篇指引会介绍如何在 Mars 里集成 `PyTorch `_。" +msgstr "这篇指引会介绍如何在 Mars 里集成 `PyTorch `_。" #: ../../source/user_guide/learn/pytorch.rst:13 msgid "Installation" @@ -47,16 +46,16 @@ msgid "" "Visit `installation guide for PyTorch `_ for more information." msgstr "" -"访问 `PyTorch 安装指南 `_ " -"获取更多信息" +"访问 `PyTorch 安装指南 `_ 获取" +"更多信息" #: ../../source/user_guide/learn/pytorch.rst:27 msgid "" "On the other hand, if you are about to use Mars on a cluster, maker sure " "PyTorch is installed on each worker." msgstr "" -"另一方面,如果你打算在集群中使用 Mars,确保 PyTorch 在每一个worker上" -"已安装。" +"另一方面,如果你打算在集群中使用 Mars,确保 PyTorch 在每一个worker上已" +"安装。" #: ../../source/user_guide/learn/pytorch.rst:31 msgid "Prepare data" @@ -69,7 +68,7 @@ msgid "" " click link to download data." msgstr "" "这里我们使用 `ionosphere 数据集 `_, 点击链接下载数据。" +"learning-databases/ionosphere/>`_,点击链接下载数据。" #: ../../source/user_guide/learn/pytorch.rst:38 msgid "Prepare PyTorch script" @@ -80,21 +79,20 @@ msgid "" "Now we create a Python file called ``torch_demo.py`` which contains the " "logic of PyTorch." msgstr "" -"现在我们创建一个命名为 `torch_demo.py` 的 Python 文件,它包含了 PyTorch 的" -"处理逻辑。" +"现在我们创建一个命名为 `torch_demo.py` 的 Python 文件,它包含了 PyTorch " +"的处理逻辑。" -#: ../../source/user_guide/learn/pytorch.rst:121 +#: ../../source/user_guide/learn/pytorch.rst:119 msgid "" "Mars libraries including DataFrame and so forth could be used directly to" " process massive data and accelerate preprocess." -msgstr "" -"Mars DataFrame 等模块可以直接在脚本里使用,以处理大规模数据和加速预处理。" +msgstr "Mars DataFrame 等模块可以直接在脚本里使用,以处理大规模数据和加速预处理。" -#: ../../source/user_guide/learn/pytorch.rst:125 +#: ../../source/user_guide/learn/pytorch.rst:123 msgid "Run PyTorch script via Mars" msgstr "通过 Mars 运行 PyTorch 脚本" -#: ../../source/user_guide/learn/pytorch.rst:127 +#: ../../source/user_guide/learn/pytorch.rst:125 msgid "The PyTorch script can be submitted via :meth:`run_pytorch_script` now." msgstr "现在可以通过 :meth:`run_pytorch_script` 提交 PyTorch 脚本。" @@ -106,8 +104,7 @@ msgstr "分布式训练和推理" msgid "" "Refer to :ref:`deploy` section for deployment, or :ref:`k8s` section for " "running Mars on Kubernetes." -msgstr "" -"部署参考 :ref:`deploy` 部分, 在 Kubernetes 上运行参考 :ref:`k8s` 部分。" +msgstr "部署参考 :ref:`deploy` 部分, 在 Kubernetes 上运行参考 :ref:`k8s` 部分。" #: ../../source/user_guide/learn/pytorch.rst:146 msgid "" @@ -117,9 +114,9 @@ msgid "" "PyTorch script. " "`_." msgstr "" -"你能从 ``torch_demo.py`` 中看出,Mars 会自动设置相关的环境变量。你不需要考虑" -"分布式相关的设置,你需要做的是写一个正确的 `分布式PyTorch脚本 " -"`_。" +"你能从 ``torch_demo.py`` 中看出,Mars 会自动设置相关的环境变量。你不需要" +"考虑分布式相关的设置,你需要做的是写一个正确的 `分布式PyTorch脚本 `_。" #: ../../source/user_guide/learn/pytorch.rst:151 msgid "" @@ -136,27 +133,29 @@ msgstr "MarsDataset" #: ../../source/user_guide/learn/pytorch.rst:171 msgid "" -"In order to use Mars to process data, we implemented a MarsDataset that " -"can convert Mars object (mars.tensor, mars.dataframe, mars.series) to " -"torch.util.data.Dataset." +"In order to use Mars to process data, we implemented a " +":class:`MarsDataset` that can convert Mars object " +"(:class:`mars.tensor.Tensor`, :class:`mars.dataframe.DataFrame`, " +":class:`mars.dataframe.Series`) to ``torch.util.data.Dataset``." msgstr "" -"为了更好地使用 Mars 处理数据,我们实现了一个 MarsDataset 对象,继承 ``torch." -"util.data.Dataset`` , 能够接收Mars 类型的数据(mars.tensor, mars.dataframe, " -"mars.series)" +"为了更好地使用 Mars 处理数据,我们实现了一个 MarsDataset 对象,继承 ``" +"torch.util.data.Dataset``,能够接收Mars 类型的数据(:class:`mars.tensor." +"Tensor`、:class:`mars.dataframe.DataFrame`、:class:`mars.dataframe.Series" +"`)。" -#: ../../source/user_guide/learn/pytorch.rst:187 +#: ../../source/user_guide/learn/pytorch.rst:188 msgid "" "Now, :meth:`run_pytorch_script` allow pass data to script. So you can " "preprocess data via mars, then pass data to script." msgstr "" -"现在,:meth:`run_pytorch_script` 允许传送 Mars 类型的数据到脚本中。所以你可以" -"先通过 Mars 处理数据, 再将其传送到脚本中。" +"现在,:meth:`run_pytorch_script` 允许传送 Mars 类型的数据到脚本中。所以你" +"可以先通过 Mars 处理数据,再将其传送到脚本中。" -#: ../../source/user_guide/learn/pytorch.rst:199 +#: ../../source/user_guide/learn/pytorch.rst:208 msgid "``torch_script.py``" msgstr "``torch_script.py``" -#: ../../source/user_guide/learn/pytorch.rst:264 +#: ../../source/user_guide/learn/pytorch.rst:270 msgid "result:" msgstr "运行结果:" diff --git a/docs/source/user_guide/learn/index.rst b/docs/source/user_guide/learn/index.rst index bcd44150f8..63310926de 100644 --- a/docs/source/user_guide/learn/index.rst +++ b/docs/source/user_guide/learn/index.rst @@ -14,6 +14,7 @@ can be obtained in the :ref:`API reference `. joblib lightgbm + pytorch statsmodels tensorflow xgboost diff --git a/docs/source/user_guide/learn/pytorch.rst b/docs/source/user_guide/learn/pytorch.rst index e0247396b2..11820a2b97 100644 --- a/docs/source/user_guide/learn/pytorch.rst +++ b/docs/source/user_guide/learn/pytorch.rst @@ -1,4 +1,4 @@ -.. _pytorch: +.. _integrate_pytorch: ************************* Integrate with PyTorch @@ -169,7 +169,8 @@ MarsDataset ------------ In order to use Mars to process data, we implemented a :class:`MarsDataset` that can convert -Mars object (mars.tensor, mars.dataframe, mars.series) to torch.util.data.Dataset. +Mars object (:class:`mars.tensor.Tensor`, :class:`mars.dataframe.DataFrame`, +:class:`mars.dataframe.Series`) to ``torch.util.data.Dataset``. .. code-block:: python @@ -262,8 +263,8 @@ via mars, then pass data to script. if __name__ == "__main__": - feature_data = feature_data - labels = labels + feature_data = globals()['feature_data'] + labels = globals()['labels'] train(feature_data, labels) result: diff --git a/mars/learn/contrib/pytorch/dataset.py b/mars/learn/contrib/pytorch/dataset.py index 672ae76fe8..849a322806 100644 --- a/mars/learn/contrib/pytorch/dataset.py +++ b/mars/learn/contrib/pytorch/dataset.py @@ -24,11 +24,13 @@ torch = None Dataset = object +from .... import execute from ....core.context import get_context from ....tensor.core import TENSOR_TYPE from ....dataframe.core import DATAFRAME_TYPE, SERIES_TYPE from ....utils import require_not_none + ACCEPT_TYPE = (TENSOR_TYPE, DATAFRAME_TYPE, SERIES_TYPE, np.ndarray, pd.DataFrame, pd.Series, List) @@ -54,11 +56,10 @@ def _check_type(self): raise TypeError(f"Unexpected dataset type: {type(t)}") def _execute(self): - import mars - - execute_data = [t for t in self._tileables if isinstance(t, ACCEPT_TYPE[:3])] + execute_data = [t for t in self._tileables + if isinstance(t, ACCEPT_TYPE[:3])] if len(execute_data): - mars.execute(execute_data) + execute(execute_data) def __len__(self): return self._tileables[0].shape[0]