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
iagapov/ocelot
gui/genesis_plot.py
1
116811
''' user interface for viewing genesis simulation results ''' import sys import os import csv import time import matplotlib # check if Xserver is connected # havedisplay = "DISPLAY" in os.environ # if not havedisplay: # # re-check # exitval = os.system('python -c "import matplotlib.pyplot as plt; plt.figure()"') # ha...
gpl-3.0
MehnaazAsad/ECO_Globular_Clusters
src/visualization/eco_sample.py
1
8054
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 17 04:27:25 2017 @author: asadm2 """ ###DESCRIPTION #This script plots current sample of objects out of the entire ECO catalog, #separates this plot into single_halos (group mass of less than 10**14 solar #masses) and coma_halos (group mass of more...
mit
giorgiop/scikit-learn
sklearn/utils/tests/test_seq_dataset.py
79
2497
# Author: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # License: BSD 3 clause import numpy as np from numpy.testing import assert_array_equal import scipy.sparse as sp from sklearn.utils.seq_dataset import ArrayDataset, CSRDataset from sklearn.datasets import load_iris from sklearn.utils.testing import assert_eq...
bsd-3-clause
kinverarity1/pyexperiment
pyexperiment/utils/plot.py
3
5557
"""Provides setup utilities for matplotlib figures. The `setup_plotting` function will configure basic plot options, such as font size, line width, etc. Calls after the first call are ignored unless the override flag is set to True. The `setup_figure` function will call `setup_plotting` without overriding an existing ...
mit
JDTimlin/QSO_Clustering
highz_clustering/clustering/Limbers/Limber_MCint_lowz.py
2
9490
import os import sys import numpy as np from astropy.io import fits as pf from sklearn.neighbors import KernelDensity as kde from scipy import integrate import camb from camb import model from scipy.special import j0 from scipy import interpolate import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D a...
mit
jmmease/pandas
pandas/io/json/normalize.py
3
9206
# --------------------------------------------------------------------- # JSON normalization routines import copy from collections import defaultdict import numpy as np from pandas._libs.lib import convert_json_to_lines from pandas import compat, DataFrame def _convert_to_line_delimits(s): """Helper function th...
bsd-3-clause
scikit-learn-contrib/py-earth
examples/plot_classifier_comp.py
3
4753
""" ====================================================== Plotting sckit-learn classifiers comparison with Earth ====================================================== This script recreates the scikit-learn classifier comparison example found at http://scikit-learn.org/stable/auto_examples/classification/plot_classif...
bsd-3-clause
architecture-building-systems/CEAforArcGIS
setup.py
2
2557
"""Installation script for the City Energy Analyst""" import os from setuptools import setup, find_packages import cea __author__ = "Daren Thomas" __copyright__ = "Copyright 2017, Architecture and Building Systems - ETH Zurich" __credits__ = ["Daren Thomas"] __license__ = "MIT" __version__ = cea.__version__ __mainta...
mit
ehogan/iris
lib/iris/tests/integration/test_regridding.py
10
3425
# (C) British Crown Copyright 2013 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
ky822/scikit-learn
sklearn/utils/tests/test_validation.py
79
18547
"""Tests for input validation functions""" import warnings from tempfile import NamedTemporaryFile from itertools import product import numpy as np from numpy.testing import assert_array_equal import scipy.sparse as sp from nose.tools import assert_raises, assert_true, assert_false, assert_equal from sklearn.utils....
bsd-3-clause
andreabduque/GAFE
ga.py
1
3069
# import pandas as pd import numpy as np import random from deap import base, creator, tools, algorithms from functions.FE import FE from sklearn.preprocessing import MinMaxScaler #Define GA creator.create("FitnessMax", base.Fitness, weights=(1.0,)) creator.create("Individual", list, fitness=creator.FitnessMax) class...
mit
elkingtonmcb/scikit-learn
examples/text/document_clustering.py
230
8356
""" ======================================= Clustering text documents using k-means ======================================= This is an example showing how the scikit-learn can be used to cluster documents by topics using a bag-of-words approach. This example uses a scipy.sparse matrix to store the features instead of ...
bsd-3-clause
madjelan/scikit-learn
benchmarks/bench_sample_without_replacement.py
397
8008
""" Benchmarks for sampling without replacement of integer. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import operator import matplotlib.pyplot as plt import numpy as np import random from sklearn.externals.six.moves i...
bsd-3-clause
JosmanPS/scikit-learn
sklearn/ensemble/partial_dependence.py
251
15097
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
bsd-3-clause
cbmoore/statsmodels
statsmodels/genmod/tests/test_gee.py
19
55589
""" Test functions for GEE External comparisons are to R and Stata. The statmodels GEE implementation should generally agree with the R GEE implementation for the independence and exchangeable correlation structures. For other correlation structures, the details of the correlation estimation differ among implementat...
bsd-3-clause
apache/arrow
python/pyarrow/tests/test_array.py
3
93104
# 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
lilleswing/deepchem
deepchem/utils/data_utils.py
1
16253
""" Simple utils to save and load from disk. """ import joblib import gzip import pickle import os import tempfile import tarfile import zipfile import logging from urllib.request import urlretrieve from typing import Any, Iterator, List, Optional, Tuple, Union, cast, IO import pandas as pd import numpy as np import ...
mit
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/mpl_examples/pylab_examples/multiple_yaxis_with_spines.py
6
1602
import matplotlib.pyplot as plt def make_patch_spines_invisible(ax): ax.set_frame_on(True) ax.patch.set_visible(False) for sp in ax.spines.itervalues(): sp.set_visible(False) fig = plt.figure() fig.subplots_adjust(right=0.75) host = fig.add_subplot(111) par1 = host.twinx() par2 = host.twinx() # ...
mit
Eniac-Xie/faster-rcnn-resnet
lib/pycocotools/coco.py
16
14881
__author__ = 'tylin' __version__ = '1.0.1' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Ple...
mit
essigmannlab/8oxoG-mutagenicity
analysis/visualize_CtA.py
1
4161
#!/usr/env/py27 # Visualize C>A portions of mutational spectra in Stratton format # Runs in py36 too from figures import spectrum_map from collections import OrderedDict import cospec as sa import matplotlib.pyplot as plt import scipy.stats as sc import scipy.cluster.hierarchy as hac from sklearn.metrics.pairwise impo...
mit
williamalu/mimo_usrp
scripts/channel_estimator.py
1
3889
import numpy as np import numpy as np import matplotlib.pyplot as plt import decoder as D import pll as PLL j = (0 + 1j) if __name__ == "__main__": # Load data files noise1 = np.fromfile('../data/noise_1.bin', dtype=np.complex64) noise2 = np.fromfile('../data/noise_2.bin', dtype=np.complex64) plt.pl...
mit
totalgood/nlpia
src/nlpia/book/examples/ch02.py
1
1549
""" NLPIA Chapter 2 Section 2.1 Code Listings and Snippets """ import pandas as pd sentence = "Thomas Jefferson began building Monticello at the age of twenty-six." sentence.split() # ['Thomas', 'Jefferson', 'began', 'building', 'Monticello', 'at', 'the', 'age', 'of', 'twenty-six.'] # As you can see, this simple Pyt...
mit
hainm/scikit-learn
sklearn/manifold/tests/test_isomap.py
226
3941
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
bsd-3-clause
ericfourrier/auto-clean
test.py
1
14139
# -*- coding: utf-8 -*- """ @author: efourrier Purpose : Automated test suites with unittest run "python -m unittest -v test" in the module directory to run the tests The clock decorator in utils will measure the run time of the test """ ######################################################### # Import Packages an...
mit
unnikrishnankgs/va
venv/lib/python3.5/site-packages/matplotlib/tests/test_ticker.py
2
19200
from __future__ import (absolute_import, division, print_function, unicode_literals) import nose.tools from nose.tools import assert_equal, assert_raises from numpy.testing import assert_almost_equal import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker a...
bsd-2-clause
glouppe/scikit-learn
examples/applications/svm_gui.py
287
11161
""" ========== Libsvm GUI ========== A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create data points by point and click and visualize the decision region induced by different kernels and parameter settings. To create positive examples click the left mouse button; to create neg...
bsd-3-clause
datapythonista/pandas
asv_bench/benchmarks/io/excel.py
4
2151
from io import BytesIO import numpy as np from odf.opendocument import OpenDocumentSpreadsheet from odf.table import ( Table, TableCell, TableRow, ) from odf.text import P from pandas import ( DataFrame, ExcelWriter, date_range, read_excel, ) from ..pandas_vb_common import tm def _gener...
bsd-3-clause
schets/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
tttor/csipb-jamu-prj
predictor/connectivity/classifier/selfblm/devel.py
1
5474
#!/usr/bin/python import numpy as np import json import time import sys import matplotlib.pyplot as plt from sklearn import svm from sklearn.model_selection import KFold from sklearn.model_selection import StratifiedKFold from sklearn.metrics import precision_recall_curve from sklearn.metrics import average_precisi...
mit
dancingdan/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/io_test.py
137
5063
# 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
lbishal/scikit-learn
sklearn/manifold/locally_linear.py
23
25123
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
dudulianangang/MAE6286-notes
m1t5.py
1
1084
import numpy as np import matplotlib.pyplot as plt # initial parameters ms = 50.0 mpv = 20.0 g = 9.81 ve = 325.0 rho = 1.091 r = 0.5 A = np.pi*r**2 C_D = 0.15 mp0 = 100.0 h0 = 0.0 v0 = 0.0 # time grid T = 40.0 dt = 0.01 N = int(T/dt)+1 # numerical scheme function def f(u): mp = u[0] h = u[1] v = ...
bsd-3-clause
raghavrv/scikit-learn
examples/cluster/plot_digits_agglomeration.py
377
1694
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Feature agglomeration ========================================================= These images how similar features are merged together using feature agglomeration. """ print(__doc__) # Code source: Gaël Varoquaux #...
bsd-3-clause
altairpearl/scikit-learn
examples/gaussian_process/plot_gpr_co2.py
131
5705
""" ======================================================== Gaussian process regression (GPR) on Mauna Loa CO2 data. ======================================================== This example is based on Section 5.4.3 of "Gaussian Processes for Machine Learning" [RW2006]. It illustrates an example of complex kernel engine...
bsd-3-clause
MingdaZhou/gnuradio
gr-filter/examples/reconstruction.py
49
5015
#!/usr/bin/env python # # Copyright 2010,2012,2013 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 ...
gpl-3.0
takuya1981/sms-tools
lectures/06-Harmonic-model/plots-code/sines-partials-harmonics-phase.py
22
1986
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF (fs, x) = UF.wavread('../...
agpl-3.0
jseabold/scikit-learn
examples/ensemble/plot_gradient_boosting_quantile.py
392
2114
""" ===================================================== Prediction Intervals for Gradient Boosting Regression ===================================================== This example shows how quantile regression can be used to create prediction intervals. """ import numpy as np import matplotlib.pyplot as plt from skle...
bsd-3-clause
lijinpei/vasper
ViewPos3D.py
1
4846
#!/usr/bin/python3 import sys import re import numpy as np import matplotlib from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.cm as cm n = [3, 3, 1] # number of grids to display print(sys.argv[1]) f = open(sys....
gpl-3.0
larsmans/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
rachel3834/lcogt-commissioning
scripts/statistics.py
1
10190
######################################################################################################## # STATISTICS FUNCTIONS ######################################################################################################## ############################ # IMPORT FUNCTIONS from ...
gpl-3.0
natanielruiz/android-yolo
jni-build/jni/include/tensorflow/examples/skflow/multiple_gpu.py
5
1649
# 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
MaxInGaussian/ZS-VAFNN
uci-expts/classification/spambase/training.py
1
4012
# Copyright 2017 Max W. Y. Lam # # 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, so...
apache-2.0
vighneshbirodkar/scikit-image
doc/examples/features_detection/plot_orb.py
33
1807
""" ========================================== ORB feature detector and binary descriptor ========================================== This example demonstrates the ORB feature detection and binary description algorithm. It uses an oriented FAST detection method and the rotated BRIEF descriptors. Unlike BRIEF, ORB is c...
bsd-3-clause
harterj/moose
modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/scaling.py
9
1503
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
pypot/scikit-learn
sklearn/preprocessing/tests/test_data.py
113
38432
import warnings import numpy as np import numpy.linalg as la from scipy import sparse from distutils.version import LooseVersion from sklearn.utils.testing import assert_almost_equal, clean_warning_registry from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal...
bsd-3-clause
cython-testbed/pandas
pandas/io/formats/html.py
3
19924
# -*- coding: utf-8 -*- """ Module for formatting output data in HTML. """ from __future__ import print_function from distutils.version import LooseVersion from textwrap import dedent from pandas import compat from pandas.compat import (lzip, range, map, zip, u, OrderedDict, unichr) impor...
bsd-3-clause
aabadie/scikit-learn
examples/applications/plot_species_distribution_modeling.py
55
7386
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
SunDwarf/Jokusoramame
jokusoramame/plugins/core.py
1
10883
""" Core plugin. """ import sys import time from itertools import cycle import asks import asyncqlio import contextlib import curio import curious import git import matplotlib.pyplot as plt import numpy as np import pkg_resources import platform import psutil import tabulate import traceback from asks.response_objects...
gpl-3.0
aetilley/scikit-learn
sklearn/linear_model/ridge.py
89
39360
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
louispotok/pandas
pandas/tests/test_common.py
1
7863
# -*- coding: utf-8 -*- import pytest import os import collections from functools import partial import numpy as np from pandas import Series, DataFrame, Timestamp from pandas.compat import range, lmap import pandas.core.common as com from pandas.core import ops from pandas.io.common import _get_handle import pandas...
bsd-3-clause
gergopokol/renate-od
utility/getdata.py
1
13246
import os import urllib.request import pandas import h5py from lxml import etree from utility import convert DEFAULT_SETUP = 'getdata_setup.xml' class GetData: """ This class is to access and load data from files. It looks for data in the following order: 1. Common local data path 2. User's local da...
lgpl-3.0
simpeg/simpeg
tests/pf/test_sensitivity_PFproblem.py
1
11447
# from __future__ import print_function # import unittest # from SimPEG import * # from simpegPF import BaseMag # import matplotlib.pyplot as plt # import simpegPF as PF # from scipy.constants import mu_0 # class MagSensProblemTests(unittest.TestCase): # def setUp(self): # cs = 25. # hxind = [(cs...
mit
rupakc/Kaggle-Compendium
Integer Sequence Learning/integer_sequence_baseline.py
1
1112
import pandas as pd from keras.models import Sequential from keras.layers import Dense,LSTM,GRU,Dropout from keras.preprocessing.sequence import pad_sequences import numpy as np filename = 'train.csv' train_frame = pd.read_csv(filename) master_sequence_list = list([]) max_float = 1000000.0 for sequence in list(train_...
mit
MehnaazAsad/ECO_Globular_Clusters
src/data/main/BUNIT_check.py
1
1704
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 3 16:46:35 2017 @author: asadm2 """ import pandas as pd import os from astropy.io import fits from glob import glob import warnings from astropy.utils.exceptions import AstropyUserWarning goodObj = '../../../data/interim/goodObj.txt' #Read goodOb...
mit
aashish24/seaborn
seaborn/tests/test_axisgrid.py
1
35616
import numpy as np import pandas as pd from scipy import stats import matplotlib as mpl import matplotlib.pyplot as plt from distutils.version import LooseVersion import nose.tools as nt import numpy.testing as npt from numpy.testing.decorators import skipif import pandas.util.testing as tm from .. import axisgrid as...
bsd-3-clause
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/mne-python-0.10/mne/viz/tests/test_misc.py
17
4858
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Cathy Nangini <cnangini@gmail.com> # Mainak Jas <mainak@neuro.hut.fi> #...
bsd-3-clause
RayMick/scikit-learn
examples/model_selection/plot_precision_recall.py
249
6150
""" ================ Precision-Recall ================ Example of Precision-Recall metric to evaluate classifier output quality. In information retrieval, precision is a measure of result relevancy, while recall is a measure of how many truly relevant results are returned. A high area under the curve represents both ...
bsd-3-clause
cheind/tf-matplotlib
tfmpl/figure.py
1
5533
# Copyright 2018 Christoph Heindl. # # Licensed under MIT License # ============================================================ import tensorflow as tf import traceback import numpy as np from functools import wraps from tfmpl.meta import vararg_decorator, as_list from tfmpl.meta import PositionalTensorArgs def fig...
mit
linebp/pandas
pandas/io/formats/excel.py
3
23353
"""Utilities for conversion to writer-agnostic Excel representation """ import re import warnings import itertools import numpy as np from pandas.compat import reduce from pandas.io.formats.css import CSSResolver, CSSWarning from pandas.io.formats.printing import pprint_thing from pandas.core.dtypes.common import is...
bsd-3-clause
Djabbz/scikit-learn
sklearn/svm/setup.py
321
3157
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('svm', parent_package, top_path) config.add_subpackage('tests') # Section L...
bsd-3-clause
waynenilsen/statsmodels
statsmodels/sandbox/tsa/examples/example_var.py
37
1218
""" Look at some macro plots, then do some VARs and IRFs. """ import numpy as np import statsmodels.api as sm import scikits.timeseries as ts import scikits.timeseries.lib.plotlib as tplt from matplotlib import pyplot as plt data = sm.datasets.macrodata.load() data = data.data ### Create Timeseries Representations ...
bsd-3-clause
appapantula/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
jseabold/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
228
11221
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
kylerbrown/scikit-learn
examples/cluster/plot_kmeans_silhouette_analysis.py
242
5885
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
bsd-3-clause
stczhc/neupy
tests/ensemble/test_dan.py
1
2429
import numpy as np from sklearn import datasets, preprocessing, cross_validation, metrics from neupy import algorithms, layers from neupy.layers import Relu, Sigmoid, Output from base import BaseTestCase class DANTestCase(BaseTestCase): def test_handle_errors(self): data, target = datasets.make_classifi...
mit
hasadna/OpenTrain
webserver/opentrain/algorithm/shape_detector.py
1
1286
from scipy import spatial import os import config import numpy as np import stops import shapes from utils import * from common.ot_utils import * from collections import deque from common import ot_utils try: import matplotlib.pyplot as plt except ImportError: pass import datetime import bssid_tracker from red...
bsd-3-clause
calliope-project/calliope
calliope/test/test_backend_pyomo_constraints_conversion_plus.py
1
10791
import pytest # noqa: F401 from calliope.test.common.util import build_test_model as build_model from calliope.test.common.util import check_variable_exists class TestBuildConversionPlusConstraints: # conversion_plus.py def test_no_balance_conversion_plus_primary_constraint(self): """ sets.l...
apache-2.0
GraphProcessor/CommunityDetectionCodes
Prensentation/algorithms/clique_percolation/problem_vis.py
1
1337
import networkx as nx import matplotlib.pyplot as plt from networkx.drawing.nx_agraph import graphviz_layout def vis_input(graph): # pos = graphviz_layout(graph) pos = nx.circular_layout(graph) nx.draw(graph, with_labels=True, pos=pos, font_size=20, node_size=2000, alpha=0.8, width=4, edge_col...
gpl-2.0
caidongyun/pylearn2
pylearn2/packaged_dependencies/theano_linear/unshared_conv/test_localdot.py
44
5013
from __future__ import print_function import nose import unittest import numpy as np from theano.compat.six.moves import xrange import theano from .localdot import LocalDot from ..test_matrixmul import SymbolicSelfTestMixin class TestLocalDot32x32(unittest.TestCase, SymbolicSelfTestMixin): channels = 3 bs...
bsd-3-clause
cainiaocome/scikit-learn
examples/ensemble/plot_forest_iris.py
335
6271
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
bsd-3-clause
leesavide/pythonista-docs
Documentation/matplotlib/mpl_examples/mplot3d/mixed_subplots_demo.py
12
1032
""" Demonstrate the mixing of 2d and 3d subplots """ from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np def f(t): s1 = np.cos(2*np.pi*t) e1 = np.exp(-t) return np.multiply(s1,e1) ################ # First subplot ################ t1 = np.arange(0.0, 5.0, 0.1) t2 = n...
apache-2.0
mblondel/scikit-learn
sklearn/decomposition/tests/test_kernel_pca.py
40
8143
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import (assert_array_almost_equal, assert_less, assert_equal, assert_not_equal, assert_raises) from sklearn.decomposition import PCA, KernelPCA from sklearn.datasets import mak...
bsd-3-clause
deonblaauw/paparazzi
sw/tools/calibration/calibrate_gyro.py
87
4686
#! /usr/bin/env python # Copyright (C) 2010 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later ...
gpl-2.0
hlin117/scikit-learn
sklearn/mixture/gmm.py
6
32594
""" Gaussian Mixture Models. This implementation corresponds to frequentist (non-Bayesian) formulation of Gaussian Mixture Models. """ # Author: Ron Weiss <ronweiss@gmail.com> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Bertrand Thirion <bertrand.thirion@inria.fr> # Important note for the deprec...
bsd-3-clause
harisbal/pandas
pandas/util/_doctools.py
4
7099
import numpy as np import pandas.compat as compat import pandas as pd class TablePlotter(object): """ Layout some DataFrames in vertical/horizontal layout for explanation. Used in merging.rst """ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): self.cell_width = cel...
bsd-3-clause
NicovincX2/Python-3.5
Physique/Mesure physique/Traitement du signal/Traitement numérique du signal/filtrage_rampe_bruitee.py
1
1290
# -*- coding: utf-8 -*- import os from math import exp, sin, atan, sqrt import numpy as np import matplotlib.pyplot as plt def X(t0, T, h): return np.arange(t0, t0 + T, h) def Y(t0, T, h, y0, Phi): t = X(t0, T, h) y = np.zeros(len(t)) y[0] = y0 for k in range(len(t) - 1): y[k + 1] = y[k...
gpl-3.0
ThomasMiconi/htmresearch
projects/sequence_classification/run_sequence_classifcation_experiment.py
11
21901
# ---------------------------------------------------------------------- # 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...
agpl-3.0
clarkfitzg/xray
xray/test/test_utils.py
2
4438
import numpy as np import pandas as pd from xray.core import ops, utils from xray.core.pycompat import OrderedDict from . import TestCase class TestSafeCastToIndex(TestCase): def test(self): dates = pd.date_range('2000-01-01', periods=10) x = np.arange(5) td = x * np.timedelta64(1, 'D') ...
apache-2.0
FFroehlich/AMICI
python/amici/pandas.py
1
20862
""" Pandas Wrappers --------------- This modules contains convenience wrappers that allow for easy interconversion between C++ objects from :mod:`amici.amici` and pandas DataFrames """ import pandas as pd import numpy as np import math import copy from typing import List, Union, Optional, Dict, SupportsFloat from .nu...
bsd-2-clause
EPFL-LQM/gpvmc
tools/vmc_legacy_utils/vmc_utils.py
2
2702
from scipy.linalg import eigh from numpy.linalg import matrix_rank from numpy import dot,conj,amax,argmin,zeros,eye,append,shape,diag,ones from matplotlib.mlab import find import copy import warnings import code def argsort(seq): return sorted(range(len(seq)),key=seq.__getitem__) def bunch(instat,Nsamp,indices=Fa...
mit
SoftwareDefinedBuildings/smap
python/doc/en/2.0/resources/plot_oat_tags.py
6
1303
"""Example code plotting one day's worth of outside air time-series, locating the streams using a metadata query. @author Stephen Dawson-Haggerty <stevedh@eecs.berkeley.edu> """ from smap.archiver.client import SmapClient from smap.contrib import dtutil from matplotlib import pyplot from matplotlib import dates # m...
bsd-2-clause
ProkopHapala/SimpleSimulationEngine
python/pySimE/space/exp/pykep/lambert_Fit_2.py
1
1847
from pylab import * import matplotlib.ticker as ticker from PyKEP import lambert_problem ax = subplot(111) ax.xaxis.set_major_locator( ticker.MaxNLocator(nbins=10) ) ax.xaxis.set_minor_locator( ticker.AutoMinorLocator(n=10) ) ax.yaxis.set_major_locator( ticker.MaxNLocator(nbins=10) ) ax.yaxis.set_minor_l...
mit
wheeler-microfluidics/teensy-minimal-rpc
rename.py
1
2609
from __future__ import absolute_import import sys import pandas as pd from path_helpers import path def main(root, old_name, new_name): names = pd.Series([old_name, new_name], index=['old', 'new']) underscore_names = names.map(lambda v: v.replace('-', '_')) camel_names = names.str.split('-').map(lambda x...
gpl-3.0
jordancheah/aas
ch11-neuro/fish.py
16
3438
# coding=utf-8 # Copyright 2015 Sanford Ryza, Uri Laserson, Sean Owen and Joshua Wills # # See LICENSE file for further information. # this code assumes you are working from an interactive Thunder (PySpark) shell import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap plt.ion() ################...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/io/tests/generate_legacy_storage_files.py
7
9673
""" self-contained to write legacy storage (pickle/msgpack) files """ from __future__ import print_function from distutils.version import LooseVersion from pandas import (Series, DataFrame, Panel, SparseSeries, SparseDataFrame, Index, MultiIndex, bdate_range, to_msgpack, ...
gpl-3.0
shangwuhencc/scikit-learn
examples/applications/plot_species_distribution_modeling.py
254
7434
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
hellokathy/coursera-compinvesting1-hw
HW3/marketsim.py
2
2840
## Computational Investing I ## HW 3 - marketsum.py ## ## Author: alexcpsec import pandas as pd import pandas.io.parsers as pd_par import numpy as np import math import copy import QSTK.qstkutil.qsdateutil as du import datetime as dt import QSTK.qstkutil.DataAccess as da import QSTK.qstkutil.tsutil as tsu startCash =...
mit
zooniverse/aggregation
blog/old_weather/faces.py
1
4117
print(__doc__) import matplotlib matplotlib.use('WXAgg') # Authors: Vlad Niculae, Alexandre Gramfort # License: BSD 3 clause import logging from time import time from numpy.random import RandomState import matplotlib.pyplot as plt from sklearn.datasets import fetch_olivetti_faces from sklearn.cluster import MiniBatc...
apache-2.0
wangyum/spark
python/pyspark/sql/session.py
4
31160
# # 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
phildias/dropbox_folder_size_calculator
folder_size_calculator.py
1
3464
import dropbox import pandas as pd # Dropbox access token. Change the string below to your own token. access_token = 'INSERT_YOUR_TOKEN_HERE' # Instance of Dropbox class that grants access to the user's Dropbox files. dbx = dropbox.Dropbox(access_token) # Global list of all folders. all_folders = [] # Global list o...
gpl-3.0
Lawrence-Liu/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
rohanp/scikit-learn
sklearn/neighbors/graph.py
26
6189
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam import warnings from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def _check_params(X, metric, p, metric_...
bsd-3-clause
fengzhyuan/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
jpautom/scikit-learn
sklearn/metrics/cluster/supervised.py
22
30444
"""Utilities to evaluate the clustering performance of models Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # License: BSD 3 clause fr...
bsd-3-clause
dstruck/comet-paper-scripts
synth_variation_pol_rega_scueal/analyze_noise.py
1
8168
# -*- coding: utf-8 -*- """ Created on Tue Jul 23 14:55:49 2013 @author: daniel """ from __future__ import division from collections import Counter, defaultdict scueal_translation = { 'CRF02':'02_AG','CRF03':'03_AB','CRF04':'04_cpx','CRF05':'05_DF','CRF06':'06_cpx' ,'CRF07':'07_BC','CRF08':'08_BC','CRF09':'09_cpx','C...
gpl-2.0
jongyoul/incubator-zeppelin
python/src/main/resources/python/mpl_config.py
41
3653
# 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 use ...
apache-2.0
jlegendary/scikit-learn
examples/model_selection/plot_validation_curve.py
229
1823
""" ========================== Plotting Validation Curves ========================== In this plot you can see the training scores and validation scores of an SVM for different values of the kernel parameter gamma. For very low values of gamma, you can see that both the training score and the validation score are low. ...
bsd-3-clause
bloyl/mne-python
tutorials/raw/40_visualize_raw.py
5
8454
# -*- coding: utf-8 -*- """ .. _tut-visualize-raw: Built-in plotting methods for Raw objects ========================================= This tutorial shows how to plot continuous data as a time series, how to plot the spectral density of continuous data, and how to plot the sensor locations and projectors stored in `~...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/core/panelnd.py
14
4605
""" Factory methods to create N-D panels """ import warnings from pandas.compat import zip import pandas.compat as compat def create_nd_panel_factory(klass_name, orders, slices, slicer, aliases=None, stat_axis=2, info_axis=0, ns=None): """ manufacture a n-d class: DEPRECATED. Pan...
gpl-3.0
vizual54/MissionPlanner
Lib/site-packages/scipy/signal/fir_filter_design.py
53
18572
"""Functions for FIR filter design.""" from math import ceil, log import numpy as np from numpy.fft import irfft from scipy.special import sinc import sigtools # Some notes on function parameters: # # `cutoff` and `width` are given as a numbers between 0 and 1. These # are relative frequencies, expressed as a fracti...
gpl-3.0