草庐IT

Scikit-Image

全部标签

python - scikit-learn - 具有置信区间的 ROC 曲线

我可以使用scikit-learn获得ROC曲线fpr,tpr,thresholds=metrics.roc_curve(y_true,y_pred,pos_label=1),其中y_true是基于我的黄金标准的值列表(即,0用于否定情况,1用于肯定情况)和y_pred是相应的分数列表(例如,0.053497243、0.008521122、0.022781548、0.101885263、0.012913795、>0.0,0.042881547[...])我试图弄清楚如何向该曲线添加置信区间,但没有找到任何简单的方法来使用sklearn。 最佳答案

python - scikit-learn - 具有置信区间的 ROC 曲线

我可以使用scikit-learn获得ROC曲线fpr,tpr,thresholds=metrics.roc_curve(y_true,y_pred,pos_label=1),其中y_true是基于我的黄金标准的值列表(即,0用于否定情况,1用于肯定情况)和y_pred是相应的分数列表(例如,0.053497243、0.008521122、0.022781548、0.101885263、0.012913795、>0.0,0.042881547[...])我试图弄清楚如何向该曲线添加置信区间,但没有找到任何简单的方法来使用sklearn。 最佳答案

python - Python scikit-learn 中的 DBSCAN : save the cluster points in an array

按照示例DemoofDBSCANclusteringalgorithm在ScikitLearning中,我试图将每个聚类类的x、y存储在一个数组中importnumpyasnpfromsklearn.clusterimportDBSCANfromsklearnimportmetricsfromsklearn.datasets.samples_generatorimportmake_blobsfromsklearn.preprocessingimportStandardScalerfrompylabimport*#Generatesampledatacenters=[[1,1],[-1,

python - Python scikit-learn 中的 DBSCAN : save the cluster points in an array

按照示例DemoofDBSCANclusteringalgorithm在ScikitLearning中,我试图将每个聚类类的x、y存储在一个数组中importnumpyasnpfromsklearn.clusterimportDBSCANfromsklearnimportmetricsfromsklearn.datasets.samples_generatorimportmake_blobsfromsklearn.preprocessingimportStandardScalerfrompylabimport*#Generatesampledatacenters=[[1,1],[-1,

python - 如何列出所有支持 predict_proba() 的 scikit-learn 分类器

我需要一个支持predict_proba()方法的所有scikit-learn分类器的列表。由于文档没有提供获取该信息的简单方法,如何以编程方式获取该信息? 最佳答案 fromsklearn.utils.testingimportall_estimatorsestimators=all_estimators()forname,class_inestimators:ifhasattr(class_,'predict_proba'):print(name)您还可以使用CalibratedClassifierCV将任何分类器变成具有pre

python - 如何列出所有支持 predict_proba() 的 scikit-learn 分类器

我需要一个支持predict_proba()方法的所有scikit-learn分类器的列表。由于文档没有提供获取该信息的简单方法,如何以编程方式获取该信息? 最佳答案 fromsklearn.utils.testingimportall_estimatorsestimators=all_estimators()forname,class_inestimators:ifhasattr(class_,'predict_proba'):print(name)您还可以使用CalibratedClassifierCV将任何分类器变成具有pre

python - 使用 scikit-learn 进行特征选择

我是机器学习的新手。我正在准备使用ScikitLearnSVM进行分类的数据。为了选择最好的功能,我使用了以下方法:SelectKBest(chi2,k=10).fit_transform(A1,A2)由于我的数据集包含负值,我收到以下错误:ValueErrorTraceback(mostrecentcalllast)/media/5804B87404B856AA/TFM_UC3M/test2_v.pyin()---->12345/usr/local/lib/python2.6/dist-packages/sklearn/base.pycinfit_transform(self,X,y

python - 使用 scikit-learn 进行特征选择

我是机器学习的新手。我正在准备使用ScikitLearnSVM进行分类的数据。为了选择最好的功能,我使用了以下方法:SelectKBest(chi2,k=10).fit_transform(A1,A2)由于我的数据集包含负值,我收到以下错误:ValueErrorTraceback(mostrecentcalllast)/media/5804B87404B856AA/TFM_UC3M/test2_v.pyin()---->12345/usr/local/lib/python2.6/dist-packages/sklearn/base.pycinfit_transform(self,X,y

python - 在 PIL 中使用 Image.point() 方法来操作像素数据

我正在使用PythonImagingLibrary使用定义颜色关系的查找表为黑白图像着色。查找表只是一个包含256个元素的RGB元组列表:>>>len(colors)256>>>colors[0](255,237,237)>>>colors[127](50,196,33)>>>我的第一个版本使用了getpixel()和putpixel()方法:forxinrange(w):foryinrange(h):pix=img.getpixel((x,y))img.putpixel((x,y),colors[pix[0]])这太慢了。profile报告指出putpixel和getpixel方法是

python - 在 PIL 中使用 Image.point() 方法来操作像素数据

我正在使用PythonImagingLibrary使用定义颜色关系的查找表为黑白图像着色。查找表只是一个包含256个元素的RGB元组列表:>>>len(colors)256>>>colors[0](255,237,237)>>>colors[127](50,196,33)>>>我的第一个版本使用了getpixel()和putpixel()方法:forxinrange(w):foryinrange(h):pix=img.getpixel((x,y))img.putpixel((x,y),colors[pix[0]])这太慢了。profile报告指出putpixel和getpixel方法是