Hướng dẫn smooth roc curve python - con trăn đường cong roc mịn
Bạn đang sử dụng các dự đoán ngưỡng để tạo đường cong ROC. Thay vào đó, bạn nên sử dụng các giá trị tin cậy ban đầu, nếu không bạn sẽ chỉ nhận được 1 điểm trung gian trên đường cong. Dưới đây là một số dữ liệu ví dụ và đường cong ROC bạn sẽ nhận được. Tôi biết câu hỏi là hai năm tuổi và câu trả lời kỹ thuật đã được đưa ra trong các bình luận, nhưng một câu trả lời công phu hơn có thể giúp những người khác vẫn phải vật lộn với các khái niệm. Đường cong ROC của OP sai vì anh ta đã sử dụng các giá trị dự đoán của các mô hình của mình thay vì xác suất. Điều đó có nghĩa là gì? Khi một mô hình được đào tạo, nó sẽ học được các mối quan hệ giữa các biến đầu vào và biến đầu ra. Đối với mỗi quan sát, mô hình được hiển thị, mô hình tìm hiểu mức độ có thể là một quan sát nhất định thuộc về một lớp nhất định. Khi mô hình được trình bày với dữ liệu thử nghiệm, nó sẽ đoán cho mỗi quan sát chưa từng thấy nó có thể thuộc về một lớp nhất định. Làm thế nào để mô hình biết nếu một quan sát thuộc về một lớp? Trong quá trình thử nghiệm, mô hình nhận được một quan sát mà nó ước tính xác suất 51% thuộc về lớp X. Làm thế nào để đưa ra quyết định gắn nhãn là thuộc lớp X hay không? Nhà nghiên cứu sẽ đặt một ngưỡng nói với mô hình rằng tất cả các quan sát với xác suất dưới 50% phải được phân loại là y và tất cả những người trên phải được phân loại là X. Đôi khi nhà nghiên cứu muốn đặt ra một quy tắc chặt chẽ hơn vì họ quan tâm hơn đến chính xác Dự đoán một lớp nhất định như X thay vì cố gắng dự đoán tất cả chúng là tốt. During testing the model receives an observation for which it estimates a probability of 51% of belonging to Class X. How does take the decision to label as belonging to Class X or not? The researcher will set a threshold telling the model that all observations with a probability under 50% must be classified as Y and all those above must be classified as X. Sometimes the researcher wants to set a stricter rule because they're more interested in correctly predicting a given class like X rather than trying to predict all of them as well. Vì vậy, mô hình được đào tạo của bạn đã ước tính xác suất cho từng quan sát của bạn, nhưng cuối cùng ngưỡng sẽ quyết định trong lớp quan sát của bạn sẽ được phân loại. Vì sao vấn đề này? Đường cong được tạo ra bởi ROC biểu thị một điểm cho từng tỷ lệ dương thực sự và tỷ lệ dương tính giả của mô hình của bạn ở các mức ngưỡng khác nhau. Điều này giúp nhà nghiên cứu thấy sự đánh đổi giữa FPR và TPR cho tất cả các cấp ngưỡng. Vì vậy, khi bạn vượt qua các giá trị dự đoán thay vì xác suất dự đoán cho ROC của bạn, bạn sẽ chỉ có một điểm vì các giá trị này được tính toán bằng một ngưỡng cụ thể. Bởi vì điểm đó là TPR và FPR của mô hình của bạn cho một mức ngưỡng cụ thể. Những gì bạn cần làm là sử dụng xác suất thay thế và để ngưỡng khác nhau. Chạy mô hình của bạn như vậy:
Khi tạo ma trận nhầm lẫn của bạn, bạn sẽ sử dụng các giá trị của mô hình của bạn
Khi tạo đường cong ROC của bạn, bạn sẽ sử dụng xác suất
Smooth: Smooth một đường cong ROC: Smooth a ROC curveMô tả đối số sử dụng đối số Chi tiết Lỗi giá trị Tài liệu tham khảo Xem thêm ví dụ Xem Nguồn: R/Smooth.R Hàm này làm mịn một đường cong ROC của dự đoán số. Theo mặc định, việc làm mịn nhị phân được thực hiện, nhưng mật độ hoặc làm mịn tùy chỉnh được hỗ trợ.
Nếu smooth(...) ## Default S3 method: smooth(...) ## S3 method for class 'roc' smooth(roc, method=c("binormal", "density", "fitdistr", "logcondens", "logcondens.smooth"), n=512, bw = "nrd0", density=NULL, density.controls=density, density.cases=density, start=NULL, start.controls=start, start.cases=start, reuse.auc=TRUE, reuse.ci=FALSE, ...) ## S3 method for class 'smooth.roc' smooth(smooth.roc, ...)3, một mô hình tuyến tính được trang bị cho các lượng tử của độ nhạy và độ đặc hiệu. Độ nhạy và độ đặc hiệu được làm mịn sau đó được tạo ra từ mô hình này trên 3 điểm. Cách tiếp cận đơn giản này đã được tìm thấy để hoạt động tốt cho hầu hết các đường cong ROC, nhưng nó có thể tạo ra các mịn trong một số tình huống (xem trong Hanley (1988)).Với 5, hàm 9 được sử dụng để tạo ra mật độ hạt nhân mịn của các quan sát điều khiển và trường hợp như được mô tả bởi Zhou et al. (1997), trừ khi 6 hoặc 7 được cung cấp trực tiếp. 4 có thể được đưa ra để chỉ định băng thông để sử dụng với 9. Nó có thể là một giá trị số hoặc một chuỗi ký tự (Hồi NRD0 ,, NRD ,, UCV ,, Trong trường hợp chuỗi ký tự, toàn bộ dữ liệu dự đoán được sử dụng để xác định giá trị số sẽ sử dụng trên cả hai điều khiển và trường hợp. Tùy thuộc vào dữ liệu của bạn, có thể là một ý tưởng tốt để chỉ định đối số smooth(...) ## Default S3 method: smooth(...) ## S3 method for class 'roc' smooth(roc, method=c("binormal", "density", "fitdistr", "logcondens", "logcondens.smooth"), n=512, bw = "nrd0", density=NULL, density.controls=density, density.cases=density, start=NULL, start.controls=start, start.cases=start, reuse.auc=TRUE, reuse.ci=FALSE, ...) ## S3 method for class 'smooth.roc' smooth(smooth.roc, ...)0 cho 9. Theo mặc định, người Gaussian, được sử dụng, nhưng Epanechnikov ,, hình chữ nhật, hình chữ nhật, hình tam giác, hình tam giác, Bi Weight ,, Cos Cosine và và Opt Optcosine được hỗ trợ. Vì tất cả các hạt nhân là đối xứng, nó có thể giúp bình thường hóa dữ liệu trước tiên (nghĩa là trước khi gọi ____10), ví dụ với chuẩn hóa lượng tử hóa:Ngoài ra, 9 có thể là một hàm phải trả về một vectơ số có mật độ trên trục Y hoặc một danh sách với một mục y y như hàm 9. Nó phải chấp nhận đầu vào sau:
Điều quan trọng là phải tôn vinh 3, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 1177 và 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 1178 để có mật độ được đánh giá trên cùng một điểm đối với các điều khiển và trường hợp. Không làm như vậy và trở lại mật độ có độ dài khác nhau sẽ tạo ra lỗi. Đó cũng là một ý tưởng tốt để sử dụng một tham số làm mịn không đổi (chẳng hạn như 4), đặc biệt là khi các điều khiển và trường hợp có số lượng quan sát khác nhau, để tránh tạo ra mật độ mượt mà hơn hoặc khó khăn hơn.Nếu 4, hàm 6 từ gói khối được sử dụng để phù hợp với các tham số cho hàm mật độ 9 với các tham số bắt đầu tùy chọn 4. Hàm mật độ được trang bị riêng biệt trong điều khiển ( 6, 5) và quan sát trường hợp ( 7, 6). 9 có thể là một trong các giá trị ký tự được phép bởi 6 hoặc hàm mật độ (chẳng hạn như Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)0, Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)1, ...).MASS package is employed to fit parameters for the density function 9 with optionnal start parameters 4. The density function are fitted separately in control ( 6, 5) and case observations ( 7, 6). 9 can be one of the character values allowed by 6 or a density function (such as Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)0, Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)1, ...). Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)2 và Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)3 Sử dụng gói logcondens để tạo ra ước tính mật độ log-concave không được làm mịn hoặc làm mịn (tương ứng) của điều khiển và quan sát trường hợp với hàm logconroc.logcondens package to generate a non smoothed or smoothed (respectively) log-concave density estimate of of the control and case observation with the logConROC function. Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)4 buộc sử dụng hàm 1 trong gói thống kê, do đó mã khác dựa vào 1 sẽ tiếp tục hoạt động bình thường.stats package, so that other code relying on 1 should continue to function normally. Các đường cong ROC được làm mịn có thể được truyền lại để làm mịn trở lại. Trong trường hợp này, việc làm mịn không được áp dụng lại trên đường cong ROC được làm mịn nhưng đối tượng ROC ROC ban đầu sẽ được sử dụng lại. Lưu ý rằng một đường cong Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates)7 không có ngưỡng. Một danh sách các lớp học mịn.
Thuộc tínhNgoài ra, đối tượng 0 ban đầu được lưu trữ dưới dạng thuộc tính ROC ROC.Thông báo Chức năng 'mật độ' phải trả về một vectơ số hoặc một danh sách có mục 'y'. sẽ được hiển thị nếu hàm 9 không trả về đầu ra hợp lệ. Thông điệp chiều dài của 'mật độ.controls' và 'mật độ.case' khác nhau. sẽ được hiển thị nếu giá trị trả về khác nhau về chiều dài.Làm mịn nhị phân không thể làm mịn đường cong ROC được xác định chỉ bằng một điểm. Bất kỳ nỗ lực nào như vậy sẽ thất bại với lỗi đường cong ROC không thể vượt qua (không đủ điểm). Nếu đường cong ROC mịn được tạo bởi 0 với các đối số số 6 và 7, nó không thể được làm mịn và lỗi không thể làm mịn một đường cong ROC được tạo trực tiếp với mật độ số 'và' mật độ.case '. được sản xuất.Phương pháp làm mịn 6 và 9 yêu cầu số 13. Nếu đường cong ROC thành mịn được tạo ra với một yếu tố được đặt hàng, chỉ có thể làm mịn nhị phân có thể được áp dụng và thông điệp các đường cong ROC của các dự đoán theo thứ tự chỉ có thể được làm mịn khi làm mịn nhị phân. được hiển thị khác.Các phương thức 6, 00 và 16 yêu cầu các gói bổ sung. Nếu không có sẵn, thông báo sau sẽ được hiển thị với lệnh bắt buộc để cài đặt gói: Gói gói? Không có sẵn, được yêu cầu với Phương thức = '?'. Vui lòng cài đặt nó với 'install.packages ("?")'. "James E. Hanley (1988) Sự mạnh mẽ của các giả định của Bin Binormal được sử dụng trong các đường cong ROC phù hợp. Ra quyết định y tế 8, 197 Từ203.8, 197–203. Lutz Duembgen, Kaspar Rufibach (2011) Logcondens: Các tính toán liên quan đến ước tính mật độ log-concave đơn biến. Tạp chí phần mềm thống kê, 39, 1 trận28. URL: jstatsoft.org/v39/i06.39, 1–28. URL: jstatsoft.org/v39/i06. Xavier Robin, Natacha Turck, Alexandre Hainard, et al. . BMC Bioinformatics, 7, 77. doi: doi: 10.1186/1471-2105-12-77.7, 77. DOI: doi: 10.1186/1471-2105-12-77. Kaspar Rufibach (2011) Một công cụ ước tính đường cong ROC trơn tru dựa trên ước tính mật độ log-concave. Tạp chí quốc tế về sinh học, 8, được chấp nhận. Doi: doi: 10.1515/1557-4679.1378. ARXIV: 1103.1787.8, accepted. DOI: doi: 10.1515/1557-4679.1378. arXiv: 1103.1787. William N. Venables, Brian D. Ripley (2002). Thống kê ứng dụng hiện đại với Siêu. New York, Springer. Sách Google. Kelly H. Zou, W. J. Hall và David E. Shapiro (1997) Các đường cong đặc tính hoạt động của máy thu không tham số mịn (ROC) cho các xét nghiệm chẩn đoán liên tục. Thống kê trong Y học 18, 2143 Từ2156. Doi: doi: 10.1002/(sici) 1097-0258 (19971015) 16: 193.0.co; 2-3.18, 2143–2156. DOI: doi: 10.1002/(SICI)1097-0258(19971015)16:19<2143::AID-SIM655>3.0.CO;2-3. 0Các gói cran Mass và logcondens được sử dụng trong chức năng này.MASS and logcondens employed in this function.
Type 'citation("pROC")' for a citation. Attaching package: ‘pROC’ The following objects are masked from ‘package:stats’: cov, smooth, var Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: smooth.roc(roc = rocobj) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Setting levels: control = Good, case = Poor Setting direction: controls < cases Call: roc.default(response = aSAH$outcome, predictor = aSAH$s100b, smooth = TRUE) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: binormal Area under the curve: 0.74 Loading required namespace: MASS Loading required namespace: logcondens Call: smooth.roc(roc = rocobj, method = "fitdistr", density = dnorm, start = list(mean = 1), sd = 0.1) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.9474 Warning messages: 1: In stats::optim(x = c(0.13, 0.14, 0.1, 0.04, 0.47, 0.18, 0.1, 0.1, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly 2: In stats::optim(x = c(0.13, 0.1, 0.16, 0.12, 0.44, 0.71, 0.49, 0.07, : one-dimensional optimization by Nelder-Mead is unreliable: use "Brent" or optimize() directly Call: smooth.roc(roc = rocobj, method = "fitdistr", density.controls = "normal", density.cases = "lognormal") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: fitdistr Area under the curve: 0.6546 Call: smooth.roc(roc = rocobj, method = "density", density.controls = density.controls$y, density.cases = density.cases$y) Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Call: smooth.roc(roc = rocobj, method = "density") Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor). Smoothing: density (bandwidth: nrd0; adjust: 1) Area under the curve: 0.7244 Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases Setting direction: controls < cases 95% CI: 0.874-0.8774 (100 stratified bootstrap replicates) Tài liệu Proc được xây dựng vào ngày 5 tháng 9 năm 2021, 5:34 chiều |