# Path: mimicus/config.py
# def _mkdir_p(path):
# def parse_config():
# 
# Path: mimicus/classifiers/sklearn_SVC.py
# class sklearn_SVC(SVC):
#     '''
#     A class representing the Support Vector Machine classifier as implemented 
#     by scikit-learn. 
#     '''
# 
#     def __init__(self, 
#                  C=10, # Found using grid search
#                  kernel='rbf', 
#                  degree=3, 
#                  gamma=0.01, # Found using grid search
#                  coef0=0.0, 
#                  shrinking=True, 
#                  probability=False, 
#                  tol=0.001, 
#                  cache_size=200, 
#                  class_weight=None, 
#                  verbose=False, 
#                  max_iter=-1):
#         '''
#         Constructor
#         '''
#         super(sklearn_SVC, self).__init__(C=C, kernel=kernel, degree=degree, gamma=gamma, 
#                        coef0=coef0, shrinking=shrinking, probability=probability, 
#                        tol=tol, cache_size=cache_size, class_weight=class_weight, 
#                        verbose=verbose, max_iter=max_iter)
#     
#     def save_model(self, modelfile):
#         '''
#         Saves a trained SVM model into the specified file. 
#         
#         modelfile - name of the file where the model should be saved.
#         '''
#         pickle.dump(self.__dict__, open(modelfile, 'wb+'))
#     
#     def load_model(self, modelfile):
#         '''
#         Loads a trained SVM model from the specified file. 
#         
#         modelfile - name of the file where the model is saved.
#         '''
# #         self.svc = pickle.load(open(modelfile, 'rb'))
#         self.__dict__.update(pickle.load(open(modelfile, 'rb')))
# 
# Path: mimicus/tools/datasets.py
# def csv2numpy(csv_in):
# def numpy2csv(csv_out, X, y, file_names=None):
# def standardize_csv(csv_in, csv_out, standardizer=None):
#     TOTAL_ROWS = 0
#     X = numpy.array(numpy.zeros((TOTAL_ROWS, FeatureDescriptor.get_feature_count())), dtype=numpy.float64, order='C')


import os
import unittest
import numpy
from mimicus import config
from mimicus.classifiers.sklearn_SVC import sklearn_SVC
from mimicus.tools import datasets
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Mimicus.  If not, see <http://www.gnu.org/licenses/>.
##############################################################################
sklearn_SVC_test.py

Created on May 23, 2013.
'''




class sklearn_SVC_Test(unittest.TestCase):
    '''
    Tests for the sklearn_SVC class.
    '''
    def setUp(self):
        self.svc = sklearn_SVC()
    
    def test_constructor(self):
        _ = sklearn_SVC()
        _ = sklearn_SVC()
        _ = sklearn_SVC()
    
    def test_fit(self):
        X, y, _ = datasets.csv2numpy(config.get('sklearn_SVC_test', 'traindata'))
        self.svc.fit(X, y)
    
    def test_predict(self):

# Path: mimicus/config.py
# def _mkdir_p(path):
# def parse_config():
# 
# Path: mimicus/classifiers/sklearn_SVC.py
# class sklearn_SVC(SVC):
#     '''
#     A class representing the Support Vector Machine classifier as implemented 
#     by scikit-learn. 
#     '''
# 
#     def __init__(self, 
#                  C=10, # Found using grid search
#                  kernel='rbf', 
#                  degree=3, 
#                  gamma=0.01, # Found using grid search
#                  coef0=0.0, 
#                  shrinking=True, 
#                  probability=False, 
#                  tol=0.001, 
#                  cache_size=200, 
#                  class_weight=None, 
#                  verbose=False, 
#                  max_iter=-1):
#         '''
#         Constructor
#         '''
#         super(sklearn_SVC, self).__init__(C=C, kernel=kernel, degree=degree, gamma=gamma, 
#                        coef0=coef0, shrinking=shrinking, probability=probability, 
#                        tol=tol, cache_size=cache_size, class_weight=class_weight, 
#                        verbose=verbose, max_iter=max_iter)
#     
#     def save_model(self, modelfile):
#         '''
#         Saves a trained SVM model into the specified file. 
#         
#         modelfile - name of the file where the model should be saved.
#         '''
#         pickle.dump(self.__dict__, open(modelfile, 'wb+'))
#     
#     def load_model(self, modelfile):
#         '''
#         Loads a trained SVM model from the specified file. 
#         
#         modelfile - name of the file where the model is saved.
#         '''
# #         self.svc = pickle.load(open(modelfile, 'rb'))
#         self.__dict__.update(pickle.load(open(modelfile, 'rb')))
# 
# Path: mimicus/tools/datasets.py
# def csv2numpy(csv_in):
# def numpy2csv(csv_out, X, y, file_names=None):
# def standardize_csv(csv_in, csv_out, standardizer=None):
#     TOTAL_ROWS = 0
#     X = numpy.array(numpy.zeros((TOTAL_ROWS, FeatureDescriptor.get_feature_count())), dtype=numpy.float64, order='C')


# Path: mimicus/test/sklearn_SVC_test.py
import os
import unittest
import numpy
from mimicus import config
from mimicus.classifiers.sklearn_SVC import sklearn_SVC
from mimicus.tools import datasets

GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Mimicus.  If not, see <http://www.gnu.org/licenses/>.
##############################################################################
sklearn_SVC_test.py

Created on May 23, 2013.
'''




class sklearn_SVC_Test(unittest.TestCase):
    '''
    Tests for the sklearn_SVC class.
    '''
    def setUp(self):
        self.svc = sklearn_SVC()
    
    def test_constructor(self):
        _ = sklearn_SVC()
        _ = sklearn_SVC()
        _ = sklearn_SVC()
    
    def test_fit(self):
        X, y, _ = datasets.csv2numpy(config.get('sklearn_SVC_test', 'traindata'))
        self.svc.fit(X, y)
    
    def test_predict(self):

        X, y, _ = datasets.csv2numpy(config.get('sklearn_SVC_test', 'traindata'))