'Need assistance on objects in PyCaret
I am learning PyCaret. It is a fantastic program. I have the following questions:
1)After running lr = create_model('lr', fold = 5), I get a nice table with accuracy etc.
>>>print(type(lr))
<class 'sklearn.multiclass.OneVsRestClassifier'>
How can I find the data in this class sklearn.multiclass.OneVsRestClassifier. Is there any way to convert to a pd dataframe for export?
2)plot_model(lr) creates a nice AUC graph. fig=plot_model(lr) also creates the same nice graph. But
>>>print(type(fig))
<class 'NoneType'>
so I cannot save the figure and export it. I can add save=True to the code but this will save the figure as auc.png, which is OK, but I would like to save the figures with different names.
Solution 1:[1]
If you are asking how to store the score grid that is printed when you use create_model, you can use pull functionality. For example:
lr = create_model('lr')
lr_results = pull()
type(lr_results) # it will be a pandas DataFrame
Currently, there is no way to change the plot name when saving. You can use save param inside plot_model to save it but it will use the default naming of PyCaret For e.g. AUC.png for AUC plot.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | 10 Rep |
