roc

数据挖掘——Data competition: From 0 to 1: Part I

跟風遠走 提交于 2019-11-28 01:20:06
Data competition: From 0 to 1: Part I 1. Data competition Introduction 2. Example: Credit Fraud Detector EDA(Exploratory Data Analysis) Why taking log transformation of continuous variables? Outliers Detection Unbalance Metrics Resampling Cross-validation: evaluating estimator performance Cross validation iterators Cross-validation iterators for grouped data Cross validation of time series data Modeling Data competition: From 0 to 1: Part I 1. Data competition Introduction A typical data science process might look like this: Project Scoping / Data Collection Exploratory Analysis Data Cleaning

Roc curve and cut off point. Python

不打扰是莪最后的温柔 提交于 2019-11-27 17:20:54
I ran a logistic regression model and made predictions of the logit values. I used this to get the points on the ROC curve: from sklearn import metrics fpr, tpr, thresholds = metrics.roc_curve(Y_test,p) I know metrics.roc_auc_score gives the area under the ROC curve. Can anyone tell me what command will find the optimal cut-off point (threshold value)? Manohar Swamynathan Though its late to answer, thought might be helpful. You can do this using the epi package in R (here!) , however I could not find similar package or example in python. The optimal cut off point would be where true positive

Obtaining threshold values from a ROC curve

核能气质少年 提交于 2019-11-27 11:02:59
I have some models, using ROCR package on a vector of the predicted class percentages, I have a performance object. Plotting the performance object with the specifications "tpr", "fpr" gives me a ROC curve. I'm comparing models at certain thresholds of false positive rate (x). I'm hoping to get the value of the true positive rate (y) out of the performance object. Even more, I would like to get the class percentage threshold that was used to generate that point. the index number of the false positive rate ( x-value ) that is closest to the threshold without being above it, should give me the

ROC curve in R using ROCR package

和自甴很熟 提交于 2019-11-27 10:34:26
问题 Can someone explain me please how to plot a ROC curve with ROCR. I know that I should first run: prediction(predictions, labels, label.ordering = NULL) and then: performance(prediction.obj, measure, x.measure="cutoff", ...) I am just not clear what is meant with prediction and labels. I created a model with ctree and cforest and I want the ROC curve for both of them to compare it in the end. In my case the class attribute is y_n, which I suppose should be used for the labels. But what about

pROC ROC curves remove empty space

烈酒焚心 提交于 2019-11-27 07:14:38
问题 I want to draw ROC curves with pRoC. However for some reason there is extra empty space on either side of the x-axis and I cannot remove it with xlim. Some example code: library(pROC) n = c(4, 3, 5) b = c(TRUE, FALSE, TRUE) df = data.frame(n, b) rocobj <- plot.roc(df$b, df$n, percent = TRUE, main="ROC", col="#1c61b6", add=FALSE) I tried the pROC help file, but that doesn't really help me. Even more puzzling is to me that the Y-axis is OK looking... I really appreciate your help! 回答1: Make

xargs的用法

旧街凉风 提交于 2019-11-27 04:54:31
处理带有空格的 文件名 #我们创建了3个日志文件, 且故意让文件名称中都含有空格 [roc@roclinux ~]$ for((i=0;i<3;i++)); do touch "test ${i}.log";done #我们列出创建的文件 [roc@roclinux ~]$ ls -1F test 0.log test 1.log test 2.log xargs 提供了 -0 选项,允许将 NULL 作为分隔符,而 find 命令也心有灵犀地提供了对应的选项来产生以 NULL 字符作为分隔符的输出。 find 命令提供的对应方法是 -print0 选项,在文件名之后输出 NULL,而不像 -print 选项那样输出换行符(换行符会被 xargs 替换成空格)。 [roc@roclinux ~]$ find . -name '*.log' -print0 | xargs -0 rm -f 需要用户确认 如果在前一个命令的标准输出中,会有一些参数是你不希望或者不确定是否要传送给后面命令的,这个时候我们就希望 xargs 在传送参数前和我们确认一下。而 -p 选项恰好可以实现这个愿望,我们可以输入 y 或者 n 来选择是否要执行当前命令: [roc@roclinux ~]$ find . -type f |xargs -p rm -f rm -f ./china.txt ./usa

Obtaining threshold values from a ROC curve

旧巷老猫 提交于 2019-11-26 15:24:13
问题 I have some models, using ROCR package on a vector of the predicted class percentages, I have a performance object. Plotting the performance object with the specifications "tpr", "fpr" gives me a ROC curve. I'm comparing models at certain thresholds of false positive rate (x). I'm hoping to get the value of the true positive rate (y) out of the performance object. Even more, I would like to get the class percentage threshold that was used to generate that point. the index number of the false

机器学习之分类

只愿长相守 提交于 2019-11-26 13:47:25
本次使用的数据集是比较经典的mnist数据集。它有着 70000 张规格较小的手写数字图片,由美国的高中生和美国人口调查局的职员手写而成。这相当于机器学习当中的“Hello World”,人们无论什么时候提出一个新的分类算法,都想知道该算法在这个数据集上的表现如何。机器学习的初学者迟早也会处理 MNIST 这个数据集。接下来就是进行数据集的读取工作。 加载数据 机器学习的初学者迟早会接触Minist这个数据集,sklearn提供很多辅助函数用于下载流行的数据集 fetch_mldata 出错修改方式 下载文件 https://github.com/amplab/datascience-sp14/raw/master/lab7/mldata/mnist-original.mat 创建一个文件夹:datasets或mldata,将下载好的mnist-original.mat文件放在这个文件夹之中。 fetch_mldata('MNIST original', data_home="datasets"),data_home参数即为从本地导入数据的地址。 from sklearn.datasets import fetch_mldata mnist = fetch_mldata('MNIST original', data_home="sample_data") mnist X, y =