Skip to content

Commit

Permalink
chore(fix): isort xgboost (#2098)
Browse files Browse the repository at this point in the history
Signed-off-by: Harshith Belagur <[email protected]>
  • Loading branch information
harshithbelagur committed May 8, 2024
1 parent f23c5c8 commit 7339880
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 25 deletions.
6 changes: 2 additions & 4 deletions examples/xgboost/lightgbm-dist/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import logging
import argparse
import logging
import os

from train import train

from utils import generate_machine_list_file, generate_train_conf_file


logger = logging.getLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion examples/xgboost/lightgbm-dist/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import logging
import re
import socket
import logging
import tempfile
from time import sleep
from typing import List, Union
Expand Down
6 changes: 3 additions & 3 deletions examples/xgboost/smoke-dist/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
# pylint: disable=too-many-branches, too-many-statements
from __future__ import absolute_import

import argparse
import logging
import os
import sys
import socket
import struct
import subprocess
import argparse
import sys
import time
import logging
from threading import Thread


Expand Down
3 changes: 2 additions & 1 deletion examples/xgboost/smoke-dist/xgboost_smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

import logging
import os
import xgboost as xgb
import traceback

from tracker import RabitTracker

import xgboost as xgb

logger = logging.getLogger(__name__)

def extract_xgbooost_cluster_env():
Expand Down
6 changes: 4 additions & 2 deletions examples/xgboost/xgboost-dist/local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
this file contains tests for xgboost local train and predict in single machine.
Note: this is not for distributed train and predict test
"""
from utils import dump_model, read_model, read_train_data, read_predict_data
import xgboost as xgb
import logging

import numpy as np
from sklearn.metrics import precision_score
from utils import dump_model, read_model, read_predict_data, read_train_data

import xgboost as xgb

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/xgboost/xgboost-dist/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import argparse
import logging

from train import train
from predict import predict
from train import train
from utils import dump_model


Expand Down
7 changes: 3 additions & 4 deletions examples/xgboost/xgboost-dist/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from sklearn.metrics import precision_score

import logging
import numpy as np

from utils import extract_xgbooost_cluster_env, read_predict_data, read_model
import numpy as np
from sklearn.metrics import precision_score
from utils import extract_xgbooost_cluster_env, read_model, read_predict_data


def predict(args):
Expand Down
6 changes: 3 additions & 3 deletions examples/xgboost/xgboost-dist/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
# pylint: disable=too-many-branches, too-many-statements
from __future__ import absolute_import

import argparse
import logging
import os
import sys
import socket
import struct
import subprocess
import argparse
import sys
import time
import logging
from threading import Thread


Expand Down
5 changes: 3 additions & 2 deletions examples/xgboost/xgboost-dist/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@


import logging
import xgboost as xgb
import traceback

from tracker import RabitTracker
from utils import read_train_data, extract_xgbooost_cluster_env
from utils import extract_xgbooost_cluster_env, read_train_data

import xgboost as xgb

logger = logging.getLogger(__name__)

Expand Down
9 changes: 5 additions & 4 deletions examples/xgboost/xgboost-dist/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import logging
import joblib
import xgboost as xgb
import os
import tempfile

import joblib
import oss2
import json
import pandas as pd

from sklearn import datasets

import xgboost as xgb

logger = logging.getLogger(__name__)


Expand Down

0 comments on commit 7339880

Please sign in to comment.