Fix with black 24.1.1. (#10014)
This commit is contained in:
parent
65d7bf2dfe
commit
54b71c8fba
@ -6,6 +6,7 @@ This demo uses 1D toy data and visualizes how XGBoost fits a tree ensemble. The
|
||||
model starts out as a flat line and evolves into a step function in order to account for
|
||||
all ranged labels.
|
||||
"""
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ Example of training with Dask on CPU
|
||||
====================================
|
||||
|
||||
"""
|
||||
|
||||
from dask import array as da
|
||||
from dask.distributed import Client, LocalCluster
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Example of using callbacks with Dask
|
||||
====================================
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
from dask.distributed import Client, LocalCluster
|
||||
from dask_ml.datasets import make_regression
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Example of training with Dask on GPU
|
||||
====================================
|
||||
"""
|
||||
|
||||
import cupy as cp
|
||||
import dask_cudf
|
||||
from dask import array as da
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Use scikit-learn regressor interface with CPU histogram tree method
|
||||
===================================================================
|
||||
"""
|
||||
|
||||
from dask import array as da
|
||||
from dask.distributed import Client, LocalCluster
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ Demo for using and defining callback functions
|
||||
|
||||
.. versionadded:: 1.3.0
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
@ -13,6 +13,7 @@ See Also
|
||||
- :ref:`sphx_glr_python_examples_cat_in_the_dat.py`
|
||||
|
||||
"""
|
||||
|
||||
from typing import List, Tuple
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -17,6 +17,7 @@ See Also
|
||||
- :ref:`sphx_glr_python_examples_cat_pipeline.py`
|
||||
|
||||
"""
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -11,6 +11,7 @@ instead of Quantile DMatrix. The feature is not ready for production use yet.
|
||||
See :doc:`the tutorial </tutorials/external_memory>` for more details.
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import tempfile
|
||||
from typing import Callable, List, Tuple
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Demo for prediction using individual trees and model slices
|
||||
===========================================================
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -15,6 +15,7 @@ position debiasing training.
|
||||
For an overview of learning to rank in XGBoost, please see
|
||||
:doc:`Learning to Rank </tutorials/learning_to_rank>`.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
|
||||
@ -13,6 +13,7 @@ https://scikit-learn.org/stable/auto_examples/ensemble/plot_gradient_boosting_qu
|
||||
crossing can happen due to limitation in the algorithm.
|
||||
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from typing import Dict
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ Created on 1 Apr 2015
|
||||
|
||||
@author: Jamie Hall
|
||||
"""
|
||||
|
||||
import pickle
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Demo for using xgboost with sklearn
|
||||
===================================
|
||||
"""
|
||||
|
||||
import multiprocessing
|
||||
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
|
||||
@ -4,6 +4,7 @@ Collection of examples for using xgboost.spark estimator interface
|
||||
|
||||
@author: Weichen Xu
|
||||
"""
|
||||
|
||||
import sklearn.datasets
|
||||
from pyspark.ml.evaluation import MulticlassClassificationEvaluator, RegressionEvaluator
|
||||
from pyspark.ml.linalg import Vectors
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Using rmm with Dask
|
||||
===================
|
||||
"""
|
||||
|
||||
import dask
|
||||
from dask.distributed import Client
|
||||
from dask_cuda import LocalCUDACluster
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Using rmm on a single node device
|
||||
=================================
|
||||
"""
|
||||
|
||||
import rmm
|
||||
from sklearn.datasets import make_classification
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
Custom hook to customize the behavior of Hatchling.
|
||||
Here, we customize the tag of the generated wheels.
|
||||
"""
|
||||
|
||||
import sysconfig
|
||||
from typing import Any, Dict
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Build configuration"""
|
||||
|
||||
import dataclasses
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"""
|
||||
Functions for building libxgboost
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
@ -4,6 +4,7 @@ Builds source distribution and binary wheels, following PEP 517 / PEP 660.
|
||||
Reuses components of Hatchling (https://github.com/pypa/hatch/tree/master/backend) for the sake
|
||||
of brevity.
|
||||
"""
|
||||
|
||||
import dataclasses
|
||||
import logging
|
||||
import os
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"""
|
||||
Functions for building sdist
|
||||
"""
|
||||
|
||||
import logging
|
||||
import pathlib
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"""
|
||||
Utility functions for implementing PEP 517 backend
|
||||
"""
|
||||
|
||||
import logging
|
||||
import pathlib
|
||||
import shutil
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""XGBoost collective communication related API."""
|
||||
|
||||
import ctypes
|
||||
import json
|
||||
import logging
|
||||
|
||||
@ -64,13 +64,11 @@ class XGBoostError(ValueError):
|
||||
|
||||
|
||||
@overload
|
||||
def from_pystr_to_cstr(data: str) -> bytes:
|
||||
...
|
||||
def from_pystr_to_cstr(data: str) -> bytes: ...
|
||||
|
||||
|
||||
@overload
|
||||
def from_pystr_to_cstr(data: List[str]) -> ctypes.Array:
|
||||
...
|
||||
def from_pystr_to_cstr(data: List[str]) -> ctypes.Array: ...
|
||||
|
||||
|
||||
def from_pystr_to_cstr(data: Union[str, List[str]]) -> Union[bytes, ctypes.Array]:
|
||||
|
||||
@ -1146,9 +1146,9 @@ async def _direct_predict_impl( # pylint: disable=too-many-branches
|
||||
if _can_output_df(isinstance(data, dd.DataFrame), output_shape):
|
||||
if base_margin is not None and isinstance(base_margin, da.Array):
|
||||
# Easier for map_partitions
|
||||
base_margin_df: Optional[
|
||||
Union[dd.DataFrame, dd.Series]
|
||||
] = base_margin.to_dask_dataframe()
|
||||
base_margin_df: Optional[Union[dd.DataFrame, dd.Series]] = (
|
||||
base_margin.to_dask_dataframe()
|
||||
)
|
||||
else:
|
||||
base_margin_df = base_margin
|
||||
predictions = dd.map_partitions(
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Utilities for the XGBoost Dask interface."""
|
||||
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Any, Dict
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""XGBoost pyspark integration submodule for core code."""
|
||||
|
||||
import base64
|
||||
|
||||
# pylint: disable=fixme, too-many-ancestors, protected-access, no-member, invalid-name
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Xgboost pyspark integration submodule for estimator API."""
|
||||
|
||||
# pylint: disable=too-many-ancestors
|
||||
# pylint: disable=fixme, too-many-ancestors, protected-access, no-member, invalid-name
|
||||
# pylint: disable=unused-argument, too-many-locals
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Xgboost pyspark integration submodule for params."""
|
||||
|
||||
from typing import Dict
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
@ -55,7 +56,6 @@ class HasFeaturesCols(Params):
|
||||
|
||||
|
||||
class HasEnableSparseDataOptim(Params):
|
||||
|
||||
"""
|
||||
This is a Params based class that is extended by _SparkXGBParams
|
||||
and holds the variable to store the boolean config of enabling sparse data optimization.
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Xgboost pyspark integration submodule for helper functions."""
|
||||
|
||||
# pylint: disable=fixme
|
||||
|
||||
import inspect
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
change without notice.
|
||||
|
||||
"""
|
||||
|
||||
# pylint: disable=invalid-name,missing-function-docstring,import-error
|
||||
import gc
|
||||
import importlib.util
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Tests for training continuation."""
|
||||
|
||||
import json
|
||||
from typing import Any, Dict, TypeVar
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Tests for dask shared by different test modules."""
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from dask import array as da
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Tests related to the `DataIter` interface."""
|
||||
|
||||
import numpy as np
|
||||
|
||||
import xgboost
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Tests for evaluation metrics."""
|
||||
|
||||
from typing import Dict, List
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Testing code shared by other tests."""
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
import collections
|
||||
import importlib.util
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Tests for updaters."""
|
||||
|
||||
import json
|
||||
from functools import partial, update_wrapper
|
||||
from typing import Any, Dict, List
|
||||
|
||||
@ -7,6 +7,7 @@ needed, run CMake .
|
||||
If this is a RC release, the version for JVM packages has the form
|
||||
<major>.<minor>.<patch>-RC1
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import os
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Utilities for packaging R code and running tests."""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Utilities for the CI."""
|
||||
|
||||
import os
|
||||
from datetime import datetime, timedelta
|
||||
from functools import wraps
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
"""Loading a pickled model generated by test_pickling.py, only used by
|
||||
`test_gpu_with_dask.py`"""
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Test model IO with pickle."""
|
||||
|
||||
import os
|
||||
import pickle
|
||||
import subprocess
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Tests for running inplace prediction."""
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Copyright 2019-2023, XGBoost contributors"""
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from collections import OrderedDict
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
"""Copyright 2019-2022 XGBoost contributors"""
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user