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
dimkal/mne-python
tutorials/plot_cluster_1samp_test_time_frequency.py
16
4759
""" .. _tut_stats_cluster_sensor_1samp_tfr: =============================================================== Non-parametric 1 sample cluster statistic on single trial power =============================================================== This script shows how to estimate significant clusters in time-frequency power est...
bsd-3-clause
0asa/scikit-learn
sklearn/utils/testing.py
2
22085
"""Testing utilities.""" # Copyright (c) 2011, 2012 # Authors: Pietro Berkes, # Andreas Muller # Mathieu Blondel # Olivier Grisel # Arnaud Joly # Denis Engemann # License: BSD 3 clause import os import inspect import pkgutil import warnings import sys import re import platf...
bsd-3-clause
bnaul/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
9
21205
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np import pytest from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils._testing import assert_a...
bsd-3-clause
ioreshnikov/wells
publish_xfrog.py
1
2084
#!/usr/bin/env python3 import argparse import scipy as s import scipy.fftpack as fft import matplotlib.pyplot as plot import wells.publisher as publisher parser = argparse.ArgumentParser() parser.add_argument("--t", type=float, help="Time at which diagram should be plotted") ...
mit
rajat1994/scikit-learn
sklearn/covariance/graph_lasso_.py
127
25626
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
bsd-3-clause
Achuth17/scikit-learn
sklearn/metrics/__init__.py
52
3394
""" The :mod:`sklearn.metrics` module includes score functions, performance metrics and pairwise metrics and distance computations. """ from .ranking import auc from .ranking import average_precision_score from .ranking import coverage_error from .ranking import label_ranking_average_precision_score from .ranking imp...
bsd-3-clause
gigglesninja/senior-design
MissionPlanner/Lib/site-packages/numpy/lib/recfunctions.py
58
34495
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ import sys import itertools import numpy as np import numpy.ma as ma from numpy import ndarray, recarray from nump...
gpl-2.0
khkaminska/scikit-learn
sklearn/decomposition/tests/test_nmf.py
47
8566
import numpy as np from scipy import linalg from sklearn.decomposition import nmf from scipy.sparse import csc_matrix from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_array_almost...
bsd-3-clause
liang42hao/bokeh
examples/compat/seaborn/violin.py
34
1153
import seaborn as sns from bokeh import mpl from bokeh.plotting import output_file, show tips = sns.load_dataset("tips") sns.set_style("whitegrid") # ax = sns.violinplot(x="size", y="tip", data=tips.sort("size")) # ax = sns.violinplot(x="size", y="tip", data=tips, # order=np.arange(1, 7), palett...
bsd-3-clause
Adai0808/scikit-learn
examples/feature_selection/plot_feature_selection.py
249
2827
""" =============================== Univariate Feature Selection =============================== An example showing univariate feature selection. Noisy (non informative) features are added to the iris data and univariate feature selection is applied. For each feature, we plot the p-values for the univariate feature s...
bsd-3-clause
sniemi/EuclidVisibleInstrument
analysis/analyse.py
1
10786
""" Object finding and measuring ellipticity ======================================== This script provides a class that can be used to analyse VIS data. One can either choose to use a Python based source finding algorithm or give a SExtractor catalog as an input. If an input catalog is provided then the program assume...
bsd-2-clause
open-lambda/open-lambda
test.py
1
15018
#!/usr/bin/env python3 import os, sys, json, time, requests, copy, traceback, tempfile, threading, subprocess from collections import OrderedDict from subprocess import check_output from multiprocessing import Pool from contextlib import contextmanager OLDIR = 'test-dir' results = OrderedDict(...
apache-2.0
Mecanon/morphing_wing
experimental/comparison_model/static_model.py
1
8433
# -*- coding: utf-8 -*- """ - dynamics of a flap with two actuators in different positions - can take in to account initial strain - calculates necessary spring stiffness for a given linear actuator length and for defined positions for the actuators ends. Will have: - coupling with Edwin matlab code - coupling with ...
mit
Erotemic/utool
utool/util_project.py
1
34436
# -*- coding: utf-8 -*- """ Ignore: ~/local/init/REPOS1.py """ from __future__ import absolute_import, division, print_function # , unicode_literals from six.moves import zip, filter, filterfalse, map, range # NOQA import six # NOQA #from os.path import split, dirname, join from os.path import dirname, join from...
apache-2.0
rhshah/Miscellaneous
check_cDNA_Contamination/check_cDNA_contamination.py
3
4630
""" Created on 11/01/2015. @author: Ronak H Shah ###Required Input columns in the structural variant file TumorId NormalId Chr1 Pos1 Chr2 Pos2 SV_Type Gene1 Gene2 Transcript1 Transcript2 Site1Description Site2Description Fusion Confidence Comments Connection_Type SV_LE...
apache-2.0
joernhees/scikit-learn
examples/model_selection/plot_roc_crossval.py
28
3697
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
GuessWhoSamFoo/pandas
pandas/tests/indexing/test_partial.py
1
23612
""" test setting *parts* of objects both positionally and label based TOD: these should be split among the indexer tests """ from warnings import catch_warnings import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, Panel, Series, date_range from pandas.util import testing as tm ...
bsd-3-clause
jlevy44/Joshua-Levy-Synteny-Analysis
hybridumAnalysisScripts/FixBhydTest/bhybridumMappingProbs.py
1
1094
from collections import defaultdict import numpy as np import matplotlib.pyplot as plt sortList = open('q.PAC4GC.001.sort2','r').read().split('\n') sortDict = defaultdict(list) for line in sortList: if line: lineList = line.split() sortDict[lineList[0]] = [lineList[1]] + [int(item) for item in lineL...
mit
thomasbarillot/DAQ
eTOF/FuncDetectPeaks.py
3
6694
# -*- coding: utf-8 -*- """ Created on Wed Mar 23 12:53:10 2016 @author: tbarillot """ """Detect peaks in data based on their amplitude and other features.""" #from __future__ import division, print_function import numpy as np __author__ = "Marcos Duarte, https://github.com/demotu/BMC" __version__ = "1.0.4" __licen...
mit
ViennaRNA/forgi
test/forgi/projection/projection2d_test.py
1
18261
from __future__ import absolute_import, division, print_function, unicode_literals from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip) import unittest import sys import numpy as np import numpy.tes...
gpl-3.0
pratapvardhan/pandas
doc/sphinxext/numpydoc/docscrape_sphinx.py
7
15301
from __future__ import division, absolute_import, print_function import sys import re import inspect import textwrap import pydoc import collections import os from jinja2 import FileSystemLoader from jinja2.sandbox import SandboxedEnvironment import sphinx from sphinx.jinja2glue import BuiltinTemplateLoader from .do...
bsd-3-clause
xzh86/scikit-learn
sklearn/feature_extraction/tests/test_text.py
110
34127
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
bsd-3-clause
lepmik/nest-simulator
pynest/examples/intrinsic_currents_spiking.py
13
5954
# -*- coding: utf-8 -*- # # intrinsic_currents_spiking.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of ...
gpl-2.0
rs2/pandas
pandas/tests/plotting/test_converter.py
1
12196
from datetime import date, datetime import subprocess import sys import numpy as np import pytest import pandas._config.config as cf from pandas.compat.numpy import np_datetime64_compat import pandas.util._test_decorators as td from pandas import Index, Period, Series, Timestamp, date_range import pandas._testing a...
bsd-3-clause
nDroidProject/android_external_blktrace
btt/btt_plot.py
43
11282
#! /usr/bin/env python # # btt_plot.py: Generate matplotlib plots for BTT generate data files # # (C) Copyright 2009 Hewlett-Packard Development Company, L.P. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free So...
gpl-2.0
jdfekete/progressivis
tests/test_02_table_merge.py
1
1859
from collections import OrderedDict import pandas as pd from progressivis import Scheduler from progressivis.table.table import Table from progressivis.table.merge import merge from . import ProgressiveTest df_left1 = pd.DataFrame(OrderedDict([('A', ['A0', 'A1', 'A2', 'A3']), ('...
bsd-2-clause
kingfink/Newport-Folk-Festival
wikipedia_origins.py
1
1064
import urllib import urllib2 from bs4 import BeautifulSoup import pandas as pd def get_location(article): article = urllib.quote(article) opener = urllib2.build_opener() opener.addheaders = [('User-agent', 'Mozilla/5.0')] #wikipedia needs this str_ret = '' try: resource = opener.open("...
mit
bjornaa/polarmap
polar_bathymetry.py
1
1753
# -*- coding: utf-8 -*- # Plot bathymetry on a polar map # ----------------------------------- # Bjørn Ådlandsvik <bjorn@imr.no> # Institute of Marine Research # ----------------------------------- # --------- # Imports # --------- import numpy as np from netCDF4 import Dataset import matplotlib.pyplot as plt from ...
mit
chrisburr/scikit-learn
sklearn/tests/test_multiclass.py
14
21802
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_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_false from sklearn.utils.testing ...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/manifold/tests/test_locally_linear.py
85
5600
from itertools import product 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.testing import assert_less from sklearn....
mit
jblackburne/scikit-learn
sklearn/neural_network/tests/test_rbm.py
225
6278
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
robin-lai/scikit-learn
sklearn/metrics/metrics.py
233
1262
import warnings warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in " "0.18. Please import from sklearn.metrics", DeprecationWarning) from .ranking import auc from .ranking import average_precision_score from .ranking import label_ranking_average_precision_score fro...
bsd-3-clause
xya/sms-tools
lectures/05-Sinusoidal-model/plots-code/sineModel-anal-synth.py
24
1483
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import sineModel as SM import utilFunctions as UF (fs, x) = UF.wavread(os.p...
agpl-3.0
salceson/PJN
lab6/main.py
1
3801
# coding: utf-8 import codecs import sys import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit from operator import itemgetter from ngrams import n_grams_stats from stats import stats _FILENAME = "data/potop.txt" _STATS_FILENAME = "out/stats.csv" _ENCODING = "utf-8" __author__ = "Mi...
mit
jjgomera/pychemqt
setup.py
1
2013
from setuptools import setup, find_packages import io __version__ = "0.1.0" with io.open('README.rst', encoding="utf8") as file: long_description = file.read() setup( name='pychemqt', author='Juan José Gómez Romera', author_email='jjgomera@gmail.com', url='https://github.com/jjgomera/pychemqt',...
gpl-3.0
CodeMonkeyJan/hyperspy
hyperspy/drawing/_widgets/label.py
3
3731
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
gpl-3.0
davidlmorton/spikepy
spikepy/plotting_utils/import_matplotlib.py
1
1221
# Copyright (C) 2012 David Morton # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distribut...
gpl-3.0
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/formats/test_format.py
7
165663
# -*- coding: utf-8 -*- # TODO(wesm): lots of issues making flake8 hard # flake8: noqa from __future__ import print_function from distutils.version import LooseVersion import re from pandas.compat import (range, zip, lrange, StringIO, PY3, u, lzip, is_platform_windows, ...
mit
rlabbe/filterpy
filterpy/kalman/tests/test_enkf.py
2
3356
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for mor...
mit
bigdataelephants/scikit-learn
sklearn/neural_network/tests/test_rbm.py
8
6202
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
mfittere/SixDeskDB
old/riccardo1/sixdeskdb.py
2
10486
import sqlite3 import numpy as np import matplotlib.pyplot as pl import scipy.signal from sqltable import SQLTable def guess_range(l): l=sorted(set(l)) start=l[0] if len(l)>1: step=np.diff(l).min() else: step=None stop=l[-1] return start,stop,step class Fort10(object): fields=[ ('turn_max'...
lgpl-2.1
deepcharles/ruptures
tests/test_display.py
1
2596
import pytest from ruptures.datasets import pw_constant from ruptures.show import display from ruptures.show.display import MatplotlibMissingError @pytest.fixture(scope="module") def signal_bkps(): signal, bkps = pw_constant() return signal, bkps def test_display_with_options(signal_bkps): try: ...
bsd-2-clause
wmvanvliet/mne-python
tutorials/source-modeling/plot_mne_dspm_source_localization.py
1
5668
""" .. _tut-inverse-methods: Source localization with MNE/dSPM/sLORETA/eLORETA ================================================= The aim of this tutorial is to teach you how to compute and apply a linear minimum-norm inverse method on evoked/raw/epochs data. """ import os.path as op import numpy as np import matplo...
bsd-3-clause
stargaser/astropy
astropy/modeling/utils.py
2
25636
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides utility functions for the models package """ from collections import deque, UserDict from collections.abc import MutableMapping from inspect import signature import numpy as np from astropy.utils.decorators import deprecated fro...
bsd-3-clause
adi-foundry/nycodex
nycodex/scrape/dataset.py
1
6364
import os import tempfile from typing import Iterable, List, Tuple import geoalchemy2 import geopandas as gpd import pandas as pd import sqlalchemy as sa from nycodex import db from nycodex.logging import get_logger from . import exceptions, utils BASE = "https://data.cityofnewyork.us/api" RAW_SCHEMA = 'raw' NULL_V...
apache-2.0
zhangzhihan/computationalphysics_n2014301020035
Chapter3/chapter3-1/harmonic motion_RK method.py
2
1534
from matplotlib.pyplot import* g=-9.8;l=1;dt=0.04; def h_motion_RKmethod1(index1,end_time1,ango1): ang=[];ang_v=[];t=[] ang.append(ango1);ang_v.append(0);t.append(0) for i in range(int(end_time1/dt)): angm=ang[-1]+1/2*dt*ang_v[-1] ang_vm=ang_v[-1]+g/l*dt*ang[-1]**index1 ang_tmp=ang...
mit
Upward-Spiral-Science/claritycontrol
assignments/textureHist.py
2
26420
#IMPORTANT: THE ABOVE PORTION IS A SCRIPT FROM SOLEM'S VISION BLOG # http://www.janeriksolem.net/2009/06/histogram-equalization-with-python-and.html import SimpleITK as sitk import clarity as cl # I wrote this module for easier operations on data import clarity.resources as rs import csv,gc # garbage memory collec...
apache-2.0
fabianp/scikit-learn
examples/svm/plot_rbf_parameters.py
57
8096
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radius Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
bsd-3-clause
ccd-utexas/tsphot
lc_online2.py
3
14102
#!/usr/bin/env python import matplotlib matplotlib.use('Agg') from matplotlib.pyplot import * from matplotlib.transforms import offset_copy import numpy as np import scipy from scipy.signal import lombscargle import scipy.optimize as sco import matplotlib.gridspec as gridspec import os def fwhm_fit2(apli...
mit
shanqing-cai/MRI_analysis
aparc12_surface_stats.py
1
11734
#!/usr/bin/python import os import sys import glob import argparse import tempfile import numpy as np import matplotlib.pyplot as plt import pickle import scipy.stats as stats from copy import deepcopy from subprocess import Popen, PIPE from get_qdec_info import get_qdec_info from fs_load_stats import fs_load_stats f...
bsd-3-clause
abhishekkrthakur/scikit-learn
examples/cluster/plot_kmeans_stability_low_dim_dense.py
338
4324
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
bsd-3-clause
hcxiong/skyline
src/analyzer/algorithms.py
9
9794
import pandas import numpy as np import scipy import statsmodels.api as sm import traceback import logging from time import time from msgpack import unpackb, packb from redis import StrictRedis from settings import ( ALGORITHMS, CONSENSUS, FULL_DURATION, MAX_TOLERABLE_BOREDOM, MIN_TOLERABLE_LENGTH,...
mit
MediffRobotics/DeepRobotics
DeepLearnMaterials/tutorials/numpy&pandas/16_concat.py
3
1436
# View more python tutorials on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial """ Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly....
gpl-3.0
qiqi/fds
apps/charles_cylinder3D_Lyapunov/draw_Lyapunov/drawCLV.py
1
4385
# This file reads the checkpoint files, computes CLVs, call charles.exe for 0 step, # and genereate the flow field solution for state variables: rho, rhoE, rhoU from __future__ import division import os import sys import time import shutil import string import tempfile import argparse import subprocess from multiproc...
gpl-3.0
suiyuan2009/tensorflow
tensorflow/examples/tutorials/word2vec/word2vec_basic.py
13
9596
# 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
dknez/libmesh
doc/statistics/libmesh_sflogos.py
7
6095
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num # SF.net pages and SFLogo Impressions. # On the site, located under "Sourceforge Traffic". Number of logos # (last column) seems to be the...
lgpl-2.1
matthiasdiener/spack
var/spack/repos/builtin/packages/py-localcider/package.py
5
1786
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
bigfishman/oceanbase
oceanbase_0.4/tools/deploy/perf/1.py
12
1857
import datetime import re import sys try: import matplotlib.pyplot as plt except ImportError: plt = None time_format = "%Y-%m-%d %H:%M:%S" d = dict() start_time = None start_time = None sql_count = 0 sql_time = 0 sql_time_dist = dict() rpc_time = 0 urpc_time = 0 wait_time = 0 qps2time = dict() rpc_times = [] urpc_...
gpl-2.0
liamneath1/hailey.io
server-side/stock_market/TTSE_Parser.py
1
5362
import IndexScraper as iScrape import constants as const import urllib.request import pandas as pd import pprint as pp import datetime from bs4 import BeautifulSoup from pandas.tseries.offsets import BDay import sys import util import os class TTSE_Parser(iScrape.IndexScraper): def __init__(self, queryFreq, tabl...
mit
QianruZhou333/ASleep
my_importData_small.py
2
1639
import numpy as np import pandas as pd input_file = "3_floor.csv" # comma delimited is the default df = pd.read_csv(input_file, header = 0) # for space delimited use: # df = pd.read_csv(input_file, header = 0, delimiter = " ") # for tab delimited use: # df = pd.read_csv(input_file, header = 0, delimiter = "\t") # ...
apache-2.0
fizz-ml/policybandit
bayestorch/hmc.py
1
3828
import torch as t import torch.nn.functional as f from torch.autograd import Variable from torch.optim import Optimizer import math import matplotlib.pyplot as plt import numpy as np class HMCSampler(object): """updates the model parameters by preforming n hcmc updates (larger description) """ def __i...
mit
anhaidgroup/py_entitymatching
py_entitymatching/tests/test_black_box_blocker.py
1
16764
import os from nose.tools import * import pandas as pd import unittest import py_entitymatching as em import py_entitymatching.feature.simfunctions as sim p = em.get_install_path() path_a = os.sep.join([p, 'tests', 'test_datasets', 'A.csv']) path_b = os.sep.join([p, 'tests', 'test_datasets', 'B.csv']) l_output_attrs ...
bsd-3-clause
CenterForTheBuiltEnvironment/comfort_tool
comfort.py
1
5570
from io import TextIOWrapper from flask import ( Flask, request, render_template, send_from_directory, abort, jsonify, make_response, ) from pythermalcomfort.models import pmv_ppd, set_tmp, cooling_effect from pythermalcomfort.psychrometrics import v_relative, clo_dynamic import pandas as pd...
gpl-2.0
rgerkin/python-neo
examples/roi_demo.py
6
1105
""" Example of working with RegionOfInterest objects """ import matplotlib.pyplot as plt import numpy as np from neo.core import CircularRegionOfInterest, RectangularRegionOfInterest, PolygonRegionOfInterest from numpy.random import rand def plot_roi(roi, shape): img = rand(120, 100) pir = np.array(roi.pixel...
bsd-3-clause
raphaelvalentin/qtlayout
syntax/interpolate/plotting/contour.py
1
1449
#!/usr/local/bin/python import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import FormatStrFormatter from matplotlib.figure import SubplotParams from matplotlib.ticker import MaxNLocator import os from function import * from xplot import * class contour(plot): def __init__(self, **kwargs): ...
gpl-2.0
shikhardb/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
10
9723
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics impo...
bsd-3-clause
davebrent/aubio
python/demos/demo_sink_create_woodblock.py
10
1580
#! /usr/bin/env python import sys from math import pi, e from aubio import sink from numpy import arange, resize, sin, exp, zeros if len(sys.argv) < 2: print 'usage: %s <outputfile> [samplerate]' % sys.argv[0] sys.exit(1) samplerate = 44100 # samplerate in Hz if len( sys.argv ) > 2: samplerate = int(sys.argv...
gpl-3.0
moreati/pandashells
pandashells/lib/outlier_lib.py
7
2092
#! /usr/bin/env python # standard library imports from collections import Counter from pandashells.lib import module_checker_lib # import required dependencies module_checker_lib.check_for_modules(['pandas', 'numpy']) import pandas as pd import numpy as np # disable the chained assignment warning because raises fa...
bsd-2-clause
besser82/shogun
applications/easysvm/esvm/plots.py
7
6555
""" This module contains code for commonly used plots """ # This software is distributed under BSD 3-clause license (see LICENSE file). # # Authors: Soeren Sonnenburg import sys import random import numpy import warnings import shutil from shogun import Labels from shogun import * def plotroc(output, LTE, draw_rand...
bsd-3-clause
liangz0707/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
eerimoq/cantools
tests/test_plot_without_mock.py
1
2943
#!/usr/bin/env python3 import os import sys import unittest from unittest import mock from io import StringIO import cantools import matplotlib.pyplot as plt class CanToolsPlotTest(unittest.TestCase): DBC_FILE = os.path.join(os.path.split(__file__)[0], 'files/dbc/abs.dbc') FN_OUT = "out.pdf" def test_p...
mit
NSLS-II-CHX/ipython_ophyd
profile_collection/ipython_qtconsole_config.py
13
24674
# Configuration file for ipython-qtconsole. c = get_config() #------------------------------------------------------------------------------ # IPythonQtConsoleApp configuration #------------------------------------------------------------------------------ # IPythonQtConsoleApp will inherit config from: BaseIPythonA...
bsd-2-clause
komsas/OpenUpgrade
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
dongjoon-hyun/spark
python/pyspark/pandas/generic.py
9
104900
# # 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
lenovor/scikit-learn
sklearn/metrics/pairwise.py
104
42995
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause
justincassidy/scikit-learn
sklearn/neighbors/tests/test_kde.py
208
5556
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
dls-controls/pymalcolm
malcolm/modules/pandablocks/controllers/pandablockcontroller.py
1
13688
import os from typing import Any, Dict, Optional, Union, cast from annotypes import Anno from malcolm.core import ( Alarm, AMri, BooleanMeta, ChoiceMeta, NumberMeta, Port, StringMeta, TableMeta, TimeStamp, VMeta, Widget, badge_value_tag, config_tag, group_tag, ...
apache-2.0
466152112/hyperopt
hyperopt/tests/test_tpe.py
7
23399
from functools import partial import os import unittest import nose import numpy as np try: import matplotlib.pyplot as plt except ImportError: pass from hyperopt import pyll from hyperopt.pyll import scope from hyperopt import Trials from hyperopt.base import miscs_to_idxs_vals, STATUS_OK from hyperopt i...
bsd-3-clause
deepesch/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
crichardson17/starburst_atlas
Low_resolution_sims/Dusty_LowRes/Geneva_inst_NoRot/Geneva_inst_NoRot_0/fullgrid/UV1.py
31
9315
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
iwonasob/BAD-masked-NMF
src/dataset.py
1
3288
''' Download, extract and partition the datasets ''' import config as cfg import os import sys import requests import zipfile from clint.textui import progress import numpy as np np.random.seed(1515) import pandas as pd class DatasetCreator: def __init__(self, dataset_name): ...
mit
robin-lai/scikit-learn
sklearn/cluster/bicluster.py
211
19443
"""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
marionleborgne/nupic.research
projects/l2_pooling/infer_hand_crafted_objects.py
1
5291
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it under the ...
agpl-3.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/sklearn/svm/tests/test_svm.py
33
35916
""" Testing for Support Vector Machine module (sklearn.svm) TODO: remove hard coded numerical results when possible """ import numpy as np import itertools from numpy.testing import assert_array_equal, assert_array_almost_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_allclose fro...
mit
stephenjust/stk-stats
userreport/views/usercount.py
1
1645
from userreport.models import UserReport from django.http import HttpResponse from django.views.decorators.cache import cache_page from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.dates import DateFormatter import matplotlib.artist @cac...
mit
lfairchild/PmagPy
programs/dmag_magic.py
1
9569
#!/usr/bin/env python # -*- python-indent-offset: 4; -*- # -*- mode: python-mode; python-indent-offset: 4 -*- import sys import os import matplotlib if matplotlib.get_backend() != "TKAgg": matplotlib.use("TKAgg") import pmagpy.pmag as pmag import pmagpy.pmagplotlib as pmagplotlib import pmagpy.contribution_builde...
bsd-3-clause
rhambach/TEMareels
tools/remove_stripes.py
1
1747
""" IMPLEMENTATION: - crude method for removing periodic noise in images recorded on Tietz CMOS slave camera in wq-mode - integrates over several lines (e.g. 10x4096) of noise and substracts signal from each line in sector Copyright (c) 2013, pwachsmuth, rhambach This file is part of...
mit
DavidLP/SourceSim
tools/charge_sharing_z_correction.py
1
1377
# Shows the correction of z to take into account a charge cloud with a sigma != 0 at the beginning import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d.axes3d import Axes3D from scipy.special import erf from itertools import product, combinations import mpl_toolkits.mp...
bsd-2-clause
mxjl620/scikit-learn
sklearn/neighbors/regression.py
100
11017
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output support by Arna...
bsd-3-clause
mindriot101/batman
docs/quickstart.py
2
1823
# The batman package: fast computation of exoplanet transit light curves # Copyright (C) 2015 Laura Kreidberg # # 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...
gpl-3.0
Akshay0724/scikit-learn
examples/neural_networks/plot_mnist_filters.py
79
2189
""" ===================================== Visualization of MLP weights on MNIST ===================================== Sometimes looking at the learned coefficients of a neural network can provide insight into the learning behavior. For example if weights look unstructured, maybe some were not used at all, or if very l...
bsd-3-clause
wzbozon/statsmodels
statsmodels/sandbox/panel/panelmod.py
27
14526
""" Sandbox Panel Estimators References ----------- Baltagi, Badi H. `Econometric Analysis of Panel Data.` 4th ed. Wiley, 2008. """ from __future__ import print_function from statsmodels.compat.python import range, reduce from statsmodels.tools.tools import categorical from statsmodels.regression.linear_model import ...
bsd-3-clause
gviejo/ThalamusPhysio
python/main_make_THETA_HISTOGRAM.py
1
5163
#!/usr/bin/env python ''' File name: main_make_Thetainfo.py Author: Guillaume Viejo Date created: 16/08/2017 Python Version: 3.5.2 Theta modulation, returns angle Used to make figure 1 # TODO ASK ADRIEN ABOUT THE RESTRICTION BY SLEEP_EP ''' import numpy as np import pandas as pd import scipy.io fr...
gpl-3.0
valpasq/yatsm
yatsm/cli/pixel.py
2
12052
""" Command line interface for running YATSM algorithms on individual pixels """ import datetime as dt import logging import re import click import matplotlib as mpl import matplotlib.cm # noqa import matplotlib.pyplot as plt import numpy as np import patsy import yaml from . import options, console from ..algorithm...
mit
asimshankar/tensorflow
tensorflow/contrib/learn/__init__.py
18
2695
# 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
QISKit/qiskit-sdk-py
qiskit/pulse/commands/sample_pulse.py
1
6024
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/sklearn/ensemble/forest.py
6
79027
"""Forest of trees-based ensemble methods Those methods include random forests and extremely randomized trees. The module structure is the following: - The ``BaseForest`` base class implements a common ``fit`` method for all the estimators in the module. The ``fit`` method of the base ``Forest`` class calls the ...
mit
relf/smt
smt/examples/b777_engine/b777_engine.py
3
8217
import numpy as np import os def get_b777_engine(): this_dir = os.path.split(__file__)[0] nt = 12 * 11 * 8 xt = np.loadtxt(os.path.join(this_dir, "b777_engine_inputs.dat")).reshape((nt, 3)) yt = np.loadtxt(os.path.join(this_dir, "b777_engine_outputs.dat")).reshape((nt, 2)) dyt_dxt = np.loadtxt(os...
bsd-3-clause
rahuldhote/scikit-learn
sklearn/feature_selection/__init__.py
244
1088
""" The :mod:`sklearn.feature_selection` module implements feature selection algorithms. It currently includes univariate filter selection methods and the recursive feature elimination algorithm. """ from .univariate_selection import chi2 from .univariate_selection import f_classif from .univariate_selection import f_...
bsd-3-clause
tmhm/scikit-learn
setup.py
143
7364
#! /usr/bin/env python # # Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # License: 3-clause BSD descr = """A set of python modules for machine learning and data mining""" import sys import os import shutil from distutils.command.clean ...
bsd-3-clause