Hot answers tagged

22

F1Score is a metric to evaluate predictors performance using the formula F1 = 2 * (precision * recall) / (precision + recall) where recall = TP/(TP+FN) and precision = TP/(TP+FP) and remember: When you have a multiclass setting, the average parameter in the f1_score function needs to be one of these: 'weighted' 'micro' 'macro' The first one, '...


19

There is no relationship between these two metrics. Loss can be seen as a distance between the true values of the problem and the values predicted by the model. Greater the loss is, more huge is the errors you made on the data. Accuracy can be seen as the number of error you made on the data. That means : - a low accuracy and huge loss means you made ...


9

Let's be precise. "Distance" has lots of meanings in data science, I think you're talking about Euclidean distance. The Gaussian kernel is a non-linear function of Euclidean distance. The kernel function decreases with distance and ranges between zero and one. In euclidean distance, the value increases with distance. Thus, the kernel function is a more ...


8

The classification report is about key metrics in a classification problem. You'll have precision, recall, f1-score and support for each class you're trying to find. The recall means "how many of this class you find over the whole number of element of this class" The precision will be "how many are correctly classified among that class" The f1-score is ...


7

F1 will never be zero, but very near to zero for a bad classifier. If TP or TN is zero then there isn't any need to check F1.


6

Well actually these can give you different insights into your models errors. If $y$ is your target, $p$ your prediction and $e = p - y$ the errors: Mean Error: $ME = mean(e)$ In (-∞,∞), the closer to 0 the better. Measures additive bias in the error. Unbiased estimates should have the same mean as your target thus ME should be close to 0, if it's ...


5

The other answers give good definitions of accuracy and loss. To answer your second question, consider this example: We have a problem of classifying images from a balanced dataset as containing either cats or dogs. Classifier 1 gives the right answer in 80/100 of cases, whereas classifier 2 gets it right in 95/100. Here, classifier 2 obviously has the ...


5

