repo_name stringlengths 7 90 | path stringlengths 5 191 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 976 581k | license stringclasses 15
values |
|---|---|---|---|---|---|
eokeeffe/uav_photogrammetry_toolkit | blur_detection/dft_inspect.py | 2 | 4639 | import cv2
import os,sys
import numpy as np
from collections import deque
from multiprocessing.pool import ThreadPool,Queue
#from matplotlib import pyplot as plt
def normalize(arr):
for i in range(3):
minval=arr[...,i].min()
maxval=arr[...,i].max()
if minval!=maxval:
arr[...,i]-... | gpl-2.0 |
pravsripad/mne-python | mne/viz/tests/test_misc.py | 9 | 10531 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Cathy Nangini <cnangini@gmail.com>
# Mainak Jas <mainak@neuro.hut.fi>
#
# License: ... | bsd-3-clause |
ngoix/OCRF | examples/text/hashing_vs_dict_vectorizer.py | 93 | 3243 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
danielballan/ipython_extensions | extensions/retina.py | 4 | 2313 | """
Enable Retina (2x) PNG figures with matplotlib
Usage: %load_ext retina
"""
import struct
from base64 import encodestring
from io import BytesIO
def pngxy(data):
"""read the width/height from a PNG header"""
ihdr = data.index(b'IHDR')
# next 8 bytes are width/height
w4h4 = data[ihdr+4:ihdr+12]
... | bsd-3-clause |
acwilton/parallel-path-finding | GetResults.py | 1 | 6144 | import os
import glob
import time
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from CustomGraph import *
class Size:
def __init__(self, width, height):
self.width = str(width)
self.height = str(height)
def getStr(self):
return self.width + "x" + se... | mit |
wangqingbaidu/aliMusic | models/new_songs_incr_bp.py | 1 | 35646 | # -*- coding: UTF-8 -*-
'''
Authorized by vlon Jang
Created on Jul 3, 2016
Email:zhangzhiwei@ict.ac.cn
From Institute of Computing Technology
All Rights Reserved.
'''
import pandas as pd
import numpy as np
import pymysql
import matplotlib ... | gpl-3.0 |
wavelets/hmmlearn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 52 | 8004 | import re
import inspect
import textwrap
import pydoc
import sphinx
from docscrape import NumpyDocString
from docscrape import FunctionDoc
from docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
sel... | bsd-3-clause |
Hojalab/mplh5canvas | examples/slider_plot.py | 4 | 2319 | #! /usr/bin/python
#
# Plot the coherence magnitude curve for the Sun
# See Born & Wolf, p. 576
#
# Ludwig Schwardt
# 31 January 2008
# Updated to HTML demo version on 13 July 2013
#
import numpy as np
try:
# SciPy is an optional dependency to get the jinc function
import scipy.special as sp
except ImportError... | bsd-3-clause |
petosegan/scikit-learn | examples/calibration/plot_calibration_multiclass.py | 272 | 6972 | """
==================================================
Probability Calibration for 3-class classification
==================================================
This example illustrates how sigmoid calibration changes predicted
probabilities for a 3-class classification problem. Illustrated is the
standard 2-simplex, wher... | bsd-3-clause |
heli522/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 |
kylerbrown/scikit-learn | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
wazeerzulfikar/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 387 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause |
miguelinux/vbox | src/VBox/ValidationKit/testmanager/webui/wuihlpgraph.py | 1 | 4309 | # -*- coding: utf-8 -*-
# $Id: wuihlpgraph.py $
"""
Test Manager Web-UI - Graph Helpers.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and... | gpl-2.0 |
jjx02230808/project0223 | sklearn/datasets/base.py | 22 | 22973 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import sys
import shutil
from os import environ... | bsd-3-clause |
andrewnc/scikit-learn | sklearn/utils/tests/test_utils.py | 215 | 8100 | import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import pinv2
from itertools import chain
from sklearn.utils.testing import (assert_equal, assert_raises, assert_true,
assert_almost_equal, assert_array_equal,
SkipTest, ... | bsd-3-clause |
timsnyder/bokeh | bokeh/core/json_encoder.py | 2 | 9041 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
barney-NG/pyCAMTracker | src/filterpy/kalman/tests/ukf2.py | 3 | 47474 | # -*- 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 mo... | mit |
arabenjamin/scikit-learn | examples/model_selection/grid_search_text_feature_extraction.py | 253 | 4158 | """
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the do... | bsd-3-clause |
jcchin/Hyperloop | src/hyperloop/plot/mc_histo.py | 1 | 1554 | import numpy as np
from matplotlib import pylab as plt
from openmdao.lib.casehandlers.api import CaseDataset
from matplotlib import mlab as mlab
class MC_Plot:
def plot(self,file):
cds = CaseDataset(file, 'bson')
data = cds.data.driver('driver').by_variable().fetch()
cds2 = CaseDataset('..... | apache-2.0 |
vigilv/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 |
arahuja/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 134 | 7452 | """
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected in... | bsd-3-clause |
waldol1/BYU-AWESOME | scripts/post_pro_lines/hough_lines.py | 1 | 5648 | import numpy as np
import argparse
import glob
import cv2
import sys
import matplotlib.pyplot as plt
import math
from scipy import signal as sig
def hough_line(img, ori, org, required_votes):
h,w = img.shape[:2]
mid_pt = (np.ceil(w/2.0), np.ceil(h/2.0)) #consider odd pixel w/h
max_diagonal = np.ceil(np.s... | gpl-3.0 |
parenthetical-e/modelmodel | dm.py | 1 | 2679 | """Design matrix processing functions"""
import numpy as np
import pandas as pd
from copy import deepcopy
from statsmodels.api import GLS
def convolve_hrf(dm, hrf, cols=None):
"""Convolve hrf onto design matrix columns.
dm : array-like or DataFrame (n_samples, n_conds)
The design matrix
hrf ... | bsd-2-clause |
equialgo/scikit-learn | sklearn/cluster/birch.py | 5 | 22735 | # Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Joel Nothman <joel.nothman@gmail.com>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
from scipy import sparse
from math import sqrt
fro... | bsd-3-clause |
jksinton/littlesleeper2 | littlesleeper.py | 1 | 36013 | #!/usr/bin/python
#************************************************************************************
# Copyright (c) 2016 James Sinton
#
# 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 Foundati... | gpl-3.0 |
lpedit-devs/lpedit | unittests/FishersExactTest.py | 1 | 1383 | #!/usr/bin/env python
import sys,os,unittest
import matplotlib as mpl
if mpl.get_backend() != 'agg':
mpl.use('agg')
from lpedit import Controller,NoGuiAnalysis
## test class for the main window function
class FishersExactTest(unittest.TestCase):
def setUp(self):
controller = Controller(debug=False) ... | bsd-3-clause |
cpudvar/Galaxy-Classification | Code/spiral_test.py | 1 | 4312 | from astropy.io import fits
import cv2
import f2n
import matplotlib
import matplotlib.pyplot as plt
import numpy
from optparse import OptionParser
import os
import pylab
import scipy
from scipy import ndimage
import sys
def get_options():
#Gets options from command line
usage = """
Read in a FITS file for ... | mit |
AISpace2/AISpace2 | aipython/agents.py | 1 | 4951 | # agents.py - Agent and Controllers
# AIFCA Python3 code Version 0.7.1 Documentation at http://aipython.org
# Artificial Intelligence: Foundations of Computational Agents
# http://artint.info
# Copyright David L Poole and Alan K Mackworth 2017.
# This work is licensed under a Creative Commons
# Attribution-NonCommerci... | gpl-3.0 |
zooniverse/aggregation | experimental/algorithms/old_weather/create_data.py | 2 | 5608 | __author__ = 'greg'
import json
from pprint import pprint
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import math
import numpy as np
import cv2
from sklearn.cluster import DBSCAN
import cPickle as pickle
# img = cv2.imread("/home/ggdhines/Dropbox/066e48f5-812c-4b5f-ab04-df6c35f50393.jpeg")
# print... | apache-2.0 |
espressomd/espresso | samples/visualization_ljliquid.py | 2 | 5844 | #
# Copyright (C) 2013-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | gpl-3.0 |
ninotoshi/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/test_dataframe.py | 2 | 4373 | """Tests of the DataFrame class."""
# Copyright 2016 Google Inc. 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
#
# Un... | apache-2.0 |
alvaroing12/CADL | session-4/tests/test_4.py | 5 | 2996 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from libs import utils
from libs import dataset_utils
from libs import vgg16, inception, i2v
from libs import stylenet
def test_libraries():
import os
import numpy as np
import matplotlib.pyp... | apache-2.0 |
PennyQ/stero_3D_dust_map | maptools.py | 1 | 86731 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# maptools.py
#
# Copyright 2013-2014 Greg Green <greg@greg-UX31A>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of ... | gpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/widgets/dicteditor.py | 2 | 56061 | # -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
Dictionary Editor Widget and Dialog based on Qt
"""
#TODO: Multiple selection: open as many editors (array/dict/...) as necessary,
# at the same time
# pyl... | gpl-3.0 |
lorgor/vulnmine | vulnmine/matchsft.py | 1 | 37225 | """matchsft: Match CPE "Software" data with SCCM Software Inventory data.
Purpose
=======
The matchven module previously produced a dataframe with CPE "Vendor" - SCCM
"Publisher" matches. This dataframe is used by matchsft as follows:
* The CPE dictionary documents the software produced by each Vendor.
Likewis... | gpl-3.0 |
antoinecarme/pyaf | notebooks_sandbox/temporal_hierarchy/time_hierarchy_prototype_GOOG.py | 1 | 1407 | # %matplotlib inline
import pyaf
import datetime
goog_link = 'https://raw.githubusercontent.com/antoinecarme/TimeSeriesData/master/YahooFinance/nasdaq/yahoo_GOOG.csv'
import pandas as pd
goog_dataframe = pd.read_csv(goog_link);
goog_dataframe['Date'] = goog_dataframe['Date'].apply(lambda x : datetime.datetime.str... | bsd-3-clause |
xguse/ggplot | ggplot/components/smoothers.py | 12 | 2576 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from pandas.lib import Timestamp
import pandas as pd
import statsmodels.api as sm
from statsmodels.nonparametric.smoothers_lowess import lowess as smlowess
from statsmodels.sandbox.regression.... | bsd-2-clause |
cl4rke/scikit-learn | examples/tree/plot_tree_regression.py | 206 | 1476 | """
===================================================================
Decision Tree Regression
===================================================================
A 1D regression with decision tree.
The :ref:`decision trees <tree>` is
used to fit a sine curve with addition noisy observation. As a result, it
learns ... | bsd-3-clause |
mkness/TheCannon | code/makeplot_fits_self.py | 1 | 7023 | #!/usr/bin/python
import scipy
import numpy
import pickle
from numpy import *
from scipy import ndimage
from scipy import interpolate
from numpy import loadtxt
import os
import numpy as np
from numpy import *
import matplotlib
from pylab import rcParams
from pylab import *
from matplotlib import pyplot
import ... | mit |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/matplotlib/colorbar.py | 10 | 49307 | '''
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 ... | mit |
jgliss/pyplis | scripts/ex0_6_pcs_lines.py | 1 | 6820 | # -*- coding: utf-8 -*-
#
# Pyplis is a Python library for the analysis of UV SO2 camera data
# Copyright (C) 2017 Jonas Gliss (jonasgliss@gmail.com)
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License a
# published by the Free Software Foundat... | gpl-3.0 |
matthewzimmer/traffic-sign-classification | examples/lesson_7_tensorflow.py | 1 | 13458 | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... | mit |
danche354/Sequence-Labeling | ner/senna-hash-pos-chunk-128-64.py | 1 | 7116 | from keras.models import Model
from keras.layers import Input, Masking, Dense, LSTM
from keras.layers import Dropout, TimeDistributed, Bidirectional, merge
from keras.layers.embeddings import Embedding
from keras.utils import np_utils
import numpy as np
import pandas as pd
import sys
import math
import os
from dateti... | mit |
louispotok/pandas | pandas/tests/io/parser/usecols.py | 3 | 19229 | # -*- coding: utf-8 -*-
"""
Tests the usecols functionality during parsing
for all of the parsers defined in parsers.py
"""
import pytest
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame, Index
from pandas._libs.tslib import Timestamp
from pandas.compat import StringIO
class Usecol... | bsd-3-clause |
michaelbramwell/sms-tools | lectures/03-Fourier-properties/plots-code/convolution-1.py | 24 | 1341 | import matplotlib.pyplot as plt
import numpy as np
import time, os, sys
from scipy.fftpack import fft, ifft, fftshift
import math
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import utilFunctions as UF
import dftModel as DF
(fs, x) = UF.wavread('../../../soun... | agpl-3.0 |
abinashpanda/pgmpy | pgmpy/estimators/BdeuScore.py | 6 | 3421 | #!/usr/bin/env python
from math import lgamma
from pgmpy.estimators import StructureScore
class BdeuScore(StructureScore):
def __init__(self, data, equivalent_sample_size=10, **kwargs):
"""
Class for Bayesian structure scoring for BayesianModels with Dirichlet priors.
The BDeu score is th... | mit |
IanHawke/toy-evolve | toy-evolve/advection_sine_weno5_upwind_rk3_convergence.py | 1 | 1392 | # Advection test evolution: convergence test
from models import advection
from bcs import periodic
from simulation import simulation
from methods import weno5_upwind
from rk import rk3
from grid import grid
import numpy
from matplotlib import pyplot
Ngz = 4
Npoints_all = 40 * 2**numpy.arange(5)
dx_all = 1 / Npoints_a... | mit |
dingocuster/scikit-learn | examples/decomposition/plot_image_denoising.py | 181 | 5819 | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of the Lena image using firstly online :ref:`DictionaryLearning` and
various transform methods.
The dictionary is fitted o... | bsd-3-clause |
billy-inn/scikit-learn | examples/model_selection/randomized_search.py | 201 | 3214 | """
=========================================================================
Comparing randomized search and grid search for hyperparameter estimation
=========================================================================
Compare randomized search and grid search for optimizing hyperparameters of a
random forest.
... | bsd-3-clause |
amath574w2015/am574-class | homeworks/hw1/problem_3_5.py | 1 | 1129 | """
Create figure to accompany problem 3.5.
"""
# load numpy, matplotlib commands...
from pylab import *
clf() # clear figure
plot([0,4],[0,0],'k') # x-axis 'k' means black line
plot([0,0],[0,6],'k') # t-axis
plot([4,4],[0,6],'k') # right boundary
def plot_rightgoing(x1,t1):
"""
plot right-going wave of s... | bsd-3-clause |
jaidevd/scikit-learn | examples/gaussian_process/plot_gpr_co2.py | 131 | 5705 | """
========================================================
Gaussian process regression (GPR) on Mauna Loa CO2 data.
========================================================
This example is based on Section 5.4.3 of "Gaussian Processes for Machine
Learning" [RW2006]. It illustrates an example of complex kernel engine... | bsd-3-clause |
pafluxa/todsynth | build/lib.linux-x86_64-2.7/todsynth/instruments/classTelescope/IO/io.py | 1 | 3895 | import os
import pandas
import numpy
import pygetdata
from todsynth.tod import TOD
from raw_data_manager import RawDataManager as RDM
@staticmethod
def todNameToTodPath( todName, basepath ):
'''
'''
# Extract year, month, day and time
yy,mm,dd,HH,MM,SS = todName.split( '-' )
path = "%s-%s/%s-%s-... | gpl-3.0 |
dhermes/google-cloud-python | bigquery/google/cloud/bigquery/table.py | 2 | 48877 | # Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
kyunghyuncho/GroundHog | scripts/evaluate.py | 18 | 2305 | #!/usr/bin/env python
import numpy
import pandas
import argparse
import matplotlib
import logging
matplotlib.use("Agg")
from matplotlib import pyplot
logger = logging.getLogger()
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--start", type=int, default=0, help="Start from this ite... | bsd-3-clause |
gisleyt/cuteforce | python/analysis/analyze.py | 1 | 9488 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from bisect import bisect
from matplotlib.pylab import *
import json
'''
Analyze event logs and produce stats.
Usage: $ sort -n events.csv | python sessions.py | python analyze.py
'''
def update_watched_episodes(episodes, session, max_length):
""... | gpl-3.0 |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/bedtool.py | 1 | 119619 | from __future__ import print_function
import tempfile
from textwrap import dedent
import shutil
import subprocess
import operator
import os
import sys
import random
import string
import pprint
from itertools import islice
import multiprocessing
import six
import gzip
import pysam
from .helpers import (
get_tempdir... | apache-2.0 |
Clyde-fare/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
xmnlab/minilab | labtrans/daq/daq_file/prepare_acquisition_data.py | 2 | 2015 | from __future__ import division
from datetime import timedelta, datetime
from collections import defaultdict
from matplotlib.ticker import EngFormatter
import matplotlib.pyplot as plt
import pickle
import sys
from copy import deepcopy
import numpy as np
# mswim module path
sys.path.insert(0, 'c:/mswim/')
# mswim pac... | gpl-3.0 |
astroML/astroML | astroML/plotting/tools.py | 2 | 4842 | import numpy as np
from io import BytesIO
from matplotlib import pyplot as plt
from scipy import interpolate
from matplotlib import image
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.transforms import Bbox
from matplotlib.patches import Ellipse
def devectorize_axes(ax=None, dpi=None, transpa... | bsd-2-clause |
PedroTrujilloV/nest-simulator | pynest/examples/intrinsic_currents_subthreshold.py | 9 | 7172 | # -*- coding: utf-8 -*-
#
# intrinsic_currents_subthreshold.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 ... | gpl-2.0 |
ngoix/OCRF | examples/applications/svm_gui.py | 124 | 11251 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | bsd-3-clause |
maheshakya/scikit-learn | sklearn/metrics/pairwise.py | 2 | 41251 | # -*- 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 |
m3wolf/xanespy | tests/test_frameset.py | 1 | 38516 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2016 Mark Wolf
#
# This file is part of Xanespy.
#
# Xanespy 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
# ... | gpl-3.0 |
douggeiger/gnuradio | gr-utils/python/utils/plot_fft_base.py | 53 | 10449 | #!/usr/bin/env python
#
# Copyright 2007,2008,2011 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 ... | gpl-3.0 |
ActiveState/code | recipes/Python/578379_Plotting_maps_Polar_Stereographic/recipe-578379.py | 1 | 3213 | #!/usr/bin/env python3
'''Simple function to define a map with North/South Polar Stereographic
projection focused in a region of the globe (Basemap object).
When plotting maps with either 'npstere' or 'spstere' projections with the
Basemap toolkit for Matplotlib, the pole will always be placed in the center of
the fi... | mit |
nhejazi/scikit-learn | sklearn/tests/test_docstring_parameters.py | 2 | 5716 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Raghav RV <rvraghav93@gmail.com>
# License: BSD 3 clause
import inspect
import sys
import warnings
import importlib
from pkgutil import walk_packages
from inspect import getsource, isabstract
import sklearn
from sklearn.base import signature
from... | bsd-3-clause |
eramirem/astroML | book_figures/chapter10/fig_LS_comparison.py | 3 | 2128 | """
Comparison of Lomb-Scargle Methods
----------------------------------
This shows a comparison of the Lomb-Scargle periodogram
and the Modified Lomb-Scargle periodogram for a single star,
along with the multi-term results.
"""
# Author: Jake VanderPlas
# License: BSD
# The figure produced by this code is published... | bsd-2-clause |
sumspr/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 |
equialgo/scikit-learn | sklearn/decomposition/pca.py | 5 | 28644 | """ Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Michael Eickenberg <michael.eickenberg@inria.fr>
# ... | bsd-3-clause |
danking/hail | hail/python/hailtop/batch/docker.py | 1 | 3112 | import shutil
import sys
import os
from typing import Optional, List
from ..utils import secret_alnum_string, sync_check_shell_output
def build_python_image(fullname: str,
requirements: Optional[List[str]] = None,
python_version: Optional[str] = None,
... | mit |
fabianp/scikit-learn | sklearn/cross_validation.py | 1 | 58422 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
marqh/cartopy | lib/cartopy/examples/gmaptiles.py | 1 | 3202 | # (C) British Crown Copyright 2011 - 2012, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | gpl-3.0 |
mancellin/capytaine | capytaine/matrices/block.py | 1 | 24206 | #!/usr/bin/env python
# coding: utf-8
"""This module implements block matrices to be used in Hierarchical Toeplitz matrices.
It takes inspiration from the following works:
* `openHmx module from Gypsilab by Matthieu Aussal (GPL licensed) <https://github.com/matthieuaussal/gypsilab>`_
* `HierarchicalMatrices by Markus... | gpl-3.0 |
arider/riderml | riderml/tests/neural_network/test_autoencoder.py | 1 | 1847 | import numpy
import unittest
from ...neural_network.autoencoder import autoencoder
from ...util.evaluation import MAE
from unittest import TestCase
from mock import patch
from sklearn import datasets
class AutoencoderTest(TestCase):
def setUp(self):
self.x = datasets.load_iris().data
def test_propaga... | mit |
fredhusser/scikit-learn | sklearn/feature_selection/tests/test_base.py | 170 | 3666 | import numpy as np
from scipy import sparse as sp
from nose.tools import assert_raises, assert_equal
from numpy.testing import assert_array_equal
from sklearn.base import BaseEstimator
from sklearn.feature_selection.base import SelectorMixin
from sklearn.utils import check_array
class StepSelector(SelectorMixin, Ba... | bsd-3-clause |
wangtianqi1993/machine-learning-project | visualization/plot_lle_digits.py | 1 | 2314 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'wtq'
from time import time
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import offsetbox
from sklearn import (manifold, datasets, decomposition, ensemble,
discriminant_analysis, random_pr... | gpl-3.0 |
sekikn/incubator-airflow | airflow/providers/apache/hive/hooks/hive.py | 3 | 41734 | #
# 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... | apache-2.0 |
ZenDevelopmentSystems/scikit-learn | benchmarks/bench_mnist.py | 76 | 6136 | """
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... | bsd-3-clause |
aminert/scikit-learn | examples/model_selection/plot_precision_recall.py | 249 | 6150 | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
In information retrieval, precision is a measure of result relevancy, while
recall is a measure of how many truly relevant results are returned. A high
area under the curve represents both ... | bsd-3-clause |
katyhuff/moose | test/tests/time_integrators/scalar/run_stiff.py | 5 | 5336 | #!/usr/bin/env python
import subprocess
import sys
import csv
import matplotlib.pyplot as plt
import numpy as np
# Use fonts that match LaTeX
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] = 17
rcParams['font.serif'] = ['Computer Modern Roman']
rcParams['text.usetex'] = True
#... | lgpl-2.1 |
jpzk/evopy | evopy/examples/experiments/parallel_benchmark/cpuplot.py | 1 | 1661 | '''
This file is part of evopy.
Copyright 2012 - 2013, Jendrik Poloczek
evopy 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.
evopy is di... | gpl-3.0 |
kratzert/RRMPG | rrmpg/models/hbvedu.py | 1 | 13564 | # -*- coding: utf-8 -*-
# This file is part of RRMPG.
#
# RRMPG is free software with the aim to provide a playground for experiments
# with hydrological rainfall-runoff-models while achieving competitive
# performance results.
#
# You should have received a copy of the MIT License along with RRMPG. If not,
# see <http... | mit |
RayMick/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 |
ebilionis/variational-reformulation-of-inverse-problems | unittests/test_optimize_catalysis_full_dmnl.py | 1 | 6880 | """
A first test for the ELBO on the catalysis problem.
The target is consisted of an uninformative prior and a Gaussian likelihood.
The approximating mixture has two components.
Author:
Panagiotis Tsilifis
Date:
6/12/2014
"""
import numpy as np
import matplotlib.pyplot as plt
import os
import cPickle as ... | gpl-2.0 |
vinodkc/spark | python/pyspark/pandas/tests/data_type_ops/test_binary_ops.py | 7 | 6774 | #
# 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 |
markneville/nupic | examples/opf/tools/MirrorImageViz/mirrorImageViz.py | 50 | 7221 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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 |
ranjeethmahankali/BIMToVec | train_embeddings.py | 1 | 3230 | from model_embeddings import *
from sklearn.manifold import TSNE
from matplotlib import pylab
import sys
import shutil
# instance of a tsne thing
tsne = TSNE(perplexity=30.0, n_components=2, init="pca", n_iter=5000)
# progressBar as a string of # signs
def progressBar(counter, size):
if(counter > size): return ""... | apache-2.0 |
FRBs/FRB | frb/tests/test_associate.py | 2 | 3119 | import os
import numpy as np
from pkg_resources import resource_filename
import pandas
from astropy import units
from frb.associate import frbassociate
import pytest
remote_data = pytest.mark.skipif(os.getenv('FRB_GDB') is None,
reason='test requires dev suite')
@remote_data
def t... | bsd-3-clause |
MuhammadVT/davitpy | davitpy/pydarn/plotting/fan.py | 1 | 29341 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 VT SuperDARN Lab
# Full license can be found in LICENSE.txt
#
# 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
# ... | gpl-3.0 |
n-west/gnuradio-volk | gr-filter/examples/fir_filter_fff.py | 47 | 4014 | #!/usr/bin/env python
#
# Copyright 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 option)
# ... | gpl-3.0 |
rmsare/scarplet | scarplet/core.py | 2 | 12891 | # -*- coding: utf-8
""" Functions for determining best-fit template parameters by convolution with
a grid """
import numexpr
import numpy as np
import multiprocessing as mp
import matplotlib
import matplotlib.pyplot as plt
import pyfftw
from pyfftw.interfaces.numpy_fft import fft2, ifft2, fftshift
from functools im... | mit |
RobertABT/heightmap | build/matplotlib/examples/animation/old_animation/dynamic_collection.py | 9 | 1371 | import random
from matplotlib.collections import RegularPolyCollection
import matplotlib.cm as cm
from matplotlib.pyplot import figure, show
from numpy.random import rand
fig = figure()
ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
ax.set_title("Press 'a' to add a point, 'd' to delete one")
# a... | mit |
bjackman/trappy | tests/test_duplicates.py | 3 | 3906 | # Copyright 2015-2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 |
DSLituiev/scikit-learn | examples/ensemble/plot_adaboost_twoclass.py | 347 | 3268 | """
==================
Two-class AdaBoost
==================
This example fits an AdaBoosted decision stump on a non-linearly separable
classification dataset composed of two "Gaussian quantiles" clusters
(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision
boundary and decision scores. The di... | bsd-3-clause |
yask123/scikit-learn | benchmarks/bench_glm.py | 297 | 1493 | """
A comparison of different methods in GLM
Data comes from a random square matrix.
"""
from datetime import datetime
import numpy as np
from sklearn import linear_model
from sklearn.utils.bench import total_seconds
if __name__ == '__main__':
import pylab as pl
n_iter = 40
time_ridge = np.empty(n_it... | bsd-3-clause |
spallavolu/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
ljchang/nltools | examples/02_Analysis/plot_hyperalignment.py | 1 | 9758 | """
Functional Alignment
====================
When performing any type of group analysis, we assume that each voxel is
reflecting the same computations across all participants. This assumption is
unlikely to be true. Several standard preprocessing steps assist in improving
'anatomical alignment'. We spatially normaliz... | mit |
fspaolo/scikit-learn | examples/ensemble/plot_adaboost_multiclass.py | 7 | 3621 | """
=====================================
Multi-class AdaBoosted Decision Trees
=====================================
This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can
improve prediction accuracy on a multi-class problem. The classification
dataset is constructed by taking a ten-dimensional ... | bsd-3-clause |
CVML/scikit-learn | sklearn/cross_decomposition/tests/test_pls.py | 215 | 11427 | import numpy as np
from sklearn.utils.testing import (assert_array_almost_equal,
assert_array_equal, assert_true, assert_raise_message)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition import pls_
from nose.tools import assert_equal
def test_pls():
d =... | bsd-3-clause |
mylons/incubator-airflow | airflow/contrib/hooks/bigquery_hook.py | 3 | 32775 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.