我想知道当我使用类似于以下代码的 scikit learn 库运行交叉验证时调用了哪些函数:
scores = cross_val_score(estimator=clf,
X=X_train,
y=y_train,
cv=10,
scoring='roc_auc')
特别是,我想了解在 scikit learn 中调用了什么 predict 函数。
您可以使用检查模块
# import required modules
import inspect
def fun(a,b):
# product of
# two numbers
return a*b
# use getsource()
print(inspect.getsource(fun))
输出如下
def fun(a,b): 两个数的乘积返回 a*b
来源:https : //www.geeksforgeeks.org/inspect-module-in-python/
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句