# Path: jubakit/wrapper/classifier.py
# class LinearClassifier(BaseJubatusClassifier):
# 
#   def __init__(self, method='AROW', regularization_weight=1.0,
#                softmax=False, n_iter=1, shuffle=False, embedded=True, seed=None):
#     super(LinearClassifier, self).__init__(n_iter, shuffle, softmax, embedded, seed)
#     self.method = method
#     self.regularization_weight = regularization_weight
# 
#   def _launch_classifier(self):
#     if self.method in ('perceptron', 'PA'):
#       self.config_ = Config(method=self.method)
#     elif self.method in ('PA1', 'PA2', 'CW', 'AROW', 'NHERD'):
#       self.config_ = Config(method=self.method,
#                             parameter={'regularization_weight': self.regularization_weight})
#     else:
#       raise NotImplementedError('method {} is not implemented yet.'.format(self.method))
#     self.classifier_ = Classifier.run(config=self.config_, embedded=self.embedded)
# 
#   def get_params(self, deep=True):
#     return {
#       'method': self.method,
#       'regularization_weight': self.regularization_weight,
#       'n_iter': self.n_iter,
#       'shuffle': self.shuffle,
#       'softmax': self.softmax,
#       'embedded': self.embedded,
#       'seed': self.seed
#     }
# 
# class NearestNeighborsClassifier(BaseJubatusClassifier):
# 
#   def __init__(self, method='euclid_lsh', nearest_neighbor_num=5, local_sensitivity=1.0,
#                hash_num=128, n_iter=1, shuffle=False, softmax=False, embedded=True, seed=None):
#     super(NearestNeighborsClassifier, self).__init__(n_iter, shuffle, softmax, embedded, seed)
#     self.method = method
#     self.nearest_neighbor_num = nearest_neighbor_num
#     self.local_sensitivity = local_sensitivity
#     self.hash_num = hash_num
# 
#   def _launch_classifier(self):
#     if self.method in ('euclid_lsh', 'lsh', 'minhash'):
#       self.config_ = Config(method='NN', parameter={'method': self.method,
#                                                     'nearest_neighbor_num': self.nearest_neighbor_num,
#                                                     'local_sensitivity': self.local_sensitivity,
#                                                     'parameter': {'hash_num': self.hash_num}})
#     elif self.method in ('euclidean', 'cosine'):
#       self.config_ = Config(method=self.method,
#                             parameter={'nearest_neighbor_num': self.nearest_neighbor_num,
#                                        'local_sensitivity': self.local_sensitivity})
#     else:
#       raise NotImplementedError('method {} is not implemented yet.'.format(self.method))
#     self.classifier_ = Classifier.run(config=self.config_, embedded=self.embedded)
# 
#   def get_params(self, deep=True):
#     return {
#       'method': self.method,
#       'nearest_neighbor_num': self.nearest_neighbor_num,
#       'local_sensitivity': self.local_sensitivity,
#       'hash_num': self.hash_num,
#       'n_iter': self.n_iter,
#       'shuffle': self.shuffle,
#       'softmax': self.softmax,
#       'embedded': self.embedded,
#       'seed': self.seed
#     }


from unittest import TestCase
from jubakit.wrapper.classifier import LinearClassifier, NearestNeighborsClassifier
from . import requireEmbedded
  import numpy as np
# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function, unicode_literals


try:
except ImportError:
  pass



class LinearClassifierTest(TestCase):
  
  def test_simple(self):

# Path: jubakit/wrapper/classifier.py
# class LinearClassifier(BaseJubatusClassifier):
# 
#   def __init__(self, method='AROW', regularization_weight=1.0,
#                softmax=False, n_iter=1, shuffle=False, embedded=True, seed=None):
#     super(LinearClassifier, self).__init__(n_iter, shuffle, softmax, embedded, seed)
#     self.method = method
#     self.regularization_weight = regularization_weight
# 
#   def _launch_classifier(self):
#     if self.method in ('perceptron', 'PA'):
#       self.config_ = Config(method=self.method)
#     elif self.method in ('PA1', 'PA2', 'CW', 'AROW', 'NHERD'):
#       self.config_ = Config(method=self.method,
#                             parameter={'regularization_weight': self.regularization_weight})
#     else:
#       raise NotImplementedError('method {} is not implemented yet.'.format(self.method))
#     self.classifier_ = Classifier.run(config=self.config_, embedded=self.embedded)
# 
#   def get_params(self, deep=True):
#     return {
#       'method': self.method,
#       'regularization_weight': self.regularization_weight,
#       'n_iter': self.n_iter,
#       'shuffle': self.shuffle,
#       'softmax': self.softmax,
#       'embedded': self.embedded,
#       'seed': self.seed
#     }
# 
# class NearestNeighborsClassifier(BaseJubatusClassifier):
# 
#   def __init__(self, method='euclid_lsh', nearest_neighbor_num=5, local_sensitivity=1.0,
#                hash_num=128, n_iter=1, shuffle=False, softmax=False, embedded=True, seed=None):
#     super(NearestNeighborsClassifier, self).__init__(n_iter, shuffle, softmax, embedded, seed)
#     self.method = method
#     self.nearest_neighbor_num = nearest_neighbor_num
#     self.local_sensitivity = local_sensitivity
#     self.hash_num = hash_num
# 
#   def _launch_classifier(self):
#     if self.method in ('euclid_lsh', 'lsh', 'minhash'):
#       self.config_ = Config(method='NN', parameter={'method': self.method,
#                                                     'nearest_neighbor_num': self.nearest_neighbor_num,
#                                                     'local_sensitivity': self.local_sensitivity,
#                                                     'parameter': {'hash_num': self.hash_num}})
#     elif self.method in ('euclidean', 'cosine'):
#       self.config_ = Config(method=self.method,
#                             parameter={'nearest_neighbor_num': self.nearest_neighbor_num,
#                                        'local_sensitivity': self.local_sensitivity})
#     else:
#       raise NotImplementedError('method {} is not implemented yet.'.format(self.method))
#     self.classifier_ = Classifier.run(config=self.config_, embedded=self.embedded)
# 
#   def get_params(self, deep=True):
#     return {
#       'method': self.method,
#       'nearest_neighbor_num': self.nearest_neighbor_num,
#       'local_sensitivity': self.local_sensitivity,
#       'hash_num': self.hash_num,
#       'n_iter': self.n_iter,
#       'shuffle': self.shuffle,
#       'softmax': self.softmax,
#       'embedded': self.embedded,
#       'seed': self.seed
#     }


# Path: jubakit/test/wrapper/test_classifier.py
from unittest import TestCase
from jubakit.wrapper.classifier import LinearClassifier, NearestNeighborsClassifier
from . import requireEmbedded
  import numpy as np

# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function, unicode_literals


try:
except ImportError:
  pass



class LinearClassifierTest(TestCase):
  
  def test_simple(self):

    classifier = LinearClassifier()