Actually, accuracy is a metric that can be applied to classification tasks only. It describes just what percentage of your test data are classified correctly. For example, you have binary classification cat or non-cats. If out of 100 test samples 95 is classified correctly (i.e. correctly determined if there's cat on the picture or not), then your accuracy ...


5

And one last thing, is my result on X_train indicative that my features are informative enough to learn the target? or is the R² train score somehow biased? High scoring fits on training data does not necessarily indicate that your features are informative enough to learn the target in a general fashion. Only your cross validation scores can do so. Note :...


5

It's a mistake on Wikipedia. $F_{1}$ as the harmonic mean is defined only at positive real numbers. $PRE$ or $REC$ could be equal 0 in case $TP=0$. Which provides to undefined result $F_1=\frac{0}{0}$.


5

First of all, precision and recall are not specific to image classification; they are relevant wherever there are two distinct "positive" and "negative" classes (for example, when you test an e-mail for "spam/not-spam", or a blood sample for "has virus/does not have virus"). You can read more on this question on Cross ...


4

According to me, it is not correct to co-relate loss with accuracy. Loss is used to optimize the hypothesis such that we can get best weights whereas accuracy is used to identify how well model is doing in term of correctly predicting the values. Model internally takes the reference of predict_proba() and returns 1 if probability is > .5 otherwise 0. ...


4

Aditya already mentioned rightly so in the comments RMSE, MSE or MAE is preferred while evaluating a linear regression model. So to answer your questions I will provide with the pros and cons of using RMSE and MAE and further more put forward some points to why R-squared is not preferred. 1. MAE vs. RMSE - Which metric is better ? Ideally this depends on ...


4

The explanation is simple, assume you have the following values: True Positives (TP) = 1 True Negatives (TN) = 998 False Positives (FP) = 1 False Negatives (FN) = 1 Accuracy = (TP + TN) / (TP + TN + FP + FN) = 999/1001 = 0.998 Precision = TP / (TP + FP) = 1/2 = 0.5 Recall = TP / (TP + FN) = 1/2 = 0.5 In summary you have an unbalanced dataset i.e. the ...


3

The Fı-score is preferred to simple classification accuracy in order to counter the problem of imbalanced datasets; if the thing you are looking for occurs only rarely anyway then a naive classifier can always say no and appear to be working very well! A variant on Fı is Fß, where Fß = (1+ß²) × [ (P × R) ÷ ( (ß² × P) + R ) ] Vary ...


3

why the equality of both partial derivatives correspond to these hypothesis. I would rather understand when one partial derivative equals the other partial derivative multiplied by minus one. Your intuition of "trading off" by "subtracting" a value is correct when you speak in terms of $\Delta R$ and $\Delta P$ (as you yourself noticed in the edit), but ...


3

Related concepts, but not the same. ROC-receiver operating curve AUC area under the curve Thank this post for explanation : Abbreviations AUC = Area Under the Curve. AUROC = Area Under the Receiver Operating Characteristic curve. AUC is used most of the time to mean AUROC, which is a bad practice since as Marc Claesen pointed out AUC is ambiguous (...


3

One major difference is that the F1-score does not care at all about how many negative examples you classified or how many negative examples are in the dataset at all; instead, the balanced accuracy metric gives half its weight to how many positives you labeled correctly and how many negatives you labeled correctly. When working on problems with heavily ...


3

To select the most different rows, you would need to define first what you consider different. For ages and scores, subtracting values would work, for example: Row1 Age is 38 Score is 0.2 Row2 Age is 87 Score is 1.0 Difference by numeric feature: Age Diff is 49 Score Diff is 0.8 Those values could be normalized or weighted to account for different ...


3

What you're looking for is something along the line of an ROC curve: Using the threshold as a decision parameter, you can observe the trade-off between FPR (False Positive Rate: how many of the articles not belonging to the author will be correctly classified) and TPR (True Positive Rate, aka recall: how many of the articles which are really by the author ...


3

MAP@k is normally used in recommendation systems, but also in other kinds of systems. Quoting from here: If you have an algorithm that is returning a ranked ordering of items, each item is either hit or miss (like relevant vs. irrelevant search results) and items further down in the list are less likely to be used (like search results at the bottom of the ...


2

For the problem of overfitting, you could look train models that employ regularization. For instance this examples shows how to regularize an SVM. Another thing I noted is that you have used the tag "unbalanced-classes". If that is the case, accuracy isn't a very good metric. While AUC is good at this, I've personally had trouble with this metric in the ...


2

If you can use python I suggest PyCM module. A vast variety of performance evaluation parameters is in access by this module and also you can use its documentation if you want to implement it by yourself. There is an example of it: >>> from pycm import * >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2] # or y_actu = numpy.array([2, 0, 2, ...


2

The metric you are looking for is the standard error. From Wikipedia: the standard error equals the standard deviation divided by the square root of the sample size. So as the sample size increases the standard error decreases. You can also see this for an explanation with some code in R.


2

According to wikipedia, Recall is defined as- In information retrieval, recall is the fraction of the relevant documents that are successfully retrieved. In your second formula, recall = p/q, where q is total number of relevant documents. If you define a confusion matrix for binary classification, you will see that q is actually sum of TP and FN. And p is ...


2

One standard metric is the top-1 or top-5 test error rate. For instance, for top-5, your model predict 5 most likely labels, and if none of the 5 labels is the ground truth label, you mark this instance as an error. This is usually a standard metric when people working with the ImageNet data. See example here usage here. This metric does not explicitly count ...


2

TF Addons computes the F1 score and more generally the FBeta Score


2

Yes, it is the loss function you pass to model.compile. See here for loss metric usage examples. You can also define your own metric (see "Custom metrics" at the bottom of the page from the last link). You can read about the Model class documentation here. The first method is the compile method with argument descriptions. If you want to dig deeper into ...


2

The sklearn docs' formula says it is applying to row vectors $x$ and $y$. When you call np.dot on the matrices $X$ and $Y$ it takes the matrix product. EDIT (responding to question in comments): It's not straightforward, as the row-vs-row operations needed aren't quite the usual matrix operations. The source code for euclidean_distances does it this way (...


Only top voted, non community-wiki answers of a minimum length are eligible