repo_name
stringlengths
7
92
path
stringlengths
5
149
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
911
693k
license
stringclasses
15 values
girving/tensorflow
tensorflow/contrib/learn/python/learn/estimators/__init__.py
39
12688
# 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
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/tests/test_transforms.py
9
19984
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import xrange, zip import unittest from nose.tools import assert_equal, assert_raises import numpy.testing as np_test from numpy.testing import assert_almost_equal from matplotlib.tr...
mit
samuelstjean/dipy
scratch/very_scratch/diffusion_sphere_stats.py
20
18082
import nibabel import os import numpy as np import dipy as dp #import dipy.core.generalized_q_sampling as dgqs import dipy.reconst.gqi as dgqs import dipy.reconst.dti as ddti import dipy.reconst.recspeed as rp import dipy.io.pickles as pkl import scipy as sp from matplotlib.mlab import find #import dipy.core.sphere_pl...
bsd-3-clause
blab/antibody-response-pulse
bcell-array/code/Virus_Bcell_IgM_IgG_Landscape.py
1
11385
# coding: utf-8 # # Antibody Response Pulse # https://github.com/blab/antibody-response-pulse # # ### B-cells evolution --- cross-reactive antibody response after influenza virus infection or vaccination # ### Adaptive immune response for repeated infection # In[1]: ''' author: Alvason Zhenhua Li date: 04/09/201...
gpl-2.0
only4hj/fast-rcnn
lib/roi_data_layer/minibatch.py
1
22641
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Compute minibatch blobs for training a Fast R-CNN network.""" impor...
mit
rodluger/everest
docs/mcmc.py
1
2721
"""MCMC example for transit fitting.""" import matplotlib.pyplot as pl from everest import Everest, TransitModel import numpy as np import emcee from tqdm import tqdm from corner import corner def lnprior(x): """Return the log prior given parameter vector `x`.""" per, t0, b = x if b < -1 or b > 1: ...
mit
cxcsds/ciao-contrib
crates_contrib/images.py
1
4630
# # Copyright (C) 2012, 2015, 2016, 2019 # Smithsonian Astrophysical Observatory # # # 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 2 of the License, or # (at you...
gpl-3.0
rasbt/python-machine-learning-book
code/optional-py-scripts/ch05.py
1
19830
# Sebastian Raschka, 2015 (http://sebastianraschka.com) # Python Machine Learning - Code Examples # # Chapter 5 - Compressing Data via Dimensionality Reduction # # S. Raschka. Python Machine Learning. Packt Publishing Ltd., 2015. # GitHub Repo: https://github.com/rasbt/python-machine-learning-book # # License: MIT # ht...
mit
LewBurton/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
sodafree/backend
build/ipython/IPython/frontend/terminal/console/app.py
3
5217
""" A minimal application using the ZMQ-based terminal IPython frontend. This is not a complete console app, as subprocess will not be able to receive input, there is no real readline support, among other limitations. Authors: * Min RK * Paul Ivanov """ #------------------------------------------------------------...
bsd-3-clause
RachitKansal/scikit-learn
sklearn/manifold/isomap.py
229
7169
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_array from ..utils.graph import...
bsd-3-clause
alekz112/xlwings
xlwings/tests/test_xlwings.py
1
33895
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import sys import shutil import pytz import nose from nose.tools import assert_equal, raises, assert_true, assert_false, assert_not_equal from datetime import datetime, date from xlwings import Application, Workbook, Sheet, Range, Chart, ChartTy...
apache-2.0
vybstat/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
arahuja/scikit-learn
sklearn/calibration.py
12
18774
"""Calibration of predicted probabilities.""" # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Balazs Kegl <balazs.kegl@gmail.com> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Mathieu Blondel <mathieu@mblondel.org> # # License: BSD 3 clause from __future__ impo...
bsd-3-clause
dudulianangang/vps
EneConsTest.py
1
5969
import sdf import matplotlib.pyplot as plt import numpy as np import matplotlib as mpl plt.style.use('seaborn-white') # plt.rcParams['font.family'] = 'sans-serif' # plt.rcParams['font.sans-serif'] = 'Tahoma' # # plt.rcParams['font.monospace'] = 'Ubuntu Mono' plt.rcParams['font.size'] = 16 # plt.rcParams['axes.labelsiz...
apache-2.0
taknevski/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py
75
29377
# 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
pleoni/game-of-life
plot/old/test_perf_mpi/life_perf_compilers.py
1
1863
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from numpy import * import sys import datetime datafile1="life_host_icc.out" datafile2="life_host_gnu.out" datafile3="life_host_pgi.out" if len(sys.argv) > 1: datafile=sys.argv[1] plotfile="compilers_perf_eurora.png" data1 = loadtxt(datafile...
gpl-2.0
DistrictDataLabs/yellowbrick
yellowbrick/classifier/rocauc.py
1
29053
# yellowbrick.classifier.rocauc # Implements visual ROC/AUC curves for classification evaluation. # # Author: Rebecca Bilbro # Author: Benjamin Bengfort # Author: Neal Humphrey # Created: Tue May 03 18:15:42 2017 -0400 # # Copyright (C) 2016 The scikit-yb developers # For license information, see LICENSE.txt # #...
apache-2.0
Wonjuseo/Project101
others/sine_RNN.py
1
4425
import tensorflow as tf import numpy as np from sklearn.model_selection import train_test_split from sklearn.utils import shuffle def sin(x, T=100): return np.sin(2.0*np.pi*x/T) def problem(T=100,ampl=0.05): x = np.arange(0,2*T+1) noise = ampl*np.random.uniform(low=-1.0,high=1.0,size=len(x)) ...
apache-2.0
Srisai85/scikit-learn
examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
mjudsp/Tsallis
sklearn/tests/test_random_projection.py
141
14040
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.metrics import euclidean_distances from sklearn.random_projection import johnson_lindenstrauss_min_dim from sklearn.random_projection import gaussian_random_matrix from sklearn.random_projection import sparse_random_matrix from...
bsd-3-clause
mugizico/scikit-learn
sklearn/externals/joblib/__init__.py
36
4795
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
nagordon/mechpy
mechpy/composites.py
1
71681
# coding: utf-8 ''' Module for composite material analysis Hyer-Stress Analysis of Fiber-Reinforced Composite Materials Herakovich-Mechanics of Fibrous Composites Daniel-Engineering Mechanics of Composite Materials Kollar-Mechanics of COmposite Structures NASA- Basic Mechancis of Lamianted Composites ht...
mit
guziy/basemap
setup.py
1
6013
from __future__ import (absolute_import, division, print_function) import glob import io import os import sys from setuptools.dist import Distribution if sys.version_info < (2, 6): raise SystemExit("""matplotlib and the basemap toolkit require Python 2.6 or later.""") # Do not require numpy for just querying the...
gpl-2.0
YuepengGuo/zipline
zipline/history/history.py
11
11707
# # Copyright 2014 Quantopian, Inc. # # 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 wr...
apache-2.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/matplotlib/sphinxext/mathmpl.py
12
3822
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import os import sys from hashlib import md5 from docutils import nodes from docutils.parsers.rst import directives import warnings from matplotlib import rcParams from matplotlib.mathtext import ...
gpl-3.0
pylayers/pylayers
pylayers/antprop/examples/ex_signature.py
3
3411
#!/usr/bin/python #-*- coding:Utf-8 -*- import matplotlib.pyplot as plt import numpy as np import networkx as nx from pylayers.gis.layout import * from pylayers.antprop.signature import * # load the layout graphs def showr2(L,r2d,tx,rx,k,l): col = ['r','b','g','c','m','k','y'] r = r2d[str(k)] pts = r['pt'...
mit
aldian/tensorflow
tensorflow/python/estimator/inputs/queues/feeding_functions_test.py
59
13552
# 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
matbra/bokeh
examples/compat/mpl/listcollection.py
34
1602
from matplotlib.collections import LineCollection import matplotlib.pyplot as plt import numpy as np from bokeh import mpl from bokeh.plotting import output_file, show def make_segments(x, y): ''' Create list of line segments from x and y coordinates. ''' points = np.array([x, y]).T.reshape(-1, 1, 2...
bsd-3-clause
sgenoud/scikit-learn
sklearn/cluster/tests/test_dbscan.py
3
2890
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from numpy.testing import assert_equal from scipy.spatial import distance from sklearn.cluster.dbscan_ import DBSCAN, dbscan from .common import generate_clustered_data n_clusters = 3 X = generate_clustered_data(n_clusters=n_clusters) ...
bsd-3-clause
nekrut/tools-iuc
tools/vsnp/vsnp_add_zero_coverage.py
12
6321
#!/usr/bin/env python import argparse import os import re import shutil import pandas import pysam from Bio import SeqIO def get_sample_name(file_path): base_file_name = os.path.basename(file_path) if base_file_name.find(".") > 0: # Eliminate the extension. return os.path.splitext(base_file_...
mit
eduardoneira/SistemasDistribuidos_TPFinal
CentroMonitoreoCiudad/FaceRecognizer/modules/old_feature_matcher.py
1
4628
#!/bin/python3 import numpy as np import cv2 import base64 import pdb from tkinter import * from matplotlib import pyplot as plt class FeatureMatcher: __PORC_DISTANCE = 0.7 def __init__(self,feature_extractor='SURF',upright=True,min_match_count=10,threshold=400): self.MIN_MATCH_COUNT = min_match_count ...
gpl-3.0
DTOcean/dtocean-core
tests/test_data_definitions_simplepie.py
1
2601
import pytest import matplotlib.pyplot as plt from aneris.control.factory import InterfaceFactory from dtocean_core.core import (AutoFileInput, AutoFileOutput, AutoPlot, Core) from dtocean_core.data import CoreMetaData from d...
gpl-3.0
buntyke/GPy
GPy/core/gp.py
8
37031
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np import sys from .. import kern from .model import Model from .parameterization import ObsAr from .mapping import Mapping from .. import likelihoods from ..inference.latent_function_i...
mit
jiyfeng/RSTParser
model.py
1
3945
## model.py ## Author: Yangfeng Ji ## Date: 09-09-2014 ## Time-stamp: <yangfeng 11/05/2014 20:44:25> ## Last changed: umashanthi 11/19/2014 """ As a parsing model, it includes the following functions 1, Mini-batch training on the data generated by the Data class 2, Shift-Reduce RST parsing for a given text sequence 3...
mit
sinhrks/scikit-learn
examples/manifold/plot_lle_digits.py
138
8594
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
bsd-3-clause
sebp/scikit-survival
sksurv/preprocessing.py
1
3945
# 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 hope that it will be useful, # bu...
gpl-3.0
jeffknupp/arrow
python/scripts/test_leak.py
6
1847
#!/usr/bin/env python # 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 # "L...
apache-2.0
jreback/pandas
pandas/tests/io/parser/usecols/test_strings.py
6
2564
""" Tests the usecols functionality during parsing for all of the parsers defined in parsers.py """ from io import StringIO import pytest from pandas import DataFrame import pandas._testing as tm _msg_validate_usecols_arg = ( "'usecols' must either be list-like " "of all strings, all unicode, all " "inte...
bsd-3-clause
yaojenkuo/stockflow
ctrls/CandleDrawer.py
2
3513
#!/bin/python # -*- coding: utf-8 -*- import numpy as np from settings import * from datetime import datetime from ctrls.Reader import Reader import matplotlib.pyplot as plt from matplotlib.finance import candlestick_ohlc class CandleDrawer(): '''畫出近 n 天 K 線圖+Ma20布林通道+高低通道+量''' def _getBooleanBand(self, seri...
mit
allenlavoie/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py
28
5024
# 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
PatrickChrist/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
NEONScience/NEON-Data-Skills
tutorials/Python/Lidar/lidar-biomass/calc-biomass_py/calc-biomass_py.py
1
20510
#!/usr/bin/env python # coding: utf-8 # --- # syncID: e6ccf19a4b454ca594388eeaa88ebe12 # title: "Calculate Vegetation Biomass from LiDAR Data in Python" # description: "Learn to calculate the biomass of standing vegetation using a canopy height model data product." # dateCreated: 2017-06-21 # authors: Tristan Goulde...
agpl-3.0
herilalaina/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
15
11812
""" Testing Recursive feature elimination """ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris, make_friedman1 from sklearn.metrics import zero_one_loss from sk...
bsd-3-clause
antoinecarme/pyaf
setup.py
1
1126
from setuptools import setup from setuptools import find_packages with open("README.md", "r") as fh: pyaf_long_description = fh.read() setup(name='pyaf', version='3.0-RC1', description='Python Automatic Forecasting', long_description=pyaf_long_description, long_description_content_type...
bsd-3-clause
thorwhalen/ut
ml/sk/transformers.py
1
4610
__author__ = 'thor' from sklearn.base import TransformerMixin, BaseEstimator from sklearn.neighbors import KNeighborsRegressor from pandas import DataFrame import numpy as np from nltk import word_tokenize from functools import reduce class HourOfDayTransformer(TransformerMixin): def __init__(self, date_field=...
mit
HBNLdev/DataStore
db/sas_tools.py
1
2566
''' tools for working with .sas7bdat files ''' import os from collections import OrderedDict import pandas as pd from sas7bdat import SAS7BDAT from .knowledge.questionnaires import map_ph4, map_ph4_ssaga map_subject = {'core': {'file_pfixes': []}} parent_dir = '/processed_data/zork/zork-phase4-69/sessi...
gpl-3.0
saimn/astropy
astropy/visualization/wcsaxes/frame.py
8
10649
# Licensed under a 3-clause BSD style license - see LICENSE.rst import abc from collections import OrderedDict import numpy as np from matplotlib import rcParams from matplotlib.lines import Line2D, Path from matplotlib.patches import PathPatch __all__ = ['RectangularFrame1D', 'Spine', 'BaseFrame', 'RectangularFr...
bsd-3-clause
mne-tools/mne-tools.github.io
0.11/_downloads/plot_evoked_topomap.py
18
1498
""" ======================================== Plotting topographic maps of evoked data ======================================== Load evoked data and plot topomaps for selected time points. """ # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # Tal Linzen <linzen@nyu.edu> # Denis A. Engeman <...
bsd-3-clause
gracecox/MagPySV
magpysv/tests/test_tools.py
2
1568
# -*- coding: utf-8 -*- """ Created on Thu Feb 2 16:45:42 2017 Testing functions for tools.py. @author: Grace Cox and Will Brown """ import unittest import os from .. import tools import pandas as pd import datetime as dt class DataResamplingTestCase(unittest.TestCase): """Set up test case for data resampling"...
mit
kaiserroll14/301finalproject
main/pandas/tseries/timedeltas.py
9
3765
""" timedelta support tools """ import re import numpy as np import pandas.tslib as tslib from pandas import compat from pandas.core.common import (ABCSeries, is_integer_dtype, is_timedelta64_dtype, is_list_like, isnull, _ensure_object, ABCIndexClass) fro...
gpl-3.0
nikitasingh981/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
50
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
DongjunLee/kino-bot
kino/slack/plot.py
1
2684
from matplotlib import pyplot as plt import matplotlib.dates as dt import seaborn seaborn.set() import datetime class Plot(object): def __init__(self): pass def make_bar( x, y, f_name, title=None, legend=None, x_label=None, y_label=None, ...
mit
sylvchev/mdla
examples/example_benchmark_performance.py
1
6309
"""Benchmarking dictionary learning algorithms on random dataset""" from multiprocessing import cpu_count from time import time import matplotlib.pyplot as plt import numpy as np from numpy import array from numpy.linalg import norm from numpy.random import permutation, rand, randint, randn from mdla import MiniBatc...
gpl-3.0
nkhuyu/blaze
blaze/compute/core.py
5
14061
from __future__ import absolute_import, division, print_function import numbers from datetime import date, datetime import toolz from toolz import first, concat, memoize, unique, assoc import itertools from collections import Iterator from ..compatibility import basestring from ..expr import Expr, Field, Symbol, symb...
bsd-3-clause
cl4rke/scikit-learn
sklearn/svm/tests/test_sparse.py
95
12156
from nose.tools import assert_raises, assert_true, assert_false import numpy as np from scipy import sparse from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classif...
bsd-3-clause
david-ragazzi/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/axes.py
69
259904
from __future__ import division, generators import math, sys, warnings, datetime, new import numpy as np from numpy import ma import matplotlib rcParams = matplotlib.rcParams import matplotlib.artist as martist import matplotlib.axis as maxis import matplotlib.cbook as cbook import matplotlib.collections as mcoll im...
gpl-3.0
cbertinato/pandas
pandas/tests/frame/test_duplicates.py
1
14578
import numpy as np import pytest from pandas import DataFrame, Series import pandas.util.testing as tm @pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']]) def test_duplicated_with_misspelled_column_name(subset): # GH 19730 df = DataFrame({'A': [0, 0, 1], 'B': [0, 0, 1], ...
bsd-3-clause
fabioticconi/scikit-learn
benchmarks/bench_plot_lasso_path.py
301
4003
"""Benchmarks of Lasso regularization path computation using Lars and CD The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function from collections import defaultdict import gc import sys from time import time import numpy as np from sklearn.linear_model import lars_pat...
bsd-3-clause
FluidityProject/multifluids
tests/sloshing_tank/plot_freesurface.py
5
2631
#!/usr/bin/env python import settings import ana_sol import sys import math import commands import matplotlib.pyplot as plt import getopt from scipy.special import erf from numpy import poly1d from matplotlib.pyplot import figure, show from numpy import pi, sin, linspace from matplotlib.mlab import stineman_interp ...
lgpl-2.1
mupif/mupif
mupif/Field.py
1
42683
# # MuPIF: Multi-Physics Integration Framework # Copyright (C) 2010-2015 Borek Patzak # # Czech Technical University, Faculty of Civil Engineering, # Department of Structural Mechanics, 166 29 Prague, Czech Republic # # This library is free software; you can redistribute it and/or # modify i...
lgpl-3.0
miloharper/neural-network-animation
matplotlib/tests/test_ticker.py
9
4261
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import nose.tools from nose.tools import assert_raises from numpy.testing import assert_almost_equal import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker as m...
mit
marionleborgne/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/contour.py
69
42063
""" These are classes to support contour plotting and labelling for the axes class """ from __future__ import division import warnings import matplotlib as mpl import numpy as np from numpy import ma import matplotlib._cntr as _cntr import matplotlib.path as path import matplotlib.ticker as ticker import matplotlib.cm...
agpl-3.0
numenta/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/colorbar.py
69
27260
''' Colorbar toolkit with two classes and a function: :class:`ColorbarBase` the base class with full colorbar drawing functionality. It can be used as-is to make a colorbar for a given colormap; a mappable object (e.g., image) is not needed. :class:`Colorbar` the derived class ...
agpl-3.0
NDManh/numbbo
code-postprocessing/bbob_pproc/comp2/pptable2.py
3
20251
#! /usr/bin/env python # -*- coding: utf-8 -*- """Rank-sum tests table on "Final Data Points". That is, for example, using 1/#fevals(ftarget) if ftarget was reached and -f_final otherwise as input for the rank-sum test, where obviously the larger the better. One table per function and dimension. """ from __future__...
bsd-3-clause
Ziqi-Li/bknqgis
pandas/pandas/core/reshape/reshape.py
1
45812
# pylint: disable=E1101,E1103 # pylint: disable=W0703,W0622,W0613,W0201 from pandas.compat import range, zip from pandas import compat import itertools import re import numpy as np from pandas.core.dtypes.common import ( _ensure_platform_int, is_list_like, is_bool_dtype, needs_i8_conversion) from pandas.c...
gpl-2.0
winklerand/pandas
asv_bench/benchmarks/replace.py
1
2171
from .pandas_vb_common import * class replace_fillna(object): goal_time = 0.2 def setup(self): self.N = 1000000 try: self.rng = date_range('1/1/2000', periods=self.N, freq='min') except NameError: self.rng = DatetimeIndex('1/1/2000', periods=self.N, offset=date...
bsd-3-clause
mattpitkin/GraWIToNStatisticsLectures
figures/scripts/pvalue.py
1
1242
#!/usr/bin/env python """ Make plots showing how to calculate the p-value """ import matplotlib.pyplot as pl from scipy.stats import norm from scipy.special import erf import numpy as np mu = 0. # the mean, mu sigma = 1. # standard deviation x = np.linspace(-4, 4, 1000) # x # set plot to render labels using latex ...
mit
arcade-lab/tia-infrastructure
tools/simulator/system.py
1
9352
""" Top-level system wrapper. """ import re import sys import pandas as pd from simulator.exception import SimulatorException class System: """ A system class to wrap a collection of processing and memory elements as well as the channels through which they communicate. """ def __init__(self): ...
mit
gwpy/gwpy.github.io
docs/0.8.0/plotter/colors-1.py
7
1123
from __future__ import division import numpy from matplotlib import (pyplot, rcParams) from matplotlib.colors import to_hex from gwpy.plotter import colors rcParams.update({ 'text.usetex': False, 'font.size': 15 }) th = numpy.linspace(0, 2*numpy.pi, 512) names = [ 'gwpy:geo600', 'gwpy:kagra', '...
gpl-3.0
karpeev/libmesh
doc/statistics/libmesh_citations.py
1
2340
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Number of "papers using libmesh" by year. # # Note 1: this does not count citations "only," the authors must have actually # used libmesh in part of their work. Therefore, these counts do not include # things like Wolfgang citing us in his pap...
lgpl-2.1
numenta/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/mlab.py
69
104273
""" Numerical python functions written for compatability with matlab(TM) commands with the same names. Matlab(TM) compatible functions ------------------------------- :func:`cohere` Coherence (normalized cross spectral density) :func:`csd` Cross spectral density uing Welch's average periodogram :func:`detrend`...
agpl-3.0
RomainBrault/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
notkarol/banjin
experiment/python_word_matching_speed.py
1
4650
#!/usr/bin/python # Takes in a dictionary of words # Verifies that all functions return the same answers # Generates random hands from the probability of getting tiles from the bunch # Then prints out how long each function takes to find all matching words # Generates various hand sizes to see if there's any scaling ...
mit
PatrickOReilly/scikit-learn
examples/model_selection/plot_validation_curve.py
141
1931
""" ========================== Plotting Validation Curves ========================== In this plot you can see the training scores and validation scores of an SVM for different values of the kernel parameter gamma. For very low values of gamma, you can see that both the training score and the validation score are low. ...
bsd-3-clause
DSLituiev/scikit-learn
sklearn/datasets/mldata.py
309
7838
"""Automatically download MLdata datasets.""" # Copyright (c) 2011 Pietro Berkes # License: BSD 3 clause import os from os.path import join, exists import re import numbers try: # Python 2 from urllib2 import HTTPError from urllib2 import quote from urllib2 import urlopen except ImportError: # Pyt...
bsd-3-clause
mortonjt/scipy
scipy/signal/wavelets.py
23
10483
from __future__ import division, print_function, absolute_import import numpy as np from numpy.dual import eig from scipy.special import comb from scipy import linspace, pi, exp from scipy.signal import convolve __all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'cwt'] def daub(p): """ The coefficient...
bsd-3-clause
broadinstitute/cms
cms/power/power_func.py
1
8625
## functions for analyzing empirical/simulated CMS output ## last updated 09.14.2017 vitti@broadinstitute.org import matplotlib as mp mp.use('agg') import matplotlib.pyplot as plt import numpy as np import math from scipy.stats import percentileofscore ################### ## DEFINE SCORES ## ################### def...
bsd-2-clause
vshtanko/scikit-learn
examples/applications/plot_prediction_latency.py
234
11277
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
bsd-3-clause
tashaxe/Red-DiscordBot
lib/youtube_dl/extractor/wsj.py
7
4311
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, unified_strdate, ) class WSJIE(InfoExtractor): _VALID_URL = r'''(?x) (?: https?://video-api\.wsj\.com/api-vid...
gpl-3.0
DiCarloLab-Delft/PycQED_py3
pycqed/utilities/pulse_scheme.py
1
5469
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches def new_pulse_fig(figsize): ''' Open a new figure and configure it to plot pulse schemes. ''' fig, ax = plt.subplots(1, 1, figsize=figsize, frameon=False) ax.axis('off') fig.subplots_adjust(bottom=0, top=1, left=0, ri...
mit
florian-f/sklearn
examples/cluster/plot_dbscan.py
3
2634
# -*- coding: utf-8 -*- """ =================================== Demo of DBSCAN clustering algorithm =================================== Finds core samples of high density and expands clusters from them. """ print(__doc__) import numpy as np from scipy.spatial import distance from sklearn.cluster import DBSCAN from s...
bsd-3-clause
bthirion/nipy
examples/labs/need_data/localizer_glm_ar.py
3
5428
#!/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__ = """ Full step-by-step example of fitting a GLM to experimental data and visualizing the results. More specif...
bsd-3-clause
kiyoto/statsmodels
statsmodels/regression/_prediction.py
27
6035
# -*- coding: utf-8 -*- """ Created on Fri Dec 19 11:29:18 2014 Author: Josef Perktold License: BSD-3 """ import numpy as np from scipy import stats # this is similar to ContrastResults after t_test, partially copied and adjusted class PredictionResults(object): def __init__(self, predicted_mean, var_pred_mean...
bsd-3-clause
kyleam/seaborn
examples/elaborate_violinplot.py
30
1055
""" Violinplot from a wide-form dataset =================================== _thumb: .6, .45 """ import seaborn as sns import matplotlib.pyplot as plt sns.set(style="whitegrid") # Load the example dataset of brain network correlations df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0) # Pull out a...
bsd-3-clause
syagev/kaggle_dsb
luna16/src/conv_net/data.py
1
2668
from __future__ import division import numpy as np import os import pickle import glob import Image from skimage.io import imread from sklearn.cross_validation import train_test_split dataset_dir = "../../data/samples" def load(): tps = glob.glob(dataset_dir+"/*true.jpg") fps_2 = glob.glob(dataset_dir+"/*fal...
apache-2.0
phoebe-project/phoebe2-docs
2.2/tutorials/irrad_method_horvat.py
1
3005
#!/usr/bin/env python # coding: utf-8 # Lambert Scattering (irrad_method='horvat') # ============================ # # Setup # ----------------------------- # Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't wa...
gpl-3.0
salazardetroya/libmesh
doc/statistics/libmesh_citations.py
1
2340
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Number of "papers using libmesh" by year. # # Note 1: this does not count citations "only," the authors must have actually # used libmesh in part of their work. Therefore, these counts do not include # things like Wolfgang citing us in his pap...
lgpl-2.1
CI-WATER/TethysCluster
utils/scimage_12_04.py
2
17224
#!/usr/bin/env python """ This script is meant to be run inside of a ubuntu cloud image available at uec-images.ubuntu.com:: $ EC2_UBUNTU_IMG_URL=http://uec-images.ubuntu.com/precise/current $ wget $EC2_UBUNTU_IMG_URL/precise-server-cloudimg-amd64.tar.gz or:: $ wget $EC2_UBUNTU_IMG_URL/precise-server-clo...
gpl-3.0
Brett777/Predict-Churn
model_management/datascience_framework.py
1
8515
import os import io import sys import dill import copy from datetime import datetime from .evaluator import Evaluator from .utils import ( post_to_platform, get_current_notebook, strip_output, get_current_notebook, mkdir_p, ) class DataScienceFramework(object): def __init__( self, ...
mit
kristohr/pybayenv2
pybayenv/compute_average_bf.py
1
4066
#!/usr/bin/python import sys, string, re, os, commands, time, math #from scipy import stats #import scipy as sp import numpy as np #import matplotlib as mpl #from matplotlib import pyplot as plt class SNP: def __init__(self, name, num_env, t): self.name = name self.num_env = [F...
bsd-3-clause
liyu1990/sklearn
sklearn/cluster/tests/test_hierarchical.py
230
19795
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
davidgardenier/frbpoppy
tests/dm_snr/future.py
1
6523
"""Check the log N log F slope for future surveys.""" import numpy as np import matplotlib.pyplot as plt from copy import copy from frbpoppy import CosmicPopulation, Survey, LargePopulation, SurveyPopulation, hist from frbpoppy import unpickle, pprint import frbpoppy.direction_dists as did import frbpoppy.galacticops ...
mit
tu-rbo/differentiable-particle-filters
methods/dpf_kitti.py
1
43029
import os import numpy as np import sonnet as snt import tensorflow as tf import matplotlib.pyplot as plt from utils.data_utils_kitti import wrap_angle, compute_statistics, split_data, make_batch_iterator, make_repeating_batch_iterator, rotation_matrix, load_data_for_stats from utils.method_utils import atan2, compute...
mit
kc-lab/dms2dfe
dms2dfe/lib/io_ml.py
2
24058
#!usr/bin/python # Copyright 2016, Rohan Dandage <rraadd_8@hotmail.com,rohan@igib.in> # This program is distributed under General Public License v. 3. """ ================================ ``io_ml`` ================================ """ from os.path import abspath,dirname,exists,basename from os import makedirs from ...
gpl-3.0
mjgrav2001/scikit-learn
sklearn/neighbors/graph.py
208
7031
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam import warnings from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def _check_params(X, metric, p, metric_...
bsd-3-clause
russel1237/scikit-learn
examples/plot_digits_pipe.py
250
1809
#!/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
SepehrMN/nest-simulator
pynest/examples/spatial/connex_ew.py
14
2269
# -*- coding: utf-8 -*- # # connex_ew.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
alexeyum/scikit-learn
sklearn/datasets/base.py
11
23497
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import sys import shutil from os import environ...
bsd-3-clause
tdhopper/scikit-learn
sklearn/manifold/tests/test_mds.py
324
1862
import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_raises from sklearn.manifold import mds def test_smacof(): # test metric smacof using the data of "Modern Multidimensional Scaling", # Borg & Groenen, p 154 sim = np.array([[0, 5, 3, 4], ...
bsd-3-clause