repo_name stringlengths 6 103 | path stringlengths 5 191 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 986 970k | license stringclasses 15
values |
|---|---|---|---|---|---|
vdumoulin/fuel | fuel/transformers/sequences.py | 7 | 4963 | from fuel.transformers import Transformer
class Window(Transformer):
"""Return pairs of source and target windows from a stream.
This data stream wrapper takes as an input a data stream outputting
sequences of potentially varying lengths (e.g. sentences, audio tracks,
etc.). It then returns two slidi... | mit |
yafeunteun/wikipedia-spam-classifier | revscoring/revscoring/utilities/tune.py | 1 | 9729 | """
Tunes a set of models against a training set to identify the best
model/configuration.
Usage:
tune <params-config> <features> <label>
[--observations=<path>]
[--scoring=<type>]
[--test-prop=<prop>]
[--folds=<num>]
[--report=<path>]
[--label-type=<type>]
... | mit |
lakshayg/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/categorical.py | 151 | 4269 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
musically-ut/statsmodels | examples/python/tsa_dates.py | 29 | 1169 |
## Dates in timeseries models
from __future__ import print_function
import statsmodels.api as sm
import pandas as pd
# ## Getting started
data = sm.datasets.sunspots.load()
# Right now an annual date series must be datetimes at the end of the year.
dates = sm.tsa.datetools.dates_from_range('1700', length=len(da... | bsd-3-clause |
jpzk/evopy | evopy/examples/experiments/cv_ppv_dsesscv/plot_precisions.py | 1 | 4256 | '''
This file is part of evopy.
Copyright 2012 - 2013, Jendrik Poloczek
evopy is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
evopy is di... | gpl-3.0 |
lakshayg/tensorflow | tensorflow/python/keras/_impl/keras/datasets/fashion_mnist.py | 12 | 2055 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
musically-ut/statsmodels | statsmodels/datasets/statecrime/data.py | 25 | 3128 | #! /usr/bin/env python
"""Statewide Crime Data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Public domain."""
TITLE = """Statewide Crime Data 2009"""
SOURCE = """
All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below.
"""
DESCRSHORT = """State ... | bsd-3-clause |
PAIR-code/recommendation-rudders | hyperbolic-rs/preprocess.py | 1 | 11964 | # Copyright 2017 The Rudders Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
openplans/shareabouts-api | src/sa_api_v2/tasks.py | 1 | 10690 |
import requests
import ujson as json
from celery import shared_task
from celery.result import AsyncResult
from django.db import transaction
from django.test.client import RequestFactory
from django.utils.timezone import now
from itertools import chain
#from social.apps.django_app.default.models import UserSocialAuth
... | gpl-3.0 |
kastnerkyle/pylearn2 | pylearn2/datasets/stl10.py | 1 | 5304 | """
.. todo::
WRITEME
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
from pylearn2.datasets import dense_design_matri... | bsd-3-clause |
nicproulx/mne-python | examples/connectivity/plot_mixed_source_space_connectity.py | 3 | 6976 | """
===============================================================================
Compute mixed source space connectivity and visualize it using a circular graph
===============================================================================
This example computes the all-to-all connectivity between 75 regions in
a m... | bsd-3-clause |
tabhitmy/MLTF | WORKFLOW/code/python_code/sklearnTrainer.py | 1 | 12746 | # sklearnTrainer
import numpy
import numpy as np
import copy
from toolkitJ import cell2dmatlab_jsp
import matplotlib as mpl
from matplotlib.font_manager import FontProperties
zhfont = FontProperties(fname="/usr/share/fonts/cjkuni-ukai/ukai.ttc") # 图片显示中文字体
mpl.use('Agg')
import pprint
from sklearn.ex... | mit |
aranega/pyecore | experimental/m2m/transfo_example.py | 2 | 2226 | import motra
# generated using
# https://github.com/kolovos/datasets/blob/master/github-mde/ghmde.ecore
# as input metamodel
import ghmde
from pyecore.ecore import *
# Define a graph like metamodel in a static way
eClass = EPackage('graph', nsURI='http://graph/1.0', nsPrefix='graph')
@EMetaclass
class Node(object):... | bsd-3-clause |
vdumoulin/fuel | fuel/converters/cifar100.py | 18 | 3576 | import os
import tarfile
import h5py
import numpy
import six
from six.moves import cPickle
from fuel.converters.base import fill_hdf5_file, check_exists
DISTRIBUTION_FILE = 'cifar-100-python.tar.gz'
@check_exists(required_files=[DISTRIBUTION_FILE])
def convert_cifar100(directory, output_directory,
... | mit |
agnusfeec/tattCBIR | lib_sistema.py | 1 | 25313 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 14 13:36:05 2016
@author: agnus
"""
#%%
def monta_lista_imagens(path = '.', ext='.png'):
import os
imagens = {}
for dirname, dirnames, filenames in os.walk(path):
# print path to all filenames with extension py.
for filename in filenames:
... | gpl-3.0 |
aalmah/pylearn2 | pylearn2/devtools/tests/test_format.py | 24 | 25785 | """
Unit tests for format checking
"""
from __future__ import print_function
from nose.plugins.skip import SkipTest
import os
import pylearn2
from pylearn2.devtools.tests.docscrape import docstring_errors
from pylearn2.devtools.list_files import list_files
from pylearn2.devtools.tests.pep8.pep8 import StyleGuide
w... | bsd-3-clause |
jfsantos/ift6266h14 | old/test_timit_iy.py | 1 | 2996 | from timit_full import TimitFullCorpusReader
import itertools
import numpy as np
from pylearn2.datasets import DenseDesignMatrix
from pylearn2.models.mlp import *
from pylearn2.costs.mlp.dropout import Dropout
from pylearn2.termination_criteria import EpochCounter
from pylearn2.training_algorithms.sgd import SGD
from p... | mit |
neuroneuro15/natnetclient | build/lib/natnetclient/utils.py | 1 | 1318 | __author__ = 'ratcave'
import numpy as np
from sklearn.decomposition import PCA
def rotate_to_var(markers):
"""Returns degrees to rotate about y axis so greatest marker variance points in +X direction"""
# Mean-Center
markers -= np.mean(markers, axis=0)
# Vector in direction of greatest variance
... | gpl-2.0 |
joshbohde/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 1 | 16225 | import numpy as np
from numpy.testing import assert_array_equal, assert_approx_equal
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from sklearn import linear_model, datasets, metrics
from sklearn import preprocessing
import unittest
from nose.tools import raises
from nose.tools import asser... | bsd-3-clause |
ephes/scikit-learn | sklearn/semi_supervised/label_propagation.py | 127 | 15312 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
google-research/scenic | scenic/projects/robust_segvit/datasets/cityscapes_variants.py | 1 | 11019 | """Data generators for the Cityscapes dataset variants.
Supported datasets, set by dataset_configs.dataset_name in the config file:
cityscapes_corrupted: https://arxiv.org/pdf/1907.07484.pdf
fishyscapes: https://link.springer.com/article/10.1007/s11263-021-01511-6
Implementation details:
cityscapes_c: https://githu... | apache-2.0 |
starimpact/fast-rcnn | tools/train_net.py | 23 | 3134 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Fast R-CNN network on a region of int... | mit |
YzPaul3/h2o-3 | py2/testdir_single_jvm/test_GBM_basic.py | 20 | 4883 | import unittest, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i
from h2o_test import dump_json, verboseprint, OutputObj
from tabulate import tabulate
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmetho... | apache-2.0 |
ephes/scikit-learn | sklearn/ensemble/partial_dependence.py | 249 | 15097 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | bsd-3-clause |
gibiansky/tensorflow | tensorflow/contrib/learn/python/learn/datasets/load_csv_test.py | 31 | 1334 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
RafaelCosman/pybrain | pybrain/rl/learners/valuebased/nfq.py | 31 | 1994 | from scipy import r_
from pybrain.rl.learners.valuebased.valuebased import ValueBasedLearner
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers.rprop import RPropMinusTrainer
from pybrain.supervised.trainers import BackpropTrainer
from pybrain.utilities import one_to_n
class NFQ(ValueBas... | bsd-3-clause |
Cito/sqlalchemy | lib/sqlalchemy/orm/query.py | 2 | 131160 | # orm/query.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The Query class and support.
Defines the :class:`.Query` class, the central
construct... | mit |
irit-melodi/attelo | attelo/metrics/classification_structured.py | 3 | 5266 | """Classification metrics for structured outputs.
"""
from collections import Counter
from itertools import chain, izip
import numpy as np
def _unique_labels(y):
"""Set of unique labels in y"""
return set(y_ij[1] for y_ij in
chain.from_iterable(y_i for y_i in y))
def unique_labels(*ys):
... | gpl-3.0 |
roxyboy/scikit-learn | sklearn/tree/tests/test_export.py | 130 | 9950 | """
Testing for export functions of decision trees (sklearn.tree.export).
"""
from re import finditer
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import GradientBoostingClassifier
from sklearn... | bsd-3-clause |
roxyboy/scikit-learn | setup.py | 142 | 7364 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distutils.command.clean ... | bsd-3-clause |
cpausmit/IntelROCCS | Monitor/dynamoToPickle.py | 2 | 2945 | #!/usr/bin/env python
import os, sys
import re, glob, time, json, pprint
import cPickle as pickle
import multiprocessing as mp
from Dataset import Dataset,Request
import dynamoDB
import requestParse
import config
#===================================================================================================
# ... | mit |
cpausmit/IntelROCCS | Detox/python/phedexApi.py | 3 | 17588 | #!/usr/bin/python
#---------------------------------------------------------------------------------------------------
#
# This script provide an API to PhEDEX communications one can delete or subscribe datasets using
# methods defined in this class.
#
# This script uses auxilary tool for logging purposes in case the r... | mit |
ephes/scikit-learn | sklearn/learning_curve.py | 109 | 13467 | """Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import check_cv
from .externals.joblib import Parallel, delayed
fro... | bsd-3-clause |
vijayaganesh/Kanjoos-HackGT | django-webapp/kanjoos/myapp/src/runner/dataset.py | 1 | 3274 | import cv2
import os
import glob
from sklearn.utils import shuffle
import numpy as np
def load_train(train_path, image_size, classes):
images = []
labels = []
img_names = []
cls = []
print('Going to read training images')
for fields in classes:
index = classes.index(fields)
pr... | mit |
bromjiri/Presto | predictor/predictor_sklearn.py | 1 | 10590 | import settings
import pandas as pd
import numpy as np
import os
from datetime import timedelta
import predictor.predictor_statistic as stat
import random
import pickle
from sklearn.feature_extraction import DictVectorizer
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticReg... | mit |
lensacom/sparkit-learn | splearn/base.py | 2 | 1701 | # -*- coding: utf-8 -*-
from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin
from sklearn.metrics import accuracy_score
class SparkBroadcasterMixin(object):
# TODO: consider caching in case of streaming
def broadcast(self, func, context):
bcvars = {name: context.broadcast(getatt... | apache-2.0 |
3quarterstack/simple_blog | djangoappengine/db/base.py | 18 | 12838 | import datetime
import decimal
import logging
import os
import shutil
from django.db.utils import DatabaseError
from google.appengine.api.datastore import Delete, Query
from google.appengine.api.datastore_errors import BadArgumentError, \
BadValueError
from google.appengine.api.datastore_types import Blob, Key, T... | mit |
alasdairtran/mclearn | projects/jakub/learning_curve/uncertainty_curve.py | 2 | 1191 | import json
import sys
import numpy as np
import sklearn.gaussian_process
# Import splitter
sys.path.insert(1, '..')
import splitter
TRAINING_SAMPLES_NUM = 1000000
TESTING_SAMPLES_NUM = 1000
MAX_GP = 3000
STEP = 100
ALPHA = .002
LENGTH_SCALE = 1
def perform_gp(train_X, train_y, test_X):
kernel = sklearn.gau... | bsd-3-clause |
Orpine/py-R-FCN | lib/datasets/pascal_voc.py | 11 | 14217 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
from datasets.imdb import imdb
import datasets.ds_utils as ds... | mit |
roxyboy/scikit-learn | sklearn/utils/__init__.py | 131 | 14185 | """
The :mod:`sklearn.utils` module includes various utilities.
"""
from collections import Sequence
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array,
assert_all_finite,
... | bsd-3-clause |
ephes/scikit-learn | examples/svm/plot_svm_margin.py | 315 | 2328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM Margins Example
=========================================================
The plots below illustrate the effect the parameter `C` has
on the separation line. A large value of `C` basically tells
our model that w... | bsd-3-clause |
roxyboy/scikit-learn | sklearn/svm/base.py | 155 | 36018 | from __future__ import print_function
import numpy as np
import scipy.sparse as sp
import warnings
from abc import ABCMeta, abstractmethod
from . import libsvm, liblinear
from . import libsvm_sparse
from ..base import BaseEstimator, ClassifierMixin, ChangedBehaviorWarning
from ..preprocessing import LabelEncoder
from... | bsd-3-clause |
edx/edx-platform | openedx/features/content_type_gating/block_transformers.py | 4 | 4525 | """
Content Type Gate Transformer implementation.
Limits access for certain users to certain types of content.
"""
from django.conf import settings
from lms.djangoapps.course_blocks.transformers.user_partitions import UserPartitionTransformer
from openedx.core.djangoapps.content.block_structure.transformer import Bl... | agpl-3.0 |
ephes/scikit-learn | sklearn/grid_search.py | 102 | 36232 | """
The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters
of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# ... | bsd-3-clause |
luo66/scikit-learn | sklearn/ensemble/gradient_boosting.py | 50 | 67625 | """Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | bsd-3-clause |
luo66/scikit-learn | sklearn/utils/__init__.py | 79 | 14202 | """
The :mod:`sklearn.utils` module includes various utilities.
"""
from collections import Sequence
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array,
assert_all_finite,
... | bsd-3-clause |
switowski/invenio | invenio/modules/indexer/tokenizers/BibIndexFiletypeTokenizer.py | 12 | 2411 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License,... | gpl-2.0 |
MohammedWasim/scikit-learn | examples/cluster/plot_affinity_propagation.py | 346 | 2304 | """
=================================================
Demo of affinity propagation clustering algorithm
=================================================
Reference:
Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages
Between Data Points", Science Feb. 2007
"""
print(__doc__)
from sklearn.cluster impor... | bsd-3-clause |
glouppe/scikit-learn | examples/cluster/plot_affinity_propagation.py | 346 | 2304 | """
=================================================
Demo of affinity propagation clustering algorithm
=================================================
Reference:
Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages
Between Data Points", Science Feb. 2007
"""
print(__doc__)
from sklearn.cluster impor... | bsd-3-clause |
mileistone/test | brambox/boxes/annotations/kitti.py | 1 | 4525 | #
# Copyright EAVISE
# Author: Tanguy Ophoff
#
"""
KITTI
-----
"""
from .annotation import *
__all__ = ["KittiAnnotation", "KittiParser"]
class KittiAnnotation(Annotation):
""" KITI image annotation """
def serialize(self):
""" generate a KITTI annotation string """
truncated = 1.0 if se... | mit |
LohithBlaze/scikit-learn | sklearn/datasets/tests/test_samples_generator.py | 35 | 15016 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
fr... | bsd-3-clause |
mlflow/mlflow | mlflow/recipes/steps/ingest/__init__.py | 1 | 10689 | import abc
import logging
import os
from pathlib import Path
from mlflow.exceptions import MlflowException
from mlflow.recipes.artifacts import DataframeArtifact
from mlflow.recipes.cards import BaseCard
from mlflow.recipes.step import BaseStep
from mlflow.recipes.step import StepClass
from mlflow.recipes.utils.step i... | apache-2.0 |
jzt5132/scikit-learn | sklearn/cross_validation.py | 47 | 67782 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
marionleborgne/nupic.research | projects/capybara/supervised_baseline/v1_no_sequences/plot_results.py | 9 | 3714 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
tomsilver/nupic | tests/integration/nupic/opf/opf_description_template_test/experiments/gym/base.py | 1 | 15721 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/models/official/mnist/mnist_eager.py | 5 | 7794 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
eadgarchen/tensorflow | tensorflow/contrib/factorization/python/ops/gmm_test.py | 40 | 9763 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ASethi77/StateOfTheMedia | src/model/tune_generic_hyperparams.py | 1 | 2503 | # adding this to suppress sklearn DeprecationWarnings...
from mpl_toolkits.mplot3d import Axes3D
from model.linear_regression_model import LinearRegressionModel
from model.MLPRegressionModel import MLPRegressionModel
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
import time
from sklearn.mod... | apache-2.0 |
luo66/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 212 | 3359 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
mlflow/mlflow | mlflow/tracking/metric_value_conversion_utils.py | 1 | 2248 | import sys
from mlflow.exceptions import MlflowException, INVALID_PARAMETER_VALUE
def _is_module_imported(module_name: str) -> bool:
return module_name in sys.modules
def _try_get_item(x):
try:
return x.item()
except Exception as e:
raise MlflowException(
f"Failed to convert... | apache-2.0 |
lilleswing/deepchem | examples/factors/FACTORS_tf_singletask.py | 6 | 3341 | """
Script that trains Tensorflow Singletask models on FACTORS dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import tempfile
import shutil
import deepchem as dc
from FACTORS_datasets import load_factors
###Load d... | mit |
LohithBlaze/scikit-learn | examples/feature_selection/plot_feature_selection.py | 248 | 2827 | """
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | bsd-3-clause |
fx2003/tensorflow-study | TensorFlow实战/models/inception/inception/data/build_imagenet_data.py | 12 | 26205 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mit |
sgenoud/scikit-learn | examples/svm/plot_custom_kernel.py | 3 | 1522 | """
======================
SVM with custom kernel
======================
Simple usage of Support Vector Machines to classify a sample. It will
plot the decision surface and the support vectors.
"""
print __doc__
import numpy as np
import pylab as pl
from sklearn import svm, datasets
# import some data to play with
... | bsd-3-clause |
glouppe/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 25 | 8544 | import numpy as np
from scipy import linalg
from sklearn.decomposition import (NMF, ProjectedGradientNMF,
non_negative_factorization)
from sklearn.decomposition import nmf # For testing internals
from scipy.sparse import csc_matrix
from sklearn.utils.testing import assert_true
from... | bsd-3-clause |
elkingtonmcb/h2o-2 | py/testdir_single_jvm/test_rf_histo_fail_fvec.py | 9 | 1394 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_rf, h2o_import as h2i
paramDict = {
'destination_key': 'model_keyA',
'ntrees': 13,
'response': 'C55',
'mtries': 3,
'source': u'covtype.hex',
'seed': '1231231',
'importance': 0,
'b... | apache-2.0 |
MohammedWasim/scikit-learn | sklearn/metrics/cluster/supervised.py | 206 | 27395 | """Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# License: BSD 3 clause
fr... | bsd-3-clause |
lilleswing/deepchem | contrib/torch/torch_multitask_classification.py | 8 | 4402 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 13 22:31:24 2017
@author: Zhenqin Wu
"""
import torch
import numpy as np
from deepchem.metrics import from_one_hot
from torch_model import TorchMultitaskModel
class TorchMultitaskClassification(TorchMultitaskModel):
def __init__(self, n_tasks, n_featu... | mit |
luo66/scikit-learn | sklearn/metrics/cluster/supervised.py | 206 | 27395 | """Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# License: BSD 3 clause
fr... | bsd-3-clause |
sgenoud/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 1 | 2616 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD Style.
from numpy.testing import assert_almost_equal, assert_array_almost_equal
import numpy as np
from sklearn import datasets
fro... | bsd-3-clause |
Diyago/Machine-Learning-scripts | time series regression/autocorelation, mov avg etc/doubleExponentialSmoothing.py | 1 | 2945 | # Load modules
from __future__ import print_function
import os
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
# Read dataset into a pandas.DataFrame
beer_df = pd.read_csv(
"datasets/quarterly-beer-production-in-aus-March 1956-June 1994.csv"
)
# Display shape of the dataset
print("Sha... | apache-2.0 |
LohithBlaze/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 296 | 1770 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
LohithBlaze/scikit-learn | sklearn/ensemble/tests/test_weight_boosting.py | 35 | 16763 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal, assert_true
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
manipopopo/tensorflow | tensorflow/contrib/learn/python/learn/estimators/logistic_regressor_test.py | 44 | 4901 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
codeworldprodigy/lab2 | lib/jinja2/visitor.py | 1402 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | apache-2.0 |
manipopopo/tensorflow | tensorflow/contrib/learn/python/learn/__init__.py | 40 | 2715 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
mileistone/test | vedanet/data/transform/_preprocess.py | 1 | 21012 | #
# Image and annotations preprocessing for lightnet networks
# The image transformations work with both Pillow and OpenCV images
# The annotation transformations work with brambox.annotations.Annotation objects
# Copyright EAVISE
#
# modified by mileistone
import random
import collections
import logging as l... | mit |
caronc/nzb-subliminal | Subliminal/guessit/transfo/guess_episode_details.py | 7 | 2809 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
luo66/scikit-learn | examples/mixture/plot_gmm_sin.py | 247 | 2747 | """
=================================
Gaussian Mixture Model Sine Curve
=================================
This example highlights the advantages of the Dirichlet Process:
complexity control and dealing with sparse data. The dataset is formed
by 100 points loosely spaced following a noisy sine curve. The fit by
the GMM... | bsd-3-clause |
automl/auto-sklearn | examples/80_extending/example_extending_regression.py | 1 | 5223 | """
================================================
Extending Auto-Sklearn with Regression Component
================================================
The following example demonstrates how to create a new regression
component for using in auto-sklearn.
"""
from typing import Optional
from pprint import pprint
from C... | bsd-3-clause |
GauthamGoli/quantify-2016 | Machine Learning - Bond Liquidity Prediction/final_code.py | 1 | 5973 | # importing various modules that would be required in the program
import pandas as pd
import numpy as np
import dateutil.parser as dateparser
from datetime import datetime
import dateutil.parser as dateparser
from datetime import datetime
from sklearn.ensemble import RandomForestRegressor
from sklearn.preproc... | mit |
MohammedWasim/scikit-learn | sklearn/neighbors/base.py | 71 | 31147 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | bsd-3-clause |
sgenoud/scikit-learn | examples/plot_digits_pipe.py | 5 | 1781 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... | bsd-3-clause |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.8/resnet-tpuv2-8/code/resnet/model/models/official/transformer/data_download.py | 4 | 14804 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
mlflow/mlflow | tests/utils/test_requirements_utils.py | 1 | 13714 | import os
import importlib
from unittest import mock
import importlib_metadata
import pytest
import mlflow
import mlflow.utils.requirements_utils
from mlflow.utils.requirements_utils import (
_is_comment,
_is_empty,
_is_requirements_file,
_strip_inline_comment,
_join_continued_lines,
_parse_re... | apache-2.0 |
jzt5132/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 102 | 22297 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
luo66/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 102 | 22297 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
luo66/scikit-learn | benchmarks/bench_plot_ward.py | 288 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
mlflow/mlflow | examples/pyspark_ml_autologging/pipeline.py | 1 | 1185 | from pyspark.ml.classification import LogisticRegression
from pyspark.ml.feature import VectorAssembler, StandardScaler
from pyspark.ml import Pipeline
from pyspark.sql import SparkSession
from sklearn.datasets import load_iris
import mlflow
spark = SparkSession.builder.getOrCreate()
mlflow.pyspark.ml.autolog()
df =... | apache-2.0 |
sgenoud/scikit-learn | examples/plot_feature_selection.py | 1 | 2443 | """
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | bsd-3-clause |
rcln/tag.suggestion | code_python27/toolEval/alchemyAPItagger/alchemyeval_strict.py | 1 | 5202 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 16 18:40:12 2015
@author: ivan
"""
from __future__ import division
#from sklearn.feature_extraction.text import CountVectorizer
#from sklearn.feature_extraction.text import TfidfTransformer
import argparse
from lxml import etree
import cPickle
import os
import time
import... | gpl-2.0 |
TinghuiWang/pyActLearn | examples/CASAS_Single_Test/b1_lstm_raw.py | 1 | 8331 | import os
import pickle
import logging
import argparse
import numpy as np
import tensorflow as tf
from datetime import datetime
from pyActLearn.CASAS.data import CASASData
from pyActLearn.CASAS.fuel import CASASFuel
from pyActLearn.learning.nn.lstm import LSTM
from pyActLearn.performance.record import LearningResult
fr... | bsd-3-clause |
lilleswing/deepchem | contrib/one_shot_models/examples/sider_from_tox21_res_one_fold.py | 8 | 2496 | """
Train low-data res models on Tox21. Test on SIDER. Test last fold only.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import numpy as np
import deepchem as dc
import tensorflow as tf
from datasets import load_sider_convmol
from datasets import loa... | mit |
tomsilver/nupic | tests/swarming/nupic/swarming/experiments/spatial_classification/description.py | 1 | 15598 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
danielfree/srs | trunk/research/api-server/server.py | 13 | 48099 | #!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2013-2014 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, cop... | mit |
jzt5132/scikit-learn | examples/linear_model/plot_polynomial_interpolation.py | 250 | 1895 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... | bsd-3-clause |
MohammedWasim/scikit-learn | examples/linear_model/plot_polynomial_interpolation.py | 250 | 1895 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... | bsd-3-clause |
MohammedWasim/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 126 | 7477 | r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected i... | bsd-3-clause |
tomsilver/nupic | nupic/datafiles/extra/regression/makeDataset.py | 9 | 5327 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | gpl-3.0 |
mlperf/training_results_v0.5 | v0.5.0/nvidia/submission/code/single_stage_detector/pytorch/ssd300.py | 1 | 7384 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.