sklearn.metrics.precision_recall_curve()

sklearn.metrics.precision_recall_curve(y_true, probas_pred, pos_label=None, sample_weight=None) [source] Compute precision-recall pairs for different probability thresholds Note: this implementation is restricted to the binary classification task. The precision is the ratio tp / (tp + fp) where tp is the number of true positives and fp the number of false positives. The precision is intuitively the ability of the classifier not to label as positive a sample that is negative. The recall is t

sklearn.metrics.pairwise_distances()

sklearn.metrics.pairwise_distances(X, Y=None, metric='euclidean', n_jobs=1, **kwds) [source] Compute the distance matrix from a vector array X and optional Y. This method takes either a vector array or a distance matrix, and returns a distance matrix. If the input is a vector array, the distances are computed. If the input is a distances matrix, it is returned instead. This method provides a safe way to take a distance matrix as input, while preserving compatibility with many other algorith

sklearn.metrics.pairwise_distances_argmin()

sklearn.metrics.pairwise_distances_argmin(X, Y, axis=1, metric='euclidean', batch_size=500, metric_kwargs=None) [source] Compute minimum distances between one point and a set of points. This function computes for each row in X, the index of the row of Y which is closest (according to the specified distance). This is mostly equivalent to calling: pairwise_distances(X, Y=Y, metric=metric).argmin(axis=axis) but uses much less memory, and is faster for large arrays. This function works with de

sklearn.metrics.pairwise_distances_argmin_min()

sklearn.metrics.pairwise_distances_argmin_min(X, Y, axis=1, metric='euclidean', batch_size=500, metric_kwargs=None) [source] Compute minimum distances between one point and a set of points. This function computes for each row in X, the index of the row of Y which is closest (according to the specified distance). The minimal distances are also returned. This is mostly equivalent to calling: (pairwise_distances(X, Y=Y, metric=metric).argmin(axis=axis), pairwise_distances(X, Y=Y, metric=metri

sklearn.metrics.pairwise.sigmoid_kernel()

sklearn.metrics.pairwise.sigmoid_kernel(X, Y=None, gamma=None, coef0=1) [source] Compute the sigmoid kernel between X and Y: K(X, Y) = tanh(gamma <X, Y> + coef0) Read more in the User Guide. Parameters: X : ndarray of shape (n_samples_1, n_features) Y : ndarray of shape (n_samples_2, n_features) gamma : float, default None If None, defaults to 1.0 / n_samples_1 coef0 : int, default 1 Returns: Gram matrix : array of shape (n_samples_1, n_samples_2)

sklearn.metrics.pairwise.rbf_kernel()

sklearn.metrics.pairwise.rbf_kernel(X, Y=None, gamma=None) [source] Compute the rbf (gaussian) kernel between X and Y: K(x, y) = exp(-gamma ||x-y||^2) for each pair of rows x in X and y in Y. Read more in the User Guide. Parameters: X : array of shape (n_samples_X, n_features) Y : array of shape (n_samples_Y, n_features) gamma : float, default None If None, defaults to 1.0 / n_samples_X Returns: kernel_matrix : array of shape (n_samples_X, n_samples_Y)

sklearn.metrics.pairwise.pairwise_kernels()

sklearn.metrics.pairwise.pairwise_kernels(X, Y=None, metric='linear', filter_params=False, n_jobs=1, **kwds) [source] Compute the kernel between arrays X and optional array Y. This method takes either a vector array or a kernel matrix, and returns a kernel matrix. If the input is a vector array, the kernels are computed. If the input is a kernel matrix, it is returned instead. This method provides a safe way to take a kernel matrix as input, while preserving compatibility with many other al

sklearn.metrics.pairwise.pairwise_distances()

sklearn.metrics.pairwise.pairwise_distances(X, Y=None, metric='euclidean', n_jobs=1, **kwds) [source] Compute the distance matrix from a vector array X and optional Y. This method takes either a vector array or a distance matrix, and returns a distance matrix. If the input is a vector array, the distances are computed. If the input is a distances matrix, it is returned instead. This method provides a safe way to take a distance matrix as input, while preserving compatibility with many other

sklearn.metrics.pairwise.polynomial_kernel()

sklearn.metrics.pairwise.polynomial_kernel(X, Y=None, degree=3, gamma=None, coef0=1) [source] Compute the polynomial kernel between X and Y: K(X, Y) = (gamma <X, Y> + coef0)^degree Read more in the User Guide. Parameters: X : ndarray of shape (n_samples_1, n_features) Y : ndarray of shape (n_samples_2, n_features) degree : int, default 3 gamma : float, default None if None, defaults to 1.0 / n_samples_1 coef0 : int, default 1 Returns: Gram matrix : array of shape (n_samples_1, n

sklearn.metrics.pairwise.paired_manhattan_distances()

sklearn.metrics.pairwise.paired_manhattan_distances(X, Y) [source] Compute the L1 distances between the vectors in X and Y. Read more in the User Guide. Parameters: X : array-like, shape (n_samples, n_features) Y : array-like, shape (n_samples, n_features) Returns: distances : ndarray (n_samples, )