How should I teach machine learning algorithm using data with big disproportion of classes? (SVM)

The most basic approach here is to use so called “class weighting scheme” – in classical SVM formulation there is a C parameter used to control the missclassification count. It can be changed into C1 and C2 parameters used for class 1 and 2 respectively. The most common choice of C1 and C2 for a … Read more

What is the difference between supervised learning and unsupervised learning? [closed]

Since you ask this very basic question, it looks like it’s worth specifying what Machine Learning itself is. Machine Learning is a class of algorithms which is data-driven, i.e. unlike “normal” algorithms it is the data that “tells” what the “good answer” is. Example: a hypothetical non-machine learning algorithm for face detection in images would … Read more

Scikit-learn: How to obtain True Positive, True Negative, False Positive and False Negative

For the multi-class case, everything you need can be found from the confusion matrix. For example, if your confusion matrix looks like this: Then what you’re looking for, per class, can be found like this: Using pandas/numpy, you can do this for all classes at once like so: FP = confusion_matrix.sum(axis=0) – np.diag(confusion_matrix) FN = … Read more