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 |
|---|---|---|---|---|---|
jhamman/xray | xarray/tests/test_formatting.py | 1 | 6100 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
from xarray.core import formatting
from xarray.core.pycompat import PY3
from . import TestCase
class TestFormatting(TestCase):
def test_get... | apache-2.0 |
JeyZeta/Dangerous | Dangerous/Golismero/thirdparty_libs/nltk/classify/scikitlearn.py | 12 | 6078 | # Natural Language Toolkit: Interface to scikit-learn classifiers
#
# Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
scikit-learn (http://scikit-learn.org) is a machine learning library for
Python, supporting most of the basic classification algo... | mit |
tdeboissiere/DeepLearningImplementations | GAN/src/utils/batch_utils.py | 8 | 2862 | import time
import numpy as np
import multiprocessing
import os
import h5py
import matplotlib.pylab as plt
import matplotlib.gridspec as gridspec
from matplotlib.pyplot import cm
class DataGenerator(object):
"""
Generate minibatches with real-time data parallel augmentation on CPU
args :
hdf5_fil... | mit |
zrhans/pythonanywhere | pyscripts/ply_O3.py | 1 | 4002 | """
DATA,Chuva,Chuva_min,Chuva_max,VVE,VVE_min,VVE_max,DVE,DVE_min,DVE_max,
Temp.,Temp._min,Temp._max,Umidade,Umidade_min,Umidade_max,Rad.,Rad._min,Rad._max,
Pres.Atm.,Pres.Atm._min,Pres.Atm._max,
Temp.Int.,Temp.Int._min,Temp.Int._max,
CH4,CH4_min,CH4_max,HCnM,HCnM_min,HCnM_max,HCT,HCT_min,HCT_max,
SO2,SO2_min,SO2_max,... | apache-2.0 |
zhengwsh/InplusTrader_Linux | rqalpha/api/api_base.py | 1 | 30203 | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, Inc
#
# 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 ... | mit |
haudren/scipy | scipy/integrate/quadrature.py | 33 | 28087 | from __future__ import division, print_function, absolute_import
import numpy as np
import math
import warnings
# trapz is a public function for scipy.integrate,
# even though it's actually a numpy function.
from numpy import trapz
from scipy.special.orthogonal import p_roots
from scipy.special import gammaln
from sc... | bsd-3-clause |
jgowans/correlation_plotter | plot_f_engine.py | 1 | 2960 | #!/usr/bin/env python
# Note: all frequencies in MHz, all times in us
import corr
import numpy as np
import itertools
import matplotlib.pyplot as plt
import time
from operator import add
def snaps():
return ['ch0_00_re', 'ch0_00_im', 'ch0_01_re', 'ch0_01_im']
def arm_snaps():
for snap in snaps():
fp... | mit |
wesm/statsmodels | scikits/statsmodels/tsa/ar_model.py | 1 | 32245 | """
This is the VAR class refactored from pymaclab.
"""
from __future__ import division
import numpy as np
from numpy import (dot, identity, atleast_2d, atleast_1d, zeros)
from numpy.linalg import inv
from scipy import optimize
from scipy.stats import t, norm, ss as sumofsq
from scikits.statsmodels.regression.linear_mo... | bsd-3-clause |
arter97/android_kernel_nvidia_shieldtablet | scripts/tracing/dma-api/trace.py | 96 | 12420 | """Main program and stuff"""
#from pprint import pprint
from sys import stdin
import os.path
import re
from argparse import ArgumentParser
import cPickle as pickle
from collections import namedtuple
from plotting import plotseries, disp_pic
import smmu
class TracelineParser(object):
"""Parse the needed informatio... | gpl-2.0 |
eg-zhang/scikit-learn | sklearn/metrics/regression.py | 175 | 16953 | """Metrics to assess performance on regression task
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Ma... | bsd-3-clause |
sanuj/shogun | examples/undocumented/python_modular/graphical/metric_lmnn_objective.py | 26 | 2350 | #!/usr/bin/env python
def load_compressed_features(fname_features):
try:
import gzip
import numpy
except ImportError:
print 'Error importing gzip and/or numpy modules. Please, verify their installation.'
import sys
sys.exit(0)
# load features from a gz compressed file
file_features = gzip.GzipFile(fname... | gpl-3.0 |
stefanosbou/trading-with-python | historicDataDownloader/historicDataDownloader.py | 77 | 4526 | '''
Created on 4 aug. 2012
Copyright: Jev Kuznetsov
License: BSD
a module for downloading historic data from IB
'''
import ib
import pandas
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
from time import sleep
import tradingWithPython.lib.logger as logger
from pandas impor... | bsd-3-clause |
probml/pyprobml | scripts/linreg_eb_modelsel_vs_n.py | 1 | 5689 | # Bayesian model selection demo for polynomial regression
# This illustartes that if we have more data, Bayes picks a more complex model.
# Based on a demo by Zoubin Ghahramani
import numpy as np
import matplotlib.pyplot as plt
import os
figdir = "../figures"
def save_fig(fname): plt.savefig(os.path.join(figdir, fnam... | mit |
ldirer/scikit-learn | examples/neural_networks/plot_mlp_alpha.py | 47 | 4159 | """
================================================
Varying regularization in Multi-layer Perceptron
================================================
A comparison of different values for regularization parameter 'alpha' on
synthetic datasets. The plot shows that different alphas yield different
decision functions.
A... | bsd-3-clause |
JPFrancoia/scikit-learn | examples/mixture/plot_gmm.py | 122 | 3265 | """
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two Gaussians
obtained with Expectation Maximisation (``GaussianMixture`` class) and
Variational Inference (``BayesianGaussianMixture`` class models with
a Dirichlet ... | bsd-3-clause |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/groupby/test_counting.py | 10 | 6573 | # -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
from pandas import (DataFrame, Series, MultiIndex)
from pandas.util.testing import assert_series_equal
from pandas.compat import (range, product as cart_product)
class TestCounting(object):
def test_cumcount(self):
df = Da... | apache-2.0 |
nekrut/tools-iuc | tools/cwpair2/cwpair2_util.py | 19 | 14130 | import bisect
import csv
import os
import sys
import traceback
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot # noqa: I202,E402
# Data outputs
DETAILS = 'D'
MATCHED_PAIRS = 'MP'
ORPHANS = 'O'
# Data output formats
GFF_EXT = 'gff'
TABULAR_EXT = 'tabular'
# Statistics histograms output directory... | mit |
henridwyer/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 222 | 3055 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Licence: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
ningyuwhut/UnbalancedDataset | unbalanced_dataset/under_sampling.py | 1 | 22638 | from __future__ import print_function
from __future__ import division
import numpy as np
from numpy import logical_not, ones
from numpy.random import seed, randint
from numpy import concatenate
from random import sample
from collections import Counter
from .unbalanced_dataset import UnbalancedDataset
class UnderSampl... | mit |
fengzhyuan/scikit-learn | sklearn/datasets/__init__.py | 176 | 3671 | """
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_diabetes
from .base import load_digits
from .base import load_files
from .base import load_iris
from .... | bsd-3-clause |
ojgarciab/JdeRobot | src/stable/components/refereeViewer/refereeViewer.py | 2 | 7496 | #!/usr/bin/python
#This program paints a graph distance, using the parameter given by refereeViewer.cfg
#VisorPainter class re-paints on a pyplot plot and updates new data.
#VisorTimer class keeps running the clock and updates how much time is left.
#Parameters for the countdown are given to the __init__() in VisorTime... | gpl-3.0 |
zygmuntz/Python-ELM | random_layer.py | 2 | 19019 | #-*- coding: utf8
# Author: David C. Lambert [dcl -at- panix -dot- com]
# Copyright(c) 2013
# License: Simple BSD
"""The :mod:`random_layer` module
implements Random Layer transformers.
Random layers are arrays of hidden unit activations that are
random functions of input activation values (dot products for simple
ac... | bsd-3-clause |
mattgiguere/scikit-learn | sklearn/ensemble/forest.py | 2 | 59479 | """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 ... | bsd-3-clause |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pandas/tests/series/test_replace.py | 7 | 8612 | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import pytest
import numpy as np
import pandas as pd
import pandas._libs.lib as lib
import pandas.util.testing as tm
from .common import TestData
class TestSeriesReplace(TestData):
def test_replace(self):
N = 100
ser = pd.Series(np.random.randn(N... | mit |
sagemathinc/cocalc | src/smc_sagews/smc_sagews/sage_server.py | 4 | 88115 | #!/usr/bin/env python
"""
sage_server.py -- unencrypted forking TCP server.
Note: I wrote functionality so this can run as root, create accounts on the fly,
and serve sage as those accounts. Doing this is horrendous from a security point of
view, and I'm definitely not doing this.
None of that functionality is actua... | agpl-3.0 |
stephenliu1989/HK_DataMiner | hkdataminer/utils/plot_.py | 1 | 23288 | __author__ = 'stephen'
import numpy as np
import scipy.io
import scipy.sparse
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.pylab as pylab
from .utils import get_subindices
import matplotlib.ticker as mtick
from collections import Counter
from s... | apache-2.0 |
impactlab/eemeter | eemeter/io/serializers.py | 1 | 11692 | import pandas as pd
import numpy as np
import pytz
import warnings
class BaseSerializer(object):
sort_key = None
required_fields = []
datetime_fields = []
def _sort_records(self, records):
if self.sort_key is None:
message = (
'Must supply cls.sort_key in class de... | mit |
UNR-AERIAL/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 |
jseabold/statsmodels | statsmodels/tsa/statespace/tests/test_save.py | 3 | 4402 | """
Tests of save / load / remove_data state space functionality.
"""
import pickle
import os
import tempfile
import pytest
from statsmodels import datasets
from statsmodels.tsa.statespace import (sarimax, structural, varmax,
dynamic_factor)
from numpy.testing import assert_all... | bsd-3-clause |
RocketRedNeck/PythonPlayground | pidSim.py | 1 | 18070 | # -*- coding: utf-8 -*-
"""
pidSim.py
A simulation of a vision control to steering PID loop accounting for communication and
processing latency and variation; demonstrates the impact of variation
to successful control when the control variable (CV) has direct influence on
the process variable (PV)
This allows student... | mit |
ozancaglayan/python-emotiv | utils/ssvep-frequencies.py | 2 | 3298 | #!/usr/bin/env python
import os
import sys
import numpy as np
from scipy import fftpack, signal
from scipy.io import loadmat
from matplotlib import pylab as plt
from emotiv import utils
if __name__ == '__main__':
if len(sys.argv) > 2:
ch = list(sys.argv[2:])
else:
ch = None
try:
... | gpl-3.0 |
serggrom/python-data-mining | DM_4_NP.py | 1 | 5279 | import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randn
from numpy.linalg import inv, qr
from random import normalvariate
import random
data = [6, 7.5, 8, 0, 1]
arr = np.array(data)
#print(arr)
data2 = [[1, 2, 3, 4], [5, 6, 7, 8]]
arr2 = np.array(data2)
#print(arr2)
#print(arr2.ndim)
#pr... | gpl-3.0 |
timberhill/blablaplot | blablaplot.py | 1 | 6659 | #!/usr/bin/python
from numpy import loadtxt, asarray
from numpy.random import normal as gaussian_noise
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import warnings
"""
Here you register new characters in format:
'<char>' : (<width>, <height>, '<filename>'),
"""
charlist = {
'a' : (0.7, 1.0,... | mit |
smeerten/jellyfish | Jellyfish.py | 1 | 31810 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017-2021 Wouter Franssen and Bas van Meerten
# This file is part of Jellyfish.
#
# Jellyfish 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... | gpl-3.0 |
girving/tensorflow | tensorflow/contrib/eager/python/examples/rnn_colorbot/rnn_colorbot.py | 16 | 13781 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
WMD-group/MacroDensity | examples/PlanarAverage.py | 1 | 1084 | #! /usr/bin/env python
import macrodensity as md
import math
import numpy as np
import matplotlib.pyplot as plt
input_file = 'LOCPOT'
lattice_vector = 4.75
output_file = 'planar.dat'
# No need to alter anything after here
#------------------------------------------------------------------
# Get the potential
# This se... | mit |
rohanisaac/spectra | spectra/calibrate.py | 1 | 18376 | """
Calibrate spectrum with neon data
"""
from .peaks import find_peaks
from .fitting import fit_data, line_fit, poly_fit, fit_data_bg, fit_peaks, peak_table
from .array_help import find_nearest_tolerance
from .convert import rwn2wl, wl2rwn, rwn2wn, wl2wn
from .normalize import normalize
from .read_files import read_ho... | gpl-3.0 |
jakobworldpeace/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 26 | 7800 | 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 |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/numpy/lib/twodim_base.py | 26 | 26904 | """ Basic functions for manipulating 2d arrays
"""
from __future__ import division, absolute_import, print_function
from numpy.core.numeric import (
asanyarray, arange, zeros, greater_equal, multiply, ones, asarray,
where, int8, int16, int32, int64, empty, promote_types, diagonal,
)
from numpy.core import... | gpl-3.0 |
benschneider/sideprojects1 | hdf5_to_mtx/load_DCE_MAPS.py | 1 | 3292 | import numpy as np
from parsers import load_hdf5, dim
from parsers import savemtx, make_header
# import matplotlib.pyplot as plt
from changeaxis import interp_y
from scipy.constants import Boltzmann as Kb
from scipy.constants import h, e, pi
# filein = "S1_511_shot_100mV_4924_5217MHz"
# filein = "S1_514_S11_4924_5217M... | gpl-2.0 |
squall1988/cuda-convnet2 | convdata.py | 174 | 14675 | # Copyright 2014 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
#
# Unless required by applicable law or... | apache-2.0 |
Marcello-Sega/pytim | pytim/observables/correlator.py | 2 | 15230 | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
""" Module: Correlator
==================
"""
from __future__ import print_function
import numpy as np
from pytim import utilities
from MDAnalysis.core.groups import Atom, AtomGroup, Resi... | gpl-3.0 |
saiwing-yeung/scikit-learn | sklearn/metrics/tests/test_regression.py | 272 | 6066 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.... | bsd-3-clause |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/io/test_html.py | 1 | 39352 | from functools import partial
from importlib import reload
from io import BytesIO, StringIO
import os
import re
import threading
import numpy as np
from numpy.random import rand
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserError
import pandas.util._test_decorators as td
... | apache-2.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/mpl_toolkits/axisartist/floating_axes.py | 18 | 22796 | """
An experimental support for curvilinear grid.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import zip
# TODO :
# *. see if tick_iterator method can be simplified by reusing the parent method.
from itertools import chai... | bsd-2-clause |
JT5D/scikit-learn | sklearn/cross_decomposition/tests/test_pls.py | 22 | 9838 | import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition import pls_
from nose.tools import assert_equal
def test_pls():
d = load_linnerud()
X = d.data
Y = d.target
# 1) Canonical (symmetric) PLS (PLS 2 b... | bsd-3-clause |
zooniverse/aggregation | experimental/penguins/distanceAnalysis/above_or_below_average.py | 2 | 5078 | #!/usr/bin/env python
__author__ = 'greghines'
import numpy as np
import os
import sys
import cPickle as pickle
import math
import matplotlib.pyplot as plt
import pymongo
import urllib
import matplotlib.cbook as cbook
if os.path.exists("/home/ggdhines"):
sys.path.append("/home/ggdhines/PycharmProjects/reduction/ex... | apache-2.0 |
idlead/scikit-learn | examples/manifold/plot_lle_digits.py | 138 | 8594 | """
=============================================================================
Manifold learning on handwritten digits: Locally Linear Embedding, Isomap...
=============================================================================
An illustration of various embeddings on the digits dataset.
The RandomTreesEmbed... | bsd-3-clause |
davidgbe/scikit-learn | sklearn/svm/tests/test_svm.py | 70 | 31674 | """
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 scipy import sparse
from nose.tools im... | bsd-3-clause |
xaccrocheur/beatnitpicker | beatnitpicker.py | 1 | 23337 | #!/usr/bin/python
import os, sys, gobject, stat, time, re
import gtk
import gst, gst.pbutils
from matplotlib.figure import Figure
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
import scipy.io.wavfile as wavfile
import wave
import numpy as np
license = """
BeatNitPicker is free s... | gpl-2.0 |
aewhatley/scikit-learn | sklearn/linear_model/stochastic_gradient.py | 130 | 50966 | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import scipy.sparse as sp
from abc import ABCMeta, abstractmethod
from ... | bsd-3-clause |
PatrickOReilly/scikit-learn | examples/ensemble/plot_forest_importances.py | 168 | 1793 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
newemailjdm/scipy | scipy/stats/_multivariate.py | 35 | 69253 | #
# Author: Joris Vankerschaver 2013
#
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
from scipy.misc import doccer
from scipy.special import gammaln, psi, multigammaln
from scipy._lib._util import check_random_state
__all__ = ['multivariate_normal', 'dirichle... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/pandas/core/computation/engines.py | 15 | 3799 | """
Engine classes for :func:`~pandas.eval`
"""
import abc
from pandas import compat
from pandas.compat import map
import pandas.io.formats.printing as printing
from pandas.core.computation.align import _align, _reconstruct_object
from pandas.core.computation.ops import (
UndefinedVariableError,
_mathops, _re... | mit |
manipopopo/tensorflow | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 24 | 6776 | # 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 |
m4rx9/rna-pdb-tools | rna_tools/tools/rna_calc_rmsd_trafl/rna_cal_rmsd_trafl_plot.py | 2 | 1331 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""rna_cal_rmsd_trafl_plot - generate a plot based of <rmsd.txt> of rna_calc_evo_rmsd.py."""
from __future__ import division
import pandas as pd
import matplotlib.pyplot as plt
import argparse
import numpy as np
import matplotlib.pyplot as plt
from pandas import Series, D... | mit |
rew4332/tensorflow | tensorflow/contrib/learn/python/learn/tests/estimators_test.py | 5 | 3169 | # 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 |
timole/solitadds-backend | main.py | 1 | 2485 | #!/usr/bin/python
import sys, re, pdb, os
import logging
import argparse
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib, datetime
import utils, data_helper
import analyze
def parse_args():
"""
Parse command line args.
Example
-------
python main.... | mit |
fredrikw/scipy | scipy/interpolate/fitpack.py | 25 | 46138 | #!/usr/bin/env python
"""
fitpack (dierckx in netlib) --- A Python-C wrapper to FITPACK (by P. Dierckx).
FITPACK is a collection of FORTRAN programs for curve and surface
fitting with splines and tensor product splines.
See
http://www.cs.kuleuven.ac.be/cwis/research/nalag/research/topics/fitpack.html
... | bsd-3-clause |
SRI-CSL/libpoly | examples/cad/plot.py | 1 | 1180 | #!/usr/bin/env python
import polypy
import cad
import matplotlib.pyplot as plt
# 2D plotting of polynomials
class PolyPlot2D(cad.CylinderNotify):
# Initialize
def __init__(self, x, y):
self.x = x
self.y = y
self.cad = cad.CAD([x, y])
self.polynomials = []
... | lgpl-3.0 |
probml/pyprobml | scripts/kernelRegressionDemo.py | 1 | 1894 | import numpy as np
from scipy.spatial.distance import cdist
import math
import matplotlib.pyplot as plt
from cycler import cycler
import pyprobml_utils as pml
CB_color = ['#377eb8', '#ff7f00', '#4daf4a']
cb_cycler = (cycler(linestyle=['-', '--', '-.']) * cycler(color=CB_color))
plt.rc('axes', prop_cycle=cb_cycler)
n... | mit |
badlogicmanpreet/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_template.py | 70 | 8806 | """
This is a fully functional do nothing backend to provide a template to
backend writers. It is fully functional in that you can select it as
a backend with
import matplotlib
matplotlib.use('Template')
and your matplotlib scripts will (should!) run without error, though
no output is produced. This provides a ... | agpl-3.0 |
krez13/scikit-learn | benchmarks/bench_sgd_regression.py | 283 | 5569 | """
Benchmark for SGD regression
Compares SGD regression against coordinate descent and Ridge
on synthetic data.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# License: BSD 3 clause
import numpy as np
import pylab as pl
import gc
from time import time
from sklearn.linear_model i... | bsd-3-clause |
dataculture/pysemantic | pysemantic/validator.py | 2 | 44008 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 jaidev <jaidev@newton>
#
# Distributed under terms of the BSD 3-clause license.
"""Traited Data validator for `pandas.DataFrame` objects."""
import copy
import cPickle
import json
import logging
import textwrap
import warnings
import... | bsd-3-clause |
zooniverse/aggregation | analysis/old_weather.py | 1 | 1806 | __author__ = 'ggdhines'
import matplotlib
matplotlib.use('WXAgg')
import aggregation_api
from matplotlib import pyplot as plt
import matplotlib.cbook as cbook
project = aggregation_api.AggregationAPI(project_id = 195, environment="staging")
project.__setup__()
cursor = project.postgres_session.cursor()
# stmt = "selec... | apache-2.0 |
shahankhatch/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 294 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
moonboots/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 3 | 8770 | # Copyright 2015 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
#
# Unless required by applicable law or a... | apache-2.0 |
josesho/bootstrap_contrast | bootstrap_contrast/old__/bootstrap_tools.py | 2 | 8156 | from __future__ import division
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import norm
from numpy.random import randint
from scipy.stats import ttest_ind, ttest_1samp, ttest_rel, mannwhitneyu, wilcoxon, norm
import warnings
# Keep python 2/3 compatibility, without using six. At some ... | mit |
kensugino/jGEM | jgem/plottracks.py | 1 | 12515 | """Basic parts for plotting bigwig (coverage etc.), genes, ideograms.
"""
import os
import re
try:
from itertools import izip
except:
izip = zip
from itertools import chain
import numpy as N
import pandas as PD
import matplotlib.pyplot as PP
from matplotlib.collections import BrokenBarHCollection
import matplotlib... | mit |
joernhees/scikit-learn | sklearn/externals/joblib/parallel.py | 24 | 33170 | """
Helpers for embarrassingly parallel code.
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
from __future__ import division
import os
import sys
from math import sqrt
import functools
import time
import threading
import itertools
fr... | bsd-3-clause |
public-ink/public-ink | server/appengine/lib/numpy/linalg/linalg.py | 11 | 77339 | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | gpl-3.0 |
manashmndl/scikit-learn | examples/cluster/plot_kmeans_silhouette_analysis.py | 242 | 5885 | """
===============================================================================
Selecting the number of clusters with silhouette analysis on KMeans clustering
===============================================================================
Silhouette analysis can be used to study the separation distance between the... | bsd-3-clause |
daemonmaker/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 |
SudipSinha/edu | MathMods/Thesis/code/timings.high.py | 1 | 7626 | from math import exp
import matplotlib.pyplot as plt
m = range( 1, 1001 )
time = [0.000469,0.000473,0.000484,0.000494,0.000502,0.000517,0.00113,0.000534,0.00116,0.000553,0.00117,0.000588,0.00119,0.000598,0.00133,0.00062,0.00136,0.000638,0.00138,0.000661,0.0014,0.000686,0.00142,0.000712,0.00145,0.000735,0.0016,0.0013... | mit |
kbrose/article-tagging | lib/tagnews/crimetype/tag.py | 2 | 6188 | import os
import pickle
import glob
import time
import pandas as pd
# not used explicitly, but this needs to be imported like this
# for unpickling to work.
from ..utils.model_helpers import LemmaTokenizer # noqa
"""
Contains the CrimeTags class that allows tagging of articles.
"""
MODEL_LOCATION = os.path.join(os.p... | mit |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/sklearn/linear_model/tests/test_ransac.py | 22 | 20592 | from scipy import sparse
import numpy as np
from scipy import sparse
from numpy.testing import assert_equal, assert_raises
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from sklearn.utils import check_random_state
from sklearn.utils.testing import assert_less
from s... | mit |
weixuanfu/tpot | tpot/tpot.py | 1 | 3465 | # -*- coding: utf-8 -*-
"""This file is part of the TPOT library.
TPOT was primarily developed at the University of Pennsylvania by:
- Randal S. Olson (rso@randalolson.com)
- Weixuan Fu (weixuanf@upenn.edu)
- Daniel Angell (dpa34@drexel.edu)
- and many more generous open source contributors
TPOT is f... | lgpl-3.0 |
deeplook/bokeh | bokeh/sampledata/gapminder.py | 41 | 2655 | from __future__ import absolute_import
import pandas as pd
from os.path import join
import sys
from . import _data_dir
'''
This module provides a pandas DataFrame instance of four
of the datasets from gapminder.org.
These are read in from csvs that have been downloaded from Bokeh's
sample data on S3. But the origina... | bsd-3-clause |
arranger1044/spyn | visualize.py | 2 | 5751 | import numpy
import matplotlib
import matplotlib.pyplot as pyplot
from matplotlib.backends.backend_pdf import PdfPages
import seaborn
#
# changing font size
seaborn.set_context("poster", font_scale=1.7, rc={'font.size': 32,
# 'axes.labelsize': fontSize,
... | gpl-3.0 |
prlz77/dm4l | plugins/plot/plugin.py | 1 | 2743 | import StringIO
import logging
import urllib
from copy import deepcopy
import numpy as np
from misc import LogStatus
from plugins.abstract_plugin import AbstractPlugin
import matplotlib
#matplotlib.use('QT4Agg')
try:
import seaborn as sns
except ImportError:
logging.getLogger('dm4l').info('Install seaborn for... | mit |
tiagolbiotech/BioCompass | BioCompass/feature_gen.py | 2 | 3384 | from Bio import SeqIO
import pandas as pd
import re
from Bio.SeqUtils import GC
from sys import argv
script, strain_name, edges_file = argv
edges_df = pd.read_csv(edges_file, sep='\t')
ref_list = edges_df['BGC'].drop_duplicates(inplace=False)
hits_list = edges_df['BLAST_hit'].drop_duplicates(inplace=False)
col1 =... | bsd-3-clause |
kcavagnolo/astroML | book_figures/chapter9/fig_photoz_tree.py | 3 | 3637 | """
Photometric Redshifts by Decision Trees
---------------------------------------
Figure 9.14
Photometric redshift estimation using decision-tree regression. The data is
described in Section 1.5.5. The training set consists of u, g , r, i, z
magnitudes of 60,000 galaxies from the SDSS spectroscopic sample.
Cross-val... | bsd-2-clause |
severinson/coded-computing-tools | overhead_performance_plots.py | 2 | 1489 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import model
import overhead
from plot import get_parameters_size, get_parameters_size_2
def unique_rows_plot():
parameters = get_parameters_size_2()
plt.subplot('111')
results = list()
for p in parameters:
rows = overhead... | apache-2.0 |
frank-tancf/scikit-learn | 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 |
vybstat/scikit-learn | sklearn/metrics/tests/test_classification.py | 53 | 49781 | from __future__ import division, print_function
import numpy as np
from scipy import linalg
from functools import partial
from itertools import product
import warnings
from sklearn import datasets
from sklearn import svm
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import la... | bsd-3-clause |
jakobj/nest-simulator | pynest/examples/plot_weight_matrices.py | 9 | 6702 | # -*- coding: utf-8 -*-
#
# plot_weight_matrices.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 the Li... | gpl-2.0 |
Prasad9/incubator-mxnet | example/autoencoder/mnist_sae.py | 15 | 4165 | # 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 u... | apache-2.0 |
cangermueller/deepcpg | scripts/dcpg_eval.py | 1 | 8067 | #!/usr/bin/env python
"""Evaluate the prediction performance of a DeepCpG model.
Imputes missing methylation states and evaluates model on observed states.
``--out_report`` will write evaluation metrics to a TSV file using.
``--out_data`` will write predicted and observed methylation state to a HDF5
file with followi... | mit |
Delosari/dazer | bin/lib/ssp_functions/dazer_SSP_example.py | 1 | 2247 | from ssp_synthesis_tools import ssp_fitter
import matplotlib.pyplot as plt
import numpy as np
from timeit import default_timer as timer
dz = ssp_fitter()
#Read parameters from command line
command_dict = dz.load_command_params()
#Read parameters from config file
conf_file_address = 'auto_ssp_V500_several_Hb... | mit |
Chilipp/psyplot_gui | psyplot_gui/console.py | 1 | 11139 | """
An example of opening up an RichJupyterWidget in a PyQT Application, this can
execute either stand-alone or by importing this file and calling
inprocess_qtconsole.show().
Based on the earlier example in the IPython repository, this has
been updated to use qtconsole.
"""
import re
import sys
try:
from qtconsole... | gpl-2.0 |
dandanvidi/in-vivo-enzyme-kinetics | scripts/helper.py | 3 | 13207 | import cPickle as pickle
import pandas as pd
from trees import Tree
import csv, re
from matplotlib_venn import venn2
import matplotlib.pyplot as plt
from copy import deepcopy
import numpy as np
import seaborn as sb
from collections import defaultdict
from cobra.io.sbml import create_cobra_model_from_sbml_file
from cobr... | mit |
JeffsanC/uavs | src/rpg_svo/svo_analysis/src/svo_analysis/analyse_timing.py | 17 | 3476 | #!/usr/bin/python
import os
import numpy as np
import matplotlib.pyplot as plt
def analyse_timing(D, trace_dir):
# identify measurements which result from normal frames and which from keyframes
is_frame = np.argwhere(D['repr_n_mps'] >= 0)
n_frames = len(is_frame)
# set initial time to zero
D['timestamp'... | gpl-2.0 |
changbindu/rufeng-finance | src/tushare/tushare/internet/boxoffice.py | 7 | 7205 | # -*- coding:utf-8 -*-
"""
电影票房
Created on 2015/12/24
@author: Jimmy Liu
@group : waditu
@contact: jimmysoa@sina.cn
"""
import pandas as pd
from tushare.stock import cons as ct
from tushare.util import dateu as du
try:
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen... | lgpl-3.0 |
ryanbressler/ClassWar | Clin/sklrf.py | 6 | 1280 | import sys
from sklearn.datasets import load_svmlight_file
from sklearn.ensemble import RandomForestClassifier
from time import time
import numpy as np
def dumptree(atree, fn):
from sklearn import tree
f = open(fn,"w")
tree.export_graphviz(atree,out_file=f)
f.close()
# def main():
fn = sys.argv[1]
X,Y = load_... | bsd-3-clause |
rgommers/statsmodels | statsmodels/graphics/tests/test_dotplot.py | 1 | 14629 | import numpy as np
from statsmodels.graphics.dotplots import dot_plot
import pandas as pd
from numpy.testing import dec
# If true, the output is written to a multi-page pdf file.
pdf_output = False
try:
import matplotlib.pyplot as plt
import matplotlib
if matplotlib.__version__ < '1':
raise
ha... | bsd-3-clause |
RobertABT/heightmap | build/matplotlib/examples/user_interfaces/embedding_in_tk.py | 9 | 1419 | #!/usr/bin/env python
import matplotlib
matplotlib.use('TkAgg')
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
# implement the default mpl key bindings
from matplotlib.backend_bases import key_press_handler
from matplotlib.figure import Fig... | mit |
jongyeob/swpy | swpy/backup/dst.py | 1 | 7373 | '''
Author : Jongyeob Park (pjystar@gmail.com)
Seonghwan Choi (shchoi@kasi.re.kr)
'''
import os
import re
from swpy import utils
from swpy.utils import config, download as dl
from swpy.utils import datetime as dt
DATA_DIR = 'data/kyoto/dst/%Y/'
DATA_FILE = 'dst_%Y%m.txt'
DST_KEYS = ['datetime','dst']
LOG =... | gpl-2.0 |
fspaolo/scikit-learn | examples/mixture/plot_gmm_sin.py | 12 | 2726 | """
=================================
Gaussian Mixture Model Sine Curve
=================================
This example highlights the advantages of the Dirichlet Process:
complexity control and dealing with sparse data. The dataset is formed
by 100 points loosely spaced following a noisy sine curve. The fit by
the GMM... | bsd-3-clause |
TitasNandi/Summer_Project | yodaqa/data/ml/fbpath/fbpath_train_logistic.py | 3 | 2964 | #!/usr/bin/python
#
# Train a Naive Bayes classifier to predict which Freebase
# property paths would match answers given the question features.
#
# Usage: fbpath_train_logistic.py TRAIN.JSON MODEL.JSON
import json
import numpy as np
from fbpathtrain import VectorizedData
import random
import re
from sklearn.linear_mo... | apache-2.0 |
igormarfin/trading-with-python | lib/functions.py | 76 | 11627 | # -*- coding: utf-8 -*-
"""
twp support functions
@author: Jev Kuznetsov
Licence: GPL v2
"""
from scipy import polyfit, polyval
import datetime as dt
#from datetime import datetime, date
from pandas import DataFrame, Index, Series
import csv
import matplotlib.pyplot as plt
import numpy as np
import p... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.