repo_name
stringlengths
6
96
path
stringlengths
4
191
copies
stringclasses
322 values
size
stringlengths
4
6
content
stringlengths
762
753k
license
stringclasses
15 values
aestrivex/ielu
ielu/plotting_utils.py
1
6230
import os import numpy as np import nibabel as nib from traits.api import HasTraits, Float, Int, Tuple from traitsui.api import View, Item, CSVListEditor from .geometry import get_vox2rasxfm, apply_affine, get_std_orientation from .utils import get_subjects_dir def force_render( figure=None ): from mayavi impor...
gpl-3.0
albu5/deepGroup
group-detection/vis_kernel_affinity.py
1
6897
""" Visualize and save group detections """ from utils import read_cad_frames, read_cad_annotations, get_interaction_features, add_annotation, custom_interaction_features from matplotlib import pyplot as plt from keras.models import Model from keras.layers import Input, Dense from keras.layers.merge import add from k...
mit
MohammedWasim/scikit-learn
sklearn/linear_model/tests/test_base.py
101
12205
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model....
bsd-3-clause
ibell/coolprop
wrappers/Python/CoolProp/Plots/PsychChart.py
1
5652
""" This file implements a psychrometric chart for air at 1 atm """ import CoolProp HAProps = CoolProp.HumidAirProp.HAProps InlineLabel = CoolProp.Plots.Plots.InlineLabel import matplotlib, numpy, textwrap import_template=( """ import numpy, matplotlib from CoolProp.HumidAirProp import HAProps from CoolProp.Plots.Plo...
mit
ulno/micropython-extra-ulno
examples/plot_log/liveplot2d.py
2
4391
#!/usr/bin/env python3 # tail a file into a plot # # take parameter of filename # # Resources: # - http://stackoverflow.com/questions/11874767/real-time-plotting-in-while-loop-with-matplotlib # - from: https://lethain.com/tailing-in-python/ # # Author: ulno # Create date: 2017-04-30 # import time from optparse import ...
mit
henriquemiranda/yambo-py
tutorial/mos2/proj_mos2.py
2
2428
from __future__ import print_function, division # # Author: Henrique Pereira Coutada Miranda # Example script to plot the weigth of the atomic species in the bandstructure # from qepy import * import sys import argparse import matplotlib.pyplot as plt folder = 'bands' npoints = 20 p = Path([ [[0.0, 0.0, 0.0],'G'], ...
bsd-3-clause
Ichaelus/Github-Classifier
Application/Models/ClassificationModules/metaonlyrandomforest.py
1
2706
#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * import sklearn from sklearn.ensemble import RandomForestClassifier import numpy as np import abc from ClassificationModule import ClassificationModule class metaonlyrandomforest(ClassificationModule): """A basic Random Forest ...
mit
NicovincX2/Python-3.5
Analyse (mathématiques)/Analyse numérique/Équations différentielles numériques/Méthode des éléments finis/hpfem2d.py
1
6104
# -*- coding: utf-8 -*- """ Program for generating 2D hp finite element trial functions and their derivatives Copyright (C) 2013 Greg von Winckel 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...
gpl-3.0
voxlol/scikit-learn
sklearn/utils/__init__.py
132
14185
""" The :mod:`sklearn.utils` module includes various utilities. """ from collections import Sequence import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, assert_all_finite, ...
bsd-3-clause
tgy/facedetect
script/plot_mblbp.py
1
2423
#!/usr/bin/env python3 '''Visualize randomly chosen mblbp features in a given window''' import random import os import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.animation as animation import matplotlib.image as mpimg from PIL import Image COLORS = ['#1a535c', '#4ecdc4', '#ff6b6...
mit
cmap/cmapPy
cmapPy/math/tests/test_fast_cov.py
1
17355
import unittest import logging import cmapPy.pandasGEXpress.setup_GCToo_logger as setup_logger import cmapPy.math.fast_cov as fast_cov import numpy import tempfile import os logger = logging.getLogger(setup_logger.LOGGER_NAME) class TestFastCov(unittest.TestCase): @staticmethod def build_standard_x_y(): ...
bsd-3-clause
drpngx/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_test.py
30
60826
# 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
ibayer/fastFM-fork
fastFM/validation.py
1
10668
# Static versions of non-core sklearn.utils functions. # Placed here since they are subject to change. """Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD ...
bsd-3-clause
Akshay0724/scikit-learn
sklearn/utils/testing.py
29
25405
"""Testing utilities.""" # Copyright (c) 2011, 2012 # Authors: Pietro Berkes, # Andreas Muller # Mathieu Blondel # Olivier Grisel # Arnaud Joly # Denis Engemann # Giorgio Patrini # Thierry Guillemot # License: BSD 3 clause import os import inspect import p...
bsd-3-clause
abimannans/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
230
19795
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
colour-science/colour
colour/plotting/tm3018/tests/test_report.py
1
3449
# -*- coding: utf-8 -*- """ Defines the unit tests for the :mod:`colour.plotting.tm3018.report` module. """ import unittest from matplotlib.pyplot import Axes, Figure from colour.colorimetry import SDS_ILLUMINANTS from colour.plotting.tm3018.report import ( plot_single_sd_colour_rendition_report_full, plot_si...
bsd-3-clause
nrjl/GPN
plot_statruns.py
1
1555
import numpy as np import matplotlib.pyplot as plt import pickle from Tkinter import Tk from tkFileDialog import askopenfilename, askdirectory from test_data import ObsObject Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing data_dir = askdirectory() # show an "Open" dialog box and ret...
mit
jm-begon/scikit-learn
examples/cluster/plot_agglomerative_clustering_metrics.py
402
4492
""" Agglomerative clustering with different metrics =============================================== Demonstrates the effect of different metrics on the hierarchical clustering. The example is engineered to show the effect of the choice of different metrics. It is applied to waveforms, which can be seen as high-dimens...
bsd-3-clause
anurag313/scikit-learn
sklearn/kernel_ridge.py
155
6545
"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression.""" # Authors: Mathieu Blondel <mathieu@mblondel.org> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, RegressorMixin from .metrics.pairwise import pairwise...
bsd-3-clause
nomadcube/scikit-learn
sklearn/manifold/locally_linear.py
206
25061
"""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
boland1992/SeisSuite
seissuite/spectrum/S_spectrum.py
6
14461
# -*- coding: utf-8 -*- """ Created on Fri July 6 11:04:03 2015 @author: boland """ import os import glob import scipy import datetime import numpy as np import datetime as dt import multiprocessing as mp import matplotlib.pyplot as plt from numpy.lib.stride_tricks import as_strided from numpy.fft import rfft, irfft ...
gpl-3.0
Moriadry/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py
62
5053
# Copyright 2015 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
psychopy/versions
psychopy/data/utils.py
1
23574
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function # from future import standard_library # standard_library.install_aliases() from builtins import str from builtins import range from past.builtins import basestring import os import re import ast import pickl...
gpl-3.0
mne-tools/mne-python
mne/cov.py
4
79191
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # Denis A. Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) from copy import deepcopy from distutils.version import LooseVersion import itertools as itt from math import log import ...
bsd-3-clause
moonbury/notebooks
github/MasteringMLWithScikit-learn/8365OS_04_Codes/reuters.py
3
1368
__author__ = 'gavin' import glob from scipy.sparse import vstack from sklearn.feature_extraction.text import HashingVectorizer from sklearn.linear_model import LogisticRegression # Create X and raw y X = None labels_for_all_instances = [] vectorizer = HashingVectorizer() d = {d[0]: d[1:] for d in [l.strip()[9:].split(...
gpl-3.0
hsuantien/scikit-learn
examples/svm/plot_rbf_parameters.py
35
8096
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radius Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
bsd-3-clause
Ecotrust/madrona-priorities
util/test_scenarios.py
3
6555
from django.core.management import setup_environ import os import sys sys.path.append(os.path.dirname(os.path.join('..','priorities',__file__))) import settings setup_environ(settings) #==================================# from seak.models import Scenario, ConservationFeature, PlanningUnit, Cost, PuVsCf, PuVsCost from ...
bsd-3-clause
rueckstiess/dopamine
scripts/cart_bas_rbf.py
1
1405
from dopamine.environments import CartPoleEnvironment, CartPoleRenderer from dopamine.agents import BASAgent, RBFEstimator, NNEstimator from dopamine.experiments import Experiment from dopamine.adapters import EpsilonGreedyExplorer, NormalizingAdapter, IndexingAdapter from matplotlib import pyplot as plt from numpy im...
gpl-3.0
JazzeYoung/VeryDeepAutoEncoder
pylearn2/pylearn2/sandbox/cuda_convnet/bench.py
44
3589
__authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import numpy as np from theano....
bsd-3-clause
RomainSabathe/kaggle_airbnb2015
Code/enhance_data.py
1
5756
import pandas as pd import numpy as np """ SETTINGS """ is_training_data = True complete_enhancing = True """ CODE """ """ Recovering the data """ if complete_enhancing: type_of_data = 'base' else: type_of_data = 'enhanced' if is_training_data: dataname = 'learning_data' else: dataname = 'testing_data...
mit
fmfn/UnbalancedDataset
examples/over-sampling/plot_comparison_over_sampling.py
2
10842
""" ============================== Compare over-sampling samplers ============================== The following example attends to make a qualitative comparison between the different over-sampling algorithms available in the imbalanced-learn package. """ # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # License...
mit
benjaminpope/pysco
kergain_sim_disk.py
2
15139
import numpy as np import matplotlib.pyplot as plt import pysco from pysco.core import * import fitsio from time import time as clock from old_diffract_tools import * import pymultinest from pysco.diffract_tools import shift_image_ft from pysco.common_tasks import shift_image from swiftmask import swiftpupil import ...
gpl-3.0
NunoEdgarGub1/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/image.py
69
28764
""" The image module supports basic image loading, rescaling and display operations. """ from __future__ import division import os, warnings import numpy as np from numpy import ma from matplotlib import rcParams from matplotlib import artist as martist from matplotlib import colors as mcolors from matplotlib import...
gpl-3.0
rgommers/statsmodels
statsmodels/sandbox/distributions/otherdist.py
33
10145
'''Parametric Mixture Distributions Created on Sat Jun 04 2011 Author: Josef Perktold Notes: Compound Poisson has mass point at zero http://en.wikipedia.org/wiki/Compound_Poisson_distribution and would need special treatment need a distribution that has discrete mass points and contiuous range, e.g. compound Pois...
bsd-3-clause
eramirem/astroML
doc/sphinxext/exfile.py
3
4259
""" Execfile is a tool that enables open a python script, extracting the file-level docstring, executing the file, and saving the resulting matplotlib figures. """ from __future__ import print_function, division import sys import os import traceback import token import tokenize import gc import matplotlib matplotlib....
bsd-2-clause
trungnt13/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
georgid/SourceFilterContoursMelody
smstools/software/models_interface/hprModel_function.py
1
3840
# function to call the extractHarmSpec analysis/synthesis functions in software/models/hprModel.py import numpy as np import matplotlib.pyplot as plt import os, sys from scipy.signal import get_window sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/')) import utilFunctions as UF im...
gpl-3.0
miloharper/neural-network-animation
matplotlib/tests/test_delaunay.py
14
7090
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import xrange import warnings import numpy as np from matplotlib.testing.decorators import image_comparison, knownfailureif from matplotlib.cbook import MatplotlibDeprecationWarning ...
mit
jseabold/scikit-learn
examples/exercises/plot_cv_digits.py
135
1223
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
bsd-3-clause
nyu-dl/dl4mt-simul-trans
insepection.py
1
9509
# -*- coding: utf-8 -*- import matplotlib # matplotlib.use('agg') import copy import numpy import os import seaborn as sns import pandas as pd sns.set(context="paper", font="monospace", style='whitegrid') from matplotlib import pyplot as plot from matplotlib import rc rc('font',**{'family':'Verdana', 'weight': 'normal...
bsd-3-clause
kjs73/pele
playground/plate_folding/geometric_folding.py
5
10127
from itertools import izip import numpy as np from pele.angleaxis import RBTopology, RBSystem, RigidFragment, RBPotentialWrapper from pele.potentials import BasePotential from pele.utils import rotations from plate_potential import PlatePotential EDGE1_TYPE = "O" EDGE2_TYPE = "C" EDGE3_TYPE = "N" OTHER_TYPE = "H" ...
gpl-3.0
bowenliu16/deepchem
deepchem/models/sklearn_models/__init__.py
3
2360
""" Code for processing datasets using scikit-learn. """ import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import LogisticRegression from sklearn.linear_model import LinearRegression from sklearn.linear_model import RidgeC...
gpl-3.0
vortex-ape/scikit-learn
examples/decomposition/plot_pca_iris.py
32
1516
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f...
bsd-3-clause
eteq/bokeh
bokeh/charts/builder/histogram_builder.py
43
9142
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Histogram class which lets you build your histograms just passing the arguments to the Chart class and calling the proper functions. """ #-------------------------------------------------------------...
bsd-3-clause
aminert/scikit-learn
examples/hetero_feature_union.py
288
6236
""" ============================================= Feature Union with Heterogeneous Data Sources ============================================= Datasets can often contain components of that require different feature extraction and processing pipelines. This scenario might occur when: 1. Your dataset consists of hetero...
bsd-3-clause
Wyliodrin/wyliodrin-app-server
source/libraries/notebook/loader.py
1
3374
import sys import json import os import traceback import types import redis wyliodrin_redis = redis.StrictRedis () #import matplotlib #matplotlib.use ('Agg') from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import PythonTracebackLexer wyliodrin_formatter = HtmlFor...
gpl-3.0
beepee14/scikit-learn
examples/model_selection/grid_search_digits.py
227
2665
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.grid_search.GridSearc...
bsd-3-clause
CuchulainX/featherweight.light
fit_camera.py
3
4000
#!/usr/bin/python # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
nburn42/tensorflow
tensorflow/examples/learn/text_classification_cnn.py
21
5221
# 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
antgonza/qiime
tests/test_make_2d_plots.py
15
13517
#!/usr/bin/env python # file test_make_2d_plots.py __author__ = "Jesse Stombaugh" __copyright__ = "Copyright 2011, The QIIME Project" # consider project name # remember to add yourself __credits__ = ["Jesse Stombaugh", "Jose Antonio Navas Molina"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jesse ...
gpl-2.0
johankaito/fufuka
graph-tool/src/graph_tool/draw/graphviz_draw.py
2
24109
#! /usr/bin/env python # -*- coding: utf-8 -*- # # graph_tool -- a general graph manipulation python module # # Copyright (C) 2006-2015 Tiago de Paula Peixoto <tiago@skewed.de> # # 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...
apache-2.0
hajicj/MUSCIMarker
MUSCIMarker/syntax/dependency_parsers.py
1
11720
"""This module implements a class that...""" from __future__ import print_function, unicode_literals from builtins import object import collections import logging import numpy from muscima.cropobject import cropobject_distance from muscima.graph import find_beams_incoherent_with_stems from muscima.inference_engine_co...
apache-2.0
elkingtonmcb/scikit-learn
sklearn/linear_model/sag.py
64
9815
"""Solvers for Ridge and LogisticRegression using SAG algorithm""" # Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # Licence: BSD 3 clause import numpy as np import warnings from ..utils import ConvergenceWarning from ..utils import check_array from .base import make_dataset from .sgd_fast import Log, Squ...
bsd-3-clause
decvalts/cartopy
lib/cartopy/examples/eyja_volcano.py
1
1831
# -*- coding: utf-8 -*- """ Map tile acquisition -------------------- Demonstrates cartopy's ability to draw map tiles which are downloaded on demand from the Stamen tile server. Internally these tiles are then combined into a single image and displayed in the cartopy GeoAxes. """ __tags__ = ["Scalar data"] import m...
gpl-3.0
davidam/python-examples
scikit/text-classifier-example.py
1
2200
import sklearn import numpy as np from glob import glob from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.linear_model import SGDClassifier from sklearn i...
gpl-3.0
dhhjx880713/GPy
doc/source/conf.py
4
12135
# -*- coding: utf-8 -*- # # GPy documentation build configuration file, created by # sphinx-quickstart on Fri Sep 18 18:16:28 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
bsd-3-clause
zhenv5/scikit-learn
sklearn/tests/test_common.py
70
7717
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
bsd-3-clause
chenyyx/scikit-learn-doc-zh
examples/en/feature_selection/plot_feature_selection.py
53
2840
""" =============================== Univariate Feature Selection =============================== An example showing univariate feature selection. Noisy (non informative) features are added to the iris data and univariate feature selection is applied. For each feature, we plot the p-values for the univariate feature s...
gpl-3.0
iproduct/course-social-robotics
11-dnn-keras/venv/Lib/site-packages/pandas/core/internals/concat.py
1
20709
from collections import defaultdict import copy from typing import TYPE_CHECKING, Any, Dict, List, Sequence, Tuple, cast import numpy as np from pandas._libs import NaT, internals as libinternals from pandas._typing import DtypeObj, Shape from pandas.util._decorators import cache_readonly from pandas.core.dtypes.cas...
gpl-2.0
fergalbyrne/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/__init__.py
72
2225
import matplotlib import inspect import warnings # ipython relies on interactive_bk being defined here from matplotlib.rcsetup import interactive_bk __all__ = ['backend','show','draw_if_interactive', 'new_figure_manager', 'backend_version'] backend = matplotlib.get_backend() # validates, to match all_bac...
agpl-3.0
justacec/bokeh
bokeh/charts/glyphs.py
3
36943
from __future__ import absolute_import, division from collections import defaultdict import numpy as np import pandas as pd from six import iteritems from bokeh.charts import DEFAULT_PALETTE from bokeh.core.enums import DashPattern from bokeh.models.glyphs import Rect, Segment, Line, Patches, Arc from bokeh.models.r...
bsd-3-clause
bestwpw/BDA_py_demos
demos_ch10/demo10_2.py
19
1606
"""Bayesian data analysis Chapter 10, demo 2 Importance sampling example """ from __future__ import division import numpy as np from scipy import stats import matplotlib.pyplot as plt # edit default plot settings (colours from colorbrewer2.org) plt.rc('font', size=14) plt.rc('lines', color='#377eb8', linewidth=2, m...
gpl-3.0
thp44/delphin_6_automation
data_process/wp6_run/sim_reports/utils.py
1
7429
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import os import numpy as np import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = [10, 5] import datetime fro...
mit
TengdaHan/Convolutional_Sketch_Inversion
src/utils/simple_utils.py
1
1499
import matplotlib.pyplot as plt import numpy as np def plot_batch_train(model, img_size, batch_size, sketch, color, epoch, idx, tag, nb_img=5): img_sketch = np.array(sketch[0:nb_img]) img_color = np.array(color[0:nb_img]) img_gen = model.predict(sketch, batch_size=batch_size)[0][0:nb_img] for i in ran...
mit
wdurhamh/statsmodels
examples/python/tsa_filters.py
34
4559
## Time Series Filters from __future__ import print_function import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm dta = sm.datasets.macrodata.load_pandas().data index = pd.Index(sm.tsa.datetools.dates_from_range('1959Q1', '2009Q3')) print(index) dta.index = index del dta['year'] del...
bsd-3-clause
great-expectations/great_expectations
great_expectations/cli/datasource.py
1
28903
import enum import logging import os import sys from typing import Optional, Union import click from great_expectations import DataContext from great_expectations.cli import toolkit from great_expectations.cli.pretty_printing import cli_message, cli_message_dict from great_expectations.cli.util import verify_library_...
apache-2.0
pratapvardhan/pandas
scripts/find_undoc_args.py
5
5098
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script that compares the signature arguments with the ones in the docsting and returns the differences in plain text or GitHub task list format. Usage:: $ ./find_undoc_args.py (see arguments below) """ from __future__ import print_function import sys from collecti...
bsd-3-clause
azogue/enerpi
enerpi/database.py
1
9124
# -*- coding: utf-8 -*- """ ENERPI - Database methods: - Get/Init/Update ENERPI data catalog - Process or clear log files - Method for appending raw data to ENERPI catalog from the ENERPI Logger ... """ import datetime as dt import os import pandas as pd from time import time import re from enerpi.base import CONFIG,...
mit
DavidJahn86/terapy
spectroComparism.py
1
7513
#!/usr/bin/env python ''' SNR Plot in FD&TD, DR Plot in FD&TD, TD with u for reference files from two different spectrometers/runs ''' import argparse import sys import matplotlib.pyplot as plt import glob import Terapy import TeraData from matplotlib2tikz import save as tikz_save plt.rc('text',usetex=True) parser =...
gpl-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/matplotlib/testing/jpl_units/UnitDblFormatter.py
23
1485
#=========================================================================== # # UnitDblFormatter # #=========================================================================== """UnitDblFormatter module containing class UnitDblFormatter.""" #==========================================================================...
gpl-3.0
anntzer/scikit-learn
sklearn/neural_network/_multilayer_perceptron.py
8
56999
"""Multi-layer Perceptron """ # Authors: Issam H. Laradji <issam.laradji@gmail.com> # Andreas Mueller # Jiyuan Qian # License: BSD 3 clause import numpy as np from abc import ABCMeta, abstractmethod import warnings import scipy.optimize from ..base import BaseEstimator, ClassifierMixin, Regressor...
bsd-3-clause
LoLab-VU/pymc
pymc/diagnostics.py
3
5373
"""Convergence diagnostics and model validation""" import numpy as np from .stats import autocorr, autocov, statfunc from copy import copy __all__ = ['geweke', 'gelman_rubin', 'trace_to_dataframe'] @statfunc def geweke(x, first=.1, last=.5, intervals=20): """Return z-scores for convergence diagnostics. Com...
apache-2.0
sid88in/incubator-airflow
airflow/hooks/druid_hook.py
6
6122
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
amolkahat/pandas
pandas/tests/io/json/test_compression.py
3
4389
import pytest import pandas as pd import pandas.util.testing as tm import pandas.util._test_decorators as td from pandas.util.testing import assert_frame_equal, assert_raises_regex def test_compression_roundtrip(compression): df = pd.DataFrame([[0.123456, 0.234567, 0.567567], [12.32112, 12...
bsd-3-clause
nelson-liu/scikit-learn
sklearn/decomposition/tests/test_sparse_pca.py
160
6028
# Author: Vlad Niculae # License: BSD 3 clause import sys import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing import ass...
bsd-3-clause
mhue/scikit-learn
examples/linear_model/plot_ridge_path.py
254
1655
""" =========================================================== Plot Ridge coefficients as a function of the regularization =========================================================== Shows the effect of collinearity in the coefficients of an estimator. .. currentmodule:: sklearn.linear_model :class:`Ridge` Regressi...
bsd-3-clause
rjenc29/numerical
tests/test_ewma.py
1
1275
import pandas as pd import numpy as np from utilities.ewma import ewma def sample_data_series(): data = np.arange(50).astype(float) data[3] = np.nan data[4] = np.nan return pd.Series(data) def test_ewma_adjust_and_ignore_na(): series = sample_data_series() alpha = 0.1 expected = series...
mit
kirbs-/edX-Learning-From-Data-Solutions
Final/Python/by_Mark_B2/hw8.py
3
5383
''' Created on @author: Mark ''' import numpy as np import sklearn.svm as svm from hw6 import readIn import random from sklearn.cross_validation import KFold from ctypes.test.test_bitfields import func def getData(): return readIn('features.train'), readIn('features.test') def classificationError(Y, Y_in): r...
apache-2.0
sergiohzlz/complejos
Logistica/logisticmap.py
1
1255
#!/usr/bin/python #-*-coding:utf8-*- import sys from pylab import * import matplotlib matplotlib.use('TkAgg') from matplotlib import pyplot as plt plt.style.use('ggplot') def logistica(x0,r, n=1000): L = [x0] for i in range(n): x_act = L[-1] L.append(r*x_act*(1-x_act)) return L def bifurc...
gpl-2.0
kmspriyatham/symath
scipy/scipy/interpolate/tests/test_rbf.py
4
4162
#!/usr/bin/env python # Created by John Travers, Robert Hetland, 2007 """ Test functions for rbf module """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_, assert_array_almost_equal, assert_almost_equal, run_module_suit...
apache-2.0
frank-tancf/scikit-learn
doc/sphinxext/numpy_ext/docscrape_sphinx.py
408
8061
import re import inspect import textwrap import pydoc from .docscrape import NumpyDocString from .docscrape import FunctionDoc from .docscrape import ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots...
bsd-3-clause
dpshelio/scikit-image
skimage/viewer/tests/test_tools.py
19
5681
from collections import namedtuple import numpy as np from numpy.testing import assert_equal from numpy.testing.decorators import skipif from skimage import data from skimage.viewer import ImageViewer, has_qt from skimage.viewer.canvastools import ( LineTool, ThickLineTool, RectangleTool, PaintTool) from skimage.v...
bsd-3-clause
florian-f/sklearn
examples/plot_johnson_lindenstrauss_bound.py
4
7402
""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected in...
bsd-3-clause
WindCanDie/spark
python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py
7
18847
# # 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
pratapvardhan/scikit-learn
sklearn/linear_model/tests/test_sag.py
33
28228
# Authors: Danny Sullivan <dbsullivan23@gmail.com> # Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # Licence: BSD 3 clause import math import numpy as np import scipy.sparse as sp from sklearn.linear_model.sag import get_auto_step_size from sklearn.linear_model.sag_fast import _multinomial_grad_loss_all_sa...
bsd-3-clause
datapythonista/pandas
pandas/tests/window/test_groupby.py
3
34849
import numpy as np import pytest from pandas import ( DataFrame, Index, MultiIndex, Series, Timestamp, date_range, to_datetime, ) import pandas._testing as tm from pandas.api.indexers import BaseIndexer from pandas.core.groupby.groupby import get_groupby class TestRolling: def setup_m...
bsd-3-clause
anjalisood/spark-tk
regression-tests/sparktkregtests/testcases/frames/ecdf_test.py
13
3032
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
pochoi/SHTOOLS
examples/python/ClassInterface/ClassExample.py
2
1931
#!/usr/bin/env python """ This script tests the python class interface """ from __future__ import division from __future__ import print_function # standard imports: import os import sys import numpy as np import matplotlib as mpl # import shtools: sys.path.append(os.path.join(os.path.dirname(__file__), "../../..")) ...
bsd-3-clause
ronw/siplca-segmentation
plot_pages.py
1
3604
# Copyright (C) 2009 Ron J. Weiss (ronweiss@gmail.com) # # 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 later version. # # This progra...
gpl-3.0
AdrienGuille/TOM
tom_lib/nlp/topic_model.py
1
13558
# coding: utf-8 import itertools from abc import ABCMeta, abstractmethod import numpy as np import tom_lib.stats from scipy import spatial, cluster from scipy.sparse import coo_matrix from sklearn.decomposition import NMF, LatentDirichletAllocation as LDA #import lda from tom_lib.structure.corpus import Corpus __auth...
mit
lukauskas/scipy
scipy/integrate/quadrature.py
26
27908
from __future__ import division, print_function, absolute_import __all__ = ['fixed_quad','quadrature','romberg','trapz','simps','romb', 'cumtrapz','newton_cotes'] from scipy.special.orthogonal import p_roots from scipy.special import gammaln from numpy import sum, ones, add, diff, isinf, isscalar, \ a...
bsd-3-clause
jjx02230808/project0223
examples/svm/plot_svm_nonlinear.py
268
1091
""" ============== Non-linear SVM ============== Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a XOR of the inputs. The color map illustrates the decision function learned by the SVC. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn imp...
bsd-3-clause
google/fuzzbench
analysis/test_coverage_data_utils.py
1
3522
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
TariqAHassan/BioVida
biovida/genomics/disgenet_interface.py
1
8839
# coding: utf-8 """ DisGeNET Interface ~~~~~~~~~~~~~~~~~~ """ import os import requests import pandas as pd # Tool to create required caches from biovida.support_tools._cache_management import package_cache_creator # BioVida Support Tools from biovida.support_tools.support_tools import header, camel_to_sna...
bsd-3-clause
fako/datascope
src/core/utils/tests/data.py
1
14820
from mock import patch, Mock import numpy as np import pandas as pd from pandas.testing import assert_frame_equal from django.test import TestCase from core.utils.data import NumericFeaturesFrame from core.models import Collective, Individual from core.exceptions import DSFileLoadError class TestNumericFeaturesFra...
gpl-3.0
crukci-bioinformatics/claritypy-ngsreports
legacy/audit_clarity.py
2
16330
""" Python script create_billing_summary Created by Anne Pajon under user 'pajon01' on 09/06/2016 """ import csv import json import numpy as np import os import pandas as pd import shutil import string import subprocess import logging import argparse from dateutil.relativedelta import * from dateutil.parser import * ...
mit
murali-munna/scikit-learn
examples/mixture/plot_gmm_pdf.py
284
1528
""" ============================================= Density Estimation for a mixture of Gaussians ============================================= Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices. """ import numpy as np import ma...
bsd-3-clause
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/pandas/tests/io/parser/test_read_fwf.py
7
15261
# -*- coding: utf-8 -*- """ Tests the 'read_fwf' function in parsers.py. This test suite is independent of the others because the engine is set to 'python-fwf' internally. """ from datetime import datetime import pytest import numpy as np import pandas as pd import pandas.util.testing as tm from pandas import DataF...
agpl-3.0
benthomasson/stdeb
stdeb/util.py
3
60220
# # This module contains most of the code of stdeb. # import re, sys, os, shutil, select import codecs try: # Python 2.x import ConfigParser except ImportError: # Python 3.x import configparser as ConfigParser import subprocess import tempfile import stdeb from stdeb import log, __version__ as __stdeb_v...
mit
JanNash/sms-tools
lectures/05-Sinusoidal-model/plots-code/sineModelAnal-bendir.py
24
1245
import numpy as np import matplotlib.pyplot as plt import sys, os, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as STFT import sineModel as SM import utilFunctions as UF (fs, x) = UF.wavread(os.path.join(os.path.dirname(os.path.realpath(__fi...
agpl-3.0