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

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)

src/d/r/dragnet-HEAD/dragnet/model_training.py   dragnet(Download)
import codecs
 
from mozsci.cross_validate import cv_kfold
 
from .blocks import Blockifier
 
        # do kfold cross validation
        folds = cv_kfold(len(labels), self.kfolds, seed=2)
 
        if self.weighted:

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
 
        self.y = (5 * self.X.reshape(100, ) - 2 + np.random.rand(100) > 0).astype(np.int)
 
        self.folds = cv_kfold(100, 4, seed=2)
 
class TestTrainModelCV(DataTest):

src/m/o/mozsci-HEAD/test/test_cross_validate.py   mozsci(Download)
    def test_cv_kfold(self):
        folds = cross_validate.cv_kfold(20, 4, seed=2)
 
        sum_training = np.sum([len(ele[0]) for ele in folds])
        self.assertTrue(sum_training == 3 * 20)