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
ondrejch/MSBR-ORNL-4528
scripts/analyze-lattices/initlattices.py
1
7150
#!/usr/bin/python3 # # Analysis module for MSBR lattice akin to ORNL-4528 # Ondrej Chvala, ochvala@utk.edu # 2016-07-16 # GNU/GPL from array import array import matplotlib.pyplot as plt from lattice import Lattice beep_every = 100 # Print something every beep_ever lattices read debug = 1 # Ver...
gpl-2.0
kashefy/caffe_sandbox
nideep/datasets/amfed/amfed.py
3
8027
''' Created on Mar 28, 2017 @author: kashefy ''' import logging import os import random from collections import namedtuple import numpy as np import pandas as pd import nideep.iow.file_system_utils as fs from comparables import list_comparables from nideep.datasets.amfed.entity import Entity class AMFED(object): ...
bsd-2-clause
giorgiop/scikit-learn
examples/datasets/plot_iris_dataset.py
35
1929
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy...
bsd-3-clause
nesterione/scikit-learn
sklearn/neighbors/tests/test_kde.py
208
5556
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
mmottahedi/neuralnilm_prototype
scripts/experiment030.py
2
3432
from __future__ import division import matplotlib.pyplot as plt import numpy as np import theano import theano.tensor as T import lasagne from gen_data_029 import gen_data, N_BATCH, LENGTH theano.config.compute_test_value = 'raise' """ tanh output lower learning rate * does just about learn something sensible, but not...
mit
axbaretto/beam
sdks/python/apache_beam/dataframe/schemas_test.py
2
10543
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
PubuduSaneth/genome4d
juicebox2hibrowse_v2.py
1
3871
# coding: utf-8 # # Read juicebox dump output and reformat to 7 column format # ## Juicebox dump output format - Input of the program # <pre> # chr1:start chr2:start Normalized_interactions # 10000 10000 311.05484 # 10000 20000 92.60087 # 20000 20000 296.0056 # 10000 30000 47.701942 # </pre> # ## 7 column format - ...
gpl-3.0
dvro/UnbalancedDataset
imblearn/under_sampling/instance_hardness_threshold.py
2
7926
"""Class to perform under-sampling based on the instance hardness threshold.""" from __future__ import print_function from __future__ import division import numpy as np from collections import Counter from sklearn.cross_validation import StratifiedKFold from ..base import BaseBinarySampler ESTIMATOR_KIND = ('knn'...
mit
Marcdnd/electrum-cesc
plugins/plot/qt.py
1
3562
from PyQt4.QtGui import * from electrum_cesc.plugins import BasePlugin, hook from electrum_cesc.i18n import _ import datetime from electrum_cesc.util import format_satoshis from electrum_cesc.bitcoin import COIN try: import matplotlib.pyplot as plt import matplotlib.dates as md from matplotlib.patches im...
mit
milapour/palm
palm/probability_matrix.py
1
1534
import numpy from pandas import DataFrame from collections import defaultdict def make_prob_matrix_from_state_ids(index_id_collection, column_id_collection=None): pm = ProbabilityMatrix() index_id_list = index_id_collection.as_list() if column_id_collection: colu...
bsd-2-clause
astroML/astroML
examples/datasets/plot_nasa_atlas.py
2
1674
""" NASA Sloan Atlas ---------------- This shows some visualizations of the data from the NASA SDSS Atlas """ # Author: Jake VanderPlas <vanderplas@astro.washington.edu> # License: BSD # The figure is an example from astroML: see http://astroML.github.com import numpy as np from matplotlib import pyplot as plt from...
bsd-2-clause
OceanPARCELS/parcels
parcels/examples/example_nemo_curvilinear.py
1
4599
from argparse import ArgumentParser from datetime import timedelta as delta from glob import glob from os import path import numpy as np import pytest from parcels import AdvectionRK4, AdvectionAnalytical from parcels import FieldSet from parcels import JITParticle from parcels import ParticleFile from parcels import...
mit
billy-inn/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
wubr2000/zipline
zipline/finance/risk/cumulative.py
17
17736
# # Copyright 2014 Quantopian, 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 wr...
apache-2.0
miltonsarria/dsp-python
images/3_example1_notMNIST.py
1
4584
#Milton Orlando Sarria #USC #realizar una primera clasificacion import matplotlib.pyplot as plt import numpy as np import os from sklearn.linear_model import LogisticRegression from six.moves import cPickle as pickle from tools_dnn import * #################################################################### #en este ...
mit
abhitopia/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/arithmetic_transform_test.py
62
2343
# 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
quaquel/EMAworkbench
ema_workbench/em_framework/parameters.py
1
19220
"""parameters and collections of parameters""" import abc import itertools import numbers import warnings import pandas import six from .util import (NamedObject, Variable, NamedObjectMap, Counter, NamedDict, combine) from ..util import get_module_logger # Created on Jul 14, 2016 # # .. codeauthor...
bsd-3-clause
wiso/dask
docs/source/scripts/scheduling.py
18
3236
from toolz import merge from time import time import dask from dask import threaded, multiprocessing, async from random import randint from collections import Iterator import matplotlib.pyplot as plt def noop(x): pass nrepetitions = 1 def trivial(width, height): """ Embarassingly parallel dask """ d = {...
bsd-3-clause
annarev/tensorflow
tensorflow/lite/micro/kernels/vexriscv/utils/log_parser.py
15
8798
# Copyright 2020 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
mhvk/astropy
astropy/timeseries/tests/test_sampled.py
11
16315
# Licensed under a 3-clause BSD style license - see LICENSE.rst from datetime import datetime import pytest from numpy.testing import assert_equal, assert_allclose from astropy.table import Table, Column from astropy.time import Time, TimeDelta from astropy import units as u from astropy.units import Quantity from ...
bsd-3-clause
Aasmi/scikit-learn
sklearn/linear_model/tests/test_bayes.py
299
1770
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.linear_model.bayes import BayesianRidge, ARDRegres...
bsd-3-clause
rmelo19/rmelo19-arduino
python/6Sensors.py
1
1995
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import serial import time sr = serial.Serial('/dev/ttyACM0', 115200) time.sleep(1) currentLine = sr.readline() count = 0 while currentLine.find('PRESSURES: ') == -1 or count < 10: currentLine = sr.readline() if (currentLine.find('PRESSURES...
gpl-3.0
cmorgan/zipline
zipline/sources/data_frame_source.py
26
5253
# # Copyright 2015 Quantopian, 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 wr...
apache-2.0
krisht/Krishna-Thesis
Research/src/runner.py
1
1205
#!/usr/bin/env python2.7 import random import tensorflow as tf from sklearn.svm import SVC from BrainNet import BrainNet alphas = [0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4] learning_rates = [1e-1, 1e-2, 1e-3, 1e-4, 1e-5] l2_weights = [1e-1, 1e-2, 1e-3, 1e-4, 1e-5] batch_sizes = [500, 1000, 5000, 10000, 50000, 100000] for run...
mit
ch3ll0v3k/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
caisq/tensorflow
tensorflow/contrib/learn/python/learn/grid_search_test.py
137
2035
# 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
misgeatgit/opencog
opencog/python/spatiotemporal/demo.py
33
1221
__author__ = 'sebastian' from spatiotemporal.temporal_events.trapezium import TemporalEventTrapezium from spatiotemporal.temporal_events.relation_formulas import FormulaCreator from spatiotemporal.temporal_events.composition.non_linear_least_squares import DecompositionFitter import matplotlib.pyplot as plt all_rel...
agpl-3.0
yt-project/unyt
paper/benchmark_plot.py
1
6184
import numpy as np import perf from collections import OrderedDict from matplotlib import pyplot as plt from matplotlib.patches import Patch ALPHA_MAP = {"small": 0.3333, "medium": 0.666, "big": 1.0} COLOR_MAP = {"unyt": "C0", "astropy": "C1", "pint": "C2"} SIZE_LABELS = {"small": "3", "medium": "$10^3$", "big": "$10^...
bsd-3-clause
pratapvardhan/pandas
pandas/tests/dtypes/test_common.py
3
23804
# -*- coding: utf-8 -*- import pytest import numpy as np import pandas as pd from pandas.core.dtypes.dtypes import (DatetimeTZDtype, PeriodDtype, CategoricalDtype, IntervalDtype) import pandas.core.dtypes.common as com import pandas.util.testing as tm import pandas.util._test_d...
bsd-3-clause
DiCarloLab-Delft/PycQED_py3
pycqed/analysis_v2/full_tomo_tfd.py
1
13763
""" Analysis for Thermal Field Double state VQE experiment """ import os import matplotlib.pylab as pl import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap import numpy as np import pycqed.analysis_v2.base_analysis as ba from pycqed.analysis.analysis_toolbox import get_datafilepath_fro...
mit
iiSeymour/pandashells
pandashells/test/parallel_lib_tests.py
10
8652
#! /usr/bin/env python import sys from unittest import TestCase from pandashells.lib import parallel_lib from mock import patch, MagicMock import datetime import multiprocessing as mp class ParallelLibTests(TestCase): def setUp(self): pass def tearDown(self): pass @patch('pandashells.lib...
bsd-2-clause
hwroitzsch/BikersLifeSaver
lib/python3.5/site-packages/numpy/linalg/linalg.py
32
75738
"""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...
mit
mrakgr/futhark
tools/compare-compilers.py
1
3657
#!/usr/bin/env python # # Quick hack to compare performance changes when you're hacking on the # compiler. import os import sys import subprocess import matplotlib import re matplotlib.use('Agg') # For headless use import numpy as np import matplotlib.pyplot as plt red = sys.argv[1] # first compiler blue = sys.argv...
bsd-3-clause
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/scipy/interpolate/_cubic.py
37
29281
"""Interpolation algorithms using piecewise cubic polynomials.""" from __future__ import division, print_function, absolute_import import numpy as np from scipy._lib.six import string_types from . import BPoly, PPoly from .polyint import _isscalar from scipy._lib._util import _asarray_validated from scipy.linalg im...
mit
Tong-Chen/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
rhyolight/nupic.research
projects/associative_network/run_hopfield_network_experiment.py
11
15603
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
dossier/dossier.models
dossier/models/linker/model.py
1
4514
'''Create a keyword searches from an entity profile. Given a labeled collection of feature collections, train a classifier to identify the entity using such as scikit-learn Bernoulli naive Bayes: http://scikit-learn.org/stable/modules/naive_bayes.html http://scikit-learn.org/stable/modules/generated/sklearn.naive_ba...
mit
ZhangXinNan/tensorflow
tensorflow/contrib/learn/python/learn/estimators/__init__.py
39
12688
# 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
dmlc/xgboost
tests/python/test_basic_models.py
1
19253
import numpy as np import xgboost as xgb import os import json import testing as tm import pytest import locale import tempfile dpath = os.path.join(tm.PROJECT_ROOT, 'demo/data/') dtrain = xgb.DMatrix(dpath + 'agaricus.txt.train') dtest = xgb.DMatrix(dpath + 'agaricus.txt.test') rng = np.random.RandomState(1994) de...
apache-2.0
Srisai85/scikit-learn
sklearn/cluster/tests/test_bicluster.py
226
9457
"""Testing for Spectral Biclustering methods""" import numpy as np from scipy.sparse import csr_matrix, issparse from sklearn.grid_search import ParameterGrid from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from...
bsd-3-clause
Scapogo/zipline
tests/pipeline/test_column.py
5
2504
""" Tests BoundColumn attributes and methods. """ from contextlib2 import ExitStack from unittest import TestCase from pandas import date_range, DataFrame from pandas.util.testing import assert_frame_equal from zipline.lib.labelarray import LabelArray from zipline.pipeline import Pipeline from zipline.pipeline.data.t...
apache-2.0
yaukwankiu/armor
tests/modifiedMexicanHatTest8.py
1
5809
# modified mexican hat wavelet test.py # spectral analysis for RADAR and WRF patterns import os, shutil import time import pickle import numpy as np from scipy import signal, ndimage import matplotlib.pyplot as plt from armor import defaultParameters as dp from armor import pattern from armor import objects4 as ob ...
cc0-1.0
googleapis/python-automl
tests/system/gapic/v1beta1/test_system_tables_client_v1.py
1
11353
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
JT5D/scikit-learn
sklearn/tests/test_qda.py
23
2833
import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_greater from sklearn import qda # Data is just 6 separable points in the plane X = np.array([[0, 0...
bsd-3-clause
lilleswing/deepchem
contrib/mpnn/mpnn.py
5
5567
# 2017 DeepCrystal Technologies - Patrick Hop # # Message Passing Neural Network SELU [MPNN-S] for Chemical Multigraphs # # MIT License - have fun!! # =========================================================== import math import deepchem as dc from rdkit import Chem, DataStructs from rdkit.Chem import AllChem impor...
mit
avicorp/firstLook
src/mnist_loader.py
1
4390
# This file contains code samples from the book: # "Neural Networks and Deep Learning". """ mnist_loader ~~~~~~~~~~~~ A library to load the MNIST image data. For details of the data structures that are returned, see the doc strings for ``load_data`` and ``load_data_wrapper``. In practice, ``load_data_wrapper`` is ...
apache-2.0
jorik041/scikit-learn
sklearn/tests/test_kernel_ridge.py
342
3027
import numpy as np import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils.testing import ignore_warnings from sklearn.utils.testing import assert...
bsd-3-clause
mjgrav2001/scikit-learn
benchmarks/bench_plot_fastkmeans.py
294
4676
from __future__ import print_function from collections import defaultdict from time import time import numpy as np from numpy import random as nr from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans def compute_bench(samples_range, features_range): it = 0 results = defaultdict(lambda: []) chun...
bsd-3-clause
poryfly/scikit-learn
sklearn/utils/random.py
234
10510
# Author: Hamzeh Alsalhi <ha258@cornell.edu> # # License: BSD 3 clause from __future__ import division import numpy as np import scipy.sparse as sp import operator import array from sklearn.utils import check_random_state from sklearn.utils.fixes import astype from ._random import sample_without_replacement __all__ =...
bsd-3-clause
tomasreimers/tensorflow-emscripten
tensorflow/examples/learn/text_classification.py
13
4967
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
henry-ngo/VIP
vip_hci/stats/im_stats.py
1
2055
#! /usr/bin/env python """ Module for image statistics. """ from __future__ import division __author__ = 'C. Gomez @ ULg' __all__ = ['frame_histo_stats'] import numpy as np from matplotlib import pyplot as plt def frame_histo_stats(image_array, plot=True): """Plots a frame with a colorbar, its histogram and s...
mit
choderalab/openpathsampling
openpathsampling/collectivevariable.py
1
24671
import openpathsampling as paths import openpathsampling.netcdfplus.chaindict as cd from openpathsampling.integration_tools import md, error_if_no_mdtraj from openpathsampling.engines.openmm.tools import trajectory_to_mdtraj from openpathsampling.netcdfplus import WeakKeyCache, \ ObjectJSON, create_to_dict, ObjectS...
lgpl-2.1
ky822/scikit-learn
examples/ensemble/plot_forest_importances_faces.py
403
1519
""" ================================================= Pixel importances with a parallel forest of trees ================================================= This example shows the use of forests of trees to evaluate the importance of the pixels in an image classification task (faces). The hotter the pixel, the more impor...
bsd-3-clause
energyPATHWAYS/energyPATHWAYS
energyPATHWAYS/supply_technologies.py
1
21354
# -*- coding: utf-8 -*- """ Created on Wed Oct 28 16:06:06 2015 @author: Ben """ import inspect from datamapfunctions import Abstract import util import copy import numpy as np import config as cfg from shared_classes import StockItem from supply_classes import SupplySalesShare, SupplySales, SupplySpecifiedStock impo...
mit
JackKelly/neuralnilm_prototype
scripts/e256.py
2
4031
from __future__ import print_function, division import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid, rectify, tanh from lasagne.objectives import crossentrop...
mit
cainiaocome/scikit-learn
sklearn/svm/tests/test_svm.py
116
31653
""" 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
optbot/quotepuller
src/timing_mgr.py
1
1262
""" .. Copyright (c) 2015 Marshall Farrier license http://opensource.org/licenses/MIT Time to wait until next run =========================== """ import datetime as dt from pandas.tseries.offsets import BDay from pytz import timezone def secs_to_next_run(logger, runtoday): logger.info('determining wait time')...
mit
Sentient07/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
cpcloud/arrow
python/pyarrow/tests/test_types.py
1
11021
# 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
squirrelo/qiime
scripts/plot_semivariogram.py
9
15002
#!/usr/bin/env python # File created on 09 Feb 2010 from __future__ import division __author__ = "Antonio Gonzalez Pena" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Antonio Gonzalez Pena", "Kyle Patnode", "Yoshiki Vazquez-Baeza"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "A...
gpl-2.0
selinerguncu/Yelp-Spatial-Analysis
maps/foliumMaps.py
1
9568
import folium from folium import plugins import numpy as np import sqlite3 as sqlite import os import sys import pandas as pd #extract data from yelp DB and clean it: DB_PATH = "/Users/selinerguncu/Desktop/PythonProjects/Fun Projects/Yelp/data/yelpCleanDB.sqlite" conn = sqlite.connect(DB_PATH) ##################...
mit
h2educ/scikit-learn
sklearn/decomposition/base.py
313
5647
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
bsd-3-clause
mojoboss/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
inkenbrandt/WellApplication
wellapplication/usgs.py
1
24274
# -*- coding: utf-8 -*- """ Created on Sun Jan 3 00:30:36 2016 @author: p """ from __future__ import absolute_import, division, print_function, unicode_literals import pandas as pd from datetime import datetime from pylab import rcParams import matplotlib.pyplot as plt import numpy as np import requests...
mit
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/mplot3d/lines3d.py
1
1346
''' ================ Parametric Curve ================ This example demonstrates plotting a parametric curve in 3D. ''' import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt # nodebox section if __name__ == '__builtin__': # were in nodebox import ...
mit
MartinDelzant/scikit-learn
sklearn/covariance/robust_covariance.py
198
29735
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
bsd-3-clause
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/misc/patheffect_demo.py
1
2340
""" =============== Patheffect Demo =============== """ import matplotlib.pyplot as plt import matplotlib.patheffects as PathEffects import numpy as np # nodebox section if __name__ == '__builtin__': # were in nodebox import os import tempfile W = 800 inset = 20 size(W, 600) plt.cla() ...
mit
ericdill/bokeh
bokeh/charts/builder/dot_builder.py
43
6160
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Dot class which lets you build your Dot charts just passing the arguments to the Chart class and calling the proper functions. """ #-------------------------------------------------------------------...
bsd-3-clause
pastas/pasta
pastas/rfunc.py
1
11676
# coding=utf-8 """This module contains all the response functions available in Pastas. More information on how to write a response class can be found `here <http://pastas.readthedocs.io/en/latest/developers.html>_`. Routines in Module ------------------ Fully supported and tested routines in this module are: - .. c...
mit
MadMax93/acc_sensor_rr-python
Code/Visualization.py
1
9091
__author__ = 'Maximilian Kurscheidt @MadMax93' import matplotlib.dates as mdates import matplotlib.pyplot as plt import numpy as np import scipy.signal as signal import peakutils import matplotlib.gridspec as gridspec from peakutils.plot import plot as pplot from matplotlib.offsetbox import AnchoredText class Visual...
mit
alexmojaki/blaze
blaze/compute/numpy.py
7
11207
from __future__ import absolute_import, division, print_function import datetime import numpy as np from pandas import DataFrame, Series from datashape import to_numpy, to_numpy_dtype from numbers import Number from ..expr import ( Reduction, Field, Projection, Broadcast, Selection, ndim, Distinct, Sort, Tai...
bsd-3-clause
relisher/ferretextras
updateOutput.py
1
1461
from EyeFeatureFinder import * from FastRadialFeatureFinder import * from SubpixelStarburstEyeFeatureFinder import * from PipelinedFeatureFinder import * from numpy import * from scipy import * from matplotlib import * from CompositeEyeFeatureFinder import * from FastRadialFeatureFinder import * from threading import T...
mit
pearsonlab/thunder
thunder/rdds/images.py
2
29337
from numpy import ndarray, arange, amax, amin, greater, size, asarray from thunder.rdds.data import Data from thunder.rdds.keys import Dimensions class Images(Data): """ Distributed collection of images or volumes. Backed by an RDD of key-value pairs, where the key is an identifier and the value is ...
apache-2.0
HolgerPeters/scikit-learn
examples/svm/plot_custom_kernel.py
43
1546
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
phbradley/tcr-dist
plot_nbrdist_distributions.py
1
21549
from basic import * import html_colors import tcr_distances import util with Parser(locals()) as p: #p.str('args').unspecified_default().multiple().required() p.str('clones_file').required() ## p.int('nbrdist_percentile').default(10) #p.float('float_arg') # --float_arg 9.6 p.flag('show') ...
mit
ChanderG/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
226
1384
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
untom/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
12
10796
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
bsd-3-clause
wasade/qiita
qiita_db/test/test_analysis.py
1
22656
from unittest import TestCase, main from os import remove from os.path import exists, join from datetime import datetime from shutil import move from biom import load_table import pandas as pd from qiita_core.util import qiita_test_checker from qiita_db.analysis import Analysis, Collection from qiita_db.job import Jo...
bsd-3-clause
andim/scipy
doc/source/tutorial/stats/plots/kde_plot4.py
142
1457
from functools import partial import numpy as np from scipy import stats import matplotlib.pyplot as plt def my_kde_bandwidth(obj, fac=1./5): """We use Scott's Rule, multiplied by a constant factor.""" return np.power(obj.n, -1./(obj.d+4)) * fac loc1, scale1, size1 = (-2, 1, 175) loc2, scale2, size2 = (2, ...
bsd-3-clause
justacec/bokeh
examples/charts/file/donut_multi.py
6
1394
from bokeh.charts import Donut, show, output_file, vplot from bokeh.sampledata.autompg import autompg import pandas as pd # simple examples with inferred meaning # implied index d1 = Donut([2, 4, 5, 2, 8]) # explicit index d2 = Donut(pd.Series([2, 4, 5, 2, 8], index=['a', 'b', 'c', 'd', 'e'])) # given a categorica...
bsd-3-clause
vsoch/repofish
repofish/github.py
1
13634
''' Functions for parsing Github repositories Copyright (c) 2016-2018 Vanessa Sochat 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 the rights ...
mit
wasit7/recognition
pub/ss.py
2
10760
""" GNU GENERAL PUBLIC LICENSE Version 2 Created on Tue Oct 14 18:52:01 2014 @author: Wasit """ import numpy as np import os from PIL import Image from scipy.ndimage import filters try: import json except ImportError: import simplejson as json #1800 num_img=100 spi=5 rootdir="dataset" mrec=64 mtran=64 margin...
gpl-2.0
fedspendingtransparency/data-act-broker-backend
tests/unit/dataactbroker/test_validation_helper.py
1
24369
import pandas as pd from pandas.util.testing import assert_frame_equal import numpy as np import os from dataactbroker.helpers import validation_helper from dataactvalidator.app import ValidationManager, ValidationError from dataactvalidator.filestreaming.csvReader import CsvReader from dataactcore.models.validationMo...
cc0-1.0
wazeerzulfikar/scikit-learn
benchmarks/bench_text_vectorizers.py
36
2112
""" To run this benchmark, you will need, * scikit-learn * pandas * memory_profiler * psutil (optional, but recommended) """ from __future__ import print_function import timeit import itertools import numpy as np import pandas as pd from memory_profiler import memory_usage from sklearn.datasets import fetch_...
bsd-3-clause
liyu1990/sklearn
doc/datasets/mldata_fixture.py
367
1183
"""Fixture module to skip the datasets loading when offline Mock urllib2 access to mldata.org and create a temporary data folder. """ from os import makedirs from os.path import join import numpy as np import tempfile import shutil from sklearn import datasets from sklearn.utils.testing import install_mldata_mock fr...
bsd-3-clause
nickos556/pandas-qt
pandasqt/views/CustomDelegates.py
4
12642
# -*- coding: utf-8 -*- from pandasqt.compat import Qt, QtCore, QtGui, Signal, Slot import numpy from pandasqt.views.BigIntSpinbox import BigIntSpinbox from pandasqt.models.DataFrameModel import DataFrameModel from pandasqt.models.SupportedDtypes import SupportedDtypes def createDelegate(dtype, column, view): t...
mit
microhh/microhh
cases/conservation/conservation_test.py
5
7180
import sys import shutil import numpy as np import netCDF4 as nc from matplotlib import pyplot as plt from matplotlib.backends.backend_pdf import PdfPages sys.path.append('../../python/') import microhh_tools as mht no_opts = {} opt_mpi = { 'master': {'npx': 2, 'npy': 2}} dict_rk = { 'rk3': {'time': {'r...
gpl-3.0
fredhusser/scikit-learn
examples/mixture/plot_gmm.py
248
2817
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet process. Both models have access to five components with which to fit the data. Note that the EM model will necessari...
bsd-3-clause
YinongLong/scikit-learn
examples/svm/plot_custom_kernel.py
43
1546
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
Achuth17/scikit-learn
benchmarks/bench_plot_nmf.py
206
5890
""" Benchmarks of Non-Negative Matrix Factorization """ from __future__ import print_function from collections import defaultdict import gc from time import time import numpy as np from scipy.linalg import norm from sklearn.decomposition.nmf import NMF, _initialize_nmf from sklearn.datasets.samples_generator import...
bsd-3-clause
n-west/gnuradio-volk
gr-utils/python/utils/plot_data.py
59
5818
# # Copyright 2007,2008,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later ve...
gpl-3.0
rstoneback/pysat
pysat/instruments/supermag_magnetometer.py
2
32219
# -*- coding: utf-8 -*- """Supports SuperMAG ground magnetometer measurements and SML/SMU indices. Downloading is supported; please follow their rules of the road: http://supermag.jhuapl.edu/info/?page=rulesoftheroad Parameters ---------- platform : string 'supermag' name : string 'magnetometer' tag : stri...
bsd-3-clause
loli/sklearn-ensembletrees
examples/plot_multilabel.py
9
4299
# Authors: Vlad Niculae, Mathieu Blondel # License: BSD 3 clause """ ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ...
bsd-3-clause
potash/scikit-learn
examples/linear_model/plot_multi_task_lasso_support.py
102
2319
#!/usr/bin/env python """ ============================================= Joint feature selection with multi-task Lasso ============================================= The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected features to be the same across tasks. This example simulates...
bsd-3-clause
ningchi/scikit-learn
examples/feature_stacker.py
246
1906
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is beneficial to combine several methods to obtain good performance. Th...
bsd-3-clause
idlead/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause
rajat1994/scikit-learn
examples/svm/plot_custom_kernel.py
171
1546
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
nrhine1/scikit-learn
examples/ensemble/plot_adaboost_multiclass.py
354
4124
""" ===================================== Multi-class AdaBoosted Decision Trees ===================================== This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction accuracy on a multi-class problem. The classification dataset is constructed by taking a ten-dimensional ...
bsd-3-clause
lucidfrontier45/scikit-learn
sklearn/feature_selection/tests/test_rfe.py
5
3077
""" Testing Recursive feature elimination """ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_equal from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris from sklearn.metrics import ...
bsd-3-clause
anaderi/lhcb_trigger_ml
hep_ml/experiments/fasttree.py
1
20043
""" This is fast version of DecisionTreeRegressor for only one target function. (This is the most simple case, but even multi-class boosting doesn't need more complicated things) I need numpy implementation mostly for further experiments, rather than for real speedup. This tree shouldn't be used by itself, only in boo...
mit