repo_name
stringlengths
7
90
path
stringlengths
5
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
976
581k
license
stringclasses
15 values
Pragmatismo/Pigrow
scripts/gui/graph_modules/graph_thresholds_pie.py
1
4158
# def read_graph_options(): ''' Returns a dictionary of settings and their default values for use by the remote gui ''' graph_module_settings_dict = { "title_text":"", "include_daterange_in_title":"true" } return graph_module_settings_dict def make_graph(li...
gpl-3.0
odo22/GV-simulation
adult13.py
1
5869
from __future__ import division, print_function, absolute_import from tmm_core import (inc_tmm, unpolarized_RT, ellips, position_resolved, find_in_structure_with_inf) from numpy import pi, linspace, inf, array from scipy.interpolate import interp1d import matplotlib.pyplot as plt import...
mit
marionleborgne/nupic.research
htmresearch/support/generate_sdr_dataset.py
6
15022
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
agpl-3.0
HBPNeurorobotics/nest-simulator
topology/pynest/tests/test_plotting.py
10
4117
# -*- coding: utf-8 -*- # # test_plotting.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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
stylianos-kampakis/scikit-learn
examples/cluster/plot_mini_batch_kmeans.py
265
4081
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
bsd-3-clause
BlueBrain/NEST
pynest/examples/twoneurons.py
8
1209
# -*- coding: utf-8 -*- # # twoneurons.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, or ...
gpl-2.0
bjsmith/motivation-simulation
SetupAASaltRatModel.py
1
2882
__author__ = 'benjaminsmith' import numpy as np import time import os import matplotlib.pyplot as plt #we might do some other tool later. from ActionModel import ActionModel import sys from BisbasModel import BisbasModel from UnitModel import * from scipy.stats import norm #i_pleasant_taste = 0 i_salt = 0 # i_food = ...
gpl-3.0
MechCoder/scikit-learn
sklearn/svm/classes.py
5
42736
import warnings import numpy as np from .base import _fit_liblinear, BaseSVC, BaseLibSVM from ..base import BaseEstimator, RegressorMixin from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \ LinearModel from ..utils import check_X_y from ..utils.validation import _num_samples from ..utils.mult...
bsd-3-clause
ian-r-rose/SHTOOLS
examples/python/TestLegendre/TestLegendre.py
2
4707
#!/usr/bin/env python """ This script tests and plots all Geodesy normalized Legendre functions. Parameters can be changed in the main function. """ # standard imports: import os import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt # import shtools: sys.path.append(os.path.join(os.pa...
bsd-3-clause
JohnGriffiths/dipy
doc/examples/piesno.py
11
3970
""" ============================= Noise estimation using PIESNO ============================= Often, one is interested in estimating the noise in the diffusion signal. One of the methods to do this is the Probabilistic Identification and Estimation of Noise (PIESNO) framework [Koay2009]_. Using this method, one can de...
bsd-3-clause
elkingtonmcb/scikit-learn
sklearn/externals/joblib/parallel.py
79
35628
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
bsd-3-clause
dialounke/pylayers
pylayers/gis/selectl.py
1
41748
# -*- coding: utf-8 -*- r""" .. currentmodule:: pylayers.gis.selectl .. autosummary:: """ import os import pdb from PIL import Image import numpy as np from pylayers.util import geomutil as geu from pylayers.util import pyutil as pyu import pylayers.util.plotutil as plu import matplotlib.pyplot as plt from pylayers...
mit
jbrundle/earthquake-forecasts
plot_ANSS_seismicity.py
1
1331
#!/opt/local/bin python ############################################################################## # Code plots earthquake data for magnitude vs. time # Usage: python plot_ANSS_seismicity.py NELat NELng SWLat SWLng MagLo # # Where: Latitude in degrees # Longitude in...
mit
davharris/leafpuppy
convolve.py
1
1028
from __future__ import print_function import matplotlib.pyplot as plt import matplotlib import numpy as np from scipy import ndimage as nd from skimage import data from skimage.util import img_as_float from skimage.filter import gabor_kernel from skimage.feature import hog from skimage import data, color, exposure ...
bsd-3-clause
CheMcCandless/hyperopt-sklearn
hpsklearn/tests/test_estimator.py
4
1604
try: import unittest2 as unittest except: import unittest import numpy as np from hpsklearn.estimator import hyperopt_estimator from hpsklearn import components class TestIter(unittest.TestCase): def setUp(self): np.random.seed(123) self.X = np.random.randn(1000, 2) self.Y = (sel...
bsd-3-clause
PatrickChrist/scikit-learn
examples/svm/plot_iris.py
225
3252
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
bsd-3-clause
INGEOTEC/microTC
microtc/textmodel.py
1
18021
# Copyright 2016-2017 Eric S. Tellez # 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 writ...
apache-2.0
architecture-building-systems/CEAforArcGIS
cea/technologies/solar/photovoltaic_thermal.py
2
42510
""" Photovoltaic thermal panels """ import os import time from itertools import repeat from math import * import geopandas as gpd import numpy as np import pandas as pd from geopandas import GeoDataFrame as gdf from numba import jit import cea.inputlocator import cea.utilities.parallel import cea.utilities.worke...
mit
satra/NiPypeold
nipype/algorithms/rapidart.py
1
22474
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ The rapidart module provides routines for artifact detection and region of interest analysis. These functions include: * ArtifactDetect: performs artifact detection on functional images * Sti...
bsd-3-clause
zorojean/scikit-learn
sklearn/decomposition/pca.py
192
23117
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Michael Eickenberg <michael.eickenberg@inria.fr> # # Lice...
bsd-3-clause
ychaim/bbg
bbg/bbg.py
1
33953
# -*- coding: utf-8 -*- """ Created on Wed Jun 04 17:44:27 2014 @author: Brian Jacobowski <bjacobowski.dev@gmail.com> """ import time import collections import blpapi as bb import pandas as pd import numpy as np import matplotlib.pyplot as plt import datetime as dt from optparse import OptionParser fro...
bsd-3-clause
DSLituiev/scikit-learn
examples/ensemble/plot_gradient_boosting_quantile.py
392
2114
""" ===================================================== Prediction Intervals for Gradient Boosting Regression ===================================================== This example shows how quantile regression can be used to create prediction intervals. """ import numpy as np import matplotlib.pyplot as plt from skle...
bsd-3-clause
RomainBrault/OVFM
Dream3/dream3.py
1
7167
import scipy.io import numpy as np from sklearn import ensemble from sklearn import cross_validation from sklearn import metrics from sklearn import preprocessing from sklearn import linear_model import OVFM.Model as md import OVFM.FeatureMap as fm import OVFM.Risk as rsk import OVFM.LearningRate as lr import OVFM.Dat...
mit
WafaaT/spark-tk
regression-tests/sparktkregtests/testcases/dicom/create_dicom_test.py
12
3719
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
yavalvas/yav_com
build/matplotlib/examples/pylab_examples/quadmesh_demo.py
14
1111
#!/usr/bin/env python """ pcolormesh uses a QuadMesh, a faster generalization of pcolor, but with some restrictions. This demo illustrates a bug in quadmesh with masked data. """ import numpy as np from matplotlib.pyplot import figure, show, savefig from matplotlib import cm, colors from numpy import ma n = 12 x = n...
mit
alexalemi/cancersim
code/cancer_old.py
1
35053
#Cancer Sim from numpy import * import scipy as sp import pylab as py import math import matplotlib.cm as cm import matplotlib.colors as colors import cPickle as pickle from scipy.spatial.distance import euclidean from math import pow from scipy.spatial import Delaunay #from scipy.spatial import KDTree from scipy...
mit
thorwhalen/ut
ml/regression/recursive_regression.py
1
1171
from sklearn.base import RegressorMixin, TransformerMixin from sklearn.linear_model import LinearRegression from numpy import zeros, vstack class RecursiveRegressionTransformer(RegressorMixin, TransformerMixin): def __init__(self, model_class=LinearRegression, n_cycles=2, **model_kwargs): self.model_cla...
mit
michigraber/scikit-learn
examples/linear_model/plot_ransac.py
250
1673
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
DonBeo/scikit-learn
sklearn/metrics/scorer.py
11
12934
""" The :mod:`sklearn.metrics.scorer` submodule implements a flexible interface for model selection and evaluation using arbitrary score functions. A scorer object is a callable that can be passed to :class:`sklearn.grid_search.GridSearchCV` or :func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame...
bsd-3-clause
wazeerzulfikar/scikit-learn
sklearn/tests/test_metaestimators.py
30
5040
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.utils.validation import...
bsd-3-clause
miltondp/ukbrest
tests/test_postloader.py
1
38352
import os import numpy as np import pandas as pd from sqlalchemy import create_engine from tests.settings import POSTGRESQL_ENGINE from tests.utils import get_repository_path, DBTest from ukbrest.common.pheno2sql import Pheno2SQL from ukbrest.common.postloader import Postloader class PostloaderTest(DBTest): def...
gpl-3.0
hyperspy/hyperspy
hyperspy/conftest.py
2
2514
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
AdamRTomkins/libSpineML2NK
libSpineML2NK/examples/Narx/Narx_Gain/python/validate_model.py
2
5585
# run and validate model from Simulator_twoGains import * from matplotlib import pyplot as plt import h5py import numpy as np from scipy import io Params = scipy.io.loadmat("intpoint_mutant2.mat") SortedPar = sortGainParams(Params,'x_mutant2') SortedPar['Mean_beta_3'] = 2000 SortedPar['Gralbeta_G'] = 1000 model...
gpl-3.0
nrego/westpa
lib/examples/stringmethodexamples/examples/DicksonPeriodicPotential/generate_figures/voronoi.py
1
2391
#!/usr/bin/env python # ----------------------------------------------------------------------------- # Voronoi diagram from a list of points # Copyright (C) 2011 Nicolas P. Rougier # # Distributed under the terms of the BSD License. # ----------------------------------------------------------------------------- impor...
gpl-3.0
xray/xray
xarray/core/nputils.py
1
9531
import warnings import numpy as np import pandas as pd from numpy.core.multiarray import normalize_axis_index try: import bottleneck as bn _USE_BOTTLENECK = True except ImportError: # use numpy methods instead bn = np _USE_BOTTLENECK = False def _select_along_axis(values, idx, axis): other_...
apache-2.0
KellyChan/Python
python/tensorflow/demos/tensorflow/concepts/placeholder.py
3
1451
import tensorflow as tf import matplotlib.image as mpimg import matplotlib.pyplot as plt class MarshOrchid(object): def __init__(self, filename): self.image = mpimg.imread(filename) def placeholder1(self): x = tf.placeholder("float", 3) y = x * 2 with tf.Session() as sessio...
mit
tmhm/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause
0asa/scikit-learn
sklearn/covariance/robust_covariance.py
17
28933
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
bsd-3-clause
hughdbrown/QSTK-nohist
src/quicksim/strategies/OneStock.py
1
1994
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on Jan 1, 2011 @author:Drew Bratcher @contact: dbratcher@gatech.edu @summary: Contains tutorial for...
bsd-3-clause
zorroblue/scikit-learn
sklearn/tests/test_isotonic.py
31
15103
import warnings import numpy as np import pickle import copy from sklearn.isotonic import (check_increasing, isotonic_regression, IsotonicRegression) from sklearn.utils.testing import (assert_raises, assert_array_equal, assert_true, assert_false, assert...
bsd-3-clause
ztytiao/t4_indudstry_classify
bin/nlpClassify.py
1
12322
import jieba import pandas as pd import random import numpy as np from sklearn import feature_extraction from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.naive_bayes import Mu...
mit
jreback/pandas
pandas/tests/util/test_show_versions.py
3
1241
import re import pytest import pandas as pd @pytest.mark.filterwarnings( # openpyxl "ignore:defusedxml.lxml is no longer supported:DeprecationWarning" ) @pytest.mark.filterwarnings( # html5lib "ignore:Using or importing the ABCs from:DeprecationWarning" ) @pytest.mark.filterwarnings( # fastparqu...
bsd-3-clause
Caranarq/01_Dmine
Datasets/MV02/MV02.py
1
4403
# -*- coding: utf-8 -*- """ Created on Thu Sep 28 13:34:56 2017 @author: carlos.arana Descripcion: Mineria de datos de accidentes vehiculares. """ # Librerias Utilizadas import os import pandas as pd import datetime import urllib import zipfile from simpledbf import Dbf5 # Ubicacion y descripcion de la fuente fuen...
gpl-3.0
yunque/sms-tools
lectures/08-Sound-transformations/plots-code/hps-morph.py
24
2691
# function for doing a morph between two sounds using the hpsModel import numpy as np import matplotlib.pyplot as plt from scipy.signal import get_window import sys, os sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../models/')) sys.path.append(os.path.join(os.path.dirname(os.path.re...
agpl-3.0
luispedro/BuildingMachineLearningSystemsWithPython
ch04/build_lda.py
22
2443
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License from __future__ import print_function try: import nltk.corpus except ImportError: print("nltk n...
mit
cmoutard/mne-python
examples/visualization/plot_evoked_delayed_ssp.py
22
3873
""" ========================================= Create evoked objects in delayed SSP mode ========================================= This script shows how to apply SSP projectors delayed, that is, at the evoked stage. This is particularly useful to support decisions related to the trade-off between denoising and preservi...
bsd-3-clause
MariaRigaki/kaggle
africa/predict.py
1
1802
__author__ = 'marik0' #!/usr/bin/env python # coding: utf-8 """ prediction code for regression """ import sys import numpy as np import pandas as pd from pylearn2.utils import serial from theano import tensor as T from theano import function if __name__ == "__main__": try: model_path = sys.argv[1] ...
mit
karstenw/nodebox-pyobjc
examples/Extended Application/sklearn/examples/linear_model/plot_sparse_logistic_regression_mnist.py
1
3510
""" ===================================================== MNIST classfification using multinomial logistic + L1 ===================================================== Here we fit a multinomial logistic regression with L1 penalty on a subset of the MNIST digits classification task. We use the SAGA algorithm for this pur...
mit
yyjiang/scikit-learn
sklearn/utils/tests/test_multiclass.py
72
15350
from __future__ import division import numpy as np import scipy.sparse as sp from itertools import product from functools import partial from sklearn.externals.six.moves import xrange from sklearn.externals.six import iteritems from scipy.sparse import issparse from scipy.sparse import csc_matrix from scipy.sparse im...
bsd-3-clause
samzhang111/scikit-learn
sklearn/tree/tree.py
3
38647
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
cogmission/nupic
src/nupic/research/monitor_mixin/monitor_mixin_base.py
13
7350
# ---------------------------------------------------------------------- # 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...
agpl-3.0
zooniverse/aggregation
active_weather/old/learning.py
1
9971
# try: # import matplotlib # matplotlib.use('WXAgg') # except ImportError: # pass from skimage.transform import probabilistic_hough_line from skimage.feature import canny import numpy as np import math import matplotlib.pyplot as plt from sklearn.cluster import DBSCAN try: import Image except ImportErr...
apache-2.0
wschenck/nest-simulator
pynest/nest/lib/hl_api_types.py
13
38621
# -*- coding: utf-8 -*- # # hl_api_types.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, o...
gpl-2.0
alexis-roche/nipy
examples/labs/multi_subject_parcellation.py
4
1990
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function # Python 2/3 compatibility __doc__ = """ This script contains a quick demo on a multi-subject parcellation on a toy 2D example. Note how the mid...
bsd-3-clause
antgonza/qiime
tests/test_plot_taxa_summary.py
15
16573
#!/usr/bin/env python # file test_plot_taxa_summary.py __author__ = "Jesse Stombaugh" __copyright__ = "Copyright 2011, The QIIME Project" # consider project name __credits__ = ["Jesse Stombaugh", "Julia Goodrich"] # remember to add yourself __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jesse Stomba...
gpl-2.0
withrocks/arteria-bcl2fastq
bcl2fastq/lib/illumina.py
1
4256
from pandas import read_csv class SampleRow: """ Provides a representation of the information presented in a Illumina Samplesheet. Different samplesheet types (e.g. HiSeq, MiSeq, etc) will provide slightly different information for each sample. This class aims at providing a interface to this that wil...
mit
ericwhyne/open-catalog-generator
scripts/metrics.py
3
13286
#!/usr/bin/python #James Tobat, 2014 import json import sys import time #import matplotlib.pyplot as plt import csv import os.path # Command line arguments and global constants active_content_file = sys.argv[1] deployed_content_file = sys.argv[2] data_dir = sys.argv[3] metric_log_dir = sys.argv[4] date = time.strftime...
apache-2.0
rustyrazorblade/ipython-cql
cql/__init__.py
1
4040
from IPython.core.magic import Magics, magics_class, cell_magic, line_magic, needs_local_scope from IPython.config.configurable import Configurable from cassandra.cluster import Cluster from cassandra.query import ordered_dict_factory, SimpleStatement from prettytable import PrettyTable try: import numpy as np ...
bsd-2-clause
bretthandrews/marvin
docs/sphinx/conf.py
1
13652
# -*- coding: utf-8 -*- # # Marvin documentation build configuration file, created by # sphinx-quickstart on Sun Apr 10 08:50:42 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
bsd-3-clause
OshynSong/scikit-learn
sklearn/tree/tree.py
59
34839
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
wclark3/machine-learning
final-project/code/bigdata.py
1
2184
import argparse import code import os import argcomplete import numpy as np import pandas as pd import sklearn.ensemble import sklearn.linear_model # e.g. python bigdata.py -o=run_2015-12-06__02_26_27 def get_immediate_subdirectories(a_dir): return [name for name in os.listdir(a_dir) if os.path.isdir(os.path.joi...
mit
ssh0/growing-string
triangular_lattice/random_lattice/growing.py
1
10453
#!/usr/bin/env python # -*- coding:utf-8 -*- # # written by Shotaro Fujimoto # 2017-03-22 import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import matplotlib.tri as tri import matplotlib.pyplot as plt import numpy as np from triangular import LatticeTriangular as LT fro...
mit
GregSilverman/cohort_rest_api
rest_api/api.py
1
6076
#!/usr/bin/env python from gevent import monkey monkey.patch_all() from flask import request, jsonify from marshmallow import Schema, fields import time # kludge for running pandas locally in testing mode import os import tempfile os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp() import pandas as pd from flask_cors imp...
gpl-3.0
ankurankan/scikit-learn
sklearn/preprocessing/tests/test_data.py
12
29380
import warnings import numpy as np import numpy.linalg as la from scipy import sparse from sklearn.utils.testing import assert_almost_equal, clean_warning_registry from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_e...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/pipeline.py
5
28169
""" The :mod:`sklearn.pipeline` module implements utilities to build a composite estimator, as a chain of transforms and estimators. """ # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Alexandre Gramfort # Lars Buitinck # License: BSD from collections import defaultdict...
mit
avmarchenko/exatomic
exatomic/core/tests/test_basis.py
2
5005
# -*- coding: utf-8 -*- # Copyright (c) 2015-2018, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 import numpy as np import pandas as pd from unittest import TestCase from exatomic.core.basis import BasisSet class TestBasisSet(TestCase): def setUp(self): adict = {co...
apache-2.0
johankaito/fufuka
microblog/flask/venv/lib/python2.7/site-packages/numpy/lib/npyio.py
21
66671
from __future__ import division, absolute_import, print_function import sys import os import re import itertools import warnings import weakref from operator import itemgetter import numpy as np from . import format from ._datasource import DataSource from ._compiled_base import packbits, unpackbits from ._iotools im...
apache-2.0
neurospin/pylearn-epac
epac/workflow/pipeline.py
1
3604
""" Define "Pipeline": the primitive to build sequential execution of tasks. @author: edouard.duchesnay@cea.fr @author: benoit.da_mota@inria.fr """ ## Abreviations ## tr: train ## te: test from epac.workflow.factory import NodeFactory def __insert_node_at_leaf(node, node2insert): """insert a node at the leaf l...
bsd-3-clause
dragoon/kilogram
kilogram/entity_linking/mention_rw/__init__.py
1
7287
from __future__ import division import math import numpy as np import networkx as nx from sklearn.preprocessing import normalize from kilogram import NgramService class Signature(object): vector = None mapping = None def __init__(self, vector, G, candidate_uris): """ :type candidate_uris:...
apache-2.0
DGrady/pandas
pandas/core/indexes/frozen.py
20
4619
""" frozen (immutable) data structures to support MultiIndexing These are used for: - .names (FrozenList) - .levels & .labels (FrozenNDArray) """ import numpy as np from pandas.core.base import PandasObject from pandas.core.dtypes.cast import coerce_indexer_dtype from pandas.io.formats.printing import pprint_thing ...
bsd-3-clause
jinghaomiao/apollo
modules/tools/realtime_plot/realtime_plot.py
3
9046
#!/usr/bin/env python3 ############################################################################### # Copyright 2017 The Apollo 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...
apache-2.0
thesuperzapper/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_test.py
2
44417
# 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
alephu5/Soundbyte
environment/lib/python3.3/site-packages/IPython/core/usage.py
7
23187
# -*- coding: utf-8 -*- """Usage information for the main IPython applications. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu> # # Distributed under the terms of...
gpl-3.0
jenfly/monsoon-onset
testing/testing-indices-onset_WLH.py
1
13079
import sys sys.path.append('/home/jwalker/dynamics/python/atmos-tools') sys.path.append('/home/jwalker/dynamics/python/atmos-read') import xarray as xray import numpy as np from datetime import datetime import matplotlib.pyplot as plt import pandas as pd import atmos as atm import precipdat from indices import onset_W...
mit
pythonvietnam/scikit-learn
examples/svm/plot_svm_anova.py
250
2000
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc__) import...
bsd-3-clause
SimonStrong/pysd
pysd/functions.py
2
30695
""" functions.py These are supports for functions that are included in modeling software but have no straightforward equivalent in python. """ from __future__ import division from functools import wraps import pandas as pd import pandas as _pd import numpy as np from . import utils import imp import warnings impor...
mit
ikaee/bfr-attendant
facerecognitionlibrary/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/base.py
7
19731
# 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
openfisca/openfisca-qt
openfisca_qt/scripts/tunisia/reforme_bareme.py
1
5534
# -*- coding:utf-8 -*- """ Created on Dec 6, 2012 @author: Mahd Ben Jelloul openFisca, Logiciel libre de simulation du système socio-fiscal français Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul This file is part of openFisca. openFisca is free software: you can redistribute it and/or modify it under th...
agpl-3.0
dgormez/pattern-recognition
pattern-reco.py
1
25210
""" Author : GORMEZ David Imagery Project: Pattern recognition """ import numpy as np from matplotlib import pyplot as plt from matplotlib.pyplot import cm from matplotlib.collections import LineCollection #from matplotlib import delaunay as triang from matplotlib import colors #from matplotlib import tri as tria ...
gpl-2.0
sequana/sequana
sequana/gff3.py
1
22288
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016-2020 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with t...
bsd-3-clause
apache/spark
python/pyspark/pandas/tests/data_type_ops/test_binary_ops.py
6
9087
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
costypetrisor/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
seckcoder/lang-learn
python/sklearn/examples/decomposition/plot_pca_vs_lda.py
9
1711
""" ======================================================= Comparison of LDA and PCA 2D projection of Iris dataset ======================================================= The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour and Virginica) with 4 attributes: sepal length, sepal width, petal length a...
unlicense
IndraVikas/scikit-learn
sklearn/ensemble/__init__.py
217
1307
""" The :mod:`sklearn.ensemble` module includes ensemble-based methods for classification and regression. """ from .base import BaseEnsemble from .forest import RandomForestClassifier from .forest import RandomForestRegressor from .forest import RandomTreesEmbedding from .forest import ExtraTreesClassifier from .fores...
bsd-3-clause
SiLab-Bonn/ccpdv4
ccpdv4/scans/scan_dac_vs_current.py
1
1518
import logging from time import sleep from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from ccpdv4.ccpdv4_run_base import Ccpdv4RunBase from pybar.run_manager import RunManager class Init(Ccpdv4RunBase): '''Init scan ''' _defau...
bsd-3-clause
CVML/scikit-learn
examples/cluster/plot_cluster_iris.py
350
2593
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= K-means Clustering ========================================================= The plots display firstly what a K-means algorithm would yield using three clusters. It is then shown what the effect of a bad initializa...
bsd-3-clause
shl198/Projects
RibosomeProfilePipeline/06_Proteomaps.py
2
24831
from __future__ import division import os import pandas as pd from natsort import natsorted from f02_RiboDataModule import * from Modules.f05_IDConvert import addGeneIDorNameForDESeqResult signalP_path = '/data/shangzhong/RibosomeProfiling/signalP_part' ribo_bam_path = '/data/shangzhong/RibosomeProfiling/Ribo_align/ba...
mit
lakshayg/tensorflow
tensorflow/contrib/metrics/python/ops/metric_ops.py
6
154353
# 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
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/scipy/integrate/odepack.py
62
9420
# Author: Travis Oliphant from __future__ import division, print_function, absolute_import __all__ = ['odeint'] from . import _odepack from copy import copy import warnings class ODEintWarning(Warning): pass _msgs = {2: "Integration successful.", 1: "Nothing was done; the integration time was 0.", ...
mit
jlegendary/scikit-learn
sklearn/covariance/tests/test_graph_lasso.py
272
5245
""" Test the graph_lasso module. """ import sys import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_less from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV, empirical_...
bsd-3-clause
dcelisgarza/phd_excercises
comp_techniques/report/report.py
1
11614
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import matplotlib.pyplot as plt import numpy as np import scipy as sc import math # Expanded the sheath class from assignment 2. I couldn't find a way to do this with abstract classes. class sheath: # Initialisation subroutine. def...
gpl-3.0
kursawe/MCSTracker
paper/Figures/Lloyds_relaxation_figure/make_lloyds_relaxation_plot.py
1
11632
# Copyright 2016 Jochen Kursawe. See the LICENSE file at the top-level directory # of this distribution and at https://github.com/kursawe/MCSTracker/blob/master/LICENSE. """This tests our first tracking example """ import mesh from mesh import Node from mesh import Element from mesh import Mesh import tracking import...
bsd-3-clause
epruesse/ymp
src/ymp/stage/project.py
1
22404
"""This module defines "Project", a Stage type defined by a project matrix file giving units and meta data for input files. """ import logging import os import re from collections.abc import Mapping, Sequence import sqlite3 from typing import List, Union, Dict, Set, Optional import ymp from ymp.exceptions import Ymp...
gpl-3.0
russel1237/scikit-learn
sklearn/tree/tests/test_tree.py
11
48140
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import platform import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_rand...
bsd-3-clause
akionakamura/scikit-learn
sklearn/linear_model/stochastic_gradient.py
130
50966
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import scipy.sparse as sp from abc import ABCMeta, abstractmethod from ...
bsd-3-clause
rrohan/scikit-learn
sklearn/decomposition/tests/test_nmf.py
47
8566
import numpy as np from scipy import linalg from sklearn.decomposition import nmf from scipy.sparse import csc_matrix from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_array_almost...
bsd-3-clause
JohanComparat/nbody-npt-functions
bin/bin_MD/otherScripts/vmax-function-0z1.py
1
50194
""" ls Multidark-lightcones/MD_*/properties/vmax-mvir/hist-Central*1.0*.dat ls Multidark-lightcones/MD_*/properties/vmax-mvir/hist-Central*0.9*.dat ls Multidark-lightcones/MD_*/properties/vmax-mvir/hist-Central*0.8*.dat ls Multidark-lightcones/MD_*/properties/vmax-mvir/hist-Central*0.7*.dat ls Multidark-lightcones/MD_...
cc0-1.0
henridwyer/scikit-learn
sklearn/gaussian_process/tests/test_gaussian_process.py
267
6813
""" Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # Licence: BSD 3 clause from nose.tools import raises from nose.tools import assert_true import numpy as np from sklearn.gaussian_process import GaussianProcess from sklearn.gaussian_process ...
bsd-3-clause
googleinterns/cabby
cabby/model/text/region_prediction/dataset.py
1
3358
# Copyright 2020 The Flax 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 wri...
apache-2.0
fredhusser/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause