how can we interpret Precision, Precision#K, ROC curve and precision-recall AUC curve - precision

I am performing a logistic regression and performing probabilistic modeling. When I go through the definition of this ** Precision, Precision#K, ROC curve, and precision-recall AUC curve** performance metrics I am not able to differentiate differences between them. Please correct me if my understanding is wrong and any suggestion would be much appreciated.
**What is the difference between precision and precision#K? The interpretation of precision score 0.8 and precision#K score 0.8 is same whereas k might give some extra information **
Precision: it gives the ratio of correctly classified positive outcomes out of all predicted positive outcomes
Precision#K: it gives the ratio of correctly classified positive outcomes over the k-value. Out of K-value how many of them are relevant to us. I understand this on the problem of recommendation but how can we use this as a performance metric in prediction classification? For example, employees leaving a company and so on.
What is the difference between the ROC curve and Precision-Recall curve AUC? How 0.8 ROC curve and 0.8 precision-recall curve are interpretated
ROC curve is ratio between **True Positive** and **False Positive**
Precision-Recall curve AUC is the ration between **Precision** and **Recall**
I am having a problem understanding the concept. Can somebody please help me to understand the concept?
Thank You

Related

Why we cannot calculate an ROC curve in cost sensitive learning?

In the Applied Predictive Modeling book, cost sensitivity learning approach, the author(s) write:
One consequence of this approach is that class probabilities cannot be
generated for the model, at least in the available implementation.
Therefore we cannot calculate an ROC curve and must use a different
performance metric. Instead we will now use the Kappa statistic,
sensitivity, and specificity to evaluate the impact of weighted
classes.
Can you explain to me why not ROC/AUC but Kappa Statistic, sensitivity and specificity instead? I think sensitivity or specificity is also ROC or AUC?
Link for the book: https://cloudflare-ipfs.com/ipfs/bafykbzacedepga3g6t7b6rq6irwhy5gzpc47bamquhygup4eqggidvkjcztqs?filename=Max%20Kuhn%2C%20Kjell%20Johnson%20-%20Applied%20Predictive%20Modeling-Springer%20%282013%29.pdf

How to form precision-recall curve using one test dataset for my algorithm?

I'm working on knowledge graph, more precisely in natural language processing field. To evaluate the components of my algorithm, it is necessary to be able to classify the good and the poor candidates. For this purpose, we manually classified pairs in a dataset.
My system returns the relevant pairs according to the implementation logic. now I'm able to calculate :
Precision = X
Recall = Y
For establishing a complete curve I need the rest of points (X,Y), what should I do?:
build another dataset for test ?
split my dataset ?
or any other solution ?
Neither of your proposed two methods. In short, Precision-recall or ROC curve is designed for classifiers with probabilistic output. That is, instead of simply producing a 0 or 1 (in case of binary classification), you need classifiers that can provide a probability in [0,1] range. This is the function to do it in sklearn, note how the 2nd parameter is called probas_pred.
To turn this probabilities into concrete class prediction, you can then set a threshold, say at .5. Setting such a threshold is problematic however, since you can trade-off precision/recall by varying the threshold, and an arbitrary choice can give false impression of a classifier's performance. To circumvent this, threshold-independent measures like area under ROC or Precision-Recall curve is used. They create thresholds at different intervals, say 0.1,0.2,0.3...0.9, turn probabilities into binary classes and then compute precision-recall for each such threshold.

Large Residual-Online Outlier Detection for Kalman Filter

I am trying to find outliers in Residual. I used three algorithms basically if the residuals magnitudes are less, the algorithm performances are good but if the residuals magnitude are big, the algorithm performances are not good.
1) 𝑿^𝟐=〖(𝒚−𝒉(𝒙))〗^𝑻 𝑺^(−𝟏) (𝒚−𝒉(𝒙)) - Chi-Square Test
if the matrix 3x3 - degree of freedom is 4.
𝑿^𝟐 > 13.277
2) Residual(i) > 3√(HP 𝐻^𝑇 + R) - Measurement Covariance Noise
3) Residual(i) > 3-Sigma
I have applied three algorithms to find the outliers. First one is Chi Square Test, second checks Measurement Covariance Noise, Third looks the 3 sigma.
Can you give any suggestion about the algorithms or I can implement a new way if you suggest?
The third case cannot be correct for all case because if there is a large residual, will fail. The second one is more stable because it is related to measurement noise covariance so that your residual should change according to the measurement covariance error.

ROC for predictions - how to define class labels

I have a set of predictions from a model, and a set of true values of the observations, and I want to create an ROC.
The quality of the prediction (in absolute error terms) is independent of the magnitude of the prediction. So I have a set of predictions (pred(1), pred(2), ..., pred(n)) and observations (obs(1), obs(2), ..., obs(n)).
Someone told me to create the elements of my binary classification vector label(i) as label(i) = ifelse(|obs(i) - pred(i)| < tol, 1, 0) and then calculate the AUC (tol is some respecified tolerance). So for each prediction, if it is close to the corresponding observation, the corresponding label is 1, otherwise it is 0.
But I don't see how the suggested labeling is valid, as higher pred() values will not necessarily discriminate my binary classification, i.e. prediction values do not serve to "RANK" the quality of my predictions (i.e., a given threshold does not divide my data naturally). Can someone please shed some light for me on what to do here? Is the suggestion given above a valid one? Or is an ROC inappropriate to use here?
ROC analysis is defined for binary classification, where the observed labels can take two values (binary), and your predictions are any sort of numbers. There are extensions of ROC analysis to multi-class classification, but your question suggests that your observations are some sort of continuous measurement. You could binarize them (something like label(i) = ifelse(obs(i) > someValue, 1, 0)), but it would be invalid for the labels to depend on the classification: they must be some sort of truth that is independent on your classifier.
Alternatively if your observations are continuous, you should assess the quality of your predictions with a coefficient of correlation or a similar measure.

How do I calculate the accuracy?

I am in the final stage of SVM implementation in Java.
I have 10 datasets and among that 3 points missclassified.
So what will be the equation to find accuracy?
Accuracy is (TP + TN) / #samples, where:
TP are the true positives (actual value is +1, and it is classified as +1)
TN are the true negatives (actual value is -1, and it is classified as -1)
In classification tasks, beyond accuracy, many other measures are used to express the performance of a classifier, such as precision, recall, ROC, area under the ROC and F1 score.
You can find further information and equations here: http://en.wikipedia.org/wiki/Receiver_operating_characteristic and here: http://en.wikipedia.org/wiki/Accuracy_and_precision
The accuracy of the algorithm is: #samples_classified_correctly / #samples.
If you have 10 samples, 7 out of them are correctly classified your accuracy is 0.7.
However, note that 10 samples is not statistically enough to estimate expected accuracy for samples that you don't know their classification (in the "real world").

Resources