我正在pycaret中训练和调优一个模型,例如:
from pycaret.classification import *
clf1 = setup(data = train, target = 'target', feature_selection = True, test_data = test, remove_multicollinearity = True, multicollinearity_threshold = 0.4)
# create model
lr = create_model('lr')
# tune model
tuned_lr = tune_model(lr)
# optimize threshold
optimized_lr = optimize_threshold(tuned_lr)
我想得到逻辑回归中特征的估计参数,这样我就可以继续了解每个特征对目标的影响大小。然而,对象optimized_lr
有一个函数optimized_lr.get_params()
,它返回模型的hiperparameters,然而,我对我的调整决策不太感兴趣,相反,我对模型的真实的参数很感兴趣。Logistic回归中估计的值。
我怎样才能使用pycaret得到它们呢?(我可以很容易地使用其他包,如statmodels,但我想知道在pycaret)
2条答案
按热度按时间v2g6jxz61#
怎么样
ru9i0ody2#
要获得系数,请使用以下代码:
现在我们可以创建一个 Dataframe ,这样我们就可以清楚地看到它是如何与自变量相关的。