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
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/matplotlib/tests/test_rcparams.py
2
18156
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import io import os import warnings from collections import OrderedDict from cycler import cycler, Cycler import pytest try: from unittest import mock except ImportError: import mock impor...
mit
lancezlin/ml_template_py
lib/python2.7/site-packages/matplotlib/backends/backend_svg.py
8
46393
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six from matplotlib.externals.six.moves import xrange from matplotlib.externals.six import unichr import os, base64, tempfile, gzip, io, sys, codecs, re import numpy as np fr...
mit
ankurankan/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
9
15843
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_raises, assert_rais...
bsd-3-clause
vibhorag/scikit-learn
examples/cluster/plot_lena_compress.py
271
2229
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Vector Quantization Example ========================================================= The classic image processing example, Lena, an 8-bit grayscale bit-depth, 512 x 512 sized image, is used here to illustrate how ...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/utils/introspection/jedi_plugin.py
2
10430
# -*- coding: utf-8 -*- # # Copyright © 2013 The Spyder Development Team # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """ Jedi Introspection Plugin """ import re import os.path as osp import sys import time import threading from spyderlib import dependencies from spyderlib.b...
gpl-3.0
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/matplotlib/tests/test_arrow_patches.py
10
1078
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison import matplotlib def draw_arrow(ax, t, r): ax.annotate('', xy=(0.5, 0.5 + r), xytext=(0.5, 0.5), siz...
gpl-2.0
jseabold/statsmodels
statsmodels/base/tests/test_data.py
2
35946
from statsmodels.compat.pandas import assert_series_equal, assert_frame_equal,\ make_dataframe import numpy as np from numpy.testing import assert_equal, assert_, assert_raises import pandas as pd import pytest from statsmodels.base import data as sm_data from statsmodels.formula import handle_formula_data from s...
bsd-3-clause
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/HTSeq-0.6.1p1-py2.7-linux-x86_64.egg/HTSeq/scripts/qa.py
5
7729
#!/usr/bin/env python # HTSeq_QA.py # # (c) Simon Anders, European Molecular Biology Laboratory, 2010 # released under GNU General Public License import sys, time, os.path, optparse from itertools import * import numpy import HTSeq def main(): try: import matplotlib except ImportError: sys.stderr....
apache-2.0
sssllliang/edx-analytics-pipeline
edx/analytics/tasks/tests/acceptance/test_internal_reporting_course.py
2
3061
""" End to end test of the internal reporting course table loading task. Testing strategy: the mock results of the course structure API will contain 2 courses, while there will be another course that has enrollments but does not appear in the course structure API. All three should appear ...
agpl-3.0
quheng/scikit-learn
examples/manifold/plot_manifold_sphere.py
258
5101
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
olivierverdier/odelab
tests/test_solver.py
1
8194
# -*- coding: utf-8 -*- from __future__ import division from odelab.scheme.rungekutta import * from odelab.scheme.generallinear import * from odelab.scheme import * from odelab.scheme.classic import * from odelab.scheme.exponential import * from odelab.store import Store, PyTableStore, SimpleStore from odelab.system...
bsd-3-clause
mbrner/funfolding
funfolding/pipeline/_feature_selection.py
1
21664
import time import numpy as np from sklearn.metrics import log_loss from concurrent.futures import ProcessPoolExecutor import funfolding as ff def __train_eval__(idx, X_train, y_train, X_validation, y_validation, binning,...
mit
grhawk/ASE
doc/exercises/siesta1/answer1.py
5
1198
# -*- coding: utf-8 -*- # creates: ener.png distance.png angle.png import os import matplotlib #matplotlib.use('Agg') import pylab as plt e_s = [0.01,0.1,0.2,0.3,0.4,0.5] E = [-463.2160, -462.9633, -462.4891, -462.0551, -461.5426, -461.1714] d = [1.1131, 1.1046, 1.0960, 1.0901, 1.0857, 1.0810] alpha = [100...
gpl-2.0
SlashDK/PennApps-XIV
ChristiansPythonLib/doc.py
1
10718
""" @mainpage Intro <div> <a name="topOfPage"></a> This is a collection of open source Python scripts that I found useful for analyzing data from human and mammalian vocalizations, and for generating aesthetically pleasing graphs and videos, to be used in publications and presentations/lectures. </div> <div> To date,...
gpl-3.0
grundgruen/powerline
powerline/utils/tradingcalendar_epex.py
2
2047
""" Defines trading days and trading times for the EPEX market. """ import pandas as pd from datetime import datetime, timedelta from zipline.utils.tradingcalendar import end, canonicalize_datetime __author__ = "Warren" canonicalize_datetime = canonicalize_datetime start = pd.Timestamp('2011-01-01', tz='UTC') end...
apache-2.0
atantet/transferCZ
plot/plotEigVecSection.py
1
7135
import os import numpy as np import matplotlib.pyplot as plt import pylibconfig2 import ergoPlot configFile = '../cfg/transferCZ.cfg' cfg = pylibconfig2.Config() cfg.read_file(configFile) fileFormat = cfg.general.fileFormat # Transition lag if (hasattr(cfg.stat, 'tauDimPlot')): tauDim = cfg.stat.tauDimPlot else: ...
gpl-2.0
gauteh/ibcao_py
ibcao/tests/test_depth_interp.py
1
2474
# encoding: utf-8 import common from common import outdir, TRAVIS import logging as ll import unittest as ut from ibcao import * import cartopy.crs as ccrs import matplotlib import matplotlib.pyplot as plt import os import os.path class IbcaoDepthTest (ut.TestCase): def setUp (self): self.i = IBCAO () def...
lgpl-3.0
YosefLab/scVI
scvi/data/_preprocessing.py
1
10183
import logging from typing import Optional import anndata import numpy as np import pandas as pd import torch from scvi._utils import track from ._utils import _check_nonnegative_integers logger = logging.getLogger(__name__) @torch.no_grad() def poisson_gene_selection( adata, layer: Optional[str] = None, ...
bsd-3-clause
mikeireland/chronostar
projects/scocen/galaxy_ages.py
1
8478
""" Plot ScoCen in (l, b) coordinates, stars for each component with different colours resembling component age. """ import numpy as np from astropy.table import Table from astropy import units as u import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.cm as cm import matplotlib as mpl i...
mit
NerdWalletOSS/Q
ML/DT/python/DTree_sklearn_titanic.py
1
1694
# coding: utf-8 # In[13]: import sklearn_dt_utils as utils from sklearn.tree import export_graphviz import os # In[14]: q_src_dir = os.getenv('Q_SRC_ROOT') if not q_src_dir: print("'Q_SRC_ROOT' is not set") exit(-1) csv_file_path = "%s/ML/KNN/data/titanic/titanic_train.csv" % q_src_dir csv_file_path = ...
mit
MartinDelzant/scikit-learn
examples/decomposition/plot_faces_decomposition.py
103
4394
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """...
bsd-3-clause
tmhm/scikit-learn
sklearn/datasets/tests/test_20news.py
280
3045
"""Test the 20news downloader, if the data is available.""" import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import SkipTest from sklearn import datasets def test_20news(): try: data = dat...
bsd-3-clause
henryhallam/libswiftnav-python
setup.py
1
3686
#!/usr/bin/env python """ ============ Installation ============ Requirements ============ libswiftnav-python has the following requirements, they must be installed before building and installing libswiftnav-python: - `Python <http://www.python.org/>`_ 2.6 or 2.7 - `Numpy <http://www.numpy.org/>`_ 1.6 or later - ...
lgpl-3.0
mdrumond/tensorflow
tensorflow/examples/learn/text_classification.py
17
6649
# 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 appl...
apache-2.0
paulthulstrup/moose
test/tests/time_integrators/convergence/implicit_plot.py
12
5535
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Use fonts that match LaTeX from matplotlib import rcParams rcParams['font.family'] = 'serif' rcParams['font.size'] = 17 rcParams['font.serif'] = ['Computer Modern Roman'] rcParams['text.usetex'] = True # Small font size for the legend from mat...
lgpl-2.1
conversationai/wikidetox
experimental/conversation_go_awry/prediction_utils/repeat_features.py
1
5425
""" Copyright 2017 Google 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 writing, software dis...
apache-2.0
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/signal/ltisys.py
1
122846
""" ltisys -- a collection of classes and functions for modeling linear time invariant systems. """ from __future__ import division, print_function, absolute_import # # Author: Travis Oliphant 2001 # # Feb 2010: Warren Weckesser # Rewrote lsim2 and added impulse2. # Apr 2011: Jeffrey Armstrong <jeff@approximatrix.co...
mit
ardiya/siamesenetwork-tensorflow
dataset.py
1
2729
from __future__ import generators, division, absolute_import, with_statement, print_function, unicode_literals import numpy as np import matplotlib.pyplot as plt from tensorflow.keras.datasets import mnist class Dataset(object): images_train = np.array([]) images_test = np.array([]) labels_train = np.array([]) la...
mit
camroach87/pr1c3_f0r3c457
tests/testModels.py
1
9116
"""testModels.py: Trying to fit some models to the weather and price data. Also calculating some evaluation metrics. Trying to plot using pandas plot functionality. """ __author__ = "Cameron Roach" import pandas as pd import numpy as np import os import matplotlib.pyplot as plt from sklearn.ensemble import RandomFore...
mit
jakevdp/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
adamgreenhall/scikit-learn
benchmarks/bench_rcv1_logreg_convergence.py
149
7173
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import matplotlib.pyplot as plt import numpy as np import gc import time from sklearn.externals.joblib import Memory from sklearn.linear_model import (LogisticRegression, SGDClassifi...
bsd-3-clause
jniediek/mne-python
mne/viz/tests/test_decoding.py
3
3962
# Authors: Denis Engemann <denis.engemann@gmail.com> # Jean-Remi King <jeanremi.king@gmail.com> # # License: Simplified BSD import os.path as op import warnings from nose.tools import assert_raises, assert_equals import numpy as np from mne.epochs import equalize_epoch_counts, concatenate_epochs from mne.d...
bsd-3-clause
ky822/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
128
4761
""" =================================== Compare cross decomposition methods =================================== Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with multivariate response, a.k.a. PLS2 - PLSRegression, with univariate response, a.k.a. PLS1 - CCA Given 2 multivari...
bsd-3-clause
jaidevd/scikit-learn
sklearn/cluster/tests/test_mean_shift.py
48
3653
""" Testing for mean shift clustering methods """ import numpy as np import warnings from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import asser...
bsd-3-clause
RobertABT/heightmap
build/matplotlib/examples/pylab_examples/line_collection2.py
9
1327
from pylab import * from matplotlib.collections import LineCollection # In order to efficiently plot many lines in a single set of axes, # Matplotlib has the ability to add the lines all at once. Here is a # simple example showing how it is done. N = 50 x = arange(N) # Here are many sets of y to plot vs x ys = [x+i f...
mit
RayMick/scikit-learn
sklearn/decomposition/tests/test_fastica.py
272
7798
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from nose.tools import assert_raises from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from skl...
bsd-3-clause
crawfordsm/pysalt
saltfirst/SpectraViewWidget.py
2
5099
""" SpectraViewWidget is a Qt4 Widget for displaying a spectra either in terms of signal or signal to noise it expects to be given the wavelenght, flux, and sn arrays for the data """ import numpy as np from PyQt4 import QtGui, QtCore from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg from saltgui i...
bsd-3-clause
amyvmiwei/neon
neon/diagnostics/ranges_plots.py
13
3114
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
apache-2.0
cpaulik/scipy
scipy/spatial/tests/test__plotutils.py
71
1463
from __future__ import division, print_function, absolute_import from numpy.testing import dec, assert_, assert_array_equal try: import matplotlib matplotlib.rcParams['backend'] = 'Agg' import matplotlib.pyplot as plt has_matplotlib = True except: has_matplotlib = False from scipy.spatial import ...
bsd-3-clause
RazerM/orbital
examples/defining_orbits.py
1
1899
############################################## # Allow this code to be run from the examples # directory without orbital installed. from pathlib import Path import sys examples_dir = Path(__file__).parent.resolve() orbital_dir = examples_dir.parent sys.path.append(str(orbital_dir)) ####################################...
mit
anddam/trading-with-python
lib/interactivebrokers.py
77
18140
""" Copyright: Jev Kuznetsov Licence: BSD Interface to interactive brokers together with gui widgets """ import sys # import os from time import sleep from PyQt4.QtCore import (SIGNAL, SLOT) from PyQt4.QtGui import (QApplication, QFileDialog, QDialog, QVBoxLayout, QHBoxLayout, QDialogButtonBox, ...
bsd-3-clause
petroniocandido/pyFTS
pyFTS/models/seasonal/common.py
1
3693
import numpy as np import pandas as pd from enum import Enum from pyFTS.common import FuzzySet, Membership from pyFTS.partitioners import partitioner, Grid from datetime import date as dt, datetime as dtm class DateTime(Enum): """ Data and Time granularity for time granularity and seasonality identification ...
gpl-3.0
robin-lai/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
cdcapano/pycbc
pycbc/results/plot.py
4
1516
""" Plotting utilities and premade plot configurations """ def hist_overflow(val, val_max, **kwds): """ Make a histogram with an overflow bar above val_max """ import pylab, numpy overflow = len(val[val>=val_max]) pylab.hist(val[val<val_max], **kwds) if 'color' in kwds: color = kwds['colo...
gpl-3.0
moeyensj/atmo2mags
atmo2mags/atmobuilder.py
1
135489
### Necessary imports import numpy as np import os import copy import matplotlib.pyplot as plt import matplotlib.patches as mp import lsst.sims.photUtils.Sed as Sed import lsst.sims.photUtils.Bandpass as Bandpass from atmo2mags.atmo import Atmo from astroML.plotting.mcmc import convert_to_stdev from astroML.decorator...
bsd-3-clause
nhejazi/scikit-learn
examples/decomposition/plot_incremental_pca.py
175
1974
""" =============== Incremental PCA =============== Incremental principal component analysis (IPCA) is typically used as a replacement for principal component analysis (PCA) when the dataset to be decomposed is too large to fit in memory. IPCA builds a low-rank approximation for the input data using an amount of memo...
bsd-3-clause
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/sklearn/linear_model/tests/test_logistic.py
6
37696
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse import scipy from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from...
gpl-2.0
LittleRichard/sormtger
server/__init__.py
1
1750
import logging import os import sys # detect and create a variable for the root of the server package SERVER_PACKAGE_PATH = os.path.dirname(__file__) + '/' # set up logging logging.basicConfig(filename=(SERVER_PACKAGE_PATH + 'debug.log'), format='%(asctime)s:%(name)s:%(levelname)s:%(message)s', ...
gpl-3.0
yangdw/PyRepo
src/repo/extension-lib/matplotlib/ldr.py
2
2323
# coding:utf-8 """ ldr.py Display analog data from Arduino using Python (matplotlib) Author: Mahesh Venkitachalam Website: electronut.in """ #import sys, serial, argparse import sys, argparse import numpy as np from time import sleep from collections import deque import matplotlib.pyplot as plt import matplotlib.ani...
mit
aricchen/openHR
openerp/addons/resource/faces/timescale.py
170
3902
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
etkirsch/scikit-learn
sklearn/manifold/tests/test_t_sne.py
162
9771
import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises_regexp ...
bsd-3-clause
Gillu13/scipy
scipy/signal/spectral.py
28
34979
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import lombscargle import warnings from scipy._lib.six import string_types __all__ = ['periodogr...
bsd-3-clause
maupontifex/hunting_complex_poles
Hunting_complex_poles_Function_and_examples.py
1
8722
"""################################################### Python code for the paper: "Extracting an accurate model for permittivity from experimental data : Hunting complex poles from the real line" Elaborated by: Mauricio Garcia-Vergara* Guillaume Demesy Frederic Zolla Affiliation: Aix-Marseille Universite, CNRS, Ce...
gpl-3.0
ClimbsRocks/scikit-learn
examples/applications/plot_prediction_latency.py
85
11395
""" ================== 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
JPFrancoia/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
zjuela/LapSRN-tensorflow
tensorlayer/files.py
1
33051
#! /usr/bin/python # -*- coding: utf8 -*- import tensorflow as tf import os import numpy as np import re import sys import tarfile import gzip import zipfile from . import visualize from . import nlp import pickle from six.moves import urllib from six.moves import cPickle from six.moves import zip from tensorflow.pyt...
apache-2.0
google/tf-quant-finance
tf_quant_finance/experimental/finite_difference/methods.py
1
7596
# Lint as: python3 # Copyright 2019 Google LLC # # 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 agr...
apache-2.0
rishikksh20/scikit-learn
sklearn/metrics/classification.py
7
72557
"""Metrics to assess performance on classification task given class prediction Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramf...
bsd-3-clause
jmargeta/scikit-learn
sklearn/cluster/tests/test_mean_shift.py
8
2273
""" Testing for mean shift clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.cluster import MeanShift from sklearn.cluster import mean_shift from sklearn.cluster import estimate_bandwidth from sklearn.cluster import ge...
bsd-3-clause
crichardson17/emgtemp
Metals_Sims/z_u_sim_plots.py
2
17136
import matplotlib.pyplot as plt import numpy as np import urllib import matplotlib.cm as cm Low_Temp_Color = 'k' Mid_Temp_Color = 'g' High_Temp_Color = 'r' #Temp_Color = 0.5 Cloudy_Sim_Color = 'cyan' markersize = 40 SDSS_File = '/Users/compastro/jenkins/emgtemp/data/4363_gr_5_0_err_dered.csv' SDSS_Data = np.genfromtxt(...
mit
olologin/scikit-learn
sklearn/neighbors/graph.py
14
6609
"""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
wattlebird/pystruct
pystruct/tests/test_learners/test_frankwolfe_svm.py
4
2266
from tempfile import mkstemp import numpy as np from numpy.testing import assert_array_equal from nose.tools import assert_less from sklearn.datasets import load_iris from sklearn.cross_validation import train_test_split from pystruct.models import GridCRF, GraphCRF from pystruct.datasets import generate_blocks_mult...
bsd-2-clause
russel1237/scikit-learn
sklearn/tests/test_learning_curve.py
225
10791
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.learning_curve import learning_curve, validation_curve from sklearn.u...
bsd-3-clause
arjunkhode/ASP
lectures/05-Sinusoidal-model/plots-code/spec-sine-synthesis-lobe.py
24
2626
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris from scipy.fftpack import fft, ifft import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as STFT import...
agpl-3.0
hodlin/BDA_py_demos
demos_ch5/demo5_2.py
19
3326
"""Bayesian Data Analysis, 3rd ed Chapter 5, demo 2 Hierarchical model for SAT-example data (BDA3, p. 102) """ from __future__ import division import numpy as np from scipy.stats import norm import scipy.io # For importing a matlab file import matplotlib.pyplot as plt # Edit default plot settings (colours from colo...
gpl-3.0
ironmussa/Optimus
tests/creator/creator-profiler.py
1
4785
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.1 # kernel_info: # name: python3 # kernelspec: # display_name: Python 3 # language...
apache-2.0
bgamecho/arduino2android
Assets/Python/plot_battery.py
1
4085
# -*- coding: utf-8 -*- """ Created on Fri Jul 18 15:41:18 2014 @author: Sensores """ import sys import time from time import sleep import datetime as dt import matplotlib.pyplot as plt import matplotlib.dates as md from scipy.interpolate import interp1d from scipy import interpolate import operator import numpy impo...
apache-2.0
ChanderG/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
gpfreitas/bokeh
bokeh/sampledata/project_funding.py
8
2986
"""Provides convenient access to data viz challenge data. Source: https://github.com/localytics/data-viz-challenge This dataset is excellent for testing and demonstrating data viz capabilities because it contains numerous categorical columns, with both high and low cardinality, columns with NaN values, dates and loca...
bsd-3-clause
pegasus-isi/pegasus
share/pegasus/init/population/scripts/county_cohort_raster.py
1
9162
#!/usr/bin/python3 import json from collections import OrderedDict import pandas as pd from typing import Dict import geopandas as gpd import numpy as np import rasterio from rasterio import features def main(no_data_val=-9999, fname_out='county_level_pop_out.tif', year=2017, grwth_rate_fct=0.0): ''' ''' ...
apache-2.0
marshallmcdonnell/interactive_plotting
TraitsUI/matplotlib/traitsui_mpl_qt.py
2
2658
#!/usr/bin/python # -*- coding: utf-8 -*- # Pierre Haessig — March 2014 """ Qt adaptation of Gael Varoquaux's tutorial to integrate Matplotlib http://docs.enthought.com/traitsui/tutorials/traits_ui_scientific_app.html#extending-traitsui-adding-a-matplotlib-figure-to-our-application based on Qt-based code shared by Did...
mit
herilalaina/scikit-learn
sklearn/utils/tests/test_random.py
33
7334
from __future__ import division import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_almost_equal from sklearn.utils.random import sample_without_replacement from sklearn.utils.random import random_choice_csc from sklearn.utils.fixes import comb from sklearn.utils.testing import ( a...
bsd-3-clause
ina-foss/ID-Fits
lib/unstable/learning/large_margin_dimension_reduction.py
1
4756
# ID-Fits # Copyright (c) 2015 Institut National de l'Audiovisuel, INA, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at...
lgpl-3.0
beiko-lab/gengis
bin/Lib/site-packages/numpy/doc/creation.py
1
5554
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk...
gpl-3.0
pickus91/Logistic-Regression-Classifier-with-L2-Regularization
example.py
1
2260
# -*- coding: utf-8 -*- """ Created on Thu Apr 20 12:35:34 2017 @author: pickus Classification of data in the Breast Cancer Wisconsin dataset using the LogisticRegression class with L2 regularization. More detailed information on this dataset can be found at: https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wi...
mit
mrustl/flopy
examples/scripts/flopy_swi2_ex1.py
1
5425
from __future__ import print_function import os import sys import math import numpy as np import flopy.modflow as mf import flopy.utils as fu import matplotlib.pyplot as plt # --modify default matplotlib settings updates = {'font.family':['Univers 57 Condensed', 'Arial'], 'mathtext.defau...
bsd-3-clause
MPTCP-smartphone-thesis/pcap-measurement
difference_rtt_sfs.py
1
5588
#! /usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 Quentin De Coninck # # 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...
gpl-3.0
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/sklearn/linear_model/tests/test_bayes.py
299
1770
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.linear_model.bayes import BayesianRidge, ARDRegres...
mit
benoitsteiner/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/learn_io/pandas_io_test.py
111
7865
# 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
ubenu/Blits
src/blitspak/crux_table_model.py
1
4139
''' Created on 18 Jan 2018 @author: schilsm ''' from PyQt5 import QtCore as qt import copy as cp #from bokeh.layouts import column class CruxTableModel(qt.QAbstractTableModel): def __init__(self, df_data, checkable_cols=[]): super(CruxTableModel, self).__init__() self.df_data = df_data ...
gpl-3.0
jmargeta/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
4
7402
""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected in...
bsd-3-clause
npdoty/bigbang
bigbang/graph.py
2
4428
from . import parse import math import numpy as np import networkx as nx import bigbang.process as process # import matplotlib.pyplot as plt from pprint import pprint as pp from collections import Counter import pandas def messages_to_reply_graph(messages): G = nx.DiGraph() for m in messages: mid = ...
agpl-3.0
rexshihaoren/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
VisTrails/VisTrails
scripts/dist/windows/Input/startup.py
2
7926
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
chaluemwut/fbserver
filtercomputation.py
1
5428
# -*- coding: UTF-8 -*- from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity from database import * from crf import * import sys, os, math import numpy as np import copy from utilfile import FileUtil class InstanceFilterData(object): # print 'instanace'...
apache-2.0
cactusbin/nyt
matplotlib/examples/pylab_examples/line_collection2.py
9
1327
from pylab import * from matplotlib.collections import LineCollection # In order to efficiently plot many lines in a single set of axes, # Matplotlib has the ability to add the lines all at once. Here is a # simple example showing how it is done. N = 50 x = arange(N) # Here are many sets of y to plot vs x ys = [x+i f...
unlicense
jinghaomiao/apollo
modules/tools/routing/util.py
3
3562
#!/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
kagayakidan/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
bhanu-mnit/EvoML
evoml/subsampling/evaluators.py
1
11934
# -*- coding: utf-8 -*- """ Copyright 2016 Bhanu Pratap and Harsh Nisar. This file is part of the Evoml library. The Evoml library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3 or later. Check the licesne file recieved along with the softwar...
gpl-3.0
altairpearl/scikit-learn
sklearn/tests/test_pipeline.py
7
24571
""" Test the pipeline module. """ import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regex from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert...
bsd-3-clause
fspaolo/scikit-learn
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
HowDoIUseThis/AGNClassification
utils/filters/calculate_percent.py
1
9132
""" This module is used to calculate a probabilistic measure of AGN, SF, and Unknown using a vecotorized gaussian PDF """ import math import numpy as np import pandas as pd graph_type = { 'BPT': ['N_II/H_Alpha', 'O_III/H_Beta'], 'He_II': ['N_II/H_Alpha', 'He_II/H_Beta'], 'Ne_III/O_II': ['Ne_...
gpl-3.0
denimalpaca/293n
classifier_university_title.py
1
5406
from __future__ import print_function import csv import sys from datetime import datetime from sklearn import svm from sklearn.ensemble import RandomForestRegressor import numpy import logging import numpy as np from optparse import OptionParser import sys from time import time import matplotlib.pyplot as plt from s...
gpl-3.0
WolfBerwouts/opengrid
opengrid/library/plotting.py
2
6242
# -*- coding: utf-8 -*- """ Created on Wed Nov 26 18:03:24 2014 @author: KDB """ import numpy as np import pandas as pd import datetime as dt import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.dates import date2num, num2date, HourLocator, DayLocator, AutoDateLocator, DateFormatter from matplotl...
apache-2.0
jblackburne/scikit-learn
sklearn/utils/deprecation.py
77
2417
import warnings __all__ = ["deprecated", ] class deprecated(object): """Decorator to mark a function or class as deprecated. Issue a warning when the function is called/the class is instantiated and adds a warning to the docstring. The optional extra argument will be appended to the deprecation mes...
bsd-3-clause
liweitianux/atoolbox
python/plot.py
1
1148
# -*- coding: utf-8 -*- # # Credits: http://www.aosabook.org/en/matplotlib.html # # Aaron LI # 2016-03-14 # # Import the FigureCanvas from the backend of your choice # and attach the Figure artist to it. from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure f...
mit
aerwin3/swift
swift/common/middleware/xprofile.py
3
9623
# Copyright (c) 2010-2012 OpenStack, LLC. # # 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 ...
apache-2.0
dingocuster/scikit-learn
benchmarks/bench_glm.py
297
1493
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
bsd-3-clause
kwierman/osf.io
scripts/analytics/utils.py
16
2605
# -*- coding: utf-8 -*- import os import unicodecsv as csv from bson import ObjectId import matplotlib.pyplot as plt import matplotlib.dates as mdates import requests from website import util from website import settings as website_settings def oid_to_datetime(oid): return ObjectId(oid).generation_time def ...
apache-2.0
crawfordsm/pysalt
saltfirst/FpRingWidget.py
2
7308
import numpy as np import os, errno from PyQt4 import QtGui,QtCore import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg from pyraf import iraf import pyfits from iraf import pysalt from saltgui import MplCanvas from erc_ring import fit_rings from saltflat import saltfla...
bsd-3-clause