PyCaret 2.0在这里-新增功能?
There’s no doubt that PyCaret is my favorite machine learning library. It’s more developer-friendly than, let’s say, Scikit-Learn, and provides built-in functions for tackling major machine learning tasks with ease. So, what’s new in this release? Read to find out.
毫無疑問,PyCaret是我最喜歡的機器學習庫。 比起Scikit-Learn,它對開發人員更友好,并且提供了內置功能,可以輕松地處理主要的機器學習任務。 那么,此版本中有哪些新功能? 閱讀以找出答案。
If you haven’t used the library before, feel free to check the articles below. They are a good starting point for both classification and regression tasks.
如果您以前從未使用過該庫,請隨時查看以下文章。 它們是分類和回歸任務的良好起點。
PyCaret: Better Machine Learning with Python
PyCaret:使用Python更好的機器學習
Regression with PyCaret: A better machine learning library
PyCaret回歸:更好的機器學習庫
Classification with PyCaret: A better machine learning library
使用PyCaret進行分類:更好的機器學習庫
A couple of days back version 2.0 was released and with it came some new features. Most of them are minor, but still worth mentioning, as they will either save you time or provide you with some additional information.
幾天前發布了2.0版,并附帶了一些新功能。 其中大多數都是次要的,但仍然值得一提,因為它們可以節省您的時間或為您提供一些其他信息。
Here’s the complete changelog.
這是完整的變更日志。
We’ll see how to install the library in the next section.
在下一節中,我們將介紹如何安裝該庫。
庫安裝 (Library installation)
To start, open up the Terminal/CMD and execute the following line:
首先,打開終端/ CMD并執行以下行:
pip install pycaret==2.0I’m assuming you have Python installed and configured, either as a standalone install or through Anaconda. PyCaret installation will take a minute or so to finish, due to a good number of dependencies.
我假設您已經安裝并配置了Python ,既可以獨立安裝也可以通過Anaconda安裝和配置。 由于存在大量依賴關系, PyCaret安裝將需要一分鐘左右的時間才能完成。
Once done, you can open the Notebook environment, import the library, and check for the version.
完成后,您可以打開Notebook環境,導入庫,然后檢查版本。
import pycaretpycaret.__version__>>> ‘2.0.0’And that’s pretty much it for the installation. We’ll discuss the most useful new features next.
這幾乎就是安裝所需的時間。 接下來,我們將討論最有用的新功能。
1.培訓時間 (1. Training time)
This feature is not groundbreaking by any means but is nice to have. For example, upon calling the compare_models() function you’ll now get an additional column that represents the training time:
此功能絕不是開創性的,但很高興。 例如,調用compare_models()函數后,您現在將獲得一個附加列,它代表訓練時間:
This is the performance of the raw Iris dataset. We can see the best algorithms marked with distinct yellow color, and the training time in seconds added on the far right, as a new column.
這是原始虹膜數據集的性能。 我們可以看到標記有明顯黃色的最佳算法,并且在最右邊以新列添加了以秒為單位的訓練時間。
It’s a nice feature to have, as it shows decent speed training speed improvements for QDA instead of the Extra Trees Classifier algorithm while providing the same performance. If speed is a concern, these features can be useful.
這是一個很好的功能,因為它顯示了QDA的速度訓練速度得到了提高,而不是Extra Trees Classifier算法,同時提供了相同的性能。 如果需要考慮速度,則這些功能可能會很有用。
2.保存可視化 (2. Saving visualizations)
My previous articles on PyCaret showed how easy it is to make great-looking visualizations based on your model performance. One thing that was missing is saving the plot to your device.
我以前在PyCaret上發表的文章顯示了根據模型性能進行美觀的可視化是多么容易。 缺少的一件事是將繪圖保存到設備中。
With version 2.0, it’s easy to save various plots to your device. Here’s an example:
使用2.0版,可以輕松地將各種繪圖保存到設備中。 這是一個例子:
plot_model(model, plot=’confusion_matrix’, save=True)As you can see, the only new parameter here is the save parameter. When it’s set to True, the plot is saved on your device. Let’s take a quick look at it:
如您所見,這里唯一的新參數是save參數。 設置為True ,繪圖將保存在您的設備上。 讓我們快速看一下:
3. MLFlow用戶界面 (3. MLFlow UI)
For those who don’t know, PyCaret 2.0 embeds an MLflow tracking component as a backend API and UI for logging. You can read more about MLFlow on this link, but in summary, it’s a nice GUI for managing machine learning lifecycle, and in this case, comparing models performance.
對于那些不知道的人, PyCaret 2.0嵌入了MLflow跟蹤組件作為日志記錄的后端API和UI。 您可以在此鏈接上了解有關MLFlow的更多信息,但總而言之,它是用于管理機器學習生命周期的一個不錯的GUI,在這種情況下,它是比較模型性能的工具。
Here’s the entire code for importing data, comparing models, and starting the backend service:
這是用于導入數據,比較模型和啟動后端服務的完整代碼:
from pycaret.classification import *from pycaret.datasets import get_datairis = get_data(‘iris’)clf = setup(
iris,
target=’species’,
session_id=42,
log_experiment=True,
experiment_name=’exp1'
)compare_models()!mlflow ui
These two bolded lines are particularly important for selecting the appropriate experiment in the application, you’ll see why in a bit.
這兩行粗體對于在應用程序中選擇適當的實驗特別重要,稍后您將了解原因。
After executing this code, simply go to http://localhost:5000 to see the application:
執行此代碼后,只需轉到http://localhost:5000即可查看該應用程序:
你走之前 (Before you go)
This was a rather quick article demonstrating the most useful new features of PyCaret 2.0, according to my current experience with the library. Your’s might vary, so keep that in mind. For the full changelog, visit this link.
根據我目前使用該庫的經驗,這是一篇相當簡短的文章,展示了PyCaret 2.0的最有用的新功能。 您的可能會有所不同,因此請記住這一點。 有關完整的變更日志, 請訪問此鏈接 。
Also, feel free to study the official documentation further on your own, as it’s one of the best documentation out there.
另外,請隨時自行研究官方文檔 ,因為它是目前最好的文檔之一。
Thanks for reading.
謝謝閱讀。
Join my private email list for more helpful insights.
加入我的私人電子郵件列表以獲取更多有用的見解。
翻譯自: https://towardsdatascience.com/pycaret-2-0-is-here-whats-new-34baa87a951e
總結
以上是生活随笔為你收集整理的PyCaret 2.0在这里-新增功能?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三星用户请注意!One UI 5.1即将
- 下一篇: 博主辟谣魅族20设计图 系魅族17弃案