repo_name stringlengths 9 55 | path stringlengths 7 120 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 169k | license stringclasses 12
values |
|---|---|---|---|---|---|
CnrLwlss/HTSauto | HTSscripts/C2MiddleVideo.py | 1 | 4482 | # Finds images from ID in our archive and dumps file locations to .json file
# Only images where a specific treatment and medium were applied, captured before a cutoff period after inoculation, are considered
# Optionally copies symlinks to images or image files themselves to pdump directory for inspection/download
# T... | gpl-2.0 |
vivekmishra1991/scikit-learn | benchmarks/bench_glmnet.py | 297 | 3848 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... | bsd-3-clause |
sinhrks/scikit-learn | sklearn/linear_model/sag.py | 29 | 11291 | """Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# Licence: BSD 3 clause
import numpy as np
import warnings
from ..exceptions import ConvergenceWarning
from ..utils import check_array
from ..utils.extmath import row_norms
from .base import ... | bsd-3-clause |
kayhayen/Nuitka | nuitka/plugins/standard/TensorflowPlugin.py | 1 | 4442 | # Copyright 2021, Jorj McKie, mailto:<jorj.x.mckie@outlook.de>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | apache-2.0 |
rouseguy/scipy2015_tutorial | check_env.py | 6 | 2002 | problems = 0
try:
import IPython
print('IPython', IPython.__version__)
assert(IPython.__version__ >= '3.0')
except ImportError:
print("IPython version 3 is not installed. Please install via pip or conda.")
problems += 1
try:
import numpy
print('NumPy', numpy.__version__)
assert(nu... | cc0-1.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/matplotlib/backends/backend_gtkcairo.py | 21 | 2348 | """
GTK+ Matplotlib interface using cairo (not GDK) drawing operations.
Author: Steve Chaplin
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import gtk
if gtk.pygtk_version < (2,7,0):
import cairo.gtk
from matplotlib.backends import bac... | bsd-2-clause |
alfayez/gnuradio | gnuradio-core/src/examples/pfb/chirp_channelize.py | 17 | 6856 | #!/usr/bin/env python
#
# Copyright 2009 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 option)
# ... | gpl-3.0 |
PanDAWMS/panda-server | pandaserver/taskbuffer/EiTaskBuffer.py | 1 | 1096 | from pandaserver.config import panda_config
from pandaserver.taskbuffer.DBProxyPool import DBProxyPool
from pandaserver.taskbuffer.EiDBProxy import EiDBProxy
# logger
from pandacommon.pandalogger.PandaLogger import PandaLogger
_logger = PandaLogger().getLogger('EiTaskBuffer')
class EiTaskBuffer:
"""
task q... | apache-2.0 |
tomsilver/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/texmanager.py | 69 | 16818 | """
This module supports embedded TeX expressions in matplotlib via dvipng
and dvips for the raster and postscript backends. The tex and
dvipng/dvips information is cached in ~/.matplotlib/tex.cache for reuse between
sessions
Requirements:
* latex
* \*Agg backends: dvipng
* PS backend: latex w/ psfrag, dvips, and Gh... | gpl-3.0 |
cdegroc/scikit-learn | examples/document_classification_20newsgroups.py | 1 | 7645 | """
======================================================
Classification of text documents using sparse features
======================================================
This is an example showing how the scikit-learn can be used to classify
documents by topics using a bag-of-words approach. This example uses
a scipy.s... | bsd-3-clause |
lreis2415/SEIMS | seims/utility/plot.py | 1 | 10352 | """Common used functions for plotting based on matplotlib.
@author : Liangjun Zhu
@changelog:
- 18-10-29 - lj - Extract from other packages.
- 18-11-18 - lj - Add getting value bounds related functions.
= 19-01-07 - lj - Add PlotConfig for basic plot settings for matplotlib
"""
from __future__ i... | gpl-3.0 |
toobaz/pandas | pandas/tests/sparse/frame/test_frame.py | 1 | 55392 | import operator
from types import LambdaType
import numpy as np
from numpy import nan
import pytest
from pandas._libs.sparse import BlockIndex, IntIndex
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import DataFrame, Series, bdate_range, compat
from pandas.core import ops
from pandas.c... | bsd-3-clause |
elkeschaper/hts | setup.py | 1 | 2749 | import os
import sys
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), "r") as f:
return f.read()
# Set the home variable wi... | gpl-2.0 |
manuamador/Misc | PostDoc_python/CAvsOATS/ProgAC_OATS_MC.py | 1 | 7269 | #!/usr/bin/env python
from numpy import *
from numpy.random import *
from pylab import *
from pylab import rcParams
rcParams['text.usetex']=True
rcParams['text.latex.unicode']=True
rc('font',**{'family':'serif','serif':['Computer Modern Roman']})
c = 299792458
R = 10
f = array(arange(50e6,2e9+50e6,50e6))
np=180
nt=... | agpl-3.0 |
acuzzio/GridQuantumPropagator | Scripts/Report_Generator.py | 1 | 13406 | import numpy as np
import pandas as pd
from jinja2 import Environment, BaseLoader
#from jinja2 import FileSystemLoader
import webbrowser
import argparse
import os
import quantumpropagator as qp
import io
import base64
import matplotlib.pyplot as plt
def style_css():
'''
return style, it is mainly the format of... | gpl-3.0 |
mumuwoyou/vnpy | vn.trader/ctaAlgo/rbDualThrust.py | 2 | 14156 | # encoding: UTF-8
"""
一个ATR-RSI指标结合的交易策略,适合用在股指的1分钟和5分钟线上。
注意事项:
1. 作者不对交易盈利做任何保证,策略代码仅供参考
2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装
3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略
"""
from ctaBase import *
from ctaTemplate import CtaTemplate
from datetime import datetime
import talib
import numpy ... | mit |
roxyboy/scikit-learn | sklearn/tests/test_lda.py | 77 | 6258 | import numpy as np
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_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert... | bsd-3-clause |
bthirion/nistats | examples/04_low_level_functions/plot_design_matrix.py | 1 | 4033 | """
Examples of design matrices
===========================
Three examples of design matrices specification and computation
for first-level fMRI data analysis.
(event-related design, block design, FIR design)
Requires matplotlib
"""
try:
import matplotlib.pyplot as plt
except ImportError:
raise RuntimeError... | bsd-3-clause |
maqifrnswa/scimpy | scimpy/speakertest.py | 1 | 9277 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Module to control soundcard input and output for impedance measurements
The main class is SpeakerTestEngine, which is initialized with no arguments.
Data is collected with the run() method. FFT corresponding to the left and
right channel are available after run() in the in... | gpl-3.0 |
vshtanko/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 |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/matplotlib/sphinxext/plot_directive.py | 10 | 28379 | """
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as t... | apache-2.0 |
boada/planckClusters | catalogs/load_catalogs.py | 1 | 5285 | from astropy.table import Table
from numpy import append as npappend
import os
import pandas as pd
from pandas import to_numeric
def load_PSZcatalog(unconf=False, full=False, extras=False, **kwargs):
''' Load the PSZ catalog data into a pandas dataframe. This is useful for
getting the catalog data into other s... | mit |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/tests/indexes/test_base.py | 7 | 77312 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import pandas.util.testing as tm
from pandas.indexes.api import Index, MultiIndex
from .common import Base
from pandas.compat import (range, lrange, lzip, u,
zip, PY3, PY36)
import operator
import os
import numpy as np
from... | apache-2.0 |
egeemirozkan/Linguistly | commonExpressions.py | 1 | 3606 | import sqlite3
import time
from openpyxl import Workbook
from docx import Document
import matplotlib.pyplot as plt
import numpy as np
class CommonExpressions:
punctuations = [".", "?", ";", ":", "!", "(", ")", ",", "\\", "\"", "-",
"--", "”", "“", "\n", "\t", "—", "'", " "]
suffices_tr = ... | mit |
loli/sklearn-ensembletrees | examples/decomposition/plot_pca_iris.py | 253 | 1801 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
PCA example with Iris Data-set
=========================================================
Principal Component Analysis applied to the Iris dataset.
See `here <http://en.wikipedia.org/wiki/Iris_flower_data_set>`_ fo... | bsd-3-clause |
mirams/sine-wave | Figures/figure_6/plot_figure_6_results.py | 1 | 8994 | import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.patches as patches
from matplotlib.ticker import FormatStrFormatter
import matplotlib as mpl
mpl.style.use('classic') # Use Matplotlib v1 defaults (plot was designed on this!)
mpl.rc('text', usetex=True)
from cycler import cycler... | bsd-3-clause |
RobertABT/heightmap | build/matplotlib/lib/matplotlib/backends/backend_ps.py | 3 | 61009 | """
A PostScript backend, which can produce both PostScript .ps and .eps
"""
# PY3KTODO: Get rid of "print >>fh" syntax
from __future__ import division, print_function
import glob, math, os, shutil, sys, time
def _fn_name(): return sys._getframe(1).f_code.co_name
import io
if sys.version_info[0] < 3:
import cStri... | 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 |
fergalbyrne/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/_mathtext_data.py | 69 | 57988 | """
font data tables for truetype and afm computer modern fonts
"""
# this dict maps symbol names to fontnames, glyphindex. To get the
# glyph index from the character code, you have to use get_charmap
"""
from matplotlib.ft2font import FT2Font
font = FT2Font('/usr/local/share/matplotlib/cmr10.ttf')
items = font.get_... | agpl-3.0 |
hbldh/skboost | skboost/gentleboost.py | 1 | 10691 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`gentleboost`
==================
.. module:: gentleboost
:platform: Unix, Windows
:synopsis:
.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>
Created on 2014-08-30, 22:25
"""
from __future__ import division
from __future__ import print_function
from ... | mit |
mattgiguere/scikit-learn | examples/cluster/plot_segmentation_toy.py | 258 | 3336 | """
===========================================
Spectral clustering for image segmentation
===========================================
In this example, an image with connected circles is generated and
spectral clustering is used to separate the circles.
In these settings, the :ref:`spectral_clustering` approach solve... | bsd-3-clause |
ch3ll0v3k/scikit-learn | sklearn/tests/test_kernel_approximation.py | 244 | 7588 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.utils.testing import assert_less_equal
from ... | bsd-3-clause |
akiratu/topic-stability | unsupervised/validation.py | 2 | 5496 | from prettytable import PrettyTable
import numpy as np
from sklearn.metrics.cluster import normalized_mutual_info_score, adjusted_mutual_info_score, adjusted_rand_score
import util, rankings
# --------------------------------------------------------------
class TermValidator:
"""
Validation measure, which compares ... | apache-2.0 |
jdmcbr/blaze | blaze/compute/tests/test_csv_compute.py | 13 | 4310 | from blaze.compute.csv import pre_compute, CSV
from blaze import compute, discover, dshape, into, resource, join, concat
from blaze.utils import example, filetext, filetexts
from blaze.expr import symbol
from pandas import DataFrame, Series
import pandas.util.testing as tm
from datashape.predicates import iscollection
... | bsd-3-clause |
billy-inn/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
gwpy/seismon | RfPrediction/RfAmp_Compiled_Python_Package/robustLocklossPredictionPkg4/for_redistribution_files_only/makePredictions.py | 2 | 5378 | ######################################################
## SEISMON RfAmp Prediction Code
##
##
## Uses PYTHON package robustLocklossPredictionPkg4 & MATLAB 2016b shared libraries,
## Make sure to run the script set_shared_library_paths.sh prior to running this script.
## To re-install the package go through readme.tx... | gpl-3.0 |
rbooth200/DiscEvolution | scripts/plot_evo.py | 1 | 2555 | from __future__ import print_function
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from matplotlib import rcParams
rcParams['image.cmap'] = 'plasma'
from snap_reader import DiscReader
class Formatter(object):
def __init__(self, im):
self.im = im
de... | gpl-3.0 |
rgommers/statsmodels | statsmodels/examples/ex_kernel_regression_dgp.py | 34 | 1202 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 06 09:50:54 2013
Author: Josef Perktold
"""
from __future__ import print_function
if __name__ == '__main__':
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.nonparametric.api import KernelReg
import statsmodels.sandbox.nonparametric... | bsd-3-clause |
tmhm/scikit-learn | sklearn/metrics/classification.py | 95 | 67713 | """Metrics to assess performance on classification task given classe 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.gram... | bsd-3-clause |
lavenderwords/cluster-scheduler-simulator | src/main/python/graphing-scripts/comparison-plot-from-protobuff.py | 5 | 23735 | #!/usr/bin/python
# Copyright (c) 2013, Regents of the University of California
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright no... | bsd-3-clause |
gojira/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 28 | 12795 | # 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 |
anurag313/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 |
yanlend/scikit-learn | examples/tree/plot_tree_regression_multioutput.py | 206 | 1800 | """
===================================================================
Multi-output Decision Tree Regression
===================================================================
An example to illustrate multi-output regression with decision tree.
The :ref:`decision trees <tree>`
is used to predict simultaneously the ... | bsd-3-clause |
libAtoms/matscipy | examples/electrochemistry/samples_pb_c2d.py | 1 | 63342 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# --... | gpl-2.0 |
jpautom/scikit-learn | sklearn/tests/test_learning_curve.py | 59 | 10869 | # 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.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
loopCM/chromium | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | 61 | 2538 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main(args):
pwd = os.environ.get('PWD', '')
is_integration_bot = 'nacl-chrome' in ... | bsd-3-clause |
aeklant/scipy | scipy/interpolate/_cubic.py | 3 | 31709 | """Interpolation algorithms using piecewise cubic polynomials."""
import numpy as np
from . import PPoly
from .polyint import _isscalar
from scipy.linalg import solve_banded, solve
__all__ = ["CubicHermiteSpline", "PchipInterpolator", "pchip_interpolate",
"Akima1DInterpolator", "CubicSpline"]
def prepa... | bsd-3-clause |
go-bears/nupic | src/nupic/research/monitor_mixin/monitor_mixin_base.py | 13 | 7350 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
olologin/scikit-learn | examples/calibration/plot_calibration_curve.py | 113 | 5904 | """
==============================
Probability Calibration curves
==============================
When performing classification one often wants to predict not only the class
label, but also the associated probability. This probability gives some
kind of confidence on the prediction. This example demonstrates how to di... | bsd-3-clause |
zfrenchee/pandas | pandas/tests/io/parser/na_values.py | 2 | 11237 | # -*- coding: utf-8 -*-
"""
Tests that NA values are properly handled during
parsing for all of the parsers defined in parsers.py
"""
import numpy as np
from numpy import nan
import pandas.io.common as com
import pandas.util.testing as tm
from pandas import DataFrame, Index, MultiIndex
from pandas.compat import Str... | bsd-3-clause |
astocko/statsmodels | examples/incomplete/wls_extended.py | 33 | 16137 | """
Weighted Least Squares
example is extended to look at the meaning of rsquared in WLS,
at outliers, compares with RLM and a short bootstrap
"""
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
data = sm.datasets.ccard.load()
data.exog = sm.add_c... | bsd-3-clause |
emmanuelle/scikits.image | doc/examples/plot_peak_local_max.py | 2 | 1575 | """
===============================================================================
Finding local maxima
===============================================================================
The ``peak_local_max`` function returns the coordinates of local peaks (maxima)
in an image. A maximum filter is used for finding loca... | bsd-3-clause |
clarkfitzg/dask | dask/dataframe/tests/test_io.py | 2 | 19157 | import gzip
import pandas as pd
import numpy as np
import pandas.util.testing as tm
import os
import dask
from operator import getitem
import pytest
from toolz import valmap
import tempfile
import shutil
from time import sleep
import dask.array as da
import dask.dataframe as dd
from dask.dataframe.io import (read_csv,... | bsd-3-clause |
johnboyington/homework | ne737/final_project/final_project.py | 1 | 2319 | # ne737 final project
import matplotlib.pyplot as plt
import numpy as np
def ZETA(SS, RR, oSS, oRR):
top = (SS - RR)**2
bot = oSS**2 + oRR**2
return top / bot
def ROLL(Df, De, oDf, oDe):
v = 9.0
W = [-1, 0, 1]
T = []
for i in [1, 2, 3]:
for j in [1, 2]:
S = 0
... | gpl-3.0 |
anurag313/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 68 | 43439 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
equialgo/scikit-learn | sklearn/cluster/bicluster.py | 26 | 19870 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... | bsd-3-clause |
BhallaLab/moose-core | tests/support/test_hhfit.py | 2 | 6029 | # -*- coding: utf-8 -*-
# Author: Subha
# Maintainer: Dilawar Singh
# Created: Tue May 21 16:34:45 2013 (+0530)
# This test is fragile.
from __future__ import print_function, division, absolute_import
import numpy as np
import unittest
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import moo... | gpl-3.0 |
dennissergeev/classcode | lib/phaseshift.py | 1 | 1941 | import numpy as np
from numpy import pi
import matplotlib.pyplot as plt
thetime=np.arange(0.,2*pi,0.05)
thewave=thetime/(2.*pi)
thirty=30.*pi/180.
sixty=2.*thirty
ninety=3.*thirty
onetwenty=2.*sixty
oneeighty=3.*sixty
fig1,axis1=plt.subplots(1,1)
axis1.plot(thewave,np.cos(thetime),'b-',label='0')
axis1.plot(thewave,n... | cc0-1.0 |
walterreade/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 |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/tests/indexes/timedeltas/test_timedelta_range.py | 9 | 1984 | import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas.tseries.offsets import Day, Second
from pandas import to_timedelta, timedelta_range
from pandas.util.testing import assert_frame_equal
class TestTimedeltas(object):
_multiprocess_can_split_ = True
def test_timedelta_range(se... | agpl-3.0 |
jereze/scikit-learn | benchmarks/bench_plot_neighbors.py | 287 | 6433 | """
Plot the scaling of the nearest neighbors algorithms with k, D, and N
"""
from time import time
import numpy as np
import pylab as pl
from matplotlib import ticker
from sklearn import neighbors, datasets
def get_data(N, D, dataset='dense'):
if dataset == 'dense':
np.random.seed(0)
return np.... | bsd-3-clause |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_modifying_data_inplace.py | 8 | 2788 | """
.. _tut_modifying_data_inplace:
Modifying data in-place
=======================
It is often necessary to modify data once you have loaded it into memory.
Common examples of this are signal processing, feature extraction, and data
cleaning. Some functionality is pre-built into MNE-python, though it is also
possibl... | bsd-3-clause |
q1ang/scikit-learn | sklearn/tree/tests/test_export.py | 130 | 9950 | """
Testing for export functions of decision trees (sklearn.tree.export).
"""
from re import finditer
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import GradientBoostingClassifier
from sklearn... | bsd-3-clause |
Roboticmechart22/sms-tools | software/models_interface/sprModel_function.py | 18 | 3422 | # function to call the main analysis/synthesis functions in software/models/sprModel.py
import numpy as np
import matplotlib.pyplot as plt
import os, sys
from scipy.signal import get_window
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
import utilFunctions as UF
import sprMod... | agpl-3.0 |
candide-guevara/programming_challenges | stackless_graph_traversal/etc/plot_complexity.py | 1 | 2005 | import sys, math, os
import pandas as pd
import matplotlib.pyplot as plt
algo_to_col = {
'DAG' : 0,
'DCYCLE' : 1,
'UCYCLE' : 2,
}
def main ():
graph_files = sys.argv[1:]
figure, ax_matrix = prepare_figure(graph_files)
for row, graph_file in enumerate(graph_files):
draw_row_of_graphs(ax_matr... | gpl-2.0 |
AlexRobson/scikit-learn | sklearn/tests/test_metaestimators.py | 226 | 4954 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
blab/antibody-response-pulse | code/VBMG_infection_OAS-Copy1.py | 1 | 16298 |
# 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 sequential infection
# In[1]:
'''
author: Alvason Zhenhua Li
date: 04/09/2... | gpl-2.0 |
kjung/scikit-learn | sklearn/metrics/tests/test_common.py | 31 | 41654 | from __future__ import division, print_function
from functools import partial
from itertools import product
import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils.multiclass import type_of_target
fro... | bsd-3-clause |
moosekaka/sweepython | tubule_het/rfp_analysis/AutoCorRFP_DY_Pop_AllCells.py | 1 | 8884 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 03 15:41:34 2015
Script to plot the autocorrelation coefficients of the various actual and
fitted DY distributions. Run lags\\MakeInputForLags.py in order to get the
fitted distributions pickle file ('*lagsunscaled)
@author: sweel
"""
import matplotlib.pyplot as plt
import... | mit |
DonBeo/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 |
samfpetersen/gnuradio | gnuradio-runtime/apps/evaluation_random_numbers.py | 26 | 5155 | #!/usr/bin/env python
#
# Copyright 2015 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 option)
# ... | gpl-3.0 |
airanmehr/bio | Scripts/TimeSeriesPaper/RealData/NeutralWFSim.py | 1 | 2752 | '''
Copyleft Jan 05, 2017 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com
'''
import sys
import numpy as np;
sys.path.insert(1, '/home/arya/workspace/bio/')
np.set_printoptions(linewidth=200, precision=5, suppress=True)
import pandas as pd;
pd.options.display.max_rows = 20;
pd.opti... | mit |
grlee77/scipy | scipy/misc/common.py | 20 | 9678 | """
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from numpy import arange, newaxis, hstack, prod, array, frombuffer, load
__all__ = ['central_diff_weights', 'derivative', 'ascent', 'face',
'electrocardiogram']
def central_diff_weights(Np, ndiv=1):
"""
... | bsd-3-clause |
kylerbrown/scikit-learn | sklearn/datasets/svmlight_format.py | 114 | 15826 | """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 |
siavooshpayandehazad/SoCDep2 | src/main/python/Clusterer/Clustering_Reports.py | 2 | 2684 | # Copyright (C) 2015 Siavoosh Payandeh Azad
import networkx
import matplotlib.pyplot as plt
def report_ctg(ctg, filename):
"""
Reports Clustered Task Graph in the Console and draws CTG in file
:param ctg: clustered task graph
:param filename: drawing file name
:return: None
"""
print("==... | gpl-2.0 |
daodaoliang/neural-network-animation | matplotlib/cm.py | 11 | 11669 | """
This module provides a large set of colormaps, functions for
registering new colormaps and for getting a colormap by name,
and a mixin class for adding color mapping functionality.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import o... | mit |
WangDequan/fast-rcnn | lib/fast_rcnn/test.py | 43 | 11975 | # --------------------------------------------------------
# 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... | mit |
chenyyx/scikit-learn-doc-zh | examples/en/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | gpl-3.0 |
phdeniel/ltpfs | testcases/realtime/tools/ftqviz.py | 28 | 4407 | #!/usr/bin/env python
# Filename: ftqviz.py
# Author: Darren Hart <dvhltc@us.ibm.com>
# Description: Plot the time and frequency domain plots of a times and
# counts log file pair from the FTQ benchmark.
# Prerequisites: numpy, scipy, and pylab packages. For debian/ubuntu:
# ... | gpl-2.0 |
cgre-aachen/gempy | gempy/bayesian/posterior_analysis_elisa.py | 1 | 8611 | """
This file is part of gempy.
gempy 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.
gempy is distributed in the h... | lgpl-3.0 |
joernhees/scikit-learn | examples/applications/plot_stock_market.py | 76 | 8522 | """
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | bsd-3-clause |
0asa/scikit-learn | sklearn/linear_model/tests/test_logistic.py | 19 | 22876 | import numpy as np
import scipy.sparse as sp
from scipy import linalg, optimize, sparse
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 sklearn.util... | bsd-3-clause |
MicrosoftGenomics/PySnpTools | pysnptools/snpreader/mergerows.py | 1 | 3941 | #import numpy as np
#import subprocess, sys, os.path
#from itertools import *
#import pandas as pd
#import logging
#from snpreader import SnpReader
#from pysnptools.standardizer import Unit
#from pysnptools.standardizer import Identity
#from pysnptools.pstreader import PstData
#import warnings
#import time
#def _iidse... | apache-2.0 |
Lawrence-Liu/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 130 | 6059 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | bsd-3-clause |
threecubed/SimpleLasCurveViewer | MainWindow.py | 1 | 5447 | '''
Simple las Curve Viewer using PyQt4 and pyqtgraph
Copyright 2015 Anthony Torlucci
Distributed under the terms of the GNU General Public License (see gpl.txt for more information)
This file is part of Simple LAS Curve Viewer.
Simple LAS Curve Viewer is free software: you can redistribute it and/or modify
... | gpl-2.0 |
lmallin/coverage_test | python_venv/lib/python2.7/site-packages/pandas/tests/frame/test_quantile.py | 9 | 17561 | # -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
import numpy as np
from pandas import (DataFrame, Series, Timestamp, _np_version_under1p11)
import pandas as pd
from pandas.util.testing import assert_series_equal, assert_frame_equal
import pandas.util.testing as tm
from pandas import _n... | mit |
siutanwong/scikit-learn | examples/ensemble/plot_gradient_boosting_regularization.py | 355 | 2843 | """
================================
Gradient Boosting regularization
================================
Illustration of the effect of different regularization strategies
for Gradient Boosting. The example is taken from Hastie et al 2009.
The loss function used is binomial deviance. Regularization via
shrinkage (``lear... | bsd-3-clause |
LeeYiFang/Carkinos | src/cv.py | 1 | 2729 | from pathlib import Path
import pandas as pd
import numpy as np
import django
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'Carkinos.settings.local'
django.setup()
from probes.models import Dataset,Platform,Sample,CellLine,ProbeID
root=Path('../').resolve()
u133a_path=root.joinpath('src','raw','Affy_U133A_probe_i... | mit |
henridwyer/scikit-learn | examples/plot_kernel_approximation.py | 262 | 8004 | """
==================================================
Explicit feature map approximation for RBF kernels
==================================================
An example illustrating the approximation of the feature map
of an RBF kernel.
.. currentmodule:: sklearn.kernel_approximation
It shows how to use :class:`RBFSa... | bsd-3-clause |
eramirem/astroML | examples/datasets/plot_sdss_spectrum.py | 5 | 1247 | """
SDSS Spectrum Example
---------------------
This example shows how to fetch and plot a spectrum from the SDSS database
using the plate, MJD, and fiber numbers. The code below sends a query to
the SDSS server for the given plate, fiber, and mjd, downloads the spectrum,
and plots the result.
"""
# Author: Jake Vande... | bsd-2-clause |
ScottFreeLLC/AlphaPy | alphapy/optimize.py | 1 | 8622 | ################################################################################
#
# Package : AlphaPy
# Module : optimize
# Created : July 11, 2013
#
# Copyright 2017 ScottFree Analytics LLC
# Mark Conway & Robert D. Scott II
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | apache-2.0 |
amandapersampa/MicroGerencia | app/main/controllers/Pedido_controller.py | 1 | 2219 |
#from builtins import print
from flask import jsonify, render_template, redirect, url_for
from pandas.core.internals import form_blocks
from app.main.forms.Pedido_forms import Pedido_forms
from app.main.forms.modal_item_cardapio import modal_item_cardapio
from app.main.models.Item_cardapio import Item_cardapio_dao
fr... | mit |
nomadcube/scikit-learn | sklearn/preprocessing/tests/test_function_transformer.py | 176 | 2169 | from nose.tools import assert_equal
import numpy as np
from sklearn.preprocessing import FunctionTransformer
def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X):
def _func(X, *args, **kwargs):
args_store.append(X)
args_store.extend(args)
kwargs_store.update(kwargs)
... | bsd-3-clause |
Djabbz/scikit-learn | sklearn/utils/tests/test_extmath.py | 3 | 19696 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis Engemann <d.engemann@fz-juelich.de>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from scipy import stats
from sklearn.utils.testing import assert_eq... | bsd-3-clause |
jakobworldpeace/scikit-learn | sklearn/utils/estimator_checks.py | 16 | 64623 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
from scipy.stats import rankdata
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memor... | bsd-3-clause |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/matplotlib/tight_bbox.py | 2 | 3839 | """
This module is to support *bbox_inches* option in savefig command.
"""
import warnings
from matplotlib.transforms import Bbox, TransformedBbox, Affine2D
def adjust_bbox(fig, format, bbox_inches):
"""
Temporarily adjust the figure so that only the specified area
(bbox_inches) is saved.
It modifi... | gpl-3.0 |
petercable/xray | xray/plot/utils.py | 1 | 5848 | import pkg_resources
import numpy as np
import pandas as pd
from ..core.pycompat import basestring
def _load_default_cmap(fname='default_colormap.csv'):
"""
Returns viridis color map
"""
from matplotlib.colors import LinearSegmentedColormap
# Not sure what the first arg here should be
f = p... | apache-2.0 |
asazo/ANN | tarea3/Pregunta2/model_8000.py | 1 | 1315 | import numpy as np
from theano.tensor.shared_randomstreams import RandomStreams
from matplotlib import pyplot
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers.embeddings import Embedding
from keras.datasets impor... | mit |
thilbern/scikit-learn | sklearn/__init__.py | 12 | 2540 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
mdrumond/tensorflow | tensorflow/contrib/learn/python/learn/estimators/debug_test.py | 46 | 32817 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.