GPU/TPU 上的 PyCaret 方法

PyCaret methods on GPU/TPU

当我 运行 best_model = compare_models() 时 CPU 内存有很大的负载,而我的 GPU 未被使用。我如何在 GPU 上 运行 setup()compare_models()? PyCaret 中是否有内置方法?

要在 PyCaret 中使用 gpu,您必须简单地将 use_gpu=True 作为设置函数中的参数。 例子: 模型 = 设置(数据,target_variable,use_gpu=真)

只有部分机型可以运行GPU,必须正确安装才能使用GPU。例如,对于 xgboost,您必须使用 pip 安装它并安装 CUDA 10+(或从 anaconda 安装 GPU xgboost 版本等)。以下是可以使用 GPU 的估算器列表及其要求:https://pycaret.readthedocs.io/en/latest/installation.html?highlight=gpu#pycaret-on-gpu

正如Yatin所说,你需要在setup()中使用use_gpu=True。或者您可以在创建单个模型时指定它,例如 xgboost_gpu = create_model('xgboost', fold=3, tree_method='gpu_hist', gpu_id=0).

对于安装 CUDA,我喜欢使用 Anaconda,因为它很容易,就像 conda install -c anaconda cudatoolkit。看起来对于非增强方法,您需要安装 cuML 以供 GPU 使用。

哦,看起来 pycaret 不能将 tune-sklearn 与 GPU 一起使用(在 tune_model 文档部分底部的警告 here 中)。