XGBoost GPU ??? ?? ? ??
XGBoost? ???? ????? ? ??? ??? ???? ?? ????? ??? ????????. ??? ?? ????? ?? XGBoost? ??? GPU? ???? ??? ?????. ????? ?? tree_method ????? "gpu_hist"? ????? ?? ????? ?? ????? "GPU"? ???? ?????.
?? ??: GPU ??? ???? ?? ???? ?? ??? ????? ??????.
- CUDA ?? ? cuDNN ??: ?? NVIDIA GPU ???? ?????.
- ???? XGBoost ??: ????? pip install xgboost ?? conda install xgboost? ?? XGBoost? GPU ?? ??? ???? ?? ? xgboost.VERSION? ?????.
- NVIDIA GPU ????: GPU ??? CUDA ??? ????? ?????.
?? ?? ?:
xgboost? xgb? ???? sklearn.datasets?? ???? fetch_california_housing # 1. ?? ??? ?? ???? data = fetch_california_housing() X = ???.??? y = ???.?? # 2. DMatrix ?? dtrain = xgb.DMatrix(X, label=y, feature_names=data.feature_names) # 3. XGBoost ???? ?? # GPU ??? ?? tree_method="gpu_hist" ?? device="GPU"? ??? ? ????. # ??: XGBoost 1.6 ?? ????? 'device' ???? ??? ?????. # ?? ????? 'tree_method="gpu_hist"'? ?? ?????? param_gpu = { "???": "reg:squarederror", "??": 0.05, "?? ??": 10, "tree_method": "hist", # ????? Hist? ???? GPU? device ????? ?????. "device": "GPU", # GPU ??? ????? ?? "??": 42 } num_round = 1000 # 4. ?? ?? print("GPU ?? ?? ??...") model_gpu = xgb.train(param_gpu, dtrain, num_round) print("GPU ??? ???????.")
XGBoost ??: CPU ? GPU ?? ??
???? ??? GPU? ?? ? XGBoost ??? CPU?? ???? ????. ??? ?? ?? ??? ?? ??? ???? ????? ??? ?? ?? ????. XGBoost? CPU ??? ???? ?? ??? ?? ???? ?? ??? ??? ???? ??? ??? ??? ? ?????.
?? ?? ? ?? ??:
?? ????? 10,000 ???? ??? ??? ?? 53,000?? ?? 10?? ?? ??? ??? ??? ???? ??? ?? ??? ??? ? ????.
- CPU (tree_method="hist"): ?? ?? CPU? ??? ???? ?? ? ?? ??? ??? ? ????.
- GPU(tree_method="gpu_hist" ?? device="GPU"): CPU ???? ? ?? ?? ? ????.
? ??? ??? ????.
- ??? ?? ????: CPU ????? GPU ???? ???? ???? ? ??? ????. ????? ?? ??? ??? ?? ??? ????? ?? GPU? ?? ??? ??? ? ????.
- GPU ??: ??? ??? GPU? ?? ?? ??? ??? ??? ?? ?? ??? GPU? ??? ?? ??? ???? ?? ?? ????.
- XGBoost ?? ???: XGBoost? CPU ??? ?? ?? ???? ?? ??????. ?? ????? ?? ?? ???? ?? ?? ????.
?? ??(CPU ?? ??):
??? ?? ??? CPU? ????? XGBoost? ???? ???? ??? ?? ??? ? ????.
#CPU ?? ?? param_cpu = { "???": "reg:squarederror", "??": 0.05, "?? ??": 10, "tree_method": "hist", # ?? CPU ????? ???? "device": "cpu", # CPU ??? ????? ?? "nthread": 24, # CPU ?? ??? ??? ????? CPU ?? ?? ?? ?????. "seed": 42 } print("CPU ???? ??? ?????...") model_cpu = xgb.train(param_cpu, dtrain, num_round) print("CPU ??? ???????.")
??: XGBoost ???? GPU? ?? CPU?? ?? ?? ????. ?? ???? CPU? ?? ?? ?? ??? ??? ???? GPU?? ? ?? ??? ??? ?? ????. ??? ??? ??? ????? ?? ???? ? ??? ??? ?????? ?? ????.
?? ?? ???? GPU? ? ??: SHAP ? ??
XGBoost ?? ???? GPU? ?? ??? ?? ???? ?? ???? ?? ??? ??? ? ?? ???? GPU? "??? ??" ?? ??? ??? ? ????. ????? ? ? ??? SHAP(SHapley Additive exPlanations) ? ?????.
SHAP ?? ?? ?? ?? ??? ???? ? ??? ????? ?? ??? ??? ??? ??? ??? ?? ?? ??? ?? ?? ? ????. XGBoost? GPU ?? SHAP ? ?? ??? ???? ?? ??? ?? ??? ? ????.
SHAP ? ?? ?(CPU ? GPU):
?? shap ?????? ???? ??? ??????(pip install shap).
?? ???? # 1. CPU? ???? SHAP ? ?? # ?? ??? CPU? ???? ??? ?? model_cpu.set_param({"device": "cpu"}) print("SHAP ?? ???? CPU? ?????...") # pred_contribs=True? SHAP ?? ????? ?????. shap_values_cpu = model_cpu.predict(dtrain, pred_contribs=True) print("SHAP ?? CPU ??? ???????.") # 2. GPU? ???? SHAP ? ?? # ?? ??? GPU? ?? model_gpu.set_param({"device": "GPU"}) # ?? model_cpu.set_param({"device": "GPU"}) print("SHAP ?? GPU ??? ?????...") shap_values_gpu = model_gpu.predict(dtrain, pred_contribs=True) print("SHAP ?? GPU ??? ???????.")
?? ??: SHAP ? ?? ???? GPU? ????? ??? ??? ??? ? ????. ?? ??, CPU??? ???? ? ?? ? ?? ??? ? ??? ?? ? ?? SHAP ?? ??? GPU??? ? ??? ??? ?? ? ????.
- CPU(?? ???): ?? ? ?? ???? ?????.
- GPU: ? ??? ??? ???? ??? ???.
??? ??? ?? ??? ?? GPU? ??? ??? ??? ??? ?? ?? ??? ?????.
?? ? ?? ??
-
?? ??:
- ?? GPU? ? ?? ?? ????. XGBoost ?? ??, ?? ?? ?? ??? ??? ?? CPU ?? ?? ?? ??? GPU ??? ????? ??? ? ?? ? ????.
- ???? ???? ?????. ?? ??? ?? ? ?????? ?? device="cpu"(? nthread ??) ? device="GPU"? ???? ????? ?? ??? ? ?? ?? ??? ????? ?????.
- ??? ?? ??. ????? ??? ??? ??? GPU? ??? ?? ??????. ???? ??? ?? ????? ?? ????? ?? ? ???? ?????.
-
??? ??(?: SHAP ? ??):
- GPU?? ??? ??? ????. SHAP ? ??? ?? ?? ???? ?? ?? ??? ?? GPU? ?? ?? ??? ??? ? ????. ??? ???? GPU? ???? ?? ????.
-
?? ????:
- XGBoost? ???? ??? ????? ????? ?? ????("cpu" ?? "GPU")? ??????.
- CPU ????? ?? CPU ??? ??? ???? ?? nthread ????? ?? ??? ?? ????? ?????.
XGBoost? ??? ???? CPU? GPU? ?? ??? ????, ??? ??? ???? ???? ?????? ?? ?? ? ?? ????? ???? ????? ? ?? ???? ??? ? ????.
? ??? XGBoost ?? ???: CPU ? GPU ?? ??? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Stock Market GPT
? ??? ??? ?? AI ?? ?? ??

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

