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 |
|---|---|---|---|---|---|
gousiosg/pullreqs-dnn | preprocess.py | 1 | 8233 | #!/usr/bin/env python
#
# (c) 2016 -- onwards Georgios Gousios <gousiosg@gmail.com>, Rik Nijessen <riknijessen@gmail.com>
#
from __future__ import print_function
import pickle
import random
import urllib
import numpy as np
import argparse
from config import *
from code_tokenizer import CodeTokenizer
from my_tokeniz... | mit |
DSLituiev/scikit-learn | sklearn/ensemble/tests/test_voting_classifier.py | 25 | 8160 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raise_message
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import Logi... | bsd-3-clause |
lavenderwords/cluster-scheduler-simulator | src/main/python/graphing-scripts/comparison-plot-from-protobuff.py | 5 | 23735 | #!/usr/bin/python
# Copyright (c) 2013, Regents of the University of California
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright no... | bsd-3-clause |
Intel-Corporation/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/ops.py | 6 | 46486 | # 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 |
Windy-Ground/scikit-learn | examples/decomposition/plot_incremental_pca.py | 244 | 1878 | """
===============
Incremental PCA
===============
Incremental principal component analysis (IPCA) is typically used as a
replacement for principal component analysis (PCA) when the dataset to be
decomposed is too large to fit in memory. IPCA builds a low-rank approximation
for the input data using an amount of memo... | bsd-3-clause |
parth1993/pycolor_detection | pycolor.py | 1 | 3288 | # -*- coding: utf-8 -*-
import random
import numpy as np
import cv2
import numpy.ma as ma
from sklearn.cluster import KMeans, SpectralClustering
from colormap import rgb2hex
from multiprocessing import Pool, cpu_count
import matplotlib.pyplot as plt
random.seed(0)
'__author__' == "sharmaparth17@gmail.com"
class Colo... | mit |
kun--hust/sccloud | swift/common/middleware/x_profile/html_viewer.py | 15 | 21038 | # Copyright (c) 2010-2012 OpenStack, 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 ... | apache-2.0 |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/tests/dataframe/tensorflow_dataframe_test.py | 24 | 13091 | # 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... | gpl-3.0 |
rahuldhote/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
simon-pepin/scikit-learn | examples/cluster/plot_dbscan.py | 346 | 2479 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn... | bsd-3-clause |
mehdidc/scikit-learn | examples/svm/plot_separating_hyperplane.py | 62 | 1274 | """
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machines classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impo... | bsd-3-clause |
sdiazpier/nest-simulator | extras/ConnPlotter/ConnPlotter.py | 14 | 83966 | # -*- coding: utf-8 -*-
#
# ConnPlotter.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 License, or... | gpl-2.0 |
tcm129/trading-with-python | nautilus/nautilus.py | 77 | 5403 | '''
Created on 26 dec. 2011
Copyright: Jev Kuznetsov
License: BSD
'''
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ib.ext.Contract import Contract
from ib.opt import ibConnection
from ib.ext.Order import Order
import tradingWithPython.lib.logger as logger
from tradingWithPython.lib.eve... | bsd-3-clause |
cybernet14/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 261 | 4490 | import unittest
import sys
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less, assert_equal
from sklearn.mixture.tests.test_gmm import GMMTester
from sklearn.externals.s... | bsd-3-clause |
dkillick/cartopy | lib/cartopy/examples/logo.py | 5 | 1461 | __tags__ = ['Miscellanea']
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import matplotlib.textpath
import matplotlib.patches
from matplotlib.font_manager import FontProperties
import numpy as np
def main():
plt.figure(figsize=[12, 6])
ax = plt.axes(projection=ccrs.Robinson())
ax.coastlines(... | lgpl-3.0 |
bkendzior/scipy | scipy/special/add_newdocs.py | 2 | 157610 | # Docstrings for generated ufuncs
#
# The syntax is designed to look like the function add_newdoc is being
# called from numpy.lib, but in this file add_newdoc puts the
# docstrings in a dictionary. This dictionary is used in
# generate_ufuncs.py to generate the docstrings for the ufuncs in
# scipy.special at the C lev... | bsd-3-clause |
jblackburne/scikit-learn | sklearn/model_selection/_split.py | 3 | 62983 | """
The :mod:`sklearn.model_selection._split` module includes classes and
functions to split the data based on a preset strategy.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# Ragha... | bsd-3-clause |
sumanthjamadagni/OZ | LJ_Isotherms.py | 1 | 4228 | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from itertools import cycle
import Potentials
import OZ_Functions as OZF
import PP_Functions
import FigFuncs
import HNC
import RHNC
colors = ['red', 'blue... | gpl-3.0 |
v-chuqin/simPoem | data_iterator.py | 1 | 53987 | import cPickle as pkl
import gzip
import pandas as pd
import numpy as np
def fopen(filename, mode='r'):
if filename.endswith('.gz'):
return gzip.open(filename, mode)
return open(filename, mode)
def remove_tags_used_char_mem(previous_source_seq, reference,
worddicts_r,
... | gpl-3.0 |
zihua/scikit-learn | sklearn/tests/test_multioutput.py | 39 | 6609 | import numpy as np
import scipy.sparse as sp
from sklearn.utils import shuffle
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regex
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing impor... | bsd-3-clause |
ua-snap/downscale | old/bin/old/cld_cru_ts31_downscaling.py | 2 | 11324 | # # #
# Current implementation of the cru ts31 (ts32) delta downscaling procedure
#
# Author: Michael Lindgren (malindgren@alaska.edu)
# # #
import numpy as np
def write_gtiff( output_arr, template_meta, output_filename, compress=True ):
'''
DESCRIPTION:
------------
output a GeoTiff given a numpy ndarray, rasterio... | mit |
pvlib/pvlib-python | pvlib/tests/test_pvsystem.py | 1 | 87245 | from collections import OrderedDict
import numpy as np
from numpy import nan, array
import pandas as pd
import pytest
from .conftest import (
assert_series_equal, assert_frame_equal, fail_on_pvlib_version)
from numpy.testing import assert_allclose
import unittest.mock as mock
from pvlib import inverter, pvsystem... | bsd-3-clause |
maheshakya/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
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
self.use_plots... | bsd-3-clause |
samzhang111/scikit-learn | examples/applications/wikipedia_principal_eigenvector.py | 233 | 7819 | """
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | bsd-3-clause |
ilo10/scikit-learn | sklearn/preprocessing/label.py | 35 | 28877 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Joel Nothman <joel.nothman@gmail.com>
# Hamzeh Alsalhi <ha258@cornell.edu>
# Licens... | bsd-3-clause |
mbalasso/mynumpy | numpy/lib/function_base.py | 1 | 115294 | __docformat__ = "restructuredtext en"
__all__ = ['select', 'piecewise', 'trim_zeros', 'copy', 'iterable',
'percentile', 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex',
'disp', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax',
'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfin... | bsd-3-clause |
nicolasfauchereau/windspharm | doc/sphinxext/plot_directive.py | 4 | 27409 | """
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as t... | mit |
jjx02230808/project0223 | sklearn/tests/test_learning_curve.py | 59 | 10869 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
ebraunkeller/kerouac-bobblehead | ProcStudentView.py | 1 | 1311 | # Process the attendance table for a public viewitems
# join attendance with demographics and
# Retain the individual student data
# Input files: DistrictAttend.csv created by script appending enrollment and attendance data
# AllStudents.csv - pulled from X2
# Output file: DistrictView.csv
import ... | mit |
buguen/pylayers | pylayers/antprop/aarray.py | 1 | 27953 | # -*- coding:Utf-8 -*-
import numpy as np
import pylayers.antprop.antenna as ant
import pylayers.util.geomutil as geu
import matplotlib.pyplot as plt
import scipy.signal as si
import doctest
import pdb
r"""
.. currentmodule:: pylayers.antprop.aarray
This module handles antenna arrays
Array class
===========
.. aut... | lgpl-3.0 |
xuewei4d/scikit-learn | benchmarks/bench_plot_randomized_svd.py | 8 | 17827 | """
Benchmarks on the power iterations phase in randomized SVD.
We test on various synthetic and real datasets the effect of increasing
the number of power iterations in terms of quality of approximation
and running time. A number greater than 0 should help with noisy matrices,
which are characterized by a slow spectr... | bsd-3-clause |
liuchengtian/CS523 | steerstats/tools/plotting/animating/anim_scatter.py | 8 | 3367 | """
Matplotlib Animation Example
author: Jake Vanderplas
email: vanderplas@astro.washington.edu
website: http://jakevdp.github.com
license: BSD
Please feel free to use and modify this, but keep the above information. Thanks!
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
... | gpl-3.0 |
Yawgmoth90/pykep | PyKEP/examples/_ex1.py | 5 | 5350 | try:
from PyGMO.problem import base as PyGMO_problem
"""
This example on the use of PyKEP constructs, using the PyGMO syntax, is an interplanetary low-thrust optimization
problem that can then be solved using one of the available PagMO solvers. The problem is a non-linear constrained
problem that u... | gpl-3.0 |
MJuddBooth/pandas | pandas/tests/extension/base/reduce.py | 5 | 1911 | import warnings
import pytest
import pandas as pd
import pandas.util.testing as tm
from .base import BaseExtensionTests
class BaseReduceTests(BaseExtensionTests):
"""
Reduction specific tests. Generally these only
make sense for numeric/boolean operations.
"""
def check_reduce(self, s, op_name,... | bsd-3-clause |
wzbozon/statsmodels | statsmodels/tsa/tsatools.py | 19 | 20189 | from statsmodels.compat.python import range, lrange, lzip
import numpy as np
import numpy.lib.recfunctions as nprf
from statsmodels.tools.tools import add_constant
from pandas.tseries import offsets
from pandas.tseries.frequencies import to_offset
def add_trend(X, trend="c", prepend=False, has_constant='skip'):
"... | bsd-3-clause |
huongttlan/statsmodels | statsmodels/tsa/base/datetools.py | 27 | 10629 | from statsmodels.compat.python import (lrange, lzip, lmap, string_types, callable,
asstr, reduce, zip, map)
import re
import datetime
from pandas import Period
from pandas.tseries.frequencies import to_offset
from pandas import datetools as pandas_datetools
import numpy as np
#NOTE: All... | bsd-3-clause |
arakcheev/python-data-plotter | plot.py | 1 | 4708 | import multiprocessing
import time
from TecData import TecData
from FileData import FileData
from NurgushBinData import NurgushBinData
import matplotlib.pyplot as plt
import json
class Configuration:
def __init__(self, config_name):
json_data_file = open('plot.json')
self.json = json.load(json_dat... | mit |
ericgibert/supersid | supersid/wxsidviewer.py | 2 | 8399 | """
wxSidViewer class implements a graphical user interface for SID based on wxPython
About Threads and wxPython http://www.blog.pythonlibrary.org/2010/05/22/wxpython-and-threads/
Each Viewer must implement:
- __init__(): all initializations
- run(): main loop to get user input
- close(): cleaning up
- status_display... | mit |
GeoscienceAustralia/eo-tools | setup.py | 2 | 1449 | #!/usr/bin/env python
# ===============================================================================
# Copyright 2015 Geoscience Australia
#
# 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
... | apache-2.0 |
farhaanbukhsh/networkx | networkx/drawing/tests/test_pylab.py | 45 | 1137 | """
Unit tests for matplotlib drawing functions.
"""
import os
from nose import SkipTest
import networkx as nx
class TestPylab(object):
@classmethod
def setupClass(cls):
global plt
try:
import matplotlib as mpl
mpl.use('PS',warn=False)
import matplotli... | bsd-3-clause |
AaltoML/kalman-jax | kalmanjax/notebooks/2d_log_gaussian_cox_process.py | 1 | 3009 | import sys
sys.path.insert(0, '../')
import numpy as np
from jax.experimental import optimizers
import matplotlib.pyplot as plt
import time
from sde_gp import SDEGP
import approximate_inference as approx_inf
import priors
import likelihoods
from utils import softplus_list, discretegrid
plot_intermediate = False
print... | apache-2.0 |
akhilaananthram/nupic.research | sensorimotor/experiments/capacity/data_utils.py | 4 | 6540 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
wiki2014/Learning-Summary | alps/cts/suite/cts/utils/grapher.py | 4 | 2683 | #!/usr/bin/env python
#
# Copyright (C) 2013 The Android Open Source Project
#
# 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 req... | gpl-3.0 |
pprett/statsmodels | statsmodels/examples/ex_feasible_gls_het.py | 1 | 4217 | # -*- coding: utf-8 -*-
"""Examples for linear model with heteroscedasticity estimated by feasible GLS
These are examples to check the results during developement.
The assumptions:
We have a linear model y = X*beta where the variance of an observation depends
on some explanatory variable Z (`exog_var`).
linear_model... | bsd-3-clause |
jpaasen/cos | framework/lib/getColormap.py | 1 | 1180 | import os
import cPickle
from scipy import io
import matplotlib
class Colormaps(object):
pass
#def setColormap():
def setColormap():
path = os.getenv('PHDCODE_ROOT')+ '/data/sonar/colormaps'
c = Colormaps()
bronze = io.loadmat(path+'/bronze_color.mat')['color']
sas = io.loadmat(... | mit |
hmurraydavis/Flutter-Sail | trackRedSailMarkers.py | 1 | 11103 | import cv2
import numpy as np
import matplotlib.pyplot as plt
import pprint
import math
import pickle
import scipy.stats as stats
testNum = 29
filename = 'Data1/t'+str(testNum)+'.mp4'
numberErrorsBk = 0
centerBk = 0; radiusBk = 0
centerPBk = 0; radiusPBk = 0;
numberErrorsFt = 0
centerPFt = 0; radiusPFt = 0;
frameNu... | bsd-3-clause |
jayflo/scikit-learn | sklearn/cluster/tests/test_hierarchical.py | 230 | 19795 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
from tempfile import mkdtemp
import shutil
from functools import partial
import numpy as np
from scipy import sparse
from... | bsd-3-clause |
val-iisc/deligan | src/mnist/tsne.py | 4 | 5196 | #
# tsne.py
#
# Implementation of t-SNE in Python. The implementation was tested on Python 2.7.10, and it requires a working
# installation of NumPy. The implementation comes with an example on the MNIST dataset. In order to plot the
# results of this example, a working installation of matplotlib is required.
#
# The ... | mit |
Moriadry/tensorflow | tensorflow/contrib/learn/python/learn/estimators/kmeans_test.py | 40 | 20118 | # 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 |
Mendelone/forex_trading | Algorithm.Python/PythonPackageTestAlgorithm.py | 2 | 6403 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Li... | apache-2.0 |
cmu-delphi/delphi-epidata | integrations/acquisition/covid_hosp/state_daily/test_scenarios.py | 1 | 5643 | """Integration tests for acquisition of COVID hospitalization."""
# standard library
from datetime import date
import unittest
from unittest.mock import patch
# third party
from freezegun import freeze_time
import pandas as pd
# first party
from delphi.epidata.acquisition.covid_hosp.state_daily.database import Datab... | mit |
nesterione/scikit-learn | examples/linear_model/plot_sgd_comparison.py | 167 | 1659 | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Author: Rob Zinkov <rob at zinkov dot com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot a... | bsd-3-clause |
RyanHope/gazetools_cl | old/test.py | 1 | 1299 | import sys,os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../python"))
import pkg_resources
import pyopencl as cl
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.colors as mc
from PIL import Image
from gazetools imp... | gpl-3.0 |
warmspringwinds/scikit-image | doc/examples/plot_piecewise_affine.py | 43 | 1111 | """
===============================
Piecewise Affine Transformation
===============================
This example shows how to use the Piecewise Affine Transformation.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import PiecewiseAffineTransform, warp
from skimage import data
image = ... | bsd-3-clause |
canavandl/bokeh | bokeh/tests/test_sources.py | 17 | 3244 | from __future__ import absolute_import
import unittest
from unittest import skipIf
import warnings
try:
import pandas as pd
is_pandas = True
except ImportError as e:
is_pandas = False
from bokeh.models.sources import DataSource, ColumnDataSource, ServerDataSource
class TestColumnDataSourcs(unittest.Test... | bsd-3-clause |
jwaterfield/echidna | echidna/output/plot.py | 4 | 11806 | import matplotlib.pyplot as plt
import numpy
from matplotlib.ticker import FixedLocator
from matplotlib.colors import BoundaryNorm
def _produce_axis(spectra, dimension):
""" This method produces an array that represents the axis.
The array is formed of the value at the bin-centre for each bin
along the s... | mit |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/scipy/signal/ltisys.py | 7 | 76129 | """
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
from __future__ import division, print_function, absolute_import
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
# Aug 2013: Juan Luis Cano
# Rewrote abcd_normaliz... | mit |
saskartt/P4UL | pyNetCDF/waveletAnalysisNetCdf.py | 1 | 6038 | #!/usr/bin/env python
import sys
import numpy as np
import argparse
import matplotlib.pyplot as plt
from plotTools import addContourf
from analysisTools import sensibleIds, groundOffset, discreteWaveletAnalysis
from netcdfTools import read3dDataFromNetCDF, netcdfOutputDataset, \
createNetcdfVariable, netcdfWriteAndCl... | mit |
ChanChiChoi/scikit-learn | sklearn/svm/tests/test_sparse.py | 95 | 12156 | from nose.tools import assert_raises, assert_true, assert_false
import numpy as np
from scipy import sparse
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classif... | bsd-3-clause |
jperla/happynews | model/analysis/compare.py | 1 | 2331 | #!/usr/bin/env python
import jsondata
from inspect_slda_model import predict
phi_filename = '../balancedtlc/mytlc-output-20-phiC.dat.npy.list.npz'
vocab_filename = ''
eta_filename = '../balancedtlc/mytlc-output-20-eta.dat.npy.gz'
titles_filename = '../data/titles.dc.nyt.json'
phi = jsondata.read(phi_filename)
eta ... | agpl-3.0 |
daniellerch/stegolab | watermarking/E_TRELLIS_8.py | 1 | 3166 | #!/usr/bin/env python3
# Copyright (c) 2020 Daniel Lerch Hostalot. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation ... | gpl-2.0 |
nof20/BitcoinModel | Signals/BitcoinData.py | 1 | 2795 | """ Module to download Bitcoin prices from Quandl.
See https://www.quandl.com/data/GDAX/USD-BTC-USD-Exchange-Rate
"""
import configparser
import datetime
import quandl
import pandas as pd
import numpy as np
from couchdb.mapping import Document, FloatField, DateField, TextField
from Tools.DBCache import DBCache
clas... | gpl-3.0 |
vince8290/dana | ui_files/samples.py | 1 | 11728 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'events.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from collections import *
from functools import *
import os, glob
import pandas a... | gpl-3.0 |
chrisbarber/dask | dask/array/tests/test_percentiles.py | 4 | 1913 | import pytest
pytest.importorskip('numpy')
from dask.utils import skip
from dask.array.utils import assert_eq
import dask.array as da
import numpy as np
def same_keys(a, b):
def key(k):
if isinstance(k, str):
return (k, -1, -1, -1)
else:
return k
return sorted(a.dask, ... | bsd-3-clause |
HumanDynamics/openbadge-analysis | openbadge_analysis/preprocessing/proximity.py | 1 | 9023 | import pandas as pd
import json
import collections
def member_to_badge_proximity(fileobject, time_bins_size='1min', tz='US/Eastern'):
"""Creates a member-to-badge proximity DataFrame from a proximity data file.
Parameters
----------
fileobject : file or iterable list of str
The proximity d... | mit |
NYU-CAL/Disco | Python/plotDiscoDiagRZ.py | 1 | 3748 | import sys
import math
import h5py as h5
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import discopy.util as util
xscale = "log"
yscale = "log"
GAM = 1.66666666667
RMAX = 0.8
GR = False
#CM = mpl.cm.inferno
CM = mpl.cm.afmhot
def plotCheckpoint(file):
print("Load... | gpl-3.0 |
idlead/scikit-learn | sklearn/neural_network/tests/test_rbm.py | 225 | 6278 | import sys
import re
import numpy as np
from scipy.sparse import csc_matrix, csr_matrix, lil_matrix
from sklearn.utils.testing import (assert_almost_equal, assert_array_equal,
assert_true)
from sklearn.datasets import load_digits
from sklearn.externals.six.moves import cStringIO as ... | bsd-3-clause |
victor-prado/broker-manager | environment/lib/python3.5/site-packages/pandas/tests/frame/test_subclass.py | 7 | 9620 | # -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
from pandas import DataFrame, Series, MultiIndex, Panel
import pandas as pd
import pandas.util.testing as tm
from pandas.tests.frame.common import TestData
class TestDataFrameSubclassing(tm.TestCase, TestData):
_multiprocess_can... | mit |
christophreimer/pytesmo | pytesmo/time_series/plotting.py | 1 | 6133 | # Copyright (c) 2014,Vienna University of Technology,
# Department of Geodesy and Geoinformation
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the... | bsd-3-clause |
x-mengao/x-mengao.github.io | markdown_generator/talks.py | 199 | 4000 |
# coding: utf-8
# # Talks markdown generator for academicpages
#
# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i... | mit |
toobaz/pandas | pandas/tests/arithmetic/test_numeric.py | 1 | 43304 | # Arithmetic tests for DataFrame/Series/Index/Array classes that should
# behave identically.
# Specifically for numeric dtypes
from collections import abc
from decimal import Decimal
from itertools import combinations
import operator
import numpy as np
import pytest
import pandas as pd
from pandas import Index, Seri... | bsd-3-clause |
DSLituiev/scikit-learn | benchmarks/bench_plot_parallel_pairwise.py | 297 | 1247 | # Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import time
import pylab as pl
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metrics.pairwise import pairwise_kernels
def plot(func):
random_state = check_random_state(0)
... | bsd-3-clause |
astroclark/bhextractor | bhex_utils/bhex_wavedata.py | 1 | 23932 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 James Clark <james.clark@ligo.org>
#
# 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 the License, or
#... | gpl-2.0 |
mjudsp/Tsallis | sklearn/gaussian_process/gpc.py | 42 | 31571 | """Gaussian processes classification."""
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve
from scipy.optimize import fmin_l_bfgs_b
from scipy.special import erf... | bsd-3-clause |
jhamman/xarray | xarray/backends/api.py | 1 | 48993 | import os.path
import warnings
from glob import glob
from io import BytesIO
from numbers import Number
from pathlib import Path
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Callable,
Dict,
Hashable,
Iterable,
Mapping,
Tuple,
Union,
)
import numpy as np
from .. import... | apache-2.0 |
davidgbe/scikit-learn | benchmarks/bench_random_projections.py | 397 | 8900 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... | bsd-3-clause |
IndraVikas/scikit-learn | sklearn/datasets/mldata.py | 309 | 7838 | """Automatically download MLdata datasets."""
# Copyright (c) 2011 Pietro Berkes
# License: BSD 3 clause
import os
from os.path import join, exists
import re
import numbers
try:
# Python 2
from urllib2 import HTTPError
from urllib2 import quote
from urllib2 import urlopen
except ImportError:
# Pyt... | bsd-3-clause |
shangwuhencc/scikit-learn | sklearn/feature_selection/__init__.py | 244 | 1088 | """
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from .univariate_selection import chi2
from .univariate_selection import f_classif
from .univariate_selection import f_... | bsd-3-clause |
shikhardb/scikit-learn | examples/ensemble/plot_forest_importances.py | 241 | 1761 | """
=========================================
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 |
ElDeveloper/scikit-learn | sklearn/utils/tests/test_seq_dataset.py | 93 | 2471 | # Author: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.seq_dataset import ArrayDataset, CSRDataset
from sklearn.datasets import load_iris
from numpy.testing import assert_array_equal
from nose.tools import assert_equal
iris =... | bsd-3-clause |
lancezlin/pylearn2 | pylearn2/packaged_dependencies/theano_linear/unshared_conv/localdot.py | 39 | 5044 | """
WRITEME
"""
import logging
from ..linear import LinearTransform
from .unshared_conv import FilterActs, ImgActs
from theano.compat.six.moves import xrange
from theano.sandbox import cuda
if cuda.cuda_available:
import gpu_unshared_conv # register optimizations
import numpy as np
import warnings
try:
impor... | bsd-3-clause |
cossatot/wnfs_stress | scripts/wnfs_stress_inversion_no_M.py | 1 | 9112 | import numpy as np
import pandas as pd
import time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import colors
import seaborn as sns
from scipy.stats import gaussian_kde
import halfspace.scripts as hss
import halfspace.projections as hsp
from tect_stress_functions import *
from... | cc0-1.0 |
zhenv5/scikit-learn | sklearn/neural_network/rbm.py | 206 | 12292 | """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 |
jakobworldpeace/scikit-learn | examples/linear_model/plot_lasso_and_elasticnet.py | 24 | 2080 | """
========================================
Lasso and Elastic Net for Sparse Signals
========================================
Estimates Lasso and Elastic-Net regression models on a manually generated
sparse signal corrupted with an additive noise. Estimated coefficients are
compared with the ground-truth.
"""
print(... | bsd-3-clause |
YerevaNN/mimic3-benchmarks | mimic3benchmark/evaluation/evaluate_los.py | 1 | 2649 | from __future__ import absolute_import
from __future__ import print_function
from mimic3models.metrics import print_metrics_regression
import sklearn.utils as sk_utils
import numpy as np
import pandas as pd
import argparse
import json
import os
def main():
parser = argparse.ArgumentParser()
parser.add_argume... | mit |
sunyihuan326/DeltaLab | shuwei_fengge/practice_four/Sense/model/dxq_DNN.py | 1 | 7277 | # coding:utf-8
'''
Created on 2018/1/5.
@author: chk01
'''
import tensorflow as tf
from tensorflow.python.framework import ops
from practice_four.utils import *
from imblearn.over_sampling import RandomOverSampler, SMOTE
from sklearn.metrics import confusion_matrix, classification_report
def preprocessing(trX, teX, ... | mit |
dsm054/pandas | pandas/tests/indexes/test_numeric.py | 1 | 40922 | # -*- coding: utf-8 -*-
from datetime import datetime
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas.compat import range
import pandas as pd
from pandas import Float64Index, Index, Int64Index, Series, UInt64Index
from pandas.tests.indexes.common import Base
import pandas.util... | bsd-3-clause |
Eric89GXL/scikit-learn | sklearn/linear_model/__init__.py | 5 | 2669 | """
The :mod:`sklearn.linear_model` module implements generalized linear models. It
includes Ridge regression, Bayesian Regression, Lasso and Elastic Net
estimators computed with Least Angle Regression and coordinate descent. It also
implements Stochastic Gradient Descent related algorithms.
"""
# See http://scikit-le... | bsd-3-clause |
evanbiederstedt/RRBSfun | epiphen/total_chr02.py | 2 | 32997 | import glob
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', 50) # print all rows
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files")
normalB = glob.glob("binary_position_RRBS_normal_B_cell*")
mcell = glob.glob("binary_position_RRBS_NormalBCD19pCD27... | mit |
ngoix/OCRF | examples/ensemble/plot_ensemble_oob.py | 259 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause |
jamdin/jdiner-mobile-byte3 | lib/numpy/lib/function_base.py | 16 | 109648 | __docformat__ = "restructuredtext en"
__all__ = ['select', 'piecewise', 'trim_zeros', 'copy', 'iterable',
'percentile', 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex',
'disp', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax',
'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'av... | apache-2.0 |
daphnei/nn_chatbot | seq2seq/seq2seq/tasks/dump_attention.py | 6 | 4850 | # Copyright 2017 Google 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 law or agreed to in writing,... | mit |
smrjan/seldon-server | docker/examples/iris/keras/keras_pipeline.py | 2 | 1625 | import sys, getopt, argparse
import seldon.pipeline.basic_transforms as bt
import seldon.pipeline.util as sutl
from sklearn.pipeline import Pipeline
import seldon.pipeline.auto_transforms as pauto
import seldon.keras as sk
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
impo... | apache-2.0 |
agarsev/grafeno | grafeno/graph.py | 1 | 9402 | # Grafeno -- Python concept graphs library
# Copyright 2016 Antonio F. G. Sevilla <afgs@ucm.es>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at... | agpl-3.0 |
Aasmi/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 |
ndingwall/scikit-learn | sklearn/experimental/enable_halving_search_cv.py | 11 | 1226 | """Enables Successive Halving search-estimators
The API and results of these estimators might change without any deprecation
cycle.
Importing this file dynamically sets the
:class:`~sklearn.model_selection.HalvingRandomSearchCV` and
:class:`~sklearn.model_selection.HalvingGridSearchCV` as attributes of the
`model_sel... | bsd-3-clause |
rahulpalamuttam/weld | examples/python/grizzly/get_population_stats_grizzly.py | 3 | 1373 | #!/usr/bin/python
# The usual preamble
import numpy as np
import grizzly.numpy_weld as npw
import pandas as pd
import grizzly.grizzly as gr
import time
# Get data (NYC 311 service request dataset) and start cleanup
raw_data = pd.read_csv('data/us_cities_states_counties.csv', delimiter='|')
raw_data.dropna(inplace=Tru... | bsd-3-clause |
myquant/strategy | Turtle/python/turtle.py | 2 | 3690 | # encoding: utf8
import logging
import logging.config
import pandas as pd
import numpy as np
from gmsdk import *
class TurtleStrategy(StrategyBase):
def __init__(self, *args, **kwargs):
super(TurtleStrategy, self).__init__(*args, **kwargs)
self.__get_param__()
self.__init_data__()
de... | apache-2.0 |
Eric89GXL/mne-python | examples/decoding/plot_decoding_xdawn_eeg.py | 9 | 4103 | """
============================
XDAWN Decoding From EEG data
============================
ERP decoding with Xdawn :footcite:`RivetEtAl2009,RivetEtAl2011`. For each event
type, a set of spatial Xdawn filters are trained and applied on the signal.
Channels are concatenated and rescaled to create features vectors that w... | bsd-3-clause |
aeklant/scipy | scipy/interpolate/_bsplines.py | 1 | 34578 | import functools
import operator
import numpy as np
from scipy.linalg import (get_lapack_funcs, LinAlgError,
cholesky_banded, cho_solve_banded)
from . import _bspl
from . import _fitpack_impl
from . import _fitpack as _dierckx
__all__ = ["BSpline", "make_interp_spline", "make_lsq_spline"]
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.