Exemplo n.º 1
0
def test_cross_validation_nlu(dataset, model_class):
    X_train, X_test, y_train, y_test, vocab = dataset
    param_grid = {'embed_dim': [10, 20]}
    mod = model_class(vocab, max_iter=2)
    best_mod = utils.fit_classifier_with_hyperparameter_search(
        X_train, y_train, mod, cv=2, param_grid=param_grid)
Exemplo n.º 2
0
def test_cross_validation_nlu(digits):
    X_train, X_test, y_train, y_test = digits
    param_grid = {'eta': [0.02, 0.03]}
    mod = BasicSGDClassifier(max_iter=2)
    best_mod = utils.fit_classifier_with_hyperparameter_search(
        X_train, y_train, mod, cv=2, param_grid=param_grid)
def test_cross_validation_nlu(digits, model_class):
    X_train, X_test, y_train, y_test = digits
    param_grid = {'hidden_dim': [10, 20]}
    mod = model_class(max_iter=2)
    best_mod = utils.fit_classifier_with_hyperparameter_search(
        X_train, y_train, mod, cv=2, param_grid=param_grid)
def test_cross_validation_nlu(X_sequence, model_class):
    X_train, X_test, y_train, y_test, vocab = X_sequence
    mod = model_class(vocab, max_iter=2)
    best_mod = utils.fit_classifier_with_hyperparameter_search(
        X_train, y_train, mod, cv=2, param_grid={'hidden_dim': [10, 20]})