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 |
|---|---|---|---|---|---|
MPTCP-smartphone-thesis/pcap-measurement | bursts_duration_bytes_wcdf.py | 1 | 10996 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Quentin De Coninck
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any... | gpl-3.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/test_msgpack/test_case.py | 9 | 2759 | #!/usr/bin/env python
# coding: utf-8
from pandas.msgpack import packb, unpackb
def check(length, obj):
v = packb(obj)
assert len(v) == length, \
"%r length should be %r but get %r" % (obj, length, len(v))
assert unpackb(v, use_list=0) == obj
def test_1():
for o in [None, True, False, 0, 1,... | mit |
ljwolf/pysal | pysal/esda/tests/test_geary.py | 1 | 2995 | """Geary Unittest."""
import unittest
from ... import open as popen
from ... import examples
from .. import geary
import numpy as np
from ...common import pandas
PANDAS_EXTINCT = pandas is None
class Geary_Tester(unittest.TestCase):
"""Geary class for unit tests."""
def setUp(self):
self.w = popen(ex... | bsd-3-clause |
mne-tools/mne-tools.github.io | 0.17/_downloads/20a1da06c35b0bcff7922862fdce817b/plot_background_filtering.py | 2 | 49239 | # -*- coding: utf-8 -*-
r"""
===================================
Background information on filtering
===================================
Here we give some background information on filtering in general,
and how it is done in MNE-Python in particular.
Recommended reading for practical applications of digital
filter des... | bsd-3-clause |
zorojean/scikit-learn | examples/plot_multioutput_face_completion.py | 330 | 3019 | """
==============================================
Face completion with a multi-output estimators
==============================================
This example shows the use of multi-output estimator to complete images.
The goal is to predict the lower half of a face given its upper half.
The first column of images sho... | bsd-3-clause |
BiRG/Omics-Dashboard | omics/omics_dashboard/blueprints/api/collections.py | 1 | 9001 | import base64
import json
import os
import uuid
from flask import request, jsonify, make_response, send_from_directory, Blueprint
from flask_login import login_required
from werkzeug.utils import secure_filename
import data_tools as dt
from data_tools.file_tools.collection_tools import validate_update
from config.con... | mit |
chrisburr/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 159 | 7852 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
phdowling/scikit-learn | examples/svm/plot_svm_margin.py | 318 | 2328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM Margins Example
=========================================================
The plots below illustrate the effect the parameter `C` has
on the separation line. A large value of `C` basically tells
our model that w... | bsd-3-clause |
gtoonstra/airflow | tests/hooks/test_hive_hook.py | 13 | 19529 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
richrr/scripts | python/table_sorter.py | 1 | 4467 | import os
import sys
from utils import *
import operator
from time import localtime, strftime
import argparse
import math
import numpy
import matplotlib.pyplot as plt
import brewer2mpl
import pylab
#usage: python ~/scripts/python/table_sorter.py -i Group_otu_table_sorted_L2.txt
def main(args):
parser = argparse.... | gpl-3.0 |
DSLituiev/scikit-learn | sklearn/datasets/tests/test_samples_generator.py | 181 | 15664 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
import scipy.sparse as sp
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing imp... | bsd-3-clause |
OGGM/oggm | oggm/tests/funcs.py | 1 | 16644 | import os
import shutil
from distutils.util import strtobool
import hashlib
import numpy as np
import xarray as xr
import shapely.geometry as shpg
from scipy import optimize as optimization
# Local imports
import oggm
import oggm.cfg as cfg
from oggm.utils import (get_demo_file, mkdir, get_git_ident, get_sys_info,
... | bsd-3-clause |
jjx02230808/project0223 | examples/linear_model/plot_lasso_coordinate_descent_path.py | 254 | 2639 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import num... | bsd-3-clause |
gregcaporaso/qiime | qiime/make_bootstrapped_tree.py | 15 | 1352 | #!/usr/bin/env python
from __future__ import division
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczynski"
__email__ = "justinak@gmail.com"
"""takes a tree and bootstrap s... | gpl-2.0 |
shikhardb/scikit-learn | doc/conf.py | 16 | 8442 | # -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | bsd-3-clause |
dsm054/pandas | pandas/tests/indexes/period/test_partial_slicing.py | 1 | 5501 | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame, DatetimeIndex, Period, PeriodIndex, Series, period_range)
from pandas.util import testing as tm
class TestPeriodIndex(object):
def setup_method(self, method):
pass
def test_slice_with_negative_step(self):
... | bsd-3-clause |
petercable/xray | xray/core/dataarray.py | 1 | 41517 | import contextlib
import functools
import warnings
import numpy as np
import pandas as pd
from ..plot.plot import _PlotMethods
from . import indexing
from . import groupby
from . import ops
from . import utils
from . import variable
from .alignment import align
from .common import AbstractArray, BaseDataObject
from ... | apache-2.0 |
ryfeus/lambda-packs | HDF4_H5_NETCDF/source2.7/numpy/lib/polynomial.py | 6 | 38467 | """
Functions to operate on polynomials.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import re
import warnings
import numpy.core.... | mit |
paveenju/mlat-sim | main/figure2_2a.py | 1 | 1441 | '''
Created on Dec 5, 2016
@author: paveenju
'''
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib2tikz.save as tikz_save
import utils.functions as fn
if __name__ == '__main__':
pass
def axes():
plt.axhline(0, alpha=.1)
plt.axvline(0, alpha=.1... | gpl-3.0 |
madjelan/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 |
hlin117/statsmodels | statsmodels/datasets/ccard/data.py | 25 | 1635 | """Bill Greene's credit scoring data."""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission of the original author, who
retains all rights."""
TITLE = __doc__
SOURCE = """
William Greene's `Econometric Analysis`
More information can be found at the web site of the text:
http:... | bsd-3-clause |
herruzojm/udacity-deep-learning | weight-initialization/helper.py | 153 | 3649 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def hist_dist(title, distribution_tensor, hist_range=(-4, 4)):
"""
Display histogram of a TF distribution
"""
with tf.Session() as sess:
values = sess.run(distribution_tensor)
plt.title(title)
plt.hist(values, ... | mit |
bokeh/bokeh | examples/app/dash/main.py | 1 | 4397 | from collections import Counter
from math import pi
import numpy as np
import pandas as pd
from bokeh.io import curdoc
from bokeh.layouts import column
from bokeh.models import (ColumnDataSource, DataTable, NumberFormatter,
RangeTool, StringFormatter, TableColumn)
from bokeh.palettes import ... | bsd-3-clause |
ahoyosid/scikit-learn | examples/manifold/plot_manifold_sphere.py | 258 | 5101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionality reducti... | bsd-3-clause |
kwailamchan/programming-languages | python/sklearn/examples/general/test_the_significance.py | 3 | 2304 | #---------------------------------------------------------------#
# Project: Test with permutations the significance of a classification score
# Author: Kelly Chan
# Date: Apr 23 2014
#---------------------------------------------------------------#
print(__doc__)
import numpy as np
import pylab as pl
from sklearn.s... | mit |
wangmiao1981/spark | python/setup.py | 14 | 13273 | #!/usr/bin/env python3
#
# 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 "L... | apache-2.0 |
wiheto/teneto | teneto/timeseries/report.py | 1 | 2762 | """Create report about derive"""
import os
import matplotlib.pyplot as plt
import numpy as np
def gen_report(report, sdir='./', report_name='report.html'):
"""Generates report of derivation and postprocess steps in teneto.timeseries"""
# Create report directory
if not os.path.exists(sdir):
os.ma... | gpl-3.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/dask/tests/test_base.py | 1 | 10784 | # -*- coding: utf-8 -*-
import os
import pytest
from operator import add, mul
import sys
import dask
from dask.base import (compute, tokenize, normalize_token, normalize_function,
visualize)
from dask.utils import tmpdir, tmpfile, ignoring
from dask.utils_test import inc, dec
from dask.compatib... | mit |
fspaolo/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 |
dongjoon-hyun/spark | python/pyspark/pandas/plot/matplotlib.py | 14 | 30172 | #
# 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 |
stevenzhang18/Indeed-Flask | lib/pandas/tseries/tests/test_util.py | 10 | 3569 | from pandas.compat import range
import nose
import numpy as np
from numpy.testing.decorators import slow
from pandas import Series, date_range
import pandas.util.testing as tm
from datetime import datetime, date
from pandas.tseries.tools import normalize_date
from pandas.tseries.util import pivot_annual, isleapyear... | apache-2.0 |
henrykironde/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 |
wiedenkje/cyberexplorer | cyberexplorer/cyberexplorer/Select.py | 1 | 1732 | import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import pandas as pd
import math
import numpy as np
import sys
import os
import h5py
import csv
#class needed to load a specified data set
class Select:
'''#Function to open a data set at the location
def Open(self, Location):
... | mit |
annahs/atmos_research | WHI_2012_display_all_HYSPLIT_BTs_colored_by_cluster.py | 1 | 5107 | import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import numpy as np
import os
import sys
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import pickle
import copy
from mpl_toolkits.basemap import Basemap
import matplotlib.colors
import shutil
GBPS_lat_min = 48.0
... | mit |
desihub/fiberassign | old/bin/universal_tiling_sequence_images.py | 1 | 3312 | # this produces plots of the tiles periodically in an equal area Sanson Flamsteed projection
# steps gives the number of plots produced, with equal intervals
# the order is initially just the ordering of the tiles (plates) in desi-tiles-full.par
# but can be changed with the function reorder
# the output files are numb... | bsd-3-clause |
sraising/Bikeley | distance.py | 1 | 7544 | from math import sin, cos, sqrt, atan2, radians
import csv
import pandas as pd
import sqlite3
import time
import ast
import datetime
import numpy as np
import pdb
#from geopy.distance import vincenty
from json import loads
from time import sleep
from urllib2 import Request, urlopen
def des_index(conn_nod... | gpl-3.0 |
schets/lwan | tools/benchmark.py | 6 | 4379 | #!/usr/bin/python
import sys
import json
import commands
import time
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
def clearstderrline():
sys.stderr.write('\033[2K')
def weighttp(url, n_threads, n_connections, n_requests, keep_alive):
keep_alive = '-k' if keep_alive else ''
command... | gpl-2.0 |
hantek/pylearn2 | pylearn2/gui/tangent_plot.py | 44 | 1730 | """
Code for plotting curves with tangent lines.
"""
__author__ = "Ian Goodfellow"
try:
from matplotlib import pyplot
except Exception:
pyplot = None
from theano.compat.six.moves import xrange
def tangent_plot(x, y, s):
"""
Plots a curve with tangent lines.
Parameters
----------
x : lis... | bsd-3-clause |
askhl/ase | ase/test/dependency_matplotlib.py | 4 | 1052 | import sys
msg = "\nThe matplotlib python module is missing or not installed properly.\n"
msg += "Is the PYTHONPATH environment variable set correctly?\n"
msg += "Please verify your installation by running on the command line:\n"
msg += "python -c 'import matplotlib'\n"
msg += "\n"
msg += "This module is optional and ... | gpl-2.0 |
jviada/QuantEcon.py | examples/preim1.py | 7 | 1294 | """
QE by Tom Sargent and John Stachurski.
Illustrates preimages of functions
"""
import matplotlib.pyplot as plt
import numpy as np
def f(x):
return 0.6 * np.cos(4 * x) + 1.4
xmin, xmax = -1, 1
x = np.linspace(xmin, xmax, 160)
y = f(x)
ya, yb = np.min(y), np.max(y)
fig, axes = plt.subplots(2, 1, figsize=(8, 8... | bsd-3-clause |
ctn-waterloo/nengo_theano | nengo_theano/test/test_enc.py | 1 | 1980 | """This is a file to test the encoders parameter on ensembles"""
import math
import time
import numpy as np
import matplotlib.pyplot as plt
import nengo_theano as nef
build_time_start = time.time()
timesteps = 10000
dt_step = 0.001
net = nef.Network('Encoder Test', dt=dt_step)
net.make_input('in1', math.sin)
net.... | mit |
tmills/neural-assertion | scripts/keras/multitask/assertion_multinetwork_cv.py | 1 | 5307 | #!/usr/bin/env python
#from keras.datasets import mnist
from keras.models import Sequential, model_from_json
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
from keras.utils import np_utils
#from sklearn.datasets import load_svmlight_file
import sklearn as sk
import sklearn.cross_v... | apache-2.0 |
hrjn/scikit-learn | sklearn/neighbors/unsupervised.py | 29 | 4756 | """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 |
shyamalschandra/scikit-learn | sklearn/neural_network/rbm.py | 46 | 12303 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
cdeboever3/cdpybio | tests/star/test_star.py | 1 | 35611 | from copy import deepcopy
import os
from numpy import array
from numpy import nan
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
from pandas.util.testing import assert_panel_equal
import pytest
import cdpybio as cpb
# Note: I use pos and neg in this file to refer to the plu... | mit |
KhanSuleyman/scikit-neuralnetwork | sknn/tests/test_deep.py | 5 | 3813 | import unittest
from nose.tools import (assert_false, assert_raises, assert_true,
assert_equal, assert_in)
import io
import pickle
import numpy
import logging
from sklearn.base import clone
import sknn
from sknn.mlp import Regressor as MLPR
from sknn.mlp import Layer as L
from . import test_... | bsd-3-clause |
nvoron23/statsmodels | statsmodels/tools/_testing.py | 29 | 4809 | """Testing helper functions
Warning: current status experimental, mostly copy paste
Warning: these functions will be changed without warning as the need
during refactoring arises.
The first group of functions provide consistency checks
"""
import numpy as np
from numpy.testing import assert_allclose, assert_
from ... | bsd-3-clause |
glennq/scikit-learn | examples/svm/plot_iris.py | 15 | 3256 | """
==================================================
Plot different SVM classifiers in the iris dataset
==================================================
Comparison of different linear SVM classifiers on a 2D projection of the iris
dataset. We only consider the first 2 features of this dataset:
- Sepal length
- Se... | bsd-3-clause |
sgranitz/nw | predict410/ols_ames-housing_hw01.py | 2 | 8494 | # Using Linear Regression to predict
# family home sale prices in Ames, Iowa
# Packages
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
import matplotlib.pyplot as plt
import seaborn as sns
from tabulate import tabulate
from statsmodels.iolib.summary2 import summary_col
# Set some op... | mit |
CVML/scikit-learn | examples/linear_model/plot_logistic.py | 312 | 1426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... | bsd-3-clause |
jostep/tensorflow | tensorflow/examples/learn/boston.py | 75 | 2549 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
fsschneider/DeepOBS | tests/testproblems/display_vae.py | 1 | 2669 | # -*- coding: utf-8 -*-
"""Script to visualize generated VAE images from DeepOBS."""
import os
import sys
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from deepobs.tensorflow import testprob... | mit |
nhejazi/scikit-learn | sklearn/datasets/species_distributions.py | 4 | 8780 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/details/3038/0>`_ ,
the Bro... | bsd-3-clause |
LennonLab/Micro-Encounter | fig-scripts/OLD-fig-scripts/EncounterFig_Heat.py | 1 | 3846 | from __future__ import division
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
import sys
mydir = os.path.expanduser('~/GitHub/Micro-Encounter')
sys.path.append(mydir+'/tools')
mydir2 = os.path.expanduser("~/")
dat = pd.read_csv(mydir + '/results/simulated_data/SimData.csv')
dat = da... | gpl-3.0 |
vigilv/scikit-learn | examples/gaussian_process/gp_diabetes_dataset.py | 223 | 1976 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
========================================================================
Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset
========================================================================
In this example, we fit a Gaussian Process model onto... | bsd-3-clause |
bzero/statsmodels | statsmodels/sandbox/infotheo.py | 33 | 16417 | """
Information Theoretic and Entropy Measures
References
----------
Golan, As. 2008. "Information and Entropy Econometrics -- A Review and
Synthesis." Foundations And Trends in Econometrics 2(1-2), 1-145.
Golan, A., Judge, G., and Miller, D. 1996. Maximum Entropy Econometrics.
Wiley & Sons, Chichester.
"""... | bsd-3-clause |
eg-zhang/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 |
leggitta/mne-python | mne/evoked.py | 2 | 52124 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Andrew Dykstra <andrew.r.dykstra@gmail.com>
# Mads Jensen <mje.mads@gmail.com>
#
# License: BSD (3-clause)
from copy imp... | bsd-3-clause |
ARudiuk/mne-python | tutorials/plot_mne_dspm_source_localization.py | 3 | 4738 | """
.. _tut_inverse_mne_dspm:
Source localization with MNE/dSPM/sLORETA
=========================================
The aim of this tutorials is to teach you how to compute and apply a linear
inverse method such as MNE/dSPM/sLORETA on evoked/raw/epochs data.
"""
import numpy as np
import matplotlib.pyplot as plt
impo... | bsd-3-clause |
matternet/ardupilot | Tools/mavproxy_modules/lib/magcal_graph_ui.py | 108 | 8248 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 fi... | gpl-3.0 |
jaeddy/bripipetools | scripts/plot_gene_coverage.py | 1 | 7695 | import logging
logger = logging.getLogger(__name__)
import os
import sys
import zipfile
import math
import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import lxml.html as lh
from datetime import datetime as dt
def read_rnaseq_metrics(path):
try:
log... | mit |
llmercury/Kaggle_Mercedes-Benz_Greener_Manufacturing | Stratified_train_validation_split.py | 1 | 1836 | """
Split train data into development and validation data sets by stratifying the y variable. Here y is a continuous variable.
"""
import numpy as np
import pandas as pd
import random
import pickle
def stratified_kfold(data, nsplit = 5):
num_per_fold = data.shape[0]//nsplit
num_folds_1less = data.shape[0]%nsp... | mit |
4tikhonov/eurogis | maps/usecases/maprender.py | 3 | 4513 | #!/usr/bin/python
# Perfect use case to get boundaries of the city in time
# (C) Vyacheslav Tykhonov vty@iisg.nl
# International Institute of Social History
# http://socialhistory.org
#get_ipython().magic(u'matplotlib inline')
import os
os.environ['MPLCONFIGDIR'] = "/tmp"
import matplotlib
matplotlib.use("Agg")
impor... | gpl-3.0 |
mwcraig/aplpy | aplpy/tests/test_axis_labels.py | 5 | 1670 | import matplotlib
matplotlib.use('Agg')
import numpy as np
from astropy.tests.helper import pytest
from .. import FITSFigure
def test_axis_labels_show_hide():
data = np.zeros((16, 16))
f = FITSFigure(data)
f.axis_labels.hide()
f.axis_labels.show()
f.axis_labels.hide_x()
f.axis_labels.show_x(... | mit |
maheshakya/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 |
ycaihua/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
eg-zhang/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 |
JeffHeard/terrapyn | geocms/drivers/shapefile.py | 1 | 11063 | # from ga_ows.views import wms, wfs
import shutil
import json
from zipfile import ZipFile
import pandas
from django.contrib.gis.geos import Polygon
import os
import sh
from osgeo import osr, ogr
from . import Driver
from pandas import DataFrame
from shapely import wkb
from django.template.defaultfilters import slugify... | apache-2.0 |
rbalda/neural_ocr | env/lib/python2.7/site-packages/matplotlib/text.py | 4 | 79856 | """
Classes for including text in a figure.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
from matplotlib.externals.six.moves import zip
import math
import warnings
import contextlib
import numpy as np
from matp... | mit |
rtavenar/tslearn | tslearn/metrics.py | 1 | 57713 | """
The :mod:`tslearn.metrics` module gathers time series similarity metrics.
"""
import warnings
import numpy
from joblib import Parallel, delayed
from numba import njit, prange
from scipy.spatial.distance import pdist, cdist
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.utils import check_ra... | bsd-2-clause |
wzbozon/scikit-learn | sklearn/utils/metaestimators.py | 283 | 2353 | """Utilities for meta-estimators"""
# Author: Joel Nothman
# Andreas Mueller
# Licence: BSD
from operator import attrgetter
from functools import update_wrapper
__all__ = ['if_delegate_has_method']
class _IffHasAttrDescriptor(object):
"""Implements a conditional property using the descriptor protocol.
... | bsd-3-clause |
heli522/scikit-learn | sklearn/metrics/cluster/supervised.py | 207 | 27395 | """Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# License: BSD 3 clause
fr... | bsd-3-clause |
lewisc/spark-tk | regression-tests/sparktkregtests/testcases/frames/cumulative_tally_test.py | 13 | 5020 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
hsiaoyi0504/scikit-learn | sklearn/decomposition/tests/test_dict_learning.py | 85 | 8565 | import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
sonnyhu/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 365 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
YetAnotherTomek/egfrd | samples/mapk/plot_ss2.py | 6 | 3633 | #!/usr/bin/env python
import sys
import os
import string
import numpy
import scipy.io
from matplotlib.pylab import *
N_A = 6.0221367e23
E2 = 5
V = 1e-15
def load_theory():
data = load('ss2_ode.dat')
ti = data[0:len(data):2][:,0]
data0 = data[0:len(data):2][:,1]
data1 = data[1:len(data):2][:,1]
... | gpl-2.0 |
ZENGXH/scikit-learn | sklearn/tests/test_pipeline.py | 162 | 14875 | """
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises, assert_raises_regex, assert_raise_message
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn... | bsd-3-clause |
google-research/policy-learning-landscape | analysis_tools/common_plotting.py | 1 | 2473 | # coding=utf-8
# Copyright 2018 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
Achuth17/scikit-learn | sklearn/tests/test_qda.py | 155 | 3481 | 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_true
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ignore_war... | bsd-3-clause |
cbmoore/statsmodels | statsmodels/tsa/tests/test_stattools.py | 26 | 12110 | from statsmodels.compat.python import lrange
from statsmodels.tsa.stattools import (adfuller, acf, pacf_ols, pacf_yw,
pacf, grangercausalitytests,
coint, acovf,
arma_order_select_... | bsd-3-clause |
xuguozhi/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 |
mikelum/pyspeckit | pyspeckit/spectrum/showspec.py | 1 | 50193 | """
showspec is my homegrown spectrum plotter, meant to somewhat follow STARLINK's
SPLAT and have functionality similar to GAIA, but with an emphasis on producing
publication-quality plots (which, while splat may do, it does unreproducibly)
TO DO:
-add spectrum arithmetic tools
(as is, you can use numpy.i... | mit |
lbishal/scikit-learn | sklearn/datasets/tests/test_mldata.py | 384 | 5221 | """Test functionality of mldata fetching utilities."""
import os
import shutil
import tempfile
import scipy as sp
from sklearn import datasets
from sklearn.datasets import mldata_filename, fetch_mldata
from sklearn.utils.testing import assert_in
from sklearn.utils.testing import assert_not_in
from sklearn.utils.test... | bsd-3-clause |
akhilpm/Masters-Project | visual_analysis/tSNE_Embedding/visualize.py | 1 | 4037 | import time
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import offsetbox
from sklearn import manifold, datasets, decomposition, ensemble
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import confusion_matrix
from sklearn.grid_search import GridSearchCV
from sklearn.metric... | mit |
csaladenes/blog | kendo romania/scripts/members_loader.py | 4 | 5619 | import pandas as pd, numpy as np, json
import clubs_loader
nyears=8
def get_members(path):
members=pd.read_excel(path,header=[1])
members=members[[231, 'Nr. EKF',
'Club', 'Unnamed: 3',
'Numele', ... | mit |
cauchycui/scikit-learn | sklearn/preprocessing/__init__.py | 31 | 1235 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data import Normalizer
from .data import RobustScaler
from .d... | bsd-3-clause |
ilo10/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 |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/lines_bars_and_markers/scatter_with_legend.py | 1 | 1323 | """
===========================
Scatter plots with a legend
===========================
Also demonstrates how transparency of the markers
can be adjusted by giving ``alpha`` a value between
0 and 1.
"""
import matplotlib.pyplot as plt
from numpy.random import rand
# nodebox section
if __name__ == '__builtin__':
... | mit |
nmartensen/pandas | pandas/util/_decorators.py | 3 | 9679 | from pandas.compat import callable, signature
from pandas._libs.lib import cache_readonly # noqa
import types
import warnings
from textwrap import dedent
from functools import wraps, update_wrapper
def deprecate(name, alternative, alt_name=None, klass=None,
stacklevel=2):
"""
Return a new funct... | bsd-3-clause |
mehdidc/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 45 | 5463 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
nicolas998/Op_Interpolated | 06_Codigos/viejos/Cron_Figura_SimSimple.py | 2 | 1327 | #!/usr/bin/env python
import os
import datetime as dt
import pandas as pd
from multiprocessing import Pool
import numpy as np
#-------------------------------------------------------------------
#FUNBCIONES LOCALES
#-------------------------------------------------------------------
ruta_qsim = '/home/renea998/Simu... | gpl-3.0 |
great-expectations/great_expectations | great_expectations/dataset/sqlalchemy_dataset.py | 1 | 85651 | import inspect
import logging
import traceback
import uuid
import warnings
from datetime import datetime
from functools import wraps
from typing import Dict, Iterable, List
import numpy as np
import pandas as pd
from dateutil.parser import parse
from great_expectations.core.util import (
convert_to_json_serializa... | apache-2.0 |
nan86150/ImageFusion | lib/python2.7/site-packages/numpy/lib/function_base.py | 30 | 124613 | from __future__ import division, absolute_import, print_function
import warnings
import sys
import collections
import operator
import numpy as np
import numpy.core.numeric as _nx
from numpy.core import linspace, atleast_1d, atleast_2d
from numpy.core.numeric import (
ones, zeros, arange, concatenate, array, asarr... | mit |
KrishnaswamyLab/PHATE | Python/phate/phate.py | 1 | 39723 | """
Potential of Heat-diffusion for Affinity-based Trajectory Embedding (PHATE)
"""
# author: Daniel Burkhardt <daniel.burkhardt@yale.edu>
# (C) 2017 Krishnaswamy Lab GPLv2
from __future__ import print_function, division, absolute_import
import numpy as np
import graphtools
from sklearn.base import BaseEstimator
from... | gpl-2.0 |
InspurUSA/kudu | python/kudu/tests/test_scanner.py | 2 | 14089 | #
# 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 |
rexshihaoren/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
mjgrav2001/scikit-learn | sklearn/feature_extraction/text.py | 110 | 50157 | # -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gma... | bsd-3-clause |
salkinium/bachelor | experiment_control/visualizer.py | 1 | 6167 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Niklas Hauser
# All rights reserved.
#
# The file is part of my bachelor thesis and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
# -----------------------------------------------------------------------------... | bsd-2-clause |
darcamo/pyphysim | apps/metis_scenarios/simulate_metis_scenario2.py | 1 | 18526 | #!/usr/bin/env python
"""
Simulator for the SINRs and capacity of a dense indoor scenario.
The scenario is a very simplified version of the Test Case 2 from the METIS
project. Only one floor of one building is simulated and only the indoor
access points are considered.
"""
import numpy as np
from matplotlib import gr... | gpl-2.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/pandas/core/reshape/merge.py | 1 | 61841 | """
SQL-style merge routines
"""
import copy
import warnings
import string
import numpy as np
from pandas.compat import range, lzip, zip, map, filter
import pandas.compat as compat
from pandas import (Categorical, DataFrame,
Index, MultiIndex, Timedelta)
from pandas.core.arrays.categorical import... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.