LightGBM是否可用于Mac M1?

3
我的目标是学习一个笔记本电脑。它的召回率为97%,而我在“流失客户”77.9%的F1分数上挣扎。问题是笔记本使用了LightGBM模型,我无法安装LightGBM。
我尝试过以下方法:
  1. pip install lightgbm,但出现错误:python setup.py egg_info运行失败。
  2. 然后,我执行了pip install whell,现在出现错误:python setup.py bdist_wheel运行失败。
  3. 然后,我执行了pip install Cmakepip install --upgrade pip setuptoolsbrew install libomp,但错误仍然存在。
完整错误信息:
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [80 lines of output]
      INFO:root:running bdist_wheel
      /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      INFO:root:running build
      INFO:root:running build_py
      INFO:root:creating build
      INFO:root:creating build/lib
      INFO:root:creating build/lib/lightgbm
1个回答

4
截至目前为止,lightgbm(用于LightGBM的Python包)没有官方版本支持M1芯片的Mac电脑。 lightgbmosx-arm64构建版本受lightgbm conda-forge feedstock支持,因此您可以使用conda在M1 Mac上安装lightgbm。请注意保留HTML标签。
conda install \
   --yes \
   -c conda-forge \
   'lightgbm>=3.3.3'

可以在microsoft/LightGBM#5269microsoft/LightGBM#5328中跟踪支持M1 Mac构建的进展。


我刚开始学Python,已经学了8周(主要学习数据分析和机器学习),我的conda使用体验不太好(Mac M1自带Python,homebrew也安装了一个版本,然后我自己还装了一个版本)。某些原因导致在安装scikit learn时出现问题,我花了整个周末重新安装了Python。于是我尝试安装线程不安全版本,暂时来说这可能是个解决方案,虽然我没有尝试过,但是显然这个问题已经在github上被解决了 - Jason Rich Darmawan
感谢您接受答案并提供解释!您可以订阅那些链接到 LightGBM GitHub 问题的内容,以便在可用于 M1 Macs 的库的“pip install”版本发布时收到通知。 - James Lamb

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接