Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(3)  |  Derive(0)  |  Import(4)

src/d/r/dragnet-HEAD/dragnet/model_training.py   dragnet(Download)
def accuracy_auc(y, ypred, weights=None):
    """Compute the accuracy, AUC, precision, recall and f1"""
    from mozsci.evaluation import classification_error, auc_wmw_fast, precision_recall_f1
    prf1 = precision_recall_f1(y, ypred, weights=weights)
    return { 'accuracy':1.0 - classification_error(y, ypred, weights=weights),

src/m/o/mozsci-HEAD/test/test_map_train.py   mozsci(Download)
from mozsci.map_train import TrainModelCV, run_train_models
from mozsci.evaluation import classification_error, auc_wmw_fast
from mozsci.cross_validate import cv_kfold
from mozsci.models import LogisticRegression
    def agg_err(yactual, ypred):
        ret = {}
        ret['accuracy'] = classification_error(yactual, ypred)
        ret['auc'] = auc_wmw_fast(yactual, ypred)
        return ret
        # load model
        trained_model = LogisticRegression.load_model('/tmp/logistic.json')
        loaded_model_error = classification_error(self.y, trained_model.predict(self.X))
        # check the errors

src/m/o/mozsci-HEAD/test/test_variables.py   mozsci(Download)
import unittest
import numpy as np
from mozsci.evaluation import classification_error

src/m/o/mozsci-HEAD/test/test_logistic_regression.py   mozsci(Download)
    def test_fit(self):
        from mozsci.evaluation import classification_error
        N = int(1e5)
        x = np.random.rand(N, 2)