Title: | Easily Get True-Positive Rate and False-Positive Rate and KS Statistic |
Version: | 0.1.0 |
Description: | The Kolmogorov-Smirnov (K-S) statistic is a standard method to measure the model strength for credit risk scoring models. This package calculates the K–S statistic and plots the true-positive rate and false-positive rate to measure the model strength. This package was written with the credit marketer, who uses risk models in conjunction with his campaigns. The users could read more details from Thrasher (1992) <doi:10.1002/dir.4000060408> and 'pyks' https://pypi.org/project/pyks/. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
Imports: | dplyr, magrittr, ROCR, ggplot2, tidyr |
RoxygenNote: | 6.1.1 |
Depends: | R (≥ 2.10) |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2020-01-26 15:09:41 UTC; lijiaxiang |
Author: | Jiaxiang Li |
Maintainer: | Jiaxiang Li <alex.lijiaxiang@foxmail.com> |
Repository: | CRAN |
Date/Publication: | 2020-02-06 16:00:06 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Plot KS chart
Description
Plot KS chart
Usage
ks_plot(df)
Arguments
df |
data.frame created by |
Value
The 'ggplot2' object
Examples
data("two_class_example_edited")
max(ks_table(two_class_example_edited$yhat, two_class_example_edited$y)$ks)
ks_table(two_class_example_edited$yhat, two_class_example_edited$y) %>%
ks_plot()
Get KS statistics
Description
Output a data.frame
with inputs (y, yhat) and tpr, fpr and ks.
Usage
ks_table(yhat, y)
Arguments
yhat |
numeric the value predicted by your model. |
y |
numeric the target values. |
Value
The data frame containing tpr, fpr and ks.
Examples
data("two_class_example_edited")
max(ks_table(two_class_example_edited$yhat, two_class_example_edited$y)$ks)
A sample with the target and predictions
Description
A dataset containing two columns, yhat
and y
as
the inputs for the function ks_table
.
Usage
two_class_example_edited
Format
A data frame with 500 rows and 2 variables:
- yhat
predictions
- y
target
Source
package yardstick::two_class_example