Fix typos in python package (#7432)

This commit is contained in:
Kian Meng Ang 2021-11-14 17:20:19 +08:00 committed by GitHub
parent 8cc75f1576
commit d27a11ff87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View File

@ -512,7 +512,7 @@ class TrainingCheckPoint(TrainingCallback):
pattern of output model file. Models will be saved as name_0.json, name_1.json, pattern of output model file. Models will be saved as name_0.json, name_1.json,
name_2.json .... name_2.json ....
as_pickle : as_pickle :
When set to Ture, all training parameters will be saved in pickle format, instead When set to True, all training parameters will be saved in pickle format, instead
of saving only the model. of saving only the model.
iterations : iterations :
Interval of checkpointing. Checkpointing is slow so setting a larger number can Interval of checkpointing. Checkpointing is slow so setting a larger number can

View File

@ -458,7 +458,7 @@ def _deprecate_positional_args(f):
Using the keyword-only argument syntax in pep 3102, arguments after the Using the keyword-only argument syntax in pep 3102, arguments after the
* will issue a warning when passed as a positional argument. * will issue a warning when passed as a positional argument.
Modifed from sklearn utils.validation. Modified from sklearn utils.validation.
Parameters Parameters
---------- ----------
@ -2411,7 +2411,7 @@ class Booster:
arr = line.split('[') arr = line.split('[')
# Leaf node # Leaf node
if len(arr) == 1: if len(arr) == 1:
# Last element of line.split is an empy string # Last element of line.split is an empty string
if arr == ['']: if arr == ['']:
continue continue
# parse string # parse string

View File

@ -166,7 +166,7 @@ def _assert_dask_support() -> None:
class RabitContext: class RabitContext:
'''A context controling rabit initialization and finalization.''' '''A context controlling rabit initialization and finalization.'''
def __init__(self, args: List[bytes]) -> None: def __init__(self, args: List[bytes]) -> None:
self.args = args self.args = args
worker = distributed.get_worker() worker = distributed.get_worker()

View File

@ -224,5 +224,5 @@ def version_number() -> int:
return ret return ret
# intialization script # initialization script
_init_rabit() _init_rabit()

View File

@ -312,7 +312,7 @@ def xgboost_model_doc(
header: str header: str
An introducion to the class. An introducion to the class.
items : list items : list
A list of commom doc items. Available items are: A list of common doc items. Available items are:
- estimators: the meaning of n_estimators - estimators: the meaning of n_estimators
- model: All the other parameters - model: All the other parameters
- objective: note for customized objective - objective: note for customized objective

View File

@ -208,7 +208,7 @@ class RabitTracker:
def worker_envs(self) -> Dict[str, Union[str, int]]: def worker_envs(self) -> Dict[str, Union[str, int]]:
""" """
get enviroment variables for workers get environment variables for workers
can be passed in as args or envs can be passed in as args or envs
""" """
return {'DMLC_TRACKER_URI': self.hostIP, return {'DMLC_TRACKER_URI': self.hostIP,
@ -286,7 +286,7 @@ class RabitTracker:
return tree_map_, parent_map_, ring_map_ return tree_map_, parent_map_, ring_map_
def accept_workers(self, n_workers: int) -> None: def accept_workers(self, n_workers: int) -> None:
# set of nodes that finishs the job # set of nodes that finishes the job
shutdown: Dict[int, WorkerEntry] = {} shutdown: Dict[int, WorkerEntry] = {}
# set of nodes that is waiting for connections # set of nodes that is waiting for connections
wait_conn: Dict[int, WorkerEntry] = {} wait_conn: Dict[int, WorkerEntry] = {}
@ -425,7 +425,7 @@ def main() -> None:
"""Main function if tracker is executed in standalone mode.""" """Main function if tracker is executed in standalone mode."""
parser = argparse.ArgumentParser(description='Rabit Tracker start.') parser = argparse.ArgumentParser(description='Rabit Tracker start.')
parser.add_argument('--num-workers', required=True, type=int, parser.add_argument('--num-workers', required=True, type=int,
help='Number of worker proccess to be launched.') help='Number of worker process to be launched.')
parser.add_argument( parser.add_argument(
'--num-servers', default=0, type=int, '--num-servers', default=0, type=int,
help='Number of server process to be launched. Only used in PS jobs.' help='Number of server process to be launched. Only used in PS jobs.'