Require isort on all Python files. (#8420)
This commit is contained in:
@@ -9,13 +9,14 @@ interfaces in the Python package like scikit-learn interface and Dask interface.
|
||||
See :doc:`/python/python_intro` and :doc:`/tutorials/index` for other references.
|
||||
|
||||
"""
|
||||
import numpy as np
|
||||
import pickle
|
||||
import xgboost as xgb
|
||||
import os
|
||||
import pickle
|
||||
|
||||
import numpy as np
|
||||
from sklearn.datasets import load_svmlight_file
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
# Make sure the demo knows where to load the data.
|
||||
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
XGBOOST_ROOT_DIR = os.path.dirname(os.path.dirname(CURRENT_DIR))
|
||||
|
||||
@@ -3,8 +3,8 @@ Demo for boosting from prediction
|
||||
=================================
|
||||
"""
|
||||
import os
|
||||
import xgboost as xgb
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
CURRENT_DIR = os.path.dirname(__file__)
|
||||
dtrain = xgb.DMatrix(os.path.join(CURRENT_DIR, '../data/agaricus.txt.train'))
|
||||
|
||||
@@ -4,14 +4,16 @@ Demo for using and defining callback functions
|
||||
|
||||
.. versionadded:: 1.3.0
|
||||
'''
|
||||
import xgboost as xgb
|
||||
import tempfile
|
||||
import argparse
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
from sklearn.datasets import load_breast_cancer
|
||||
from sklearn.model_selection import train_test_split
|
||||
from matplotlib import pyplot as plt
|
||||
import argparse
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
|
||||
class Plotting(xgb.callback.TrainingCallback):
|
||||
|
||||
@@ -3,11 +3,13 @@ Demo for training continuation
|
||||
==============================
|
||||
"""
|
||||
|
||||
from sklearn.datasets import load_breast_cancer
|
||||
import xgboost
|
||||
import os
|
||||
import pickle
|
||||
import tempfile
|
||||
import os
|
||||
|
||||
from sklearn.datasets import load_breast_cancer
|
||||
|
||||
import xgboost
|
||||
|
||||
|
||||
def training_continuation(tmpdir: str, use_pickle: bool) -> None:
|
||||
|
||||
@@ -3,7 +3,9 @@ Demo for using cross validation
|
||||
===============================
|
||||
"""
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
# load data in do training
|
||||
|
||||
@@ -14,14 +14,16 @@ The `SLE` objective reduces impact of outliers in training dataset, hence here w
|
||||
compare its performance with standard squared error.
|
||||
|
||||
"""
|
||||
import numpy as np
|
||||
import xgboost as xgb
|
||||
from typing import Tuple, Dict, List
|
||||
from time import time
|
||||
import argparse
|
||||
from time import time
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
import matplotlib
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
# shape of generated data.
|
||||
kRows = 4096
|
||||
kCols = 16
|
||||
|
||||
@@ -10,11 +10,13 @@ See :doc:`/tutorials/custom_metric_obj` for detailed tutorial and notes.
|
||||
|
||||
'''
|
||||
|
||||
import numpy as np
|
||||
import xgboost as xgb
|
||||
from matplotlib import pyplot as plt
|
||||
import argparse
|
||||
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
np.random.seed(1994)
|
||||
|
||||
kRows = 100
|
||||
|
||||
@@ -3,6 +3,7 @@ This script demonstrate how to access the eval metrics
|
||||
======================================================
|
||||
"""
|
||||
import os
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
CURRENT_DIR = os.path.dirname(__file__)
|
||||
|
||||
@@ -12,11 +12,13 @@ See :doc:`the tutorial </tutorials/external_memory>` for more details.
|
||||
|
||||
"""
|
||||
import os
|
||||
import xgboost
|
||||
from typing import Callable, List, Tuple
|
||||
from sklearn.datasets import make_regression
|
||||
import tempfile
|
||||
from typing import Callable, List, Tuple
|
||||
|
||||
import numpy as np
|
||||
from sklearn.datasets import make_regression
|
||||
|
||||
import xgboost
|
||||
|
||||
|
||||
def make_batches(
|
||||
|
||||
@@ -5,11 +5,13 @@ Demo for using feature weight to change column sampling
|
||||
.. versionadded:: 1.3.0
|
||||
'''
|
||||
|
||||
import numpy as np
|
||||
import xgboost
|
||||
from matplotlib import pyplot as plt
|
||||
import argparse
|
||||
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
import xgboost
|
||||
|
||||
|
||||
def main(args):
|
||||
rng = np.random.RandomState(1994)
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
Demo for gamma regression
|
||||
=========================
|
||||
"""
|
||||
import xgboost as xgb
|
||||
import numpy as np
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
# this script demonstrates how to fit gamma regression model (with log link function)
|
||||
# in xgboost, before running the demo you need to generate the autoclaims dataset
|
||||
# by running gen_autoclaims.R located in xgboost/demo/data.
|
||||
|
||||
@@ -3,7 +3,9 @@ Demo for GLM
|
||||
============
|
||||
"""
|
||||
import os
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
##
|
||||
# this script demonstrate how to fit generalized linear model in xgboost
|
||||
# basically, we are using linear model, instead of tree for our boosters
|
||||
|
||||
@@ -10,10 +10,11 @@ See :doc:`/tutorials/multioutput` for more information.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from typing import Dict, Tuple, List
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,12 @@ Demo for prediction using number of trees
|
||||
=========================================
|
||||
"""
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
import xgboost as xgb
|
||||
from sklearn.datasets import load_svmlight_file
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
CURRENT_DIR = os.path.dirname(__file__)
|
||||
train = os.path.join(CURRENT_DIR, "../data/agaricus.txt.train")
|
||||
test = os.path.join(CURRENT_DIR, "../data/agaricus.txt.test")
|
||||
|
||||
@@ -3,6 +3,7 @@ Demo for obtaining leaf index
|
||||
=============================
|
||||
"""
|
||||
import os
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
# load data in do training
|
||||
|
||||
@@ -17,10 +17,11 @@ using `itertools.tee` might incur significant memory usage according to:
|
||||
|
||||
'''
|
||||
|
||||
import xgboost
|
||||
import cupy
|
||||
import numpy
|
||||
|
||||
import xgboost
|
||||
|
||||
COLS = 64
|
||||
ROWS_PER_BATCH = 1000 # data is splited by rows
|
||||
BATCHES = 32
|
||||
|
||||
@@ -3,10 +3,11 @@ Demo for accessing the xgboost eval metrics by using sklearn interface
|
||||
======================================================================
|
||||
"""
|
||||
|
||||
import xgboost as xgb
|
||||
import numpy as np
|
||||
from sklearn.datasets import make_hastie_10_2
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
X, y = make_hastie_10_2(n_samples=2000, random_state=42)
|
||||
|
||||
# Map labels from {-1, 1} to {0, 1}
|
||||
|
||||
@@ -7,12 +7,13 @@ Created on 1 Apr 2015
|
||||
@author: Jamie Hall
|
||||
'''
|
||||
import pickle
|
||||
import xgboost as xgb
|
||||
|
||||
import numpy as np
|
||||
from sklearn.model_selection import KFold, train_test_split, GridSearchCV
|
||||
from sklearn.datasets import fetch_california_housing, load_digits, load_iris
|
||||
from sklearn.metrics import confusion_matrix, mean_squared_error
|
||||
from sklearn.datasets import load_iris, load_digits, fetch_california_housing
|
||||
from sklearn.model_selection import GridSearchCV, KFold, train_test_split
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
rng = np.random.RandomState(31337)
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
Demo for using xgboost with sklearn
|
||||
===================================
|
||||
"""
|
||||
from sklearn.model_selection import GridSearchCV
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
import xgboost as xgb
|
||||
import multiprocessing
|
||||
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
from sklearn.model_selection import GridSearchCV
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Parallel Parameter optimization")
|
||||
X, y = fetch_california_housing(return_X_y=True)
|
||||
|
||||
@@ -7,9 +7,10 @@ experiment.
|
||||
|
||||
"""
|
||||
|
||||
import xgboost as xgb
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
import numpy as np
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
|
||||
import xgboost as xgb
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user