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
samuelgarcia/HearingLossSimulator
hearinglosssimulator/tests/find_good_chunksize.py
1
4416
""" chunksize and backward_chunksize variables have a strong impact on the quality of backward filtering. Normally the backward stage pgc2 shoudl be done offline for the whole buffer. For online it is done chunk by chunksize. For low frequency this lead to bias the result because of side effect, so the chunksize and...
mit
lukebarnard1/bokeh
examples/charts/file/scatter.py
37
1607
from collections import OrderedDict import pandas as pd from bokeh.charts import Scatter, output_file, show, vplot from bokeh.sampledata.iris import flowers setosa = flowers[(flowers.species == "setosa")][["petal_length", "petal_width"]] versicolor = flowers[(flowers.species == "versicolor")][["petal_length", "peta...
bsd-3-clause
guillermo-carrasco/bcbio-nextgen
bcbio/utils.py
1
20334
"""Helpful utilities for building analysis pipelines. """ import gzip import os import tempfile import time import shutil import contextlib import itertools import functools import random import ConfigParser import collections import fnmatch import subprocess import sys import subprocess import toolz as tz import yaml...
mit
ssorgatem/qiime
qiime/group.py
15
35019
#!/usr/bin/env python """This module contains functions useful for obtaining groupings.""" __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Jai Ram Rideout", "Greg Caporaso", "Jeremy Widmann"] __license__ = "GPL" __version__ = "1.9.1-dev"...
gpl-2.0
ashhher3/pylearn2
pylearn2/scripts/datasets/browse_small_norb.py
44
6901
#!/usr/bin/env python import sys import argparse import pickle import warnings import exceptions import numpy try: from matplotlib import pyplot except ImportError as import_error: warnings.warn("Can't use this script without matplotlib.") pyplot = None from pylearn2.datasets import norb warnings.warn("T...
bsd-3-clause
ndchorley/scipy
scipy/stats/_binned_statistic.py
17
17622
from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib.six import callable from collections import namedtuple def binned_statistic(x, values, statistic='mean', bins=10, range=None): """ Compute a binned statistic for a set of d...
bsd-3-clause
PatrickOReilly/scikit-learn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
fbagirov/scikit-learn
examples/linear_model/plot_ard.py
248
2622
""" ================================================== Automatic Relevance Determination Regression (ARD) ================================================== Fit regression model with Bayesian Ridge Regression. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary l...
bsd-3-clause
espenhgn/nest-simulator
pynest/examples/twoneurons.py
3
1260
# -*- 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
jorik041/scikit-learn
examples/cluster/plot_lena_segmentation.py
271
2444
""" ========================================= Segmenting the picture of Lena in regions ========================================= This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogeneous regions. This procedure (spe...
bsd-3-clause
sgkang/GeophysicsToy
seismic/EOSC350widget.py
4
7381
import scipy.io import numpy as np import matplotlib.pyplot as plt def ViewWiggle(syndata, obsdata): dx = 20 fig, ax = plt.subplots(1, 2, figsize=(14, 8)) kwargs = { 'skipt':1, 'scale': 0.05, 'lwidth': 1., 'dx': dx, 'sampr': 0.004, 'clip' : dx*10., } extent = [0., 38*dx, 1.0...
mit
andyh616/mne-python
mne/viz/misc.py
13
19748
"""Functions to make simple plots with M/EEG data """ from __future__ import print_function # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com...
bsd-3-clause
run2/citytour
4symantec/Lib/site-packages/numpy-1.9.2-py2.7-win-amd64.egg/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...
mit
scottpurdy/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/ticker.py
69
37420
""" Tick locating and formatting ============================ This module contains classes to support completely configurable tick locating and formatting. Although the locators know nothing about major or minor ticks, they are used by the Axis class to support major and minor tick locating and formatting. Generic t...
agpl-3.0
THEdavehogue/glassdoor-analysis
topic_modeling.py
1
9413
import os import sys import numpy as np import pandas as pd import spacy import matplotlib.pyplot as plt from PIL import Image from clean_text import STOPLIST from wordcloud import WordCloud from itertools import combinations from progressbar import ProgressBar from sklearn.decomposition import NMF from sklearn.metrics...
gpl-3.0
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/SoftContact_NonLinHardSoftShear/Area/A_1e2/Normalized_Shear_Stress_Plot.py
48
3533
#!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as np; plt.rcParams.update({'font.size': 28}) # set tick width mpl.rcParams['xtick.major.size'] = 10 mpl.rcParams['xtick.major.width'] = 5 mpl.rcParams['xtick.minor.size'] = 10 mpl.rcParams['xtick.minor.width...
cc0-1.0
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/examples/svm/plot_svm_kernels.py
1
1969
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM-Kernels ========================================================= Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially useful when the data-points are not linearly sep...
mit
mhdella/scikit-learn
sklearn/datasets/species_distributions.py
198
7923
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
lthurlow/Boolean-Constrained-Routing
networkx-1.8.1/networkx/readwrite/tests/test_gml.py
35
3099
#!/usr/bin/env python import io from nose.tools import * from nose import SkipTest import networkx class TestGraph(object): @classmethod def setupClass(cls): global pyparsing try: import pyparsing except ImportError: try: import matplotlib.pyparsi...
mit
LindaLS/Sausage_Biscuits
architecture/examples/2_nn_autoencoer/load.py
6
1484
# Example implementing 5 layer encoder # Original code taken from # https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/autoencoder.py # First train a model using train.py from __future__ import division, print_function, absolute_import # Import MNIST data from tensorflow.exampl...
gpl-3.0
appapantula/scikit-learn
sklearn/preprocessing/__init__.py
268
1319
""" The :mod:`sklearn.preprocessing` module includes scaling, centering, normalization, binarization and imputation methods. """ from ._function_transformer import FunctionTransformer from .data import Binarizer from .data import KernelCenterer from .data import MinMaxScaler from .data import MaxAbsScaler from .data ...
bsd-3-clause
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/sklearn/neighbors/nearest_centroid.py
25
7219
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..ext...
mit
bavardage/statsmodels
statsmodels/sandbox/km_class.py
5
11704
#a class for the Kaplan-Meier estimator import numpy as np from math import sqrt import matplotlib.pyplot as plt class KAPLAN_MEIER(object): def __init__(self, data, timesIn, groupIn, censoringIn): raise RuntimeError('Newer version of Kaplan-Meier class available in survival2.py') #store the inputs...
bsd-3-clause
scikit-beam/scikit-beam-examples
demos/xrf/demo_xrf_spectrum.py
5
5373
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # @author: Li Li (lili@bnl.g...
bsd-3-clause
atmtools/typhon
typhon/tests/plots/test_colors.py
1
4724
# -*- coding: utf-8 -*- """Testing the functions in typhon.plots.colors. """ import filecmp import os from tempfile import mkstemp import matplotlib.pyplot as plt import matplotlib.colors as mcolors import numpy as np import pytest from typhon.plots import colors class TestColors: """Testing the cm functions.""...
mit
ndingwall/scikit-learn
sklearn/decomposition/_base.py
5
5517
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <denis-alexander.engemann@inria.fr> # Kyle Kastner <kastnerkyle@gmail.com> ...
bsd-3-clause
johnwu93/find_best_mall
recomendation system/nmf_analysis.py
3
2993
__author__ = 'John' #from mall_count_dataset import dict as data import re import numpy as np from sklearn import decomposition from numpy import linalg as LA def get_category_matrix(data): #get the category count matrix from the joe jean dataset. #This dataset is clean #constants category_size = 0 ...
mit
brenoec/cefetmg.msc.influence.networks
simulation/pycxsimulator.py
1
12602
## "pycxsimulator.py" ## Realtime Simulation GUI for PyCX ## ## Developed by: ## Chun Wong ## email@chunwong.net ## ## Revised by: ## Hiroki Sayama ## sayama@binghamton.edu ## ## Copyright 2012 Chun Wong & Hiroki Sayama ## ## Simulation control & GUI extensions ## Copyright 2013 Przemyslaw Szufel & Bogumi...
mit
rdipietro/tensorflow
tensorflow/python/client/notebook.py
33
4608
# Copyright 2015 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
tzulitai/flink
flink-python/pyflink/table/tests/test_pandas_udf.py
1
18807
################################################################################ # 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...
apache-2.0
IssamLaradji/scikit-learn
sklearn/tests/test_common.py
5
16372
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
bsd-3-clause
sknepneklab/SAMoS
analysis/plot_analysis_nematic/angle_plot_pretty_phi.py
1
7874
# * ************************************************************* # * # * Soft Active Mater on Surfaces (SAMoS) # * # * Author: Rastko Sknepnek # * # * Division of Physics # * School of Engineering, Physics and Mathematics # * University of Dundee # * # * (c) 2013, 2014 # * # * School of Scienc...
gpl-3.0
alanmcruickshank/superset-dev
tests/viz_tests.py
1
23862
from datetime import datetime import unittest from mock import Mock, patch import pandas as pd import superset.utils as utils from superset.utils import DTTM_ALIAS import superset.viz as viz class BaseVizTestCase(unittest.TestCase): def test_constructor_exception_no_datasource(self): form_data = {} ...
apache-2.0
abhishekkrthakur/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
effigies/mne-python
examples/realtime/ftclient_rt_average.py
2
2816
""" ======================================================== Compute real-time evoked responses with FieldTrip client ======================================================== This example demonstrates how to connect the MNE real-time system to the Fieldtrip buffer using FieldTripClient class. This example was tested ...
bsd-3-clause
Mctigger/KagglePlanetPytorch
find_best_threshold.py
1
1496
import numpy as np from sklearn.metrics import fbeta_score, make_scorer import itertools import pathos.multiprocessing def fbeta(true_label, prediction): return fbeta_score(true_label, prediction, beta=2, average='samples') def optimise_f2_thresholds_fast(y, p, iterations=100, verbose=True): best_threshold =...
mit
schae234/gingivere
tests/test_lr.py
2
1117
from sklearn.linear_model import LinearRegression from sklearn.cross_validation import StratifiedKFold import numpy as np from sklearn.metrics import classification_report from sklearn.metrics import roc_auc_score from tests import shelve_api XX, yy = shelve_api.load('lr') X = XX[2700:] y = yy[2700:] clf = LinearRe...
mit
xguse/scikit-bio
skbio/stats/distance/_bioenv.py
12
9577
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
jbedorf/tensorflow
tensorflow/contrib/learn/python/learn/grid_search_test.py
137
2035
# 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
iszlai/sklearn_pycon2015
notebooks/fig_code/sgd_separator.py
54
1148
import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import SGDClassifier from sklearn.datasets.samples_generator import make_blobs def plot_sgd_separator(): # we create 50 separable points X, Y = make_blobs(n_samples=50, centers=2, random_state=0, cluster_std=0.60...
bsd-3-clause
lesserwhirls/scipy-cwt
scipy/signal/cwt.py
1
25837
import numpy as np from scipy.fftpack import fft, ifft, fftshift __all__ = ['cwt', 'ccwt', 'icwt', 'SDG', 'Morlet'] class MotherWavelet(object): """Class for MotherWavelets. Contains methods related to mother wavelets. Also used to ensure that new mother wavelet objects contain the minimum requirements ...
bsd-3-clause
booya-at/paraBEM
examples/plots/far_field_error_src.py
2
1317
# -*- coding: utf-8 -*- import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import parabem from parabem.pan3d import src_3_0_vsaero, src_3_0_n0 from parabem.utils import check_path pnt1 = parabem.PanelVector3(-0.5, -0.5, 0) pnt2 = parabem.PanelVector3(0.5, -0.5, 0) pnt3 = parabe...
gpl-3.0
pannarale/pycbc
pycbc/results/followup.py
6
4568
# Copyright (C) 2014 Alex Nitz # # This program 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. # # This program is distributed in the ...
gpl-3.0
WangWenjun559/Weiss
classifier/daily_train.py
1
1788
""" This file builds a model from training data, which can be incorporated into daily pipeline. =========================================================================================== TODO(wenjunw@cs.cmu.edu): - change the path of training file, its transformed feature file, and the model file currently these fi...
apache-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/util/clipboard/__init__.py
7
3420
""" Pyperclip A cross-platform clipboard module for Python. (only handles plain text for now) By Al Sweigart al@inventwithpython.com BSD License Usage: import pyperclip pyperclip.copy('The text to be copied to the clipboard.') spam = pyperclip.paste() if not pyperclip.copy: print("Copy functionality unav...
gpl-3.0
dhermes/bezier
src/python/bezier/curved_polygon.py
1
9291
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
ruymanengithub/vison
vison/flat/BF01aux.py
1
6503
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Auxiliary Functions and resources to BF01. Created on Tue Jul 31 17:50:00 2018 :author: Ruyman Azzollini """ # IMPORT STUFF from pdb import set_trace as stop import numpy as np import os from collections import OrderedDict import string as st import pandas as pd ...
gpl-3.0
siou83/trading-with-python
sandbox/spreadCalculations.py
78
1496
''' Created on 28 okt 2011 @author: jev ''' from tradingWithPython import estimateBeta, Spread, returns, Portfolio, readBiggerScreener from tradingWithPython.lib import yahooFinance from pandas import DataFrame, Series import numpy as np import matplotlib.pyplot as plt import os symbols = ['SPY','...
bsd-3-clause
chengjunjian/tushare
tushare/util/dateu.py
27
2184
# -*- coding:utf-8 -*- import datetime import pandas as pd def year_qua(date): mon = date[5:7] mon = int(mon) return[date[0:4], _quar(mon)] def _quar(mon): if mon in [1, 2, 3]: return '1' elif mon in [4, 5, 6]: return '2' elif mon in [7, 8, 9]: ...
bsd-3-clause
magnunor/hyperspy
hyperspy/misc/holography/tools.py
4
3063
# -*- coding: utf-8 -*- # Copyright 2007-2017 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
sgrid/pysgrid
demos/basic_interp.py
3
2452
import numpy as np import matplotlib.pyplot as plt import pysgrid node_lon = np.array(([1, 3, 5], [1, 3, 5], [1, 3, 5])) node_lat = np.array(([1, 1, 1], [3, 3, 3], [5, 5, 5])) edge2_lon = np.array(([0, 2, 4, 6], [0, 2, 4, 6], [0, 2, 4, 6])) edge2_lat = np.array(([1, 1, 1, 1], [3, 3, 3, 3], [5, 5, 5, 5])) edge1_lon = n...
bsd-3-clause
lucalianas/openmicroscopy
components/tools/OmeroPy/src/omero/install/jvmcfg.py
2
16253
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # th...
gpl-2.0
LLNL/spack
var/spack/repos/builtin/packages/py-misopy/package.py
5
1114
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyMisopy(PythonPackage): """MISO (Mixture of Isoforms) is a probabilistic framework that ...
lgpl-2.1
rkuchan/Tax-Calculator
taxcalc/tests/test_records.py
3
1742
import os import sys CUR_PATH = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(CUR_PATH, "../../")) import numpy as np from numpy.testing import assert_array_equal import pandas as pd import pytest import tempfile from numba import jit, vectorize, guvectorize from taxcalc import * from taxcalc....
mit
VisualComputingInstitute/towards-reid-tracking
track.py
1
15761
#TODO: comments/doc import numpy as np from filterpy.kalman import KalmanFilter import scipy from scipy import ndimage from scipy import signal from scipy.linalg import block_diag,inv from filterpy.common import Q_discrete_white_noise from filterpy.stats import plot_covariance_ellipse import matplotlib.pyplot as plt f...
mit
Srisai85/scikit-learn
sklearn/setup.py
225
2856
import os from os.path import join import warnings def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError import numpy libraries = [] if os.name == 'posix': libraries.appe...
bsd-3-clause
prabhjyotsingh/incubator-zeppelin
python/src/main/resources/python/mpl_config.py
41
3653
# 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 use ...
apache-2.0
ddboline/pylearn2
pylearn2/scripts/plot_monitor.py
37
10204
#!/usr/bin/env python """ usage: plot_monitor.py model_1.pkl model_2.pkl ... model_n.pkl Loads any number of .pkl files produced by train.py. Extracts all of their monitoring channels and prompts the user to select a subset of them to be plotted. """ from __future__ import print_function __authors__ = "Ian Goodfell...
bsd-3-clause
codematician/study
study/ml/tests/test_classifiers.py
1
3754
import unittest import pandas as pd from study.ml.classifiers import DecisionTreeClassifier, LookUpClassifier, MajorityClassifier class ClassifierBaseTest(unittest.TestCase): data1_df = pd.DataFrame({'one': [1., 2., 3., 4.], 'two': [1., 3., 2., 1.]}) class TestDecisionTreeClassif...
apache-2.0
kikimaroca/beamtools
beamtools/dev/specplot.py
1
1194
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 8 17:47:28 2018 @author: cpkmanchee """ import numpy as np import matplotlib.pyplot as plt import beamtools as bt from matplotlib.gridspec import GridSpec show_plt = True save_plt = False dpi=600 wlim = [1005,1065] f_sp ='/Users/cpkmanchee/Googl...
mit
davidsamu/seal
seal/io/convert.py
1
2457
""" Functions related to converting TPLCell data into Seal data. @author: David Samu """ import os import pandas as pd from seal.util import util, constants from seal.object import unit, unitarray def task_TPL_to_Seal(f_tpl, f_seal, task, rec_info): """Convert TPLCell data to Seal data of single task.""" ...
gpl-3.0
KarlTDebiec/Moldynplot
moldynplot/PDistFigureManager.py
2
15841
#!/usr/bin/python # -*- coding: utf-8 -*- # moldynplot.PDistFigureManager.py # # Copyright (C) 2015-2017 Karl T Debiec # All rights reserved. # # This software may be modified and distributed under the terms of the # BSD license. See the LICENSE file for details. """ Generates probability distribution figures...
bsd-3-clause
clingsz/GAE
misc/cv/collect_ND5_3.py
1
12374
# -*- coding: utf-8 -*- """ Created on Fri Mar 24 10:53:51 2017 @author: cling """ # collect ND5_3 import misc.cv.exp_test as exp_test from misc.utils import saveobj,getJobOpts,loadobj,spearmancorr import numpy from misc.data_gen import DataOpts,load_data import misc.data_gen as data_gen from gae.model.trainer impor...
gpl-3.0
grlee77/scipy
scipy/stats/_discrete_distns.py
2
50643
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from functools import partial from scipy import special from scipy.special import entr, logsumexp, betaln, gammaln as gamln, zeta from scipy._lib._util import _lazywhere, rng_integers from numpy import floor, ceil, ...
bsd-3-clause
terentjew-alexey/market-analysis-system
data/create_picture.py
1
1393
import time import numpy as np import matplotlib.pyplot as plt plt.style.use('dark_background') from mas_tools.data import timeseries_to_img lpath = 'E:/Projects/market-analysis-system/data/transformed/' spath = 'E:/Projects/market-analysis-system/data/test/' fn = 'GBPUSD240' window = 50 new_data = np.genfromtxt(lp...
mit
AnasGhrab/scikit-learn
sklearn/mixture/tests/test_dpgmm.py
261
4490
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
bsd-3-clause
darcyabjones/bioplotlib
bioplotlib/collections.py
1
14622
""" Extension of matplotlib collections. Classes for the efficient drawing of large collections of objects that share most properties, e.g., a large number of line segments or polygons. The classes are not meant to be as flexible as their single element counterparts (e.g., you may not be able to select all line style...
bsd-3-clause
dogwood008/DeepFX
histdata_converter.py
1
2444
# coding: utf-8 # In[ ]: # histdata.comでDLした1分足のデータを任意の足に変換する # http://www.histdata.com/download-free-forex-historical-data/?/ascii/1-minute-bar-quotes/usdjpy/2017/10 # In[ ]: import pandas as pd import numpy as np from hist_data import HistData, BitcoinHistData # In[ ]: def get_new_index(old_dataframe, fr...
mit
sys-bio/tellurium
examples/notebooks-py/tellurium_stochastic.py
2
2082
# coding: utf-8 # Back to the main [Index](../index.ipynb) # #### Stochastic simulation # # Stochastic simulations can be run by changing the current integrator type to 'gillespie' or by using the `r.gillespie` function. # In[1]: #!!! DO NOT CHANGE !!! THIS FILE WAS CREATED AUTOMATICALLY FROM NOTEBOOKS !!! CHANGE...
apache-2.0
saulberardo/MagikEDA
test/univarTest.py
1
1687
""" Test Case for module univar.py """ import unittest import matplotlib.pyplot as plt import pandas as pd import numpy as np from magikeda import univar class UnivarTestCase(unittest.TestCase): def test_plot_bar_chart(self): # Test series with categorical data d1 = pd.Series(pd.Categorical(['...
gpl-2.0
Lawrence-Liu/scikit-learn
sklearn/preprocessing/tests/test_label.py
156
17626
import numpy as np from scipy.sparse import issparse from scipy.sparse import coo_matrix from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils.multiclass import type_of_target from sklearn.utils.testing impor...
bsd-3-clause
shikhardb/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
jakereimer/pipeline
python/pipeline/legacy/aodtrk.py
6
18511
import datajoint as dj import pandas as pd from . import aodpre import warnings from IPython import embed import glob import numpy as np import dateutil.parser from . import utils import cv2 import os,shutil try: from pupil_tracking.pupil_tracker_aod import PupilTracker except ImportError: warnings.warn("Failed...
lgpl-3.0
yavalvas/yav_com
build/matplotlib/examples/api/custom_projection_example.py
9
18246
from __future__ import unicode_literals import matplotlib from matplotlib.axes import Axes from matplotlib.patches import Circle from matplotlib.path import Path from matplotlib.ticker import NullLocator, Formatter, FixedLocator from matplotlib.transforms import Affine2D, BboxTransformTo, Transform from matplotlib.pro...
mit
SanketDG/networkx
examples/graph/napoleon_russian_campaign.py
44
3216
#!/usr/bin/env python """ Minard's data from Napoleon's 1812-1813 Russian Campaign. http://www.math.yorku.ca/SCS/Gallery/minard/minard.txt """ __author__ = """Aric Hagberg (hagberg@lanl.gov)""" # Copyright (C) 2006 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <sw...
bsd-3-clause
facebookincubator/prophet
python/prophet/forecaster.py
2
64372
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function import logging from collections import OrderedDict, d...
bsd-3-clause
jreback/pandas
pandas/tests/indexes/multi/test_sorting.py
1
8730
import random import numpy as np import pytest from pandas.errors import PerformanceWarning, UnsortedIndexError from pandas import CategoricalIndex, DataFrame, Index, MultiIndex, RangeIndex import pandas._testing as tm from pandas.core.indexes.frozen import FrozenList def test_sortlevel(idx): tuples = list(idx...
bsd-3-clause
kiyoto/statsmodels
statsmodels/stats/tests/test_panel_robustcov.py
34
2750
# -*- coding: utf-8 -*- """Test for panel robust covariance estimators after pooled ols this follows the example from xtscc paper/help Created on Tue May 22 20:27:57 2012 Author: Josef Perktold """ from statsmodels.compat.python import range, lmap import numpy as np from numpy.testing import assert_almost_equal fro...
bsd-3-clause
henrykironde/scikit-learn
sklearn/feature_selection/variance_threshold.py
238
2594
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: 3-clause BSD import numpy as np from ..base import BaseEstimator from .base import SelectorMixin from ..utils import check_array from ..utils.sparsefuncs import mean_variance_axis from ..utils.validation import check_is_fitted class VarianceThreshold(BaseEstim...
bsd-3-clause
lavizhao/Tyrion
learner.py
1
4231
#coding: utf-8 ''' 这个是学习的主要文件 ''' from data import load_label,load_data,load_data_total from scipy.sparse import csr_matrix import numpy as np from sklearn.naive_bayes import GaussianNB as NB from sklearn import linear_model from sklearn import svm from sklearn.ensemble import RandomForestClassifier as RF from skle...
mit
akiradeveloper/blktrace
btt/btt_plot.py
8
13237
#! /usr/bin/env python # # btt_plot.py: Generate matplotlib plots for BTT generate data files # # (C) Copyright 2009 Hewlett-Packard Development Company, L.P. # # This program 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 So...
gpl-2.0
bikong2/scikit-learn
examples/covariance/plot_robust_vs_empirical_covariance.py
248
6359
r""" ======================================= Robust vs Empirical covariance estimate ======================================= The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers in the data set. In such a case, it would be better to use a robust estimator of covariance to guar...
bsd-3-clause
hrjn/scikit-learn
examples/decomposition/plot_pca_iris.py
49
1511
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f...
bsd-3-clause
rohanp11/IITIGNSSR
src/vtecvtime.py
1
7938
# Imports import os,copy,csv import numpy as np import pandas as pd import matplotlib.pyplot as plt from math import radians,sin from datetime import date, timedelta as td # Function to cheak if leap year def checkleap(year): return ((year % 400 == 0) or ((year % 4 == 0) and (year % 100 != 0))) # Date of the year Co...
mit
lenovor/scikit-learn
sklearn/preprocessing/label.py
35
28877
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Joel Nothman <joel.nothman@gmail.com> # Hamzeh Alsalhi <ha258@cornell.edu> # Licens...
bsd-3-clause
Parallel-in-Time/pySDC
pySDC/playgrounds/deprecated/Dedalus/dynamo_playground.py
1
4660
import numpy as np import sys import matplotlib.pyplot as plt from mpi4py import MPI from pySDC.helpers.stats_helper import filter_stats, sort_stats from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right from pySDC.implementations.controller_classes.controller_MPI import controlle...
bsd-2-clause
phdowling/scikit-learn
examples/neighbors/plot_species_kde.py
282
4059
""" ================================================ Kernel Density Estimate of Species Distributions ================================================ This shows an example of a neighbors-based query (in particular a kernel density estimate) on geospatial data, using a Ball Tree built upon the Haversine distance metric...
bsd-3-clause
kdebrab/pandas
pandas/tests/sparse/test_combine_concat.py
3
15360
# pylint: disable-msg=E1101,W0612 import pytest import numpy as np import pandas as pd import pandas.util.testing as tm import itertools class TestSparseSeriesConcat(object): def test_concat(self): val1 = np.array([1, 2, np.nan, np.nan, 0, np.nan]) val2 = np.array([3, np.nan, 4, 0, 0]) ...
bsd-3-clause
JsNoNo/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
jjx02230808/project0223
examples/ensemble/plot_forest_iris.py
335
6271
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
bsd-3-clause
andaag/scikit-learn
sklearn/neighbors/approximate.py
128
22351
"""Approximate nearest neighbor search""" # Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk> # Joel Nothman <joel.nothman@gmail.com> import numpy as np import warnings from scipy import sparse from .base import KNeighborsMixin, RadiusNeighborsMixin from ..base import BaseEstimator from ..utils.va...
bsd-3-clause
jacenkow/beard-server
beard_server/modules/predictor/arxiv.py
2
8502
# -*- coding: utf-8 -*- # # This file is part of Inspire. # Copyright (C) 2016 CERN. # # Inspire 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 (at your option) any later...
gpl-2.0
gfyoung/pandas
pandas/tests/scalar/test_na_scalar.py
4
7335
import pickle import numpy as np import pytest from pandas._libs.missing import NA from pandas.core.dtypes.common import is_scalar import pandas as pd import pandas._testing as tm def test_singleton(): assert NA is NA new_NA = type(NA)() assert new_NA is NA def test_repr(): assert repr(NA) == "<...
bsd-3-clause
VirusTotal/msticpy
msticpy/sectools/syslog_utils.py
1
9857
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """ syslog...
mit
addfor/addutils
addutils/palette.py
1
5095
# The MIT License (MIT) # # Copyright (c) 2015 addfor s.r.l. # # 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, copy, m...
mit
liangz0707/scikit-learn
sklearn/ensemble/tests/test_bagging.py
72
25573
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause import numpy as np from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.te...
bsd-3-clause
BeiLuoShiMen/nupic
examples/opf/tools/MirrorImageViz/mirrorImageViz.py
50
7221
# ---------------------------------------------------------------------- # 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...
agpl-3.0
marionleborgne/nupic.research
projects/sequence_prediction/continuous_sequence/run_adaptive_filter.py
12
5310
# ---------------------------------------------------------------------- # 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
parenthetical-e/pyentropy
docs/sphinxext/inheritance_diagram.py
98
13648
""" Defines a docutils directive for inserting inheritance diagrams. Provide the directive with one or more classes or modules (separated by whitespace). For modules, all of the classes in that module will be used. Example:: Given the following classes: class A: pass class B(A): pass class C(A): pass ...
gpl-2.0
romanorac/discomll
discomll/tests/tests_classification.py
1
4525
import unittest import numpy as np import Orange from disco.core import result_iterator import datasets class Tests_Classification(unittest.TestCase): @classmethod def setUpClass(self): import chunk_testdata from disco import ddfs ddfs = ddfs.DDFS() if not ddfs.exists("test:...
apache-2.0