【pycaret 分类任务】有监督学习之分类任务

1.一个数据科学利器 PyCaret,几行代码搞定从数据处理到模型训练,保存,部署。
2.PyCaret 是一个将我们常用到的机器学习库进行封装了的轮子。
3.PyCaret对于在时间紧迫的情况下快速生成结果非常有用。在不同类型的数据集上练习使用它——你会越充分利用它,就越能真正掌握它的实用性!
4.PyCaret 支持6个模块, 有监督 和 无监督 模型的训练和部署,分别有分类、回归、聚类、异常检测、自然语言处理和关联规则挖掘。
5、模型比较,这是模型训练的第一步。 compare_models 函数会训练模型库中的所有模型,并使用 k 折交叉验证(默认 k=10)来比较常见的评估指标。所使用的评估指标如下所示:
分类模块: Accuracy , AUC , Recall , Precision , F1 , Kappa
回归模块: MAE , MSE , RMSE , R2 , RMSLE , MAPE


from pycaret.datasets import get_data
from pycaret.classification import *
dataset = get_data('iris')

data = dataset.sample(frac=0.8, random_state=786)
data_unseen = dataset.drop(data.index)

data.reset_index(drop=True, inplace=True)
.reset_index(drop=True, inplace=True)

print('Data for Modeling: ' + str(data.shape))
print('Unseen Data For Predictions ' + str(data_unseen.shape))

classification_setup = setup(data=data , target='species')

compare_models()

qda = create_model('qda')

evaluate_model(qda)

predictions = predict_model(lda, data=data_unseen)

print(predictions)

save_model(lda, 'qda_iris_model')

qda_model=load_model(model_name='qda_iris_model')

pred_new = predict_model(qda_model, data = data_unseen)

【pycaret 分类任务】有监督学习之分类任务
【pycaret 分类任务】有监督学习之分类任务

附录其他:

【1】回归:https://pycaret.org/reg101/
【2】聚类:https://pycaret.org/clu101/
【3】异常检测:https://www.pycaret.org/anom101
【4】自然语言处理:https://pycaret.org/nlp101/
【5】关联规则挖掘:https://pycaret.org/arul101/
【6】预处理功能:https://www.pycaret.org/preprocessing
【7】模型列表:https://www.pycaret.org/create-model
【8】可视化信息:https://www.pycaret.org/plot-model

Original: https://blog.csdn.net/u013421629/article/details/122102866
Author: 东华果汁哥
Title: 【pycaret 分类任务】有监督学习之分类任务

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/664854/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球