sklearn.metrics.pairwise.additive_chi2_kernel()

sklearn.metrics.pairwise.additive_chi2_kernel(X, Y=None) [source] Computes the additive chi-squared kernel between observations in X and Y The chi-squared kernel is computed between each pair of rows in X and Y. X and Y have to be non-negative. This kernel is most commonly applied to histograms. The chi-squared kernel is given by: k(x, y) = -Sum [(x - y)^2 / (x + y)] It can be interpreted as a weighted difference per entry. Read more in the User Guide. Parameters: X : array-like of shape

sklearn.metrics.pairwise.cosine_distances()

sklearn.metrics.pairwise.cosine_distances(X, Y=None) [source] Compute cosine distance between samples in X and Y. Cosine distance is defined as 1.0 minus the cosine similarity. Read more in the User Guide. Parameters: X : array_like, sparse matrix with shape (n_samples_X, n_features). Y : array_like, sparse matrix (optional) with shape (n_samples_Y, n_features). Returns: distance matrix : array An array with shape (n_samples_X, n_samples_Y). See also sklearn.metrics.pairwise.cosi

sklearn.metrics.pairwise.chi2_kernel()

sklearn.metrics.pairwise.chi2_kernel(X, Y=None, gamma=1.0) [source] Computes the exponential chi-squared kernel X and Y. The chi-squared kernel is computed between each pair of rows in X and Y. X and Y have to be non-negative. This kernel is most commonly applied to histograms. The chi-squared kernel is given by: k(x, y) = exp(-gamma Sum [(x - y)^2 / (x + y)]) It can be interpreted as a weighted difference per entry. Read more in the User Guide. Parameters: X : array-like of shape (n_samp

sklearn.metrics.normalized_mutual_info_score()

sklearn.metrics.normalized_mutual_info_score(labels_true, labels_pred) [source] Normalized Mutual Information between two clusterings. Normalized Mutual Information (NMI) is an normalization of the Mutual Information (MI) score to scale the results between 0 (no mutual information) and 1 (perfect correlation). In this function, mutual information is normalized by sqrt(H(labels_true) * H(labels_pred)) This measure is not adjusted for chance. Therefore adjusted_mustual_info_score might be pre

sklearn.metrics.mutual_info_score()

sklearn.metrics.mutual_info_score(labels_true, labels_pred, contingency=None) [source] Mutual Information between two clusterings. The Mutual Information is a measure of the similarity between two labels of the same data. Where is the probability of a random sample occurring in cluster and is the probability of a random sample occurring in cluster , the Mutual Information between clusterings and is given as: This is equal to the Kullback-Leibler divergence of the joint distribution

sklearn.metrics.mean_absolute_error()

sklearn.metrics.mean_absolute_error(y_true, y_pred, sample_weight=None, multioutput='uniform_average') [source] Mean absolute error regression loss Read more in the User Guide. Parameters: y_true : array-like of shape = (n_samples) or (n_samples, n_outputs) Ground truth (correct) target values. y_pred : array-like of shape = (n_samples) or (n_samples, n_outputs) Estimated target values. sample_weight : array-like of shape = (n_samples), optional Sample weights. multioutput : string i

sklearn.metrics.median_absolute_error()

sklearn.metrics.median_absolute_error(y_true, y_pred) [source] Median absolute error regression loss Read more in the User Guide. Parameters: y_true : array-like of shape = (n_samples) Ground truth (correct) target values. y_pred : array-like of shape = (n_samples) Estimated target values. Returns: loss : float A positive floating point value (the best value is 0.0). Examples >>> from sklearn.metrics import median_absolute_error >>> y_true = [3, -0.5, 2, 7] >&

sklearn.metrics.log_loss()

sklearn.metrics.log_loss(y_true, y_pred, eps=1e-15, normalize=True, sample_weight=None, labels=None) [source] Log loss, aka logistic loss or cross-entropy loss. This is the loss function used in (multinomial) logistic regression and extensions of it such as neural networks, defined as the negative log-likelihood of the true labels given a probabilistic classifier?s predictions. The log loss is only defined for two or more labels. For a single sample with true label yt in {0,1} and estimated

sklearn.metrics.matthews_corrcoef()

sklearn.metrics.matthews_corrcoef(y_true, y_pred, sample_weight=None) [source] Compute the Matthews correlation coefficient (MCC) for binary classes The Matthews correlation coefficient is used in machine learning as a measure of the quality of binary (two-class) classifications. It takes into account true and false positives and negatives and is generally regarded as a balanced measure which can be used even if the classes are of very different sizes. The MCC is in essence a correlation co

sklearn.metrics.make_scorer()

sklearn.metrics.make_scorer(score_func, greater_is_better=True, needs_proba=False, needs_threshold=False, **kwargs) [source] Make a scorer from a performance metric or loss function. This factory function wraps scoring functions for use in GridSearchCV and cross_val_score. It takes a score function, such as accuracy_score, mean_squared_error, adjusted_rand_index or average_precision and returns a callable that scores an estimator?s output. Read more in the User Guide. Parameters: score_fun