repo_name
stringlengths
6
67
path
stringlengths
5
185
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
962k
license
stringclasses
15 values
dr-leo/pandaSDMX
pandasdmx/util.py
1
9243
import collections import logging import typing from enum import Enum from typing import TYPE_CHECKING, Any, List, Type, TypeVar, Union, no_type_check import pydantic from pydantic import DictError, Extra, ValidationError, validator # noqa: F401 from pydantic.class_validators import make_generic_validator KT = TypeV...
apache-2.0
andim/scipydirect
doc/sphinxext/inheritance_diagram.py
98
13648
""" Defines a docutils directive for inserting inheritance diagrams. Provide the directive with one or more classes or modules (separated by whitespace). For modules, all of the classes in that module will be used. Example:: Given the following classes: class A: pass class B(A): pass class C(A): pass ...
mit
adykstra/mne-python
tutorials/discussions/plot_background_filtering.py
1
49893
# -*- coding: utf-8 -*- r""" .. _disc-filtering: =================================== Background information on filtering =================================== Here we give some background information on filtering in general, and how it is done in MNE-Python in particular. Recommended reading for practical applications ...
bsd-3-clause
andrewcmyers/tensorflow
tensorflow/contrib/timeseries/examples/predict_test.py
80
2487
# Copyright 2017 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
shyamalschandra/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
YJango/tensorflow
Py_version/FNNs_Demo/demoLV3.py
1
12562
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/6/19 11:10 # @Author : zzy824 # @File : demoLV3.py import tensorflow as tf import numpy as np import matplotlib.pyplot as plt tf.set_random_seed(55) np.random.seed(55) """ add some branched based on demoLV2,X.npy and Y.npy are files including data fo...
gpl-3.0
anntzer/scikit-learn
sklearn/decomposition/_fastica.py
7
21041
""" Python implementation of the fast ICA algorithms. Reference: Tables 8.3 and 8.4 page 196 in the book: Independent Component Analysis, by Hyvarinen et al. """ # Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux, # Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann # License: BS...
bsd-3-clause
inpefess/kaggle_competitions
cats_vs_dogs/predict.py
1
1193
import argparse import pandas as pd from keras.models import load_model from cats_vs_dogs.config import data_dir from cats_vs_dogs.data_generators import DataGenerators def save_predictions( model_file: str, submission_filename: str = "submission.csv" ): batch_size = 20 model = load_model(mo...
mit
IshankGulati/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
53
13398
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import scipy.sparse as sp 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.u...
bsd-3-clause
Karel-van-de-Plassche/QLKNN-develop
qlknn/misc/random_access_benchmark.py
1
3875
import xarray as xr from IPython import embed import numpy as np from itertools import product import pandas as pd #import dask.dataframe as df import time #import dask.array as da import numpy as np def cartesian(arrays, out=None): """ Generate a cartesian product of input arrays. Parameters --------...
mit
bmcfee/ismir2017_chords
code/train_model.py
1
19274
#!/usr/bin/env python '''Model construction and training script''' import argparse import os import sys from collections import defaultdict from glob import glob import six import pickle import numpy as np import pandas as pd import keras as K from tqdm import tqdm from sklearn.model_selection import ShuffleSplit ...
bsd-2-clause
aliciawyy/CompInvest
portfolio_frontier.py
1
4645
""" This file will store the function which will determine the efficient frontier @author: Alicia Wang @date: 4 Oct 2014 """ # QSTK Imports import QSTK.qstkutil.tsutil as tsu # Third Party import import datetime as dt import numpy as np import matplotlib.pyplot as plt from load.load_ticker import load_valid_cac40_na...
mit
thilbern/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
Anmol-Singh-Jaggi/Recommend
without-DB/python/uu.py
1
3767
import scipy as sp import time import pickle import numpy as np import os import sys import matplotlib.pyplot as plt import math from collections import defaultdict f = open("/home/goel/rec/data/u1.base",'r') user_train = {} user_mean = {} user_ratings = {} simy = {} n_all = {} def init_user_train(): for line...
gpl-2.0
yyjiang/scikit-learn
sklearn/utils/arpack.py
265
64837
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
bsd-3-clause
akionakamura/scikit-learn
sklearn/datasets/tests/test_rcv1.py
322
2414
"""Test the rcv1 loader. Skipped if rcv1 is not already downloaded to data_home. """ import errno import scipy.sparse as sp import numpy as np from sklearn.datasets import fetch_rcv1 from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing i...
bsd-3-clause
trashkalmar/omim
search/search_quality/scoring_model.py
4
9667
#!/usr/bin/env python3 from math import exp, log from scipy.stats import pearsonr, t from sklearn import svm from sklearn.model_selection import GridSearchCV, KFold from sklearn.utils import resample import argparse import collections import itertools import numpy as np import pandas as pd import random import sys M...
apache-2.0
vigilv/scikit-learn
examples/gaussian_process/plot_gp_regression.py
253
4054
#!/usr/bin/python # -*- coding: utf-8 -*- r""" ========================================================= Gaussian Processes regression: basic introductory example ========================================================= A simple one-dimensional regression exercise computed in two different ways: 1. A noise-free cas...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/tight_bbox.py
22
2601
""" This module is to support *bbox_inches* option in savefig command. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import warnings from matplotlib.transforms import Bbox, TransformedBbox, Affine2D def adjust_bbox(fig, bbox_inches, fixe...
gpl-3.0
atanna/benchpy
benchpy/magic.py
1
5170
# -*- coding: utf-8 -*- from __future__ import absolute_import from functools import partial from matplotlib import pyplot as plt def magic_benchpy(line='', cell=None): """ Run benchpy.run %benchpy [[-i] [-g] [-n <N>] [-m <M>] [-p] [-r <R>] [-t <T>] -s<S>] statement where statement is Bench or Grou...
mit
jakdot/pyactr
tutorials/forbook/code/ch7_lexical_decision_pyactr_no_imaginal.py
1
10801
""" A model of lexical decision: Bayes+ACT-R, no imaginal buffer """ import warnings import sys import matplotlib as mpl mpl.use("pgf") pgf_with_pdflatex = {"text.usetex": True, "pgf.texsystem": "pdflatex", "pgf.preamble": [r"\usepackage{mathpazo}", r"\usepac...
gpl-3.0
rpbarnes/nmrglue
doc/_build/html/examples/el/interactive/2d_interactive/2d_interactive.py
10
1209
#! /usr/bin/env python # Create contour plots of a 2D NMRPipe spectrum import nmrglue as ng import numpy as np import matplotlib.pyplot as plt import matplotlib.cm # plot parameters cmap = matplotlib.cm.Blues_r # contour map (colors to use for contours) contour_start = 30000 # contour level start value conto...
bsd-3-clause
lail3344/sms-tools
lectures/09-Sound-description/plots-code/mfcc.py
25
1103
import numpy as np import matplotlib.pyplot as plt import essentia.standard as ess M = 1024 N = 1024 H = 512 fs = 44100 spectrum = ess.Spectrum(size=N) window = ess.Windowing(size=M, type='hann') mfcc = ess.MFCC(numberCoefficients = 12) x = ess.MonoLoader(filename = '../../../sounds/speech-male.wav', sampleRate = fs)(...
agpl-3.0
liangz0707/scikit-learn
examples/plot_digits_pipe.py
250
1809
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the predictio...
bsd-3-clause
aberdah/Stockvider
stockvider/stockviderApp/sourceDA/rawData/referenceRawDataDA.py
1
13837
# -*- coding: utf-8 -*- ''' Todo : - vérifier que quand on fait le réindex, les dates ajoutées à un DF ont bien des values à NaN (sinon ça fausse le vote). ''' import pandas as pd import numpy as np class ReferenceRawDataDA(object): ''' Base class handling **raw data aggregation to reference dat...
mit
DonBeo/scikit-learn
sklearn/tests/test_qda.py
155
3481
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.utils.testing import assert_raises from sklearn.utils.testing import ignore_war...
bsd-3-clause
abimannans/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
eg-zhang/scikit-learn
sklearn/tree/export.py
78
15814
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
bsd-3-clause
ChanChiChoi/scikit-learn
examples/svm/plot_svm_regression.py
249
1451
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
bsd-3-clause
gilt/incubator-airflow
airflow/contrib/operators/hive_to_dynamodb.py
15
3701
# -*- coding: utf-8 -*- # # 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, software ...
apache-2.0
h2oai/h2o-3
h2o-hadoop-3/tests/python/pyunit_s3_import_export.py
2
2041
#! /usr/env/python import sys, os sys.path.insert(1, os.path.join("..","..","..")) from tests import pyunit_utils from datetime import datetime import h2o import uuid from pandas.util.testing import assert_frame_equal import boto3 def s3_import_export(): local_frame = h2o.import_file(path=pyunit_utils.locate("sma...
apache-2.0
choldgraf/download
examples/plot_download_providers.py
1
1876
""" Download from Dropbox, Google Drive, and Github ----------------------------------------------- It's also possible to download files from Github, Google Drive, and Dropbox. While you can go through a little extra effort to get a direct download link, ``download`` will try to make things a little bit easier for you...
mit
tianrui/521dev
svhn/cnn_train.py
1
8823
# 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...
gpl-3.0
kaichogami/scikit-learn
sklearn/__init__.py
29
3071
""" Machine learning module for Python ================================== sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). It aims to provide simple and efficient solutions to learning problems that are acc...
bsd-3-clause
neuro-lyon/multiglom-model
src/plotting.py
1
6438
# -*- coding:utf-8 -*- from matplotlib import pyplot as plt, cm as cmap from numpy import where from brian.stdunits import * from brian.units import * from matplotlib.mlab import psd from pylab import detrend_mean def raster_plot(spikes_i, spikes_t, connection_matrix): """Raster plot with focus on interconnecti...
mit
pv/scikit-learn
examples/svm/plot_rbf_parameters.py
57
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
lifei96/Medium-crawler-with-data-analyzer
User_Crawler/medium_users_data_reader.py
2
1748
# -*- coding: utf-8 -*- import pandas as pd import json import datetime import os def read_users(): users = list() file_in = open('./username_list.txt', 'r') username_list = str(file_in.read()).split(' ') file_in.close() num = 0 for username in username_list: if not username: ...
mit
mjirik/larVolumeToObj
larVolumeToObj/computation/old/step_calcchains_tobinary.py
2
8706
# -*- coding: utf-8 -*- from lar import * from scipy import * import json import scipy import numpy as np import time as tm import gc from pngstack2array3d import * import struct import getopt, sys import traceback # import matplotlib.pyplot as plt # ------------------------------------------------------------ # Logg...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/dask/dataframe/io/demo.py
4
8227
from __future__ import absolute_import, division, print_function import pandas as pd import numpy as np from ..core import tokenize, DataFrame from .io import from_delayed from ...delayed import delayed from ...utils import random_state_data __all__ = ['make_timeseries'] def make_float(n, rstate): return rstat...
gpl-3.0
Jiangshangmin/mpld3
examples/heart_path.py
19
3958
""" Patches and Paths ================= This is a demo adapted from a `matplotlib gallery example <http://matplotlib.org/examples/shapes_and_collections/path_patch_demo.html>`_ This example adds a custom D3 plugin allowing the user to drag the path control-points and see the effect on the path. Use the toolbar button...
bsd-3-clause
thientu/scikit-learn
sklearn/__check_build/__init__.py
345
1671
""" Module to give helpful messages to the user that did not compile the scikit properly. """ import os INPLACE_MSG = """ It appears that you are importing a local scikit-learn source tree. For this, you need to have an inplace install. Maybe you are in the source directory and you need to try from another location.""...
bsd-3-clause
MartinSavc/scikit-learn
sklearn/gaussian_process/gaussian_process.py
83
34544
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause from __future__ import print_function import numpy as np from scipy import linalg, optimize from ..base import BaseEstimator, RegressorMixin from ..metrics...
bsd-3-clause
waterponey/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py
13
5539
""" Testing for the gradient boosting loss functions and initial estimators. """ import numpy as np from numpy.testing import assert_array_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_equal from sklearn.utils import check_random_state from sklearn.utils.testing import assert_ra...
bsd-3-clause
DuCorey/bokeh
examples/models/file/anscombe.py
12
3015
from __future__ import print_function import numpy as np import pandas as pd from bokeh.util.browser import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.layouts import gridplot from bokeh.models.glyphs import Circle, Line from bokeh.models import ColumnDataSource, Grid, Linear...
bsd-3-clause
energyPATHWAYS/energyPATHWAYS
energyPATHWAYS/shape.py
1
25285
# -*- coding: utf-8 -*- """ Created on Mon Oct 05 14:45:48 2015 @author: ryan """ import config as cfg import datamapfunctions as dmf import util import pandas as pd import pytz import datetime as DT # PyCharm complains about dateutil not being listed in the project requirements, but my understanding is that # it is ...
mit
cerebis/meta-sweeper
bin/readthru_parser.py
1
16212
#!/usr/bin/env python """ meta-sweeper - for performing parametric sweeps of simulated metagenomic sequencing experiments. Copyright (C) 2016 "Matthew Z DeMaere" 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 F...
gpl-3.0
ilo10/scikit-learn
sklearn/datasets/lfw.py
50
19048
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
meerkat-code/meerkat_api
meerkat_api/resources/indicators.py
1
6821
import pandas as pd import numpy as np from dateutil.relativedelta import relativedelta from flask_restful import Resource from flask import request from sqlalchemy import or_, Float from meerkat_api.extensions import db, api from meerkat_api.util import series_to_json_dict from meerkat_analysis.indicators import count...
mit
monkeypants/MAVProxy
setup.py
1
3872
from setuptools import setup import os, platform version = "1.8.2" def package_files(directory): paths = [] for (path, directories, filenames) in os.walk(directory): for filename in filenames: paths.append(os.path.join('..', path, filename)) return paths package_data = ['modules/mavpr...
gpl-3.0
seckcoder/lang-learn
python/sklearn/sklearn/decomposition/__init__.py
2
1166
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from .nmf import NMF, ProjectedGradientNMF from .pca import PCA, RandomizedPCA, ProbabilisticPC...
unlicense
kyleabeauchamp/FitEnsemble
fitensemble/nmr_tools/chemical_shift_readers.py
1
2854
import pandas as pd import string import numpy as np """ TO DO: implement shiftx2 parser.""" def read_sparta_tab(filename, skiprows): names = string.split("RESID RESNAME ATOMNAME SS_SHIFT SHIFT RC_SHIFT HM_SHIFT EF_SHIFT SIGMA") x = pd.io.parsers.read_table(filename, skiprows=skiprows, header=None, names=nam...
gpl-3.0
ch3ll0v3k/scikit-learn
sklearn/metrics/ranking.py
75
25426
"""Metrics to assess performance on classification task given scores Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria....
bsd-3-clause
code-sauce/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_functions.py
18
12209
# 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
etkirsch/scikit-learn
examples/linear_model/plot_polynomial_interpolation.py
251
1895
#!/usr/bin/env python """ ======================== Polynomial interpolation ======================== This example demonstrates how to approximate a function with a polynomial of degree n_degree by using ridge regression. Concretely, from n_samples 1d points, it suffices to build the Vandermonde matrix, which is n_samp...
bsd-3-clause
ABcDexter/python-weka-wrapper
setup.py
2
3655
# 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 program is distributed in the hope that it will be useful, # b...
gpl-3.0
rethore/FUSED-Wake
setup.py
1
2873
#!/usr/bin/env python # -*- coding: utf-8 -*- # # try: # from setuptools import setup # except ImportError: # from distutils.core import setup #from setuptools import setup #from setuptools import Extension from numpy.distutils.core import setup from numpy.distutils.extension import Extension import os impo...
agpl-3.0
ThomasMiconi/nupic.research
htmresearch/frameworks/layers/l2456_model.py
2
22876
# ---------------------------------------------------------------------- # 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
rosinality/knotter
knotter/mapper/lense.py
1
1316
import numpy as np import scipy as sp import scipy.linalg as la import scipy.spatial.distance as dist from sklearn import manifold def pca(X, n_components=2): centered = X - X.mean(axis=0) U, s, Vt = la.svd(centered, full_matrices = False) s2 = s ** 2 U = U[:, :n_components] s = s[:n_compone...
mit
wangyum/spark
python/pyspark/ml/clustering.py
5
62508
# # 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
Shaswat27/scipy
scipy/signal/windows.py
11
53970
"""The suite of window functions.""" from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy import fftpack, linalg, special from scipy._lib.six import string_types __all__ = ['boxcar', 'triang', 'parzen', 'bohman', 'blackman', 'nuttall', 'blackmanhar...
bsd-3-clause
monarch-initiative/dipper
setup.py
2
1401
#!/usr/bin/env python3 from setuptools import setup, find_packages import os import subprocess directory = os.path.dirname(os.path.abspath(__file__)) # long_description readme_path = os.path.join(directory, 'README.md') with open(readme_path) as read_file: long_description = read_file.read() setup( name='...
bsd-3-clause
peterwilletts24/Python-Scripts
plot_scripts/EMBRACE/rad_flux/plot_from_pp_2201_diff_8km.py
2
5598
""" Load pp, plot and save """ import os, sys import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcParams from mpl_toolkits.basemap import Basemap rc('font', family = '...
mit
hypergravity/bopy
bopy/spec/dataset.py
1
17097
# -*- coding: utf-8 -*- """ migrated from TheCannon package """ from __future__ import (absolute_import, division, print_function) import numpy as np import sys from corner import corner import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import rc # from astropy.table import Table f...
bsd-3-clause
caisq/tensorflow
tensorflow/contrib/losses/python/metric_learning/metric_loss_ops_test.py
41
20535
# Copyright 2017 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
rstoneback/pysat
pysat/tests/test_ssnl_plot.py
2
3184
""" tests the pysat averaging code """ import matplotlib as mpl import matplotlib.pyplot as plt import warnings import pysat from pysat.ssnl import plot class TestBasics(): def setup(self): """Runs before every method to create a clean testing setup.""" self.testInst = pysat.Instrument('pysat', '...
bsd-3-clause
droundy/deft
papers/histogram/figs/ising-N128-lndos-comparison.py
1
1853
from __future__ import division, print_function import sys, os, matplotlib import numpy as np matplotlib.rcParams['text.usetex'] = True matplotlib.rc('font', family='serif') if 'noshow' in sys.argv: matplotlib.use('Agg') import matplotlib.pyplot as plt import colors import readnew plt.figure(figsize=(5, 4)) ...
gpl-2.0
Akshay0724/scikit-learn
sklearn/covariance/tests/test_covariance.py
79
12193
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
torypages/luigi
examples/pyspark_wc.py
56
3361
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
jmmease/pandas
pandas/tests/indexing/test_callable.py
14
8721
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 import numpy as np import pandas as pd import pandas.util.testing as tm class TestIndexingCallable(object): def test_frame_loc_ix_callable(self): # GH 11485 df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': list('aabb'), ...
bsd-3-clause
benoitsteiner/tensorflow-xsmm
tensorflow/examples/learn/hdf5_classification.py
75
2899
# 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
silky/sms-tools
lectures/09-Sound-description/plots-code/mfcc.py
25
1103
import numpy as np import matplotlib.pyplot as plt import essentia.standard as ess M = 1024 N = 1024 H = 512 fs = 44100 spectrum = ess.Spectrum(size=N) window = ess.Windowing(size=M, type='hann') mfcc = ess.MFCC(numberCoefficients = 12) x = ess.MonoLoader(filename = '../../../sounds/speech-male.wav', sampleRate = fs)(...
agpl-3.0
quchunguang/test
testpy/testmatplotlib.py
1
1277
import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm def f(t): return np.exp(-t) * np.cos(2*np.pi*t) def simple_plot1(): plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() def simple_plot2(): plt.plot([1, 2, 3, 4], [1, 4, 9, 16], 'ro') plt.axis([0, 6, 0...
mit
petebachant/TurbineDAQ-project-template
Modules/processing.py
1
30074
# -*- coding: utf-8 -*- """ This module contains classes and functions for processing data. """ from __future__ import division, print_function import numpy as np from pxl import timeseries as ts from pxl.timeseries import loadhdf import matplotlib.pyplot as plt import multiprocessing as mp import scipy.stats from sci...
mit
habi/GlobalDiagnostiX
readAptinaRAW.py
1
1313
# -*- coding: utf-8 -*- """ This script reads the RAW files from the Aptina cameras as numpy arrays, ready for display or further use. Made to help Valerie Duay get up to speed :) """ import os import numpy import matplotlib.pyplot as plt Directory = '/scratch/tmp/DevWareX/MT9M001/DSL949A-NIR/' Folder = '1394629994_M...
unlicense
daniel20162016/my-first
read_xml_all/good_version_read_xml_1/read_wav_xml_good_1.py
2
2673
# -*- coding: utf-8 -*- """ Created on Mon Oct 31 15:45:22 2016 @author: wang """ from matplotlib import pylab as plt from numpy import fft, fromstring, int16, linspace import wave from good_read_xml_1 import* # open a wave file #filename = 'francois_filon_pure_1.wav' #filename_1 ='francois_filon_pure_1.xml' #word ='...
mit
tum-camp/survival-support-vector-machine
survival/svm/naive_survival_svm.py
1
6322
# 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 program is distributed in the hope that it will be useful, # bu...
gpl-3.0
eranchetz/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/units.py
70
4810
""" The classes here provide support for using custom classes with matplotlib, eg those that do not expose the array interface but know how to converter themselves to arrays. It also supoprts classes with units and units conversion. Use cases include converters for custom objects, eg a list of datetime objects, as we...
agpl-3.0
bsipocz/statsmodels
statsmodels/examples/ex_lowess.py
34
2827
# -*- coding: utf-8 -*- """ Created on Mon Oct 31 15:26:06 2011 Author: Chris Jordan Squire extracted from test suite by josef-pktd """ from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm lowess = sm.nonparametric.lowess # this is just to check dire...
bsd-3-clause
verdverm/pypge
experiments/post_process/scripts/timing_stats_05.py
1
1221
import pandas as pd import sys pgefile=sys.argv[1] df = pd.read_csv(pgefile, delim_whitespace=True) df2 = df[sys.argv[2:]] pge = df2.groupby("problem") for name, grp in pge: # print(name) # print(grp) ac_t = grp["elapsed_seconds"].iloc[2]/grp["elapsed_seconds"].iloc[0] ac_m = grp["evald_models"].iloc[2]/grp...
mit
jmetzen/scikit-learn
benchmarks/bench_covertype.py
120
7381
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
jblackburne/scikit-learn
sklearn/tests/test_multioutput.py
39
6609
import numpy as np import scipy.sparse as sp from sklearn.utils import shuffle from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regex from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing impor...
bsd-3-clause
JeremyRubin/Graffiti-codes
Graffiti-server/Processor.py
1
3841
from App import * import ast import numpy import matplotlib.pyplot as plt import datetime import scipy from scipy import signal, integrate from numpy import trapz class Processor(object): """ This class processes the data from the Phone""" def __init__(self, data): data = ast.literal_eval(data) ...
mit
dsquareindia/scikit-learn
sklearn/feature_extraction/dict_vectorizer.py
41
12562
# Authors: Lars Buitinck # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from array import array from collections import Mapping from operator import itemgetter import numpy as np import scipy.sparse as sp from ..base import BaseEstimator, TransformerMixin from ..externals import six from ..ext...
bsd-3-clause
tvaroska/autopandas
autopandas/transformers.py
1
3679
""" Collection of transformers for autopandas """ import numpy as np from sklearn.base import TransformerMixin from sklearn.preprocessing import LabelEncoder from sklearn.linear_model import LinearRegression class DataFrameImputer(TransformerMixin): """ Credits http://stackoverflow.com/a/25562948/1575066 ...
mit
Jimmy-Morzaria/scikit-learn
benchmarks/bench_multilabel_metrics.py
86
7286
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
equialgo/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
francisco-dlp/hyperspy
hyperspy/_signals/signal1d.py
1
58255
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
nesterione/scikit-learn
sklearn/cluster/tests/test_spectral.py
262
7954
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
greysAcademicCode/batch-iv-analysis
batch_iv_analysis/gui.py
1
54573
from batch_iv_analysis.batch_iv_analysis_UI import Ui_batch_iv_analysis # needed for file watching import time # for performance tuning #import cProfile, pstats, io #pr = cProfile.Profile() import math #TODO: make area editable from collections import OrderedDict from itertools import zip_longest import os, sys,...
mit
twankim/weaksemi
main_local.py
1
8601
# -*- coding: utf-8 -*- # @Author: twankim # @Date: 2017-02-24 17:46:51 # @Last Modified by: twankim # @Last Modified time: 2018-03-09 22:14:15 import numpy as np import time import sys import os import argparse import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from ssac import weakSSAC from...
mit
denis-gordeev/CNN-aggression-RU
train_tensorflow.py
1
10126
# -*- coding: UTF-8 -*- import numpy as np import pandas as pd import itertools import csv import gensim import re import nltk.data import tensorflow from nltk.tokenize import WordPunctTokenizer from collections import Counter from keras.models import Sequential, Graph from keras.layers.core import Dense, Dropout, Acti...
mit
AlmightyMegadeth00/kernel_tegra
scripts/tracing/dma-api/trace.py
96
12420
"""Main program and stuff""" #from pprint import pprint from sys import stdin import os.path import re from argparse import ArgumentParser import cPickle as pickle from collections import namedtuple from plotting import plotseries, disp_pic import smmu class TracelineParser(object): """Parse the needed informatio...
gpl-2.0
edublancas/python-ds-tools
src/dstools/util.py
2
6039
import pickle from pathlib import Path import yaml from pydoc import locate import re import collections from functools import wraps from inspect import signature, _empty, getargspec from copy import copy def isiterable(obj): try: iter(obj) except TypeError: return False else: ret...
mit
mojoboss/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/androidviewclient-13.4.0-py2.7.egg/com/dtmilano/android/plot.py
2
6871
# -*- coding: utf-8 -*- """ Copyright (C) 2012-2017 Diego Torres Milano Created on mar 11, 2017 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 U...
gpl-3.0
nmartensen/pandas
pandas/tests/indexes/datetimes/test_tools.py
1
65488
""" test to_datetime """ import sys import pytz import pytest import locale import calendar import dateutil import numpy as np from dateutil.parser import parse from datetime import datetime, date, time from distutils.version import LooseVersion import pandas as pd from pandas._libs import tslib, lib from pandas.core...
bsd-3-clause
vellamike/optimizer
optimizer/graphic.py
1
97405
import wx import sys from traceHandler import sizeError try: import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.figure import Figure except RuntimeError as re: print re sys.exit() #from inspyred.ec import anal...
lgpl-2.1
RayMick/scikit-learn
examples/covariance/plot_lw_vs_oas.py
248
2903
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotically optimal shrinkage parameter (minimizing a MSE criterion), yielding th...
bsd-3-clause
nrhine1/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
LiaoPan/scikit-learn
sklearn/metrics/pairwise.py
104
42995
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause