# Path: mimicus/config.py
# def _mkdir_p(path):
# def parse_config():
# 
# Path: mimicus/classifiers/RandomForest.py
# class sklearn_RF(RandomForestClassifier):
#     def __init__(self,
#                  n_estimators=1000, # Used by PDFrate
#                  criterion="gini",
#                  max_depth=None,
#                  min_samples_split=2,
#                  min_samples_leaf=1,
#                  max_features=43, # Used by PDFrate
#                  bootstrap=True,
#                  oob_score=False,
#                  n_jobs=-1, # Run in parallel
#                  random_state=None,
#                  verbose=0):
#     def decision_function(self, X):
#     def save_model(self, model_file):
#     def load_model(self, model_file):
# 
# 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 import RandomForest
from mimicus.tools import datasets
class RandomForest_Test(unittest.TestCase):
    '''
    Tests for the RandomForest class.
    '''
    
    def setUp(self):
        self.rf = RandomForest()
    
    def test_constructor(self):
        _ = RandomForest()
    
    def test_decision_function(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)
        newX, _, _ = datasets.csv2numpy(config.get('RandomForest_test', 'noveldata'))
        self.assertTrue(len(self.rf.decision_function(newX)) == 20)
    
    def test_fit(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)
    
    def test_predict(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)
        newX, _, _ = datasets.csv2numpy(config.get('RandomForest_test', 'noveldata'))
        self.assertTrue(len(self.rf.predict(newX)) == 20)
    
    def test_save_model(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)

# Path: mimicus/config.py
# def _mkdir_p(path):
# def parse_config():
# 
# Path: mimicus/classifiers/RandomForest.py
# class sklearn_RF(RandomForestClassifier):
#     def __init__(self,
#                  n_estimators=1000, # Used by PDFrate
#                  criterion="gini",
#                  max_depth=None,
#                  min_samples_split=2,
#                  min_samples_leaf=1,
#                  max_features=43, # Used by PDFrate
#                  bootstrap=True,
#                  oob_score=False,
#                  n_jobs=-1, # Run in parallel
#                  random_state=None,
#                  verbose=0):
#     def decision_function(self, X):
#     def save_model(self, model_file):
#     def load_model(self, model_file):
# 
# 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/RandomForest_test.py
import os
import unittest
import numpy
from mimicus import config
from mimicus.classifiers import RandomForest
from mimicus.tools import datasets

class RandomForest_Test(unittest.TestCase):
    '''
    Tests for the RandomForest class.
    '''
    
    def setUp(self):
        self.rf = RandomForest()
    
    def test_constructor(self):
        _ = RandomForest()
    
    def test_decision_function(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)
        newX, _, _ = datasets.csv2numpy(config.get('RandomForest_test', 'noveldata'))
        self.assertTrue(len(self.rf.decision_function(newX)) == 20)
    
    def test_fit(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)
    
    def test_predict(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)
        newX, _, _ = datasets.csv2numpy(config.get('RandomForest_test', 'noveldata'))
        self.assertTrue(len(self.rf.predict(newX)) == 20)
    
    def test_save_model(self):
        X, y, _ = datasets.csv2numpy(config.get('RandomForest_test', 'traindata'))
        self.rf.fit(X, y)

        newX, _, _ = datasets.csv2numpy(config.get('RandomForest_test', 'noveldata'))