Esempio n. 1
0
def knn_classifier():
    # Creating  model:
    model = KNeighborsClassifier()

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(model=model, model_author='Jan',
                                     model_description="K-NN classifier, sklearn default params")
    return th_model
def support_vector_classifier():
    svc = SVC(probability=True)

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(model=svc,
                                     model_author='Hamed',
                                     model_description="SVC")

    return th_model
def linear_SVC():
    lin_svc = SVC(kernel='linear', probability=True)

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(model=lin_svc,
                                     model_author='Hamed',
                                     model_description="Linear SVC")

    return th_model
Esempio n. 4
0
def gmm_classification():
    # Creating  model:
    model = GaussianMixture(n_components=2)

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(
        model=model,
        model_author='Jan',
        model_description="Gaussian Mixture Classifier, n_components=2")
    return th_model
Esempio n. 5
0
def rocklins_logistic_classifier():
    rocklins_logistic_model = LogisticRegression(penalty='l1',
                                                 C=0.1,
                                                 n_jobs=-1,
                                                 solver='liblinear')
    th_model = SklearnClassification(
        model=rocklins_logistic_model,
        model_author='Hamed',
        model_description="Rocklin Logistic: penalty='l1' and C=0.1")
    return th_model
Esempio n. 6
0
def svm_classification():
    # Creating  model:
    model = SVC(probability=True)

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(
        model=model,
        model_author='Jan',
        model_description="Support Vector Classifier, sklearn default params")
    return th_model
def decision_tree_classification():
    # Creating  model:
    model = DecisionTreeClassifier()

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(
        model=model,
        model_author='Jan',
        model_description="Decision Tree Classifier, sklearn default params")
    return th_model
Esempio n. 8
0
def naive_bayes_classification():
    # Creating  model:
    nbc = GaussianNB()

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(
        model=nbc,
        model_author='Jan',
        model_description="Naive Bayes Classifier, sklearn default params")
    return th_model
Esempio n. 9
0
def baseline_prior():
    strategy = 'prior'
    baseline_model = DummyClassifier(strategy=strategy, random_state=5)

    th_model = SklearnClassification(
        model=baseline_model,
        model_author="Hamed",
        model_description="Baseline DummyClassifier with strategy='{}'".format(
            strategy))
    return th_model
def rfc_terra(n_estimators=500, n_jobs=-1):
    # Creating an sklearn random forest classification model:
    rfc = RandomForestClassifier(n_estimators=n_estimators, n_jobs=n_jobs)

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(
        model=rfc,
        model_author='Hamed',
        model_description="Random Forest: n_estimators={0}, n_jobs={1}".format(
            n_estimators, n_jobs))
    return th_model
Esempio n. 11
0
def gbc_classification():
    # Creating  model:
    model = GradientBoostingClassifier()

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(
        model=model,
        model_author='Jan',
        model_description="Gradient Boosting Classifier, sklearn default params"
    )
    return th_model
Esempio n. 12
0
def support_vector_radial_basis_classifier():
    # RBF SVM hyperparameters optimized by Zhi Li for perovskite data classification
    support_vector_model = SVC(C=100000,
                               gamma=0.1,
                               cache_size=5000,
                               max_iter=-1,
                               kernel='rbf',
                               decision_function_shape='ovr',
                               probability=True)
    th_model = SklearnClassification(
        model=support_vector_model,
        model_author="Zhi",
        model_description="svm with radial basis function")
    return th_model
Esempio n. 13
0
def gradient_boosted_tree():
    # Gradient Boosted tree with hyperparams configured on stateset 0021
    xgb = GradientBoostingClassifier(
        learning_rate= 1,
        loss='deviance',
        max_depth= 10,
        max_features='auto',
        n_estimators=100,
    )
    
    th_model = SklearnClassification(model=xgb,
                                     model_author="Scott Novotney",
                                     model_description="gradient boosted tree with n_trees=10,max_depth=5")
    return th_model
Esempio n. 14
0
def gaussian_naive_bayes_classification():
    '''

    :param n_estimators:
    :param max_features:
    :param criterion:
    :param min_samples_leaf:
    :param n_jobs:
    :param class_weight:
    :return:
    '''
    # Creating an sklearn random forest classification model:
    gnb = GaussianNB()

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(model=gnb,
                                     model_author='Mohammed',
                                     model_description="Gaussan Naive Bayes")
    return th_model
def random_forest_classification(n_estimators=361,
                                 max_features='auto',
                                 criterion='entropy',
                                 min_samples_leaf=13,
                                 n_jobs=-1,
                                 class_weight="balanced"):
    # Creating an sklearn random forest classification model:
    rfc = RandomForestClassifier(n_estimators=n_estimators,
                                 max_features=max_features,
                                 criterion=criterion,
                                 min_samples_leaf=min_samples_leaf,
                                 n_jobs=n_jobs,
                                 class_weight=class_weight)

    # Creating an instance of the SklearnClassification TestHarnessModel subclass
    th_model = SklearnClassification(
        model=rfc,
        model_author='Hamed',
        model_description=
        "Random Forest: n_estimators={0}, max_features={1}, criterion={2}, min_samples_leaf={3}, n_jobs={4}"
        .format(n_estimators, max_features, criterion, min_samples_leaf,
                n_jobs))
    return th_model
Esempio n. 16
0
def rxn_only_xgb():
    model = RxnOnlyXGB()
    return SklearnClassification(model=model,
                                     model_author="Scott Novotney",
                                     model_description="RBF xgb using only 3 rxn features",
    )
Esempio n. 17
0
def rxn_only_svm():
    model = RxnOnlySVM()
    return SklearnClassification(model=model,
                                     model_author="Scott Novotney",
                                     model_description="RBF svm w/only rxn features",
    )
Esempio n. 18
0
def rxn_intuition_svm():
    model = RxnRatioOnlySVM()
    return SklearnClassification(model=model,
                                     model_author="Scott Novotney, Josh Schrier",
                                     model_description="RBF xgb w/org/inorg ratio, inorganic and acid amounts ",
    )