? ????? PEFT LORA ???? ?? ??? ????? ???? ??? ??? ? ??? ???? ??? ??? ?????. ? ??? ???? ?? ???? ?? ?????? ?????. Aumodel? ???????? ???? ???? ???? PEFT ??????? MERGE_AND_UNLOAD ??? ???? ??? ????? ?????. ?? ????? ?? ????? ??? ?? ???? ???? PEFT ?? ??? ?? ? ???? ?? ?????.

??? ???? ????? pipinstall-rrequirements.txt? ??????. ??? ???, ?? ??? ???? ???? PIP? ???????? ???? ??? ?? ?? ??? ???? ??-no-deps ?? --user? ?? ??? ???? ?? ????.

Python? Python? ???? ??? ??? ?????. ?? ? ??? ??? ?? ?? ??? ?? ???? ?????. ?? ? ???? ?? test_? ???? ??? ???? @pytest.fixture? ???? ??? ??? ??? ???? ???? pytest.raises? ?? ??? ???? ??? ??? ?? ? ?? ?? ? ??? ???? ??? ???? ??????.

theargparsemoduleisecomedendedway handlecommand-lineargumentsinpython, robustparsing, typevalidation, helpmessages, anderrorhandling; audys.argvforsimplecaseSrequiringMinimalSetup? ?????.

? ??? Python? Numpy? ?? ??? ?? ?? ?? ?? ???? ???? ??? ???? ?? ?????, ?? ??? ?? 64 ?? ??? ??? ?? ?? ??? ??? ?????. ? ?? ???? ??? ??? ????? ??,? ??? ??? ??? ??? ??? ?????? ??? ??? ??? ? ??? MPMATH, Sympy ? GMPY? ?? ??? ?? ?????? ?? ??, ?? ? ?? ????? ???? ?????.

? ??? PEFT ?????? MERGE_AND_UNLOAD ??? ???? LORA ???? ?? ?? ?? ??? ????? ???? ???? ?? ? ?? ?? ??? ?? ??? ??? ???? ??? ?? ??? ?????. ? ??? ???? ?? ????? ? ?? ???? ???? ???? ?? ?? ???? ??? ???? AUMODEL? ?? ?? ??, ?? ?????? ?? ? ??? ? ?? ?? ??? ?????? ?? ??? ??? ??? ?? ??? ???? ??? ?? ????? ?????.

PYPDF2, PDFPLAMBER ? FPDF? Python? PDF? ?????? ?? ????????. PYPDF2? ???? PDFREADER? ?? ???? ?? extract_text ()? ????? ??? ??, ??, ?? ? ???? ??????. PDFPlumber? ???? ??? ?? ? ??? ??? ???? ? ? ???? TABLE ???? ???? ???? ?? Extract_Tables ()? ?????. FPDF (?? FPDF2)? PDF? ???? ? ???? ??? add_page (), set_font () ? cell ()? ?? ?? ? ?????. pdfs? ?? ? ? pdfwriter? append () ???? ?? ??? ?? ? ? ????.

import@contextManagerFromContextLibandDefineAgeneratorFunctionThatYieldSActlyOnce, whereCodeBeforeYieldActSasEnterAndErandCodeftertyield (??????) ACTSAS__EXIT __
