# Path: recordlinkage/types.py
# def is_string_like(obj):
#     return isinstance(obj, str)


import logging
import warnings
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.validation import check_array, check_X_y
from sklearn.exceptions import NotFittedError
from sklearn.preprocessing import LabelBinarizer, binarize
    from scipy.special import logsumexp
    from scipy.misc import logsumexp  # noqa
from scipy.sparse import issparse
from recordlinkage.types import is_string_like
        X : {array-like, sparse matrix}, shape = [n_samples, n_features]
            Training vectors, where n_samples is the number of samples and
            n_features is the number of features.

        Returns
        -------
        self : object
            Returns self.
        """
        X = check_array(X, accept_sparse='csr')

        # count frequencies of elements in vector space
        # based on https://stackoverflow.com/a/33235665
        # faster than numpy.unique
        X_unique, X_freq = np.unique(X, axis=0, return_counts=True)
        X_freq = np.atleast_2d(X_freq)

        # Transform data with a label binarizer. Each column will get
        # transformed into a N columns (for each distinct value a column). For
        # a situation with 0 and 1 outcome values, the result given two
        # columns.
        X_unique_bin = self._fit_data(X_unique)
        _, n_features = X_unique_bin.shape

        # initialise parameters
        self.classes_ = np.array([0, 1])

        if is_string_like(self.init) and self.init == 'random':
            self.class_log_prior_, self.feature_log_prob_ = \
                self._init_parameters_random(X_unique_bin)

# Path: recordlinkage/types.py
# def is_string_like(obj):
#     return isinstance(obj, str)


# Path: recordlinkage/algorithms/nb_sklearn.py
import logging
import warnings
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.validation import check_array, check_X_y
from sklearn.exceptions import NotFittedError
from sklearn.preprocessing import LabelBinarizer, binarize
    from scipy.special import logsumexp
    from scipy.misc import logsumexp  # noqa
from scipy.sparse import issparse
from recordlinkage.types import is_string_like

        X : {array-like, sparse matrix}, shape = [n_samples, n_features]
            Training vectors, where n_samples is the number of samples and
            n_features is the number of features.

        Returns
        -------
        self : object
            Returns self.
        """
        X = check_array(X, accept_sparse='csr')

        # count frequencies of elements in vector space
        # based on https://stackoverflow.com/a/33235665
        # faster than numpy.unique
        X_unique, X_freq = np.unique(X, axis=0, return_counts=True)
        X_freq = np.atleast_2d(X_freq)

        # Transform data with a label binarizer. Each column will get
        # transformed into a N columns (for each distinct value a column). For
        # a situation with 0 and 1 outcome values, the result given two
        # columns.
        X_unique_bin = self._fit_data(X_unique)
        _, n_features = X_unique_bin.shape

        # initialise parameters
        self.classes_ = np.array([0, 1])

        if is_string_like(self.init) and self.init == 'random':
            self.class_log_prior_, self.feature_log_prob_ = \
                self._init_parameters_random(X_unique_bin)

        elif is_string_like(self.init) and self.init == 'jaro':