This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.metrics.pairwise import rbf_kernel | |
class KMeansTransformer(BaseEstimator, TransformerMixin): | |
def __init__(self, centroids): | |
self.centroids = centroids | |
def fit(self, X, y=None): | |
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cimport numpy as np | |
def csc_columnwise_max(np.ndarray[np.float64_t, ndim=1] data, | |
np.ndarray[int, ndim=1] indices, | |
np.ndarray[int, ndim=1] indptr, | |
np.ndarray[np.float64_t, ndim=1] out): | |
cdef double mx | |
cdef int n_features = indptr.shape[0] - 1 | |
cdef int i, j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick and dirty Brat-to-CSV conversion. | |
from __future__ import print_function | |
import csv | |
import io | |
import re | |
import sys | |
# copy server/src/{gtbtokenize,tokenise}.py from Brat | |
from tokenise import gtb_token_boundary_gen |
NewerOlder