Esempio n. 1
0
def test_create_trained_model_svm():
    """Test create trained model for support vector machine"""
    classifier = ReviewClassifier('svm')
    train_data, train_target = classifier.build_dataset('test-reviews.csv')
    model = classifier.create_trained_model(train_data=train_data,
                                            train_target=train_target)
    assert model
Esempio n. 2
0
def test_create_trained_model_rf():
    """Test create trained model for random forest"""
    classifier = ReviewClassifier('rf')
    train_data, train_target = classifier.build_dataset('test-reviews.csv')
    model = classifier.create_trained_model(train_data=train_data,
                                            train_target=train_target)
    assert model
Esempio n. 3
0
def test_create_trained_model_nn():
    """Test create trained model for neural network"""
    classifier = ReviewClassifier('nn')
    train_data, train_target = classifier.build_dataset('test-reviews.csv')
    model = classifier.create_trained_model(train_data=train_data,
                                            train_target=train_target)
    assert model
Esempio n. 4
0
def test_create_trained_model_nb():
    """Test create train model for naive bayes"""
    classifier = ReviewClassifier('nb')
    dataset = classifier.create_dataset('test-reviews.csv')
    model = classifier.create_trained_model(dataset=dataset)
    assert model