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
ligovirgo/gwdetchar
gwdetchar/omega/tests/test_plot.py
1
2702
# -*- coding: utf-8 -*- # Copyright (C) Alex Urban (2019) # # This file is part of the GW DetChar python package. # # GW DetChar is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
n7jti/machine_learning
project/tune-rain.py
1
2065
#!/usr/bin/python import argparse import numpy as np from sklearn.cross_validation import train_test_split from sklearn.grid_search import GridSearchCV from sklearn.metrics import classification_report from sklearn.svm import SVC def loadData (subdir, prefix): # Load a csv of floats: data = np.genfromtxt(subdir +...
apache-2.0
mtat76/atm-py
build/lib/atmPy/for_removal/POPS/housekeeping.py
6
4514
# -*- coding: utf-8 -*- """ @author: Hagen Telg """ import datetime import pandas as pd # import os # import pylab as plt # from atmPy.tools import conversion_tools as ct from atmPy.atmos import atmosphere_standards as atm_std, timeseries def _read_housekeeping(fname): """Reads housekeeping file (f...
mit
JackKelly/neuralnilm_prototype
scripts/e347.py
2
6285
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
xwolf12/scikit-learn
sklearn/decomposition/truncated_svd.py
199
7744
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA). """ # Author: Lars Buitinck <L.J.Buitinck@uva.nl> # Olivier Grisel <olivier.grisel@ensta.org> # Michael Becker <mike@beckerfuffle.com> # License: 3-clause BSD. import numpy as np import scipy.sparse as sp try: from scipy.sp...
bsd-3-clause
batxes/4c2vhic
src/prepare_data_binary.py
2
2726
#!/usr/bin/python import sys, re, os import collections import matplotlib.pyplot as plt #plt.style.use('ggplot') ############################################################################################################# # This script takes the raw 4C-seq data. Then for each file it creates another one with some ch...
gpl-3.0
tmthyjames/Achoo
data/data/treatment_tracker.py
1
1396
# treatment_tracker.py import time import pandas as pd import RPi.GPIO as GPIO import munging.utils as utils def main(): engine = utils.get_db_engine() inhaler_btn = 18 breathing_treatment_btn = 23 GPIO.setmode(GPIO.BCM) GPIO.setup(inhaler_btn, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setu...
mit
Zhang-O/small
tensor__cpu/Numba/numba_example.py
1
1425
# -*- coding: utf-8 -*- # http://numba.pydata.org/numba-doc/latest/user/examples.html from __future__ import print_function, division, absolute_import from timeit import default_timer as timer from matplotlib.pylab import imshow, jet, show, ion import numpy as np from numba import jit, int32, int8, float64 @jit(i...
mit
letsgoexploring/fredpy-package
build/lib/fredpy/__init__.py
2
47252
import requests import dateutil import datetime import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import warnings import statsmodels.api as sm import time tsa = sm.tsa # Read recession data data cycle_data = pd.read_csv('https://raw.githubusercontent.com/letsgoexploring/fredpy-package/gh...
mit
henridwyer/scikit-learn
sklearn/ensemble/tests/test_bagging.py
127
25365
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause import numpy as np from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.te...
bsd-3-clause
CallaJun/hackprince
indico/skimage/filters/_gabor.py
4
6929
import numpy as np from scipy import ndimage from .._shared.utils import assert_nD __all__ = ['gabor_kernel', 'gabor_filter'] def _sigma_prefactor(bandwidth): b = bandwidth # See http://www.cs.rug.nl/~imaging/simplecell.html return 1.0 / np.pi * np.sqrt(np.log(2) / 2.0) * \ (2.0 ** b + 1) / (2.0...
lgpl-3.0
multipath-tcp/mptcp-analysis-scripts
scripts_graph/bursts_conn_duration.py
1
4804
#! /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
cjermain/numpy
doc/source/conf.py
63
9811
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function import sys, os, re # Check Sphinx version import sphinx if sphinx.__version__ < "1.0.1": raise RuntimeError("Sphinx 1.0.1 or newer required") needs_sphinx = '1.0' # ----------------------------------------------------------...
bsd-3-clause
shangwuhencc/scikit-learn
sklearn/preprocessing/tests/test_function_transformer.py
176
2169
from nose.tools import assert_equal import numpy as np from sklearn.preprocessing import FunctionTransformer def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X): def _func(X, *args, **kwargs): args_store.append(X) args_store.extend(args) kwargs_store.update(kwargs) ...
bsd-3-clause
dcherian/tools
ROMS/pmacc/tools/post_tools/rompy/tags/rompy-0.1.6/test.py
4
8114
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from rompy import rompy, plot_utils, utils map1 = False map2 = False map3 = False map4 = False map5 = False map6 = False map7 = Fa...
mit
CVML/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
treycausey/scikit-learn
examples/ensemble/plot_random_forest_embedding.py
286
3531
""" ========================================================= Hashing feature transformation using Totally Random Trees ========================================================= RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representation, which might be beneficial for classificati...
bsd-3-clause
spyder-ide/conda-manager
scripts/convertainitodic.py
2
31378
# -*- coding: utf-8 -*- """ Created on Sun Sep 13 10:51:43 2015 @author: goanpeca """ a = """[_license] description=Interactive prompt objects for printing the license text, a list of contributors and the copyright notice home= pypi= docs= dev= [_windows] description= home= pypi= docs= dev= [abstract-rendering] d...
mit
phobson/seaborn
seaborn/tests/test_relational.py
3
57698
from __future__ import division from itertools import product import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import pytest from .. import relational as rel from ..palettes import color_palette from ..utils import categorical_order, sort_df class TestRelationalPlotter(o...
bsd-3-clause
snowicecat/umich-eecs445-f16
lecture07_naive-bayes/Lec07.py
2
5343
# plotting from matplotlib import pyplot as plt; from matplotlib import colors import matplotlib as mpl; from mpl_toolkits.mplot3d import Axes3D if "bmh" in plt.style.available: plt.style.use("bmh"); # matplotlib objects from matplotlib import mlab; from matplotlib import gridspec; # scientific import numpy as np; im...
mit
ClimbsRocks/scikit-learn
sklearn/utils/estimator_checks.py
1
56576
from __future__ import print_function import types import warnings import sys import traceback import pickle from copy import deepcopy import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memory from sklearn.utils.testing imp...
bsd-3-clause
mr-cloud/deep-learning-udacity
download.py
1
2153
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from scipy import ndimage from sklearn.line...
mit
brodoll/sms-tools
lectures/05-Sinusoidal-model/plots-code/sine-analysis-synthesis.py
22
1543
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import sys, os, functools, time from scipy.fftpack import fft, ifft, fftshift sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import ...
agpl-3.0
daStrauss/sparseConv
src/convNet.py
1
5746
''' Created on Dec 26, 2012 @author: dstrauss Copyright 2013 David Strauss 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
atsoroka/cs207project
src/group5code/correlation.py
5
8042
import os, sys curr_dir = os.getcwd().split('/') sys.path.append('/'.join(curr_dir[:-1])) ts_dir = curr_dir[:-1] ts_dir.append('timeseries') sys.path.append('/'.join(ts_dir)) import numpy.fft as nfft import numpy as np from timeseries.timeseries import TimeSeries from scipy.stats import norm class cor...
mit
glennq/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
evertrol/healpy
healpy/projaxes.py
2
39008
# # This file is part of Healpy. # # Healpy 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 # (at your option) any later version. # # Healpy is distributed in the h...
gpl-2.0
dilawar/moose-full
moose-examples/traub_2005/py/testutils.py
2
11988
# test_utils.py --- # # Filename: test_utils.py # Description: # Author: # Maintainer: # Created: Sat May 26 10:41:37 2012 (+0530) # Version: # Last-Updated: Fri Dec 7 16:27:24 2012 (+0530) # By: subha # Update #: 400 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Chang...
gpl-2.0
aman-iitj/scipy
scipy/interpolate/ndgriddata.py
45
7161
""" Convenience interface to N-D interpolation .. versionadded:: 0.9 """ from __future__ import division, print_function, absolute_import import numpy as np from .interpnd import LinearNDInterpolator, NDInterpolatorBase, \ CloughTocher2DInterpolator, _ndim_coords_from_arrays from scipy.spatial import cKDTree _...
bsd-3-clause
manashmndl/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
wlamond/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
127
1270
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import matplotlib.pyplot as plt 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_rand...
bsd-3-clause
Featuretools/featuretools
featuretools/tests/primitive_tests/test_make_agg_primitives.py
1
2901
import numpy as np import pandas as pd import featuretools as ft from featuretools.primitives.base.aggregation_primitive_base import ( make_agg_primitive ) from featuretools.variable_types import Datetime, Numeric # Check the custom agg primitives description def test_description_make_agg_primitive(): def ma...
bsd-3-clause
adrienpacifico/openfisca-france-data
openfisca_france_data/input_data_builders/build_openfisca_survey_data/step_04_famille.py
2
26656
#! /usr/bin/env python # -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redist...
agpl-3.0
drphilmarshall/SpaceWarps
analysis/make_offline_reports.py
2
17829
#!/usr/bin/env python # ====================================================================== import sys, getopt, numpy as np import matplotlib # Force matplotlib to not use any Xwindows backend: matplotlib.use('Agg') # Fonts, latex: matplotlib.rc('font', **{'family':'serif', 'serif':['TimesNewRoman']}) matplotlib....
mit
abimannans/scikit-learn
doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py
254
2005
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
VINScodeReviewGroup/VINS_CodeReviewRep
VINS_ThirdPartyLib/ceres-solver/examples/slam/pose_graph_2d/plot_results.py
8
1537
#!/usr/bin/python # # Plots the results from the 2D pose graph optimization. It will draw a line # between consecutive vertices. The commandline expects two optional filenames: # # ./plot_results.py --initial_poses optional --optimized_poses optional # # The files have the following format: # ID x y yaw_radians i...
gpl-3.0
tomsilver/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/pyplot.py
69
77521
import sys import matplotlib from matplotlib import _pylab_helpers, interactive from matplotlib.cbook import dedent, silent_list, is_string_like, is_numlike from matplotlib.figure import Figure, figaspect from matplotlib.backend_bases import FigureCanvasBase from matplotlib.image import imread as _imread from matplotl...
gpl-3.0
spatchcock/models
foraminifera/foraminiferal_test_accumulation_time_evolution.py
1
6938
# -*- coding: utf-8 -*- """ Created on Tue Apr 15 22:52:11 2014 @author: spatchcock """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Advection - diffusion - Decay - production # # Differential equation # # dC/dt = D(d^2C/dx^2) - w(dC/dx) - uC + Ra(x) # # Difference ...
unlicense
nest/nest-simulator
pynest/examples/gif_population.py
8
5045
# -*- coding: utf-8 -*- # # gif_population.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,...
gpl-2.0
dsanno/chainer-cifar
src/train.py
1
11021
import argparse import cPickle as pickle import numpy as np import os import matplotlib.pyplot as plt import chainer from chainer import optimizers from chainer import serializers import net import trainer import time class CifarDataset(chainer.datasets.TupleDataset): def __init__(self, x, y, augment=None): ...
mit
hsaputra/tensorflow
tensorflow/contrib/learn/python/learn/estimators/multioutput_test.py
136
1696
# 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
acompa/leptoid
tests/test_graphite.py
1
1437
""" Unit test for calls to Graphite's /render API. """ import leptoid.graphite as g import leptoid.namespaces as ns from leptoid.scaler import LeptoidScaler from unittest import TestCase from numpy import arange from time import ctime from pandas import TimeSeries class TestGraphite(TestCase): """ Graphite Test Cas...
apache-2.0
mr3bn/DAT210x
Module6/assignment1.py
1
5224
import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import numpy as np import time # # INFO: Your Parameters. # You can adjust them after completing the lab C = 1 kernel = 'linear' iterations = 5000 # TODO: Change to 200000 once you get to Question#2 # # INFO: You can set this to false ...
mit
vigilv/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
stevenzhang18/Indeed-Flask
lib/pandas/io/pickle.py
15
1656
from pandas.compat import cPickle as pkl, pickle_compat as pc, PY3 def to_pickle(obj, path): """ Pickle (serialize) object to input file path Parameters ---------- obj : any object path : string File path """ with open(path, 'wb') as f: pkl.dump(obj, f, protocol=pkl.HIG...
apache-2.0
siutanwong/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
cwu2011/scikit-learn
sklearn/qda.py
140
7682
""" Quadratic Discriminant Analysis """ # Author: Matthieu Perrot <matthieu.perrot@gmail.com> # # License: BSD 3 clause import warnings import numpy as np from .base import BaseEstimator, ClassifierMixin from .externals.six.moves import xrange from .utils import check_array, check_X_y from .utils.validation import ...
bsd-3-clause
ZENGXH/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
mne-tools/mne-tools.github.io
0.17/_downloads/0919bcb81dbc886011b0f529b4baf6c3/plot_epochs_to_data_frame.py
8
8847
""" ================================= Export epochs to Pandas DataFrame ================================= In this example the pandas exporter will be used to produce a DataFrame object. After exploring some basic features a split-apply-combine work flow will be conducted to examine the latencies of the response maxima...
bsd-3-clause
jhnnsnk/nest-simulator
pynest/examples/Potjans_2014/helpers.py
14
13629
# -*- coding: utf-8 -*- # # helpers.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
neurodata/ndgrutedb
MR-OCP/MROCPdjango/computation/plotting/plotHelpers.py
2
7503
# Copyright 2014 Open Connectome Project (http://openconnecto.me) # # 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 ap...
apache-2.0
hainm/scikit-learn
examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
huobaowangxi/scikit-learn
sklearn/kernel_approximation.py
258
17973
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
roryhr/yelp_kaggle
old_scripts/resnet_graph.py
1
14485
import cPickle as pickle import glob import numpy as np # 1.10.1 import pandas as pd import random import time from keras.callbacks import EarlyStopping, TensorBoard, LearningRateScheduler from keras.regularizers import l2 from keras.layers.normalization import BatchNormalization from keras.models import Graph fr...
gpl-3.0
Juanlu001/pfc-uc3m
code/plot_combined_ei_numeric.py
1
3027
import os from datetime import datetime import numpy as np from numpy.linalg import norm from matplotlib import rc import matplotlib.pyplot as plt from astropy import units as u from poliastro.bodies import Earth from poliastro.twobody import Orbit from poliastro.twobody.propagation import cowell from poliastro.tw...
mit
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/examples/ex_kernel_regression_sigtest.py
3
3113
# -*- coding: utf-8 -*- """Kernel Regression and Significance Test Warning: SLOW, 11 minutes on my computer Created on Thu Jan 03 20:20:47 2013 Author: Josef Perktold results - this version ---------------------- >>> execfile('ex_kernel_regression_censored1.py') bw [ 0.3987821 0.50933458] [0.39878209999999997, 0...
apache-2.0
mc-suchecki/MSc
scripts/analyze_stars_and_views.py
1
5989
"""Displays a histogram for photos metadata - number of stars and views.""" import datetime from math import log from matplotlib import pylab import numpy import pyprind import sys # settings PHOTOS_LIST_LOCATION = '/media/p307k07/hdd/MSc/data/list.txt' NUMBER_OF_BINS = 100 VIEWS_THRESHOLD = 0 DESIRED_WIDTH = 240 DESI...
gpl-3.0
ZenDevelopmentSystems/scikit-learn
benchmarks/bench_covertype.py
120
7381
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
kerimlcr/ab2017-dpyo
ornek/imageio/imageio-2.1.2/debian/python-imageio/usr/lib/python2.7/dist-packages/imageio/plugins/_tifffile.py
2
219652
#!/usr/bin/env python # -*- coding: utf-8 -*- # tifffile.py # styletest: skip # Copyright (c) 2008-2016, Christoph Gohlke # Copyright (c) 2008-2016, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary ...
gpl-3.0
ishanic/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
julien6387/supvisors
supvisors/plot.py
2
4007
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================================== # Copyright 2016 Julien LE CLEACH # # 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 Lice...
apache-2.0
openego/dingo
ding0/grid/mv_grid/solvers/base.py
1
6408
"""This file is part of DING0, the DIstribution Network GeneratOr. DING0 is a tool to generate synthetic medium and low voltage power distribution grids based on open data. It is developed in the project open_eGo: https://openegoproject.wordpress.com DING0 lives at github: https://github.com/openego/ding0/ The docume...
agpl-3.0
compops/gpo-joe2015
para/ml_helpers.py
2
9739
############################################################################## ############################################################################## # Default settings and helpers for # Maximum-likelihood inference # # Copyright (c) 2016 Johan Dahlin # liu (at) johandahlin.com # ###############################...
mit
harisbal/pandas
pandas/tests/arrays/test_datetimelike.py
1
7878
# -*- coding: utf-8 -*- import numpy as np import pytest import pandas as pd from pandas.core.arrays import ( DatetimeArrayMixin, PeriodArray, TimedeltaArrayMixin) import pandas.util.testing as tm # TODO: more freq variants @pytest.fixture(params=['D', 'B', 'W', 'M', 'Q', 'Y']) def period_index(request): """...
bsd-3-clause
tapomayukh/projects_in_python
classification/Classification_with_kNN/Single_Contact_Classification/Final/best_kNN_PCA/4-categories/96/test11_cross_validate_categories_96_no_motion_1200ms.py
1
4743
# Principal Component Analysis Code : from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import ro...
mit
Nyker510/scikit-learn
sklearn/utils/tests/test_fixes.py
281
1829
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Justin Vincent # Lars Buitinck # License: BSD 3 clause import numpy as np from nose.tools import assert_equal from nose.tools import assert_false from nose.tools import assert_true from numpy.testing import (assert_almost_equal, ...
bsd-3-clause
daneschi/berkeleytutorial
tutorial/tuliplib/tulipBin/test/pyTests/01_TUTORIAL/04_TUTORIAL_RVMRegression.py
1
1314
# Imports import sys sys.path.insert(0, '../../py') import tulipUQ as uq import numpy as np import matplotlib.pyplot as plt # ============= # MAIN FUNCTION # ============= if __name__ == "__main__": # Construct samples samples = uq.uqSamples() samples.addVariable('Var1',uq.kSAMPLEUniform,-1.0,1.0) samples.ad...
mit
cybernet14/scikit-learn
benchmarks/bench_sparsify.py
323
3372
""" Benchmark SGD prediction time with dense/sparse coefficients. Invoke with ----------- $ kernprof.py -l sparsity_benchmark.py $ python -m line_profiler sparsity_benchmark.py.lprof Typical output -------------- input data sparsity: 0.050000 true coef sparsity: 0.000100 test data sparsity: 0.027400 model sparsity:...
bsd-3-clause
xray/xray
xarray/tests/test_accessor_str.py
1
25563
# Tests for the `str` accessor are derived from the original # pandas string accessor tests. # For reference, here is a copy of the pandas copyright notice: # (c) 2011-2012, Lambda Foundry, Inc. and PyData Development Team # All rights reserved. # Copyright (c) 2008-2011 AQR Capital Management, LLC # All rights rese...
apache-2.0
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/sklearn/gaussian_process/tests/test_gpr.py
36
11813
"""Testing for Gaussian process regression """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from scipy.optimize import approx_fprime from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels \ import RBF, Constan...
mit
ChanderG/scikit-learn
examples/ensemble/plot_gradient_boosting_oob.py
230
4762
""" ====================================== Gradient Boosting Out-of-Bag estimates ====================================== Out-of-bag (OOB) estimates can be a useful heuristic to estimate the "optimal" number of boosting iterations. OOB estimates are almost identical to cross-validation estimates but they can be compute...
bsd-3-clause
samzhang111/scikit-learn
examples/missing_values.py
233
3056
""" ====================================================== Imputing missing values before building an estimator ====================================================== This example shows that imputing the missing values can give better results than discarding the samples containing any missing value. Imputing does not ...
bsd-3-clause
yaukwankiu/armor
patternMatching/mark3.py
1
9506
""" mark3.py switched to wepsFolder - the folder containing all forecasts made at different startTimes fixed wrfPathList problem ALGORITHM: moment-normalised correlation USE: cd [.. FILL IN YOUR ROOT DIRECTORY HERE ..]/ARMOR/python/ python from armor.patternMatching import mark3 x=mark3.main(verbose=Tr...
cc0-1.0
pandas-ml/pandas-ml
pandas_ml/skaccessors/test/test_preprocessing.py
2
18331
#!/usr/bin/env python import pytest import numpy as np import pandas as pd import sklearn.datasets as datasets import sklearn.preprocessing as pp import pandas_ml as pdml import pandas_ml.util.testing as tm class TestPreprocessing(tm.TestCase): def test_objectmapper(self): df = pdml.Mode...
bsd-3-clause
HaydenFaulkner/phd
keras_code/rnns/sentence/train.py
1
19333
import os import sys dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path = dir_path[:dir_path.find('/phd')+4] if not dir_path in sys.path: sys.path.append(dir_path) print(sys.path) from keras import backend as K import numpy as np import random import matplotlib.pyplot as plt import time import da...
mit
zymsys/sms-tools
lectures/04-STFT/plots-code/windows-2.py
24
1026
import matplotlib.pyplot as plt import numpy as np import time, os, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DF import utilFunctions as UF import math (fs, x) = UF.wavread('../../../sounds/violin-B3.wav') N = 1024 pin = 5000 w = np...
agpl-3.0
sealhuang/brainDecodingToolbox
braincode/prf/quantitative_prf.py
2
4569
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os import numpy as np import pandas as pd import seaborn as sns def load_roi_prf(roi_dir): """Load all pRF data for specific ROI. Usage: orig_data = load_roi_prf(roi_dir) """ ...
bsd-3-clause
paladin74/neural-network-animation
matplotlib/mpl.py
11
1069
""" .. note:: Deprecated in 1.3 """ from __future__ import (absolute_import, division, print_function, unicode_literals) import warnings from matplotlib import cbook cbook.warn_deprecated( '1.3', name='matplotlib.mpl', alternative='`import matplotlib as mpl`', obj_type='module') from ma...
mit
Chandlercjy/OnePy
OnePy/custom_module/analysis.py
1
15556
import json from collections import defaultdict import arrow import numpy as np import pandas as pd from OnePy.constants import ActionType, OrderType from OnePy.sys_module.metabase_env import OnePyEnvBase from OnePy.utils.memo_for_cache import memo # mpl.rcParams['font.sans-serif'] = ['SimHei'] # 指定默认字体 # mpl.rcPar...
mit
adrn/Biff
biff/scf/tests/test_computecoeff_discrete.py
1
1314
# coding: utf-8 from __future__ import division, print_function import os # Third-party import numpy as np from astropy.utils.data import get_pkg_data_filename from astropy.constants import G import gala.potential as gp from gala.units import galactic _G = G.decompose(galactic).value # Project from ..core import c...
mit
GaZ3ll3/scikit-image
doc/examples/plot_marching_cubes.py
32
2051
""" ============== Marching Cubes ============== Marching cubes is an algorithm to extract a 2D surface mesh from a 3D volume. This can be conceptualized as a 3D generalization of isolines on topographical or weather maps. It works by iterating across the volume, looking for regions which cross the level of interest. ...
bsd-3-clause
themrmax/scikit-learn
examples/applications/plot_model_complexity_influence.py
323
6372
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
rl-institut/reegis_hp
reegis_hp/de21/scenario_tools.py
3
22415
# -*- coding: utf-8 -*- import pandas as pd import os import os.path as path import logging from oemof import network from oemof.solph import EnergySystem from oemof.solph.options import BinaryFlow, Investment from oemof.solph.plumbing import sequence from oemof.solph.network import (Bus, Source, Sink, Flow, LinearTra...
gpl-3.0
MHarland/cthyb_vs_wick
g2plot.py
1
3675
import numpy as np, matplotlib, itertools as itt from pytriqs.gf.local import Block2Gf, GfImFreqTv4 class G2ConstiwPlot: def __init__(self, g2, bosonic_frequency_to_plot = 0): self.g2 = g2 self.n = dict() for s, b in g2: g2mesh = np.array([w.imag for w in g2[s].mesh.components[...
gpl-3.0
CINPLA/exana
exana/waveform/tools.py
1
6026
import numpy as np import matplotlib.pyplot as plt from scipy.cluster.vq import kmeans, vq def calculate_waveform_features(sptrs, calc_all_spikes=False): """Calculates waveform features for spiketrains; full-width half-maximum (half width) and minimum-to-maximum peak width (peak-to-peak width) for mean sp...
gpl-3.0
Akshay0724/scikit-learn
examples/neighbors/plot_kde_1d.py
60
5120
""" =================================== Simple 1D Kernel Density Estimation =================================== This example uses the :class:`sklearn.neighbors.KernelDensity` class to demonstrate the principles of Kernel Density Estimation in one dimension. The first plot shows one of the problems with using histogram...
bsd-3-clause
johanvdw/niche_vlaanderen
tests/test_niche.py
1
21967
from __future__ import division from unittest import TestCase import pytest import niche_vlaanderen from niche_vlaanderen.exception import NicheException from rasterio.errors import RasterioIOError import numpy as np import pandas as pd import tempfile import shutil import os import sys import distutils.spawn import...
mit
boland1992/seissuite_iran
build/lib/seissuite/spacing/dataless_map.py
8
4579
# -*- coding: utf-8 -*- """ Created on Wed May 20 14:12:37 2015 @author: boland """ from pysismo import pscrosscorr, pserrors, psstation import os import sys sys.path.append('/home/boland/Anaconda/lib/python2.7/site-packages') import warnings import datetime as dt import itertools as it import pickle import obspy.sign...
gpl-3.0
dereneaton/ipyrad
ipyrad/analysis/structure.py
1
40544
#!/usr/bin/env python "convenience wrappers for running structure in a jupyter notebook" # py2/3 compat from __future__ import print_function from builtins import range # standard lib import os import re import sys import glob import time import subprocess as sps # third party import numpy as np import pandas as pd...
gpl-3.0
Garrett-R/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
1
3401
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
nelson-liu/scikit-learn
sklearn/linear_model/coordinate_descent.py
4
81531
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
jorik041/scikit-learn
sklearn/metrics/ranking.py
75
25426
"""Metrics to assess performance on classification task given scores 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....
bsd-3-clause
yaroslavvb/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py
18
13185
# 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
xwolf12/scikit-learn
sklearn/neural_network/tests/test_rbm.py
142
6276
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
russel1237/scikit-learn
examples/cluster/plot_affinity_propagation.py
349
2304
""" ================================================= Demo of affinity propagation clustering algorithm ================================================= Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Points", Science Feb. 2007 """ print(__doc__) from sklearn.cluster impor...
bsd-3-clause
toastedcornflakes/scikit-learn
examples/model_selection/randomized_search.py
9
3278
""" ========================================================================= Comparing randomized search and grid search for hyperparameter estimation ========================================================================= Compare randomized search and grid search for optimizing hyperparameters of a random forest. ...
bsd-3-clause
loli/sklearn-ensembletrees
examples/neighbors/plot_digits_kde_sampling.py
251
2022
""" ========================= Kernel Density Estimation ========================= This example shows how kernel density estimation (KDE), a powerful non-parametric density estimation technique, can be used to learn a generative model for a dataset. With this generative model in place, new samples can be drawn. These...
bsd-3-clause
treverhines/RBF
docs/scripts/gproc.c.py
1
1709
''' This script describes how to use the *outliers* method to detect and remove outliers prior to conditioning a *GaussinaProcess*. ''' import numpy as np import matplotlib.pyplot as plt import logging from rbf.gproc import gpiso, gppoly logging.basicConfig(level=logging.DEBUG) np.random.seed(1) y = np.linspace(-7.5...
mit
hlin117/scikit-learn
sklearn/discriminant_analysis.py
27
26804
""" Linear Discriminant Analysis and Quadratic Discriminant Analysis """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .extern...
bsd-3-clause
glennhickey/teHmm
bin/compareBedStates.py
1
35043
#!/usr/bin/env python #Copyright (C) 2013 by Glenn Hickey # #Released under the MIT license, see LICENSE.txt import unittest import sys import os import argparse import logging import numpy as np import copy import ast import itertools from collections import defaultdict from teHmm.trackIO import readBedIntervals fro...
mit