You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Installation.md 4.0 kB

3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Installation
  2. ## Python
  3. FLAML requires **Python version >= 3.7**. It can be installed from pip:
  4. ```bash
  5. pip install flaml
  6. ```
  7. or conda:
  8. ```
  9. conda install flaml -c conda-forge
  10. ```
  11. ### Optional Dependencies
  12. #### Notebook
  13. To run the [notebook examples](https://github.com/microsoft/FLAML/tree/main/notebook),
  14. install flaml with the [notebook] option:
  15. ```bash
  16. pip install flaml[notebook]
  17. ```
  18. #### Extra learners/models
  19. * openai models
  20. ```bash
  21. pip install flaml[openai]
  22. ```
  23. * catboost
  24. ```bash
  25. pip install flaml[catboost]
  26. ```
  27. * vowpal wabbit
  28. ```bash
  29. pip install flaml[vw]
  30. ```
  31. * time series forecaster: prophet, statsmodels
  32. ```bash
  33. pip install flaml[forecast]
  34. ```
  35. * huggingface transformers
  36. ```bash
  37. pip install flaml[hf]
  38. ```
  39. #### Distributed tuning
  40. * ray
  41. ```bash
  42. pip install flaml[ray]
  43. ```
  44. * spark
  45. > *Spark support is added in v1.1.0*
  46. ```bash
  47. pip install flaml[spark]>=1.1.0
  48. ```
  49. For cloud platforms such as [Azure Synapse](https://azure.microsoft.com/en-us/products/synapse-analytics/), Spark clusters are provided.
  50. But you may also need to install `Spark` manually when setting up your own environment.
  51. For latest Ubuntu system, you can install Spark 3.3.0 standalone version with below script.
  52. For more details of installing Spark, please refer to [Spark Doc](https://spark.apache.org/docs/latest/api/python/getting_started/install.html).
  53. ```bash
  54. sudo apt-get update && sudo apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
  55. ca-certificates-java ca-certificates openjdk-17-jdk-headless \
  56. && sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/*
  57. wget --progress=dot:giga "https://www.apache.org/dyn/closer.lua/spark/spark-3.3.0/spark-3.3.0-bin-hadoop2.tgz?action=download" \
  58. -O - | tar -xzC /tmp; archive=$(basename "spark-3.3.0/spark-3.3.0-bin-hadoop2.tgz") \
  59. bash -c "sudo mv -v /tmp/\${archive/%.tgz/} /spark"
  60. export SPARK_HOME=/spark
  61. export PYTHONPATH=/spark/python/lib/py4j-0.10.9.5-src.zip:/spark/python
  62. export PATH=$PATH:$SPARK_HOME/bin
  63. ```
  64. * nni
  65. ```bash
  66. pip install flaml[nni]
  67. ```
  68. * blendsearch
  69. ```bash
  70. pip install flaml[blendsearch]
  71. ```
  72. * synapse
  73. > *To install flaml in Azure Synapse and similar cloud platform*
  74. ```bash
  75. pip install flaml[synapse]
  76. ```
  77. #### Test and Benchmark
  78. * test
  79. ```bash
  80. pip install flaml[test]
  81. ```
  82. * benchmark
  83. ```bash
  84. pip install flaml[benchmark]
  85. ```
  86. ## .NET
  87. FLAML has a .NET implementation in [ML.NET](http://dot.net/ml), an open-source, cross-platform machine learning framework for .NET.
  88. You can use FLAML in .NET in the following ways:
  89. **Low-code**
  90. - [*Model Builder*](https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotnet/model-builder) - A Visual Studio extension for training ML models using FLAML. For more information on how to install the, see the [install Model Builder](https://docs.microsoft.com/dotnet/machine-learning/how-to-guides/install-model-builder?tabs=visual-studio-2022) guide.
  91. - [*ML.NET CLI*](https://docs.microsoft.com/dotnet/machine-learning/automate-training-with-cli) - A dotnet CLI tool for training machine learning models using FLAML on Windows, MacOS, and Linux. For more information on how to install the ML.NET CLI, see the [install the ML.NET CLI](https://docs.microsoft.com/dotnet/machine-learning/how-to-guides/install-ml-net-cli?tabs=windows) guide.
  92. **Code-first**
  93. - [*Microsoft.ML.AutoML*](https://www.nuget.org/packages/Microsoft.ML.AutoML/0.20.0-preview.22313.1) - NuGet package that provides direct access to the FLAML AutoML APIs that power low-code solutions like Model Builder and the ML.NET CLI. For more information on installing NuGet packages, see the install and use a NuGet package in [Visual Studio](https://docs.microsoft.com/nuget/quickstart/install-and-use-a-package-in-visual-studio) or [dotnet CLI](https://docs.microsoft.com/nuget/quickstart/install-and-use-a-package-using-the-dotnet-cli) guides.
  94. To get started with the ML.NET API and AutoML, see the [csharp-notebooks](https://github.com/dotnet/csharp-notebooks#machine-learning).