repo_name
stringlengths
6
67
path
stringlengths
5
185
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
962k
license
stringclasses
15 values
amitgroup/parts-net
scripts/script_parts.py
1
9041
from __future__ import division, print_function, absolute_import import matplotlib as mpl mpl.rc('font', size=8) from vzlog import default as vz import numpy as np import amitgroup as ag import itertools as itr import sys import os from amitgroup.plot import ImageGrid import pnet import time def test(ims, labels, n...
bsd-3-clause
hlin117/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
harpolea/pyro2
compressible/problems/logo.py
2
2297
from __future__ import print_function import sys import mesh.patch as patch import numpy as np from util import msg import matplotlib.pyplot as plt def init_data(my_data, rp): """ initialize the logo problem """ msg.bold("initializing the logo problem...") # make sure that we are passed a valid patch o...
bsd-3-clause
bxlab/HiFive_Paper
Scripts/HiCLib/mirnylab-hiclib-460c3fbc0f72/src/hiclib/binnedData.py
2
64389
#(c) 2012 Massachusetts Institute of Technology. All Rights Reserved # Code written by: Maksim Imakaev (imakaev@mit.edu) #TODO:(MIU) Write tests for this module! """ Binned data - analysis of HiC, binned to resolution. Concepts -------- class Binned Data allows low-level manipulation of multiple HiC datasets, bin...
bsd-3-clause
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/mpl_toolkits/axes_grid1/colorbar.py
10
27874
''' 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 ...
bsd-3-clause
acmaheri/sms-tools
lectures/6-Harmonic-model/plots-code/f0-TWM-errors-1.py
2
3586
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackman import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF def TWM (pfreq, p...
agpl-3.0
tansey/vsmrfs
vsmrfs/test_learning.py
2
6974
import matplotlib matplotlib.use('Agg') from matplotlib import cm, colors import matplotlib.pyplot as plt import numpy as np import scipy.sparse as sp import argparse import csv import sys from node_learning import * from exponential_families import * from utils import * if __name__ == '__main__': parser = argpars...
mit
zutshi/S3CAMX
create_example_from_template.py
1
6354
#!/usr/bin/python # -*- coding: utf-8 -*- import fileOps as f import sys import err plant_str = ''' # Must satisfy the signature # [t,X,D,P] = sim_function(T,X0,D0,P0,I0); import numpy as np from scipy.integrate import ode import matplotlib.pyplot as PLT class SIM(object): def __init__(self, plt, pvt_init_dat...
bsd-2-clause
hainm/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
zingale/pyro2
compressible_react/simulation.py
1
3310
from __future__ import print_function import matplotlib import matplotlib.pyplot as plt import numpy as np import compressible import compressible.eos as eos import util.plot_tools as plot_tools class Simulation(compressible.Simulation): def initialize(self): """ For the reacting compressible ...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/test_panelnd.py
7
3952
# -*- coding: utf-8 -*- import nose from pandas.core import panelnd from pandas.core.panel import Panel from pandas.util.testing import assert_panel_equal import pandas.util.testing as tm class TestPanelnd(tm.TestCase): def setUp(self): pass def test_4d_construction(self): with tm.assert_...
gpl-3.0
Lawrence-Liu/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
228
11221
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
bsd-3-clause
conversationai/wikidetox
antidox/perspective.py
1
9999
""" inputs comments to perspective and dlp apis and detects toxicity and personal information> has support for csv files, bigquery tables, and wikipedia talk pages""" #TODO(tamajongnc): configure pipeline to distribute work to multiple machines # pylint: disable=fixme, import-error # pylint: disable=fixme, unused-impor...
apache-2.0
ScazLab/snap_circuits
board_perception/part_classifier.py
1
12583
import os import time import json from copy import deepcopy import numpy as np import cv2 from sklearn.svm import SVC from sklearn.metrics import confusion_matrix from sklearn.externals import joblib # Location of board training data DATA = os.path.join(os.path.dirname(__file__), '../data/') BOARD_DATA = os.path.joi...
gpl-3.0
cactusbin/nyt
matplotlib/examples/pylab_examples/legend_auto.py
3
2281
""" This file was written to test matplotlib's autolegend placement algorithm, but shows lots of different ways to create legends so is useful as a general examples Thanks to John Gill and Phil ?? for help at the matplotlib sprint at pycon 2005 where the auto-legend support was written. """ from pylab import * import ...
unlicense
SpatialTranscriptomicsResearch/st_analysis
scripts/differential_analysis.py
1
7792
#! /usr/bin/env python """ This script performs Differential Expression Analysis using DESeq2 or Scran + DESeq2 on ST datasets. The script can take one or several datasets with the following format: GeneA GeneB GeneC 1x1 1x2 ... Ideally, each dataset (matrix) would correspond to a region of interest (...
mit
anurag313/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
arizona-phonological-imaging-lab/Autotrace
matlab-version/image_diversityNEW.py
3
17500
#!/usr/bin/env python """ image_diversityNEW.py Rewritten by Gus Hahn-Powell on March 7 2014 based on ~2010 code by Jeff Berry purpose: This script measures the distance from average for each image in the input set, and copies the specified number of highest scoring images to a new folder called 'diverse'. If ROI_...
mit
iychoi/syndicate
planetlab/graphs/scatter.py
2
4707
""" Copyright 2013 The Trustees of Princeton University 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 applicab...
apache-2.0
mvpossum/deep-learning
tp3/base.py
1
9188
from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility import os from keras.utils import np_utils from keras import backend as K from scipy import misc from time import time, strftime, localtime import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from ke...
mit
MechCoder/scikit-learn
examples/model_selection/plot_learning_curve.py
76
4509
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
bsd-3-clause
RomainBrault/scikit-learn
examples/mixture/plot_gmm.py
122
3265
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians obtained with Expectation Maximisation (``GaussianMixture`` class) and Variational Inference (``BayesianGaussianMixture`` class models with a Dirichlet ...
bsd-3-clause
alexsavio/scikit-learn
sklearn/linear_model/tests/test_sparse_coordinate_descent.py
94
10801
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_true from sklearn.utils.t...
bsd-3-clause
henryroe/NIHTS-xcam
setup.py
2
5385
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding import os base_dir = os.path.abspath(os.path.dirname(__file__)) about = {} with open(os.path.join(base_dir, "nihts_xcam", "__about__.py")) as f: exec(f.read(), about) # G...
mit
ruohoruotsi/librosa
librosa/segment.py
1
21884
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Temporal segmentation ===================== Recurrence and self-similarity ------------------------------ .. autosummary:: :toctree: generated/ recurrence_matrix recurrence_to_lag lag_to_recurrence timelag_filter Temporal clustering --------------...
isc
allinpaybusiness/ACS
allinpay projects/creditscorelogisticvaropt/classlogistic.py
1
18588
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import sys; import os; sys.path.append("allinpay projects") from imp import reload import creditscore reload(creditscore) from creditscore import CreditScore import pandas as pd import numpy as np import time from sklearn.model_selection i...
apache-2.0
marcocaccin/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
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_toolkits/axes_grid1/anchored_artists.py
8
5410
from matplotlib.patches import Rectangle, Ellipse import numpy as np from matplotlib.offsetbox import AnchoredOffsetbox, AuxTransformBox, VPacker,\ TextArea, AnchoredText, DrawingArea, AnnotationBbox class AnchoredDrawingArea(AnchoredOffsetbox): """ AnchoredOffsetbox with DrawingArea """ def ...
gpl-2.0
codeforfrankfurt/PolBotCheck
polbotcheck/plots/front_back_link.py
1
1108
import sys from os import path sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) import db import seaborn as sns import pandas as pd import numpy as np # takes data (that should come from the backend) and creates the output we would like to have # on the front end. def follower_botness(userna...
mit
spallavolu/scikit-learn
sklearn/linear_model/least_angle.py
61
54324
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ from __future__ import print_function # Author: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux # # License: BSD 3 ...
bsd-3-clause
kagayakidan/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
marmarko/ml101
tensorflow/examples/tutorials/word2vec/word2vec_basic.py
8
8995
# 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...
bsd-2-clause
pauljxtan/nbody
src/plot_realtime_N3.py
1
1028
#!/usr/bin/env python import matplotlib.pyplot as plt import sys def main(): # Set the frameskip (plot every n-th frame) frame_skip = int(sys.argv[1]) # Enable interactive mode plt.ion() # Set up figure fig = plt.figure() sp = fig.add_subplot(111) frame_count = 0 while True:...
mit
a301-teaching/pyman
Book/chap5/Supporting Materials/MultPlotDemo.py
3
1270
# Demonstrates the following: # plotting logarithmic axes # user-defined functions # "where" function, NumPy array conditional import numpy as np import matplotlib.pyplot as plt # Define the sinc function, with output for x=0 defined # as a special case to avoid division by zero def s(x): a = np.where(x...
cc0-1.0
chenyyx/scikit-learn-doc-zh
examples/zh/plot_johnson_lindenstrauss_bound.py
39
7489
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
gpl-3.0
kdaily/altanalyze
misopy/sashimi_plot/Sashimi.py
1
3716
## ## Class for representing figures ## import os import matplotlib import matplotlib.pyplot as plt from matplotlib import rc import misopy.sashimi_plot.plot_utils.plot_settings as plot_settings import misopy.sashimi_plot.plot_utils.plotting as plotting class Sashimi: """ Representation of a figure. """ ...
apache-2.0
tri-CSI/Bioinfo
lib/GTF.py
1
2702
#!/usr/bin/env python """ GTF.py Kamil Slowikowski December 24, 2013 Changed by: Tran Minh Tri Org: CTRAD - CSI ver: 0.0.1 Read GFF/GTF files. Works with gzip compressed files and pandas. http://useast.ensembl.org/info/website/upload/gff.html Source: https://gist.github.com/slowkow/8101481 """ from collect...
cc0-1.0
xiyuw123/Tax-Calculator
taxcalc/decorators.py
1
11007
import numpy as np import pandas as pd import inspect from numba import jit, vectorize, guvectorize from functools import wraps from six import StringIO import ast import toolz class GetReturnNode(ast.NodeVisitor): """ A Visitor to get the return tuple names from a calc-style function """ def visi...
mit
elijah513/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
214
4690
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.linear_model.randomized_l1 i...
bsd-3-clause
timcera/hspfbintoolbox
tests/test_catalog.py
1
115314
# -*- coding: utf-8 -*- """ catalog ---------------------------------- Tests for `hspfbintoolbox` module. """ import csv import shlex import subprocess import sys from unittest import TestCase from pandas.testing import assert_frame_equal try: from cStringIO import StringIO except: from io import StringIO ...
bsd-3-clause
dnolivieri/RFVextract
rfVextract/VsPredict05.py
1
3766
#!/usr/bin/env python """ dnolivieri: (updated: 23 oct 2014) random forest, but using the idea of intervals used in the MHC exons """ import numpy as np import matplotlib.pyplot as plt import time import os, fnmatch import sys import itertools from operator import itemgetter, attrgetter import math from Bio ...
bsd-3-clause
mhdella/scikit-learn
sklearn/cluster/setup.py
263
1449
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration cblas_libs, blas_info = ...
bsd-3-clause
robertsj/libdetran
src/python/pydetranutils/quad_plot.py
2
1931
# This provides utilities for plotting things on a # 1D or 2D mesh or a slice of a 3D mesh. try : import numpy as np except ImportError : print "Error importing Numpy" try : import mpl_toolkits.mplot3d.axes3d as p3 import matplotlib.pyplot as plt except ImportError : print "Error importing matplotlib" glob...
mit
telefar/stockEye
coursera-compinvest1-master/coursera-compinvest1-master/Examples/Basic/movingavg-ex.py
2
1060
import QSTK.qstkutil.qsdateutil as du import QSTK.qstkutil.tsutil as tsu import QSTK.qstkutil.DataAccess as da import datetime as dt import matplotlib.pyplot as plt import pandas from pylab import * # # Prepare to read the data # symbols = ["AAPL","GLD","GOOG","$SPX","XOM"] startday = dt.datetime(2008,1,1) endday = dt...
bsd-3-clause
heli522/scikit-learn
examples/linear_model/plot_ridge_path.py
254
1655
""" =========================================================== Plot Ridge coefficients as a function of the regularization =========================================================== Shows the effect of collinearity in the coefficients of an estimator. .. currentmodule:: sklearn.linear_model :class:`Ridge` Regressi...
bsd-3-clause
babsey/sumatra
test/system/test_ircr.py
3
6521
""" A run through of basic Sumatra functionality. As our example code, we will use a Python program for analyzing scanning electron microscope (SEM) images of glass samples. This example was taken from an online SciPy tutorial at http://scipy-lectures.github.com/intro/summary-exercises/image-processing.html Usage: ...
bsd-2-clause
rmccoy7541/egillettii-rnaseq
scripts/model_A.synonymous.py
1
3634
#! /bin/env python import sys from optparse import OptionParser import copy import matplotlib matplotlib.use('Agg') import pylab import scipy.optimize import numpy from numpy import array import dadi #import demographic models import gillettii_models def runModel(outFile, nuW_start, nuC_start, T_start): # Pa...
mit
fabioticconi/scikit-learn
sklearn/datasets/svmlight_format.py
19
16759
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
bsd-3-clause
nawawi/poedit
deps/boost/libs/metaparse/tools/benchmark/benchmark.py
8
10484
#!/usr/bin/python """Utility to benchmark the generated source files""" # Copyright Abel Sinkovics (abel@sinkovics.hu) 2016. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import argparse import os im...
mit
rosswhitfield/mantid
scripts/MantidIPython/plot_functions.py
3
4224
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + """ ...
gpl-3.0
MaxHalford/StSICMR-Inference
simulations/plotting.py
1
4200
import matplotlib.pyplot as plt import numpy as np plt.style.use('fivethirtyeight') def plotModel(model, times, lambdas=None, logScale=False, save=None, show=True): ''' Plot a model in green and a determined lambda function in red. ''' plt.clf() plt.grid(color='white', linestyle='solid') ...
mit
ishank08/scikit-learn
sklearn/datasets/tests/test_mldata.py
384
5221
"""Test functionality of mldata fetching utilities.""" import os import shutil import tempfile import scipy as sp from sklearn import datasets from sklearn.datasets import mldata_filename, fetch_mldata from sklearn.utils.testing import assert_in from sklearn.utils.testing import assert_not_in from sklearn.utils.test...
bsd-3-clause
rrohan/scikit-learn
sklearn/mixture/tests/test_gmm.py
200
17427
import unittest import copy import sys from nose.tools import assert_true import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_raises) from scipy import stats from sklearn import mixture from sklearn.datasets.samples_generator import make_spd_ma...
bsd-3-clause
thebucknerlife/caravel
setup.py
1
1426
from setuptools import setup, find_packages version = '0.8.4' setup( name='caravel', description=( "A interactive data visualization platform build on SqlAlchemy " "and druid.io"), version=version, packages=find_packages(), include_package_data=True, zip_safe=False, scripts...
apache-2.0
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/sklearn/utils/testing.py
4
30964
"""Testing utilities.""" # Copyright (c) 2011, 2012 # Authors: Pietro Berkes, # Andreas Muller # Mathieu Blondel # Olivier Grisel # Arnaud Joly # Denis Engemann # Giorgio Patrini # Thierry Guillemot # License: BSD 3 clause import os import inspect import p...
mit
prheenan/Research
Perkins/Projects/Protein/alpha3d/2016-11-30-devin-iwt/Main_alpha3d_iwt.py
1
2674
# force floating point division. Can still use integer with // from __future__ import division # This file is used for importing the common utilities classes. import numpy as np import matplotlib.pyplot as plt import sys sys.path.append("../../../../../../") from Research.Perkins.AnalysisUtil.EnergyLandscapes import I...
gpl-3.0
dhesse/parmalgt-analysis
actions.py
1
7884
""" :mod:`actions` -- Methods to perform the data analysis ======================================================= .. module: actions In this module, we collect the functions that can be applied to the data. """ from puwr import tauint from math import log import numpy as np from scipy.linalg import svd, diagsvd, no...
mit
timsnyder/bokeh
examples/app/gapminder/main.py
5
2769
# -*- coding: utf-8 -*- import pandas as pd from bokeh.core.properties import field from bokeh.io import curdoc from bokeh.layouts import layout from bokeh.models import (ColumnDataSource, HoverTool, SingleIntervalTicker, Slider, Button, Label, CategoricalColorMapper) from bokeh.palettes impo...
bsd-3-clause
pizzathief/scipy
scipy/interpolate/fitpack.py
5
25629
__all__ = ['splrep', 'splprep', 'splev', 'splint', 'sproot', 'spalde', 'bisplrep', 'bisplev', 'insert', 'splder', 'splantider'] import warnings import numpy as np # These are in the API for fitpack even if not used in fitpack.py itself. from ._fitpack_impl import bisplrep, bisplev, dblint from . import _f...
bsd-3-clause
tBuLi/symfit
examples/ode_reaction_kinetics_simple.py
1
1250
from symfit import variables, Parameter, Fit, D, ODEModel import numpy as np import matplotlib.pyplot as plt # First order reaction kinetics. Data taken from # http://chem.libretexts.org/Core/Physical_Chemistry/Kinetics/Rate_Laws/The_Rate_Law tdata = np.array([0, 0.9184, 9.0875, 11.2485, 17.5255, 23.9993, 27.7949, ...
gpl-2.0
khkaminska/scikit-learn
sklearn/utils/random.py
234
10510
# Author: Hamzeh Alsalhi <ha258@cornell.edu> # # License: BSD 3 clause from __future__ import division import numpy as np import scipy.sparse as sp import operator import array from sklearn.utils import check_random_state from sklearn.utils.fixes import astype from ._random import sample_without_replacement __all__ =...
bsd-3-clause
jlegendary/scikit-learn
sklearn/neighbors/nearest_centroid.py
199
7249
# -*- 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 ..met...
bsd-3-clause
madjelan/scikit-learn
sklearn/linear_model/least_angle.py
57
49338
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ from __future__ import print_function # Author: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux # # License: BSD 3 ...
bsd-3-clause
iitjee/SteppinsMachineLearning
Tensorflow/01 TF Fundamentals/07 CNN-kaden.py
1
4567
# Let's create a Gaussian curve! # The 1 dimensional gaussian takes two parameters, the mean value, and the standard deviation, which is commonly denoted by the name sigma. mean = 0.0 sigma = 1.0 # Don't worry about trying to learn or remember this formula. I always have to refer to textbooks or check online for ...
apache-2.0
qiudebo/13learn
other/stock/stockholm.py
1
6150
import argparse import option import csv import os import datetime import json import re import io import requests import timeit import time from multiprocessing.dummy import Pool as ThreadPool from functools import partial import pandas as pd from pandas.io.excel import ExcelFile import co...
mit
materialsproject/pymatgen
pymatgen/io/abinit/pseudos.py
5
65306
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides objects describing the basic parameters of the pseudopotentials used in Abinit, and a parser to instantiate pseudopotential objects.. """ import abc import collections import logging im...
mit
courtarro/gnuradio-wg-grc
gr-digital/examples/snr_estimators.py
46
6348
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
Vimos/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
17
10084
import numpy as np import itertools from sklearn.exceptions import ConvergenceWarning from sklearn.utils import check_array from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import...
bsd-3-clause
dblalock/flock
python/viz/motifs.py
1
8148
#!/bin/env/python import numpy as np import matplotlib.pyplot as plt from sklearn.decomposition import TruncatedSVD from ..algo.motif import findMotif, findAllMotifInstances from ..utils.subseq import simMatFromDistTensor from viz_utils import plotRect, plotRanges def findAndPlotMotif(seq, lengths, **kwargs): moti...
mit
apdjustino/urbansim
urbansim/models/util.py
1
9311
""" Utilities used within the ``urbansim.models`` package. """ import collections import logging import numbers try: from StringIO import StringIO except ImportError: from io import StringIO from tokenize import generate_tokens, NAME import numpy as np import pandas as pd import patsy from zbox import toolz a...
bsd-3-clause
samzhang111/scikit-learn
sklearn/linear_model/logistic.py
3
65828
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> imp...
bsd-3-clause
lamontu/data-analysis
pandas/series.py
1
1171
# -*- coding: utf-8 -*- from pandas import Series print("## Create Series using array:") obj = Series([4, 7, -5, 3]) print(obj) print(obj.values) print(obj.index) print() print("## Designate the index of a Series:") obj2 = Series([4, 7, -5, 3], index=['d', 'b', 'a', 'c']) print(obj2) print(obj2.index) print(obj2['a'...
gpl-3.0
JohannesBuchner/matplotlib-subsets
tests/nestedsetrect_test.py
1
1110
from matplotlib_subsets import * def test_nested_example1(): sets = [ set(list('ABCDEFGH')), set(list('DEFG')), set(list('E')), ] setsizes = [len(s) for s in sets] nestedsets_rectangles(setsizes, labels = [ r'$\mathbf{%s}$ ($%d$)' % (string.ascii_uppercase[i], len(s)) for i, s in enumerate(sets)]) plt...
mit
ClockworkOrigins/m2etis
dependencies/create_virtualenv.py
1
1472
import virtualenv import textwrap import subprocess import os import sys ###################### # Add required dependencies to the object dependenciesList. # Syntax is equivalent to pip requirements files. # If there are dependencies between packages mind that all packages will be installed in the specified order. d...
apache-2.0
cogmission/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/cbook.py
69
42525
""" A collection of utility functions and classes. Many (but not all) from the Python Cookbook -- hence the name cbook """ from __future__ import generators import re, os, errno, sys, StringIO, traceback, locale, threading, types import time, datetime import warnings import numpy as np import numpy.ma as ma from weakr...
agpl-3.0
BlueBrain/NeuroM
neurom/view/view.py
1
16854
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
ch3ll0v3k/scikit-learn
sklearn/neighbors/unsupervised.py
106
4461
"""Unsupervised nearest neighbors learner""" from .base import NeighborsBase from .base import KNeighborsMixin from .base import RadiusNeighborsMixin from .base import UnsupervisedMixin class NearestNeighbors(NeighborsBase, KNeighborsMixin, RadiusNeighborsMixin, UnsupervisedMixin): """Unsu...
bsd-3-clause
evgchz/scikit-learn
examples/cluster/plot_dict_face_patches.py
337
2747
""" Online learning of a dictionary of parts of faces ================================================== This example uses a large dataset of faces to learn a set of 20 x 20 images patches that constitute faces. From the programming standpoint, it is interesting because it shows how to use the online API of the sciki...
bsd-3-clause
francesco-mannella/dmp-esn
parametric/parametric_dmp/bin/tr_datasets/e_cursive_curves_angles_LWPR_100/data/trajectories/plot.py
18
1043
#!/usr/bin/env python import glob import numpy as np import matplotlib.pyplot as plt import os import sys pathname = os.path.dirname(sys.argv[0]) if pathname: os.chdir(pathname) n_dim = None trains = [] for fname in glob.glob("tl*"): t = np.loadtxt(fname) trains.append(t) tests = [] for fname in glob...
gpl-2.0
jakobworldpeace/scikit-learn
sklearn/utils/multiclass.py
41
14732
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi # # License: BSD 3 clause """ Multi-class / multi-label utility function ========================================== """ from __future__ import division from collections import Sequence from itertools import chain from scipy.sparse import issparse from scipy.sparse....
bsd-3-clause
r-mart/scikit-learn
sklearn/manifold/tests/test_locally_linear.py
232
4761
from itertools import product from nose.tools import assert_true import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from scipy import linalg from sklearn import neighbors, manifold from sklearn.manifold.locally_linear import barycenter_kneighbors_graph from sklearn.utils.testi...
bsd-3-clause
MartinDelzant/scikit-learn
examples/decomposition/plot_pca_vs_fa_model_selection.py
142
4467
""" =============================================================== Model selection with Probabilistic PCA and Factor Analysis (FA) =============================================================== Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the likelihood of new data can be u...
bsd-3-clause
gkioxari/RstarCNN
lib/fast_rcnn/test_stanford40.py
1
10561
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Test a Fast R-CNN network on an imdb (image database).""" from fast...
bsd-2-clause
av8ramit/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_test.py
7
54392
# 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
jms-dipadua/financial-forecasting
forecast_dir.py
1
20535
import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import yaml #import h5py from sklearn import svm from sklearn.metrics import f1_score, accuracy_score, mean_absolute_error, mean_squared_error from sklearn.preprocessing import StandardScaler from sklearn.cross_vali...
gpl-3.0
webmasterraj/GaSiProMo
flask/lib/python2.7/site-packages/pandas/computation/scope.py
24
9002
"""Module for scope operations """ import sys import struct import inspect import datetime import itertools import pprint import numpy as np import pandas as pd from pandas.compat import DeepChainMap, map, StringIO from pandas.core.base import StringMixin import pandas.computation as compu def _ensure_scope(level,...
gpl-2.0
tehtechguy/mHTM
dev/mnist_novelty_detection/mnist_novelty_detection.py
1
12417
# mnist_novelty_detection.py # # Author : James Mnatzaganian # Contact : http://techtorials.me # Organization : NanoComputing Research Lab - Rochester Institute of # Technology # Website : https://www.rit.edu/kgcoe/nanolab/ # Date Created : 03/13/16 # # Description : Experiment f...
mit
undercoveridiot/gunfolds
gunfolds/scripts/stackedbars.py
1
3438
from gunfolds.tools import zickle as zkl import matplotlib as mpl from matplotlib import pyplot as plt import numpy as np import pandas as pd import pylab as pl import seaborn as sns def get_counts(d): eqc = [len(x['eq']) for x in d] keys = np.sort(np.unique(eqc)) c = {} for k in keys: c[k] = ...
gpl-3.0
jaffe59/vp-cnn
cnn_classifier/error_analysis.py
1
1799
import pandas from statsmodels.sandbox.stats.runs import mcnemar cnn_file = 'final_run.3.preds.txt' lr_file = 'stats.1_prev_no_resp.csv' dialogue_file = 'corrected.tsv' def read_in_dialogues(dialogue_file): dialogue_indices = [] dialogue_index = -1 turn_index = -1 records = [] with open(dialogue_fi...
apache-2.0
samgale/MouseEyeTracker
MouseEyeTracker.py
1
126077
# -*- coding: utf-8 -*- """ GUI for tracking mouse pupil area and position/rotation Acquire data with camera or analyze data from hdf5 or video file @author: samgale """ from __future__ import division import sip sip.setapi('QString', 2) import h5py, json, math, os, time import cv2 import numpy as np im...
mit
MartinDelzant/scikit-learn
sklearn/tests/test_dummy.py
186
17778
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.base import clone 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 sklearn.utils.testing import assert_almost_eq...
bsd-3-clause
corburn/scikit-bio
skbio/draw/_distributions.py
10
30987
# ---------------------------------------------------------------------------- # 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
btabibian/scikit-learn
sklearn/preprocessing/data.py
3
90834
# 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> # Eric Martin <eric@ericmart.in> # Giorgio Patrini <giorgio.patrini@anu.edu.au> # Lic...
bsd-3-clause
merenlab/anvio
anvio/parsers/hmmscan.py
3
35794
# -*- coding: utf-8 """Parser for HMMER's various outputs""" import anvio import anvio.utils as utils import anvio.terminal as terminal from anvio.errors import ConfigError from anvio.parsers.base import Parser import numpy as np import pandas as pd __author__ = "Developers of anvi'o (see AUTHORS.txt)" __copyright...
gpl-3.0
drufat/vispy
vispy/testing/__init__.py
21
2415
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Testing ======= This module provides functions useful for running tests in vispy. Tests can be run in a few ways: * From Python, you can import ``vispy`` and do ``vis...
bsd-3-clause
oddt/oddt
oddt/pandas.py
2
19996
""" Pandas extension for chemical analysis """ from __future__ import absolute_import from collections import deque from six import BytesIO, StringIO, text_type import pandas as pd import oddt pd.set_option("display.max_colwidth", 999999) def _mol_reader(fmt='sdf', filepath_or_buffer=None, ...
bsd-3-clause
SciTools/iris
lib/iris/tests/unit/plot/test_points.py
5
2370
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.plot.points` function.""" # Import iris.tests first so that some things can be initialised before ...
lgpl-3.0
Adai0808/scikit-learn
examples/classification/plot_lda_qda.py
164
4806
""" ==================================================================== Linear and Quadratic Discriminant Analysis with confidence ellipsoid ==================================================================== Plot the confidence ellipsoids of each class and decision boundary """ print(__doc__) from scipy import lin...
bsd-3-clause
goldmedal/spark
python/pyspark/sql/pandas/functions.py
2
27749
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
cdegroc/scikit-learn
sklearn/neighbors/graph.py
14
2839
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD, (C) INRIA, University of Amsterdam from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def kneighbors_graph(X, n_neighbors, mode='connectivity'): "...
bsd-3-clause