Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

src/g/a/GA-DAT-08-HEAD/Homework_11/student/kmeans_api.py   GA-DAT-08(Download)
from kmeans_exercise import k_means
from kmeans_exercise import _compute_labels_and_score
 
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import euclidean_distances
        self._check_fitted()
        X = self._check_test_data(X)
        return _compute_labels_and_score(X, self.cluster_centers_)[0]
 
    def score(self, X):
        self._check_fitted()
        X = self._check_test_data(X)
        return -_compute_labels_and_score(X, self.cluster_centers_)[1]

src/g/a/GADS7-HEAD/src/lesson12/kmeans/test_k_means.py   GADS7(Download)
from sklearn.metrics.cluster import v_measure_score
from kmeans_exercise import KMeans, k_means, distance_function
from kmeans_exercise import _compute_labels_and_score
from sklearn.datasets.samples_generator import make_blobs
from sklearn.externals.six.moves import cStringIO as StringIO
 
    # perform label assignment using the dense array input
    labels_array, score_array = _compute_labels_and_score(X, noisy_centers)
    assert_array_almost_equal(score_array, score_gold)
    assert_array_equal(labels_array, labels_gold)

src/g/a/gadsdc-HEAD/18-clustering/test_kmeans_exercise.py   gadsdc(Download)
from sklearn.metrics.cluster import v_measure_score
from kmeans_exercise import KMeans, k_means, distance_function
from kmeans_exercise import _compute_labels_and_score
from sklearn.datasets.samples_generator import make_blobs
from sklearn.externals.six.moves import cStringIO as StringIO
 
    # perform label assignment using the dense array input
    labels_array, score_array = _compute_labels_and_score(X, noisy_centers)
    assert_array_almost_equal(score_array, score_gold)
    assert_array_equal(labels_array, labels_gold)

src/g/a/GA-DAT-08-HEAD/Homework_11/student/test_k_means.py   GA-DAT-08(Download)
 
from sklearn.metrics.cluster import v_measure_score
from kmeans_exercise import k_means, distance_function, _compute_labels_and_score
from kmeans_api import KMeans
from sklearn.datasets.samples_generator import make_blobs
 
    # perform label assignment using the dense array input
    labels_array, score_array = _compute_labels_and_score(X, noisy_centers)
    assert_array_almost_equal(score_array, score_gold)
    assert_array_equal(labels_array, labels_gold)