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
libsmelt/libsmelt
scripts/plot-ab-bench.py
1
26075
#!/usr/bin/python3 import matplotlib matplotlib.use('Agg') import sys import os import config import numpy import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import plotsetup import json import gzip import numpy as np #import topology_parser import helpers from extract_ab_bench i...
mit
tkaitchuck/nupic
external/darwin64/lib/python2.6/site-packages/matplotlib/dviread.py
69
29920
""" An experimental module for reading dvi files output by TeX. Several limitations make this not (currently) useful as a general-purpose dvi preprocessor. Interface:: dvi = Dvi(filename, 72) for page in dvi: # iterate over pages w, h, d = page.width, page.height, page.descent for x,y,font,gl...
gpl-3.0
joshloyal/scikit-learn
sklearn/decomposition/tests/test_nmf.py
28
17934
import numpy as np import scipy.sparse as sp import numbers from scipy import linalg from sklearn.decomposition import NMF, non_negative_factorization from sklearn.decomposition import nmf # For testing internals from scipy.sparse import csc_matrix from sklearn.utils.testing import assert_true from sklearn.utils.te...
bsd-3-clause
dgketchum/MT_Rsense
obspnts/obsio/providers/wrcc.py
1
17467
from ..util.humidity import calc_pressure, convert_rh_to_tdew, \ convert_rh_to_vpd, convert_rh_to_vpd_daily from .generic import ObsIO from StringIO import StringIO from calendar import monthrange from datetime import datetime from multiprocessing import Pool import numpy as np import os import pandas as pd import ...
apache-2.0
BiaDarkia/scikit-learn
sklearn/linear_model/base.py
30
21031
""" Generalized Linear models. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Vincent Michel <vincent.michel@inria.fr> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Mathieu Blond...
bsd-3-clause
benjaminy/ThreadMeasurement
BlakesWork/csv_to_graphs.py
1
4932
#!/usr/bin/env python3 ''' This generates some graphs from the csv data output by dat_to_csv.py ''' import sys, os, csv, yaml import matplotlib.pyplot as plt from overlaps import count_overlaps, pairwise_overlap_time, pairwise_time_sans_longs, time_any_overlaps, any_overlaps_sans_longs config = yaml.safe_load(open('c...
mit
saltastro/pipetools
saltslewstats.py
1
6904
################################# LICENSE ################################## # Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. # # # # Redistribu...
bsd-3-clause
zaxtax/scikit-learn
examples/applications/topics_extraction_with_nmf_lda.py
18
3891
""" ======================================================================================= Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation ======================================================================================= This is an example of applying Non-negative Matrix ...
bsd-3-clause
jonycgn/scipy
scipy/special/c_misc/struve_convergence.py
76
3725
""" Convergence regions of the expansions used in ``struve.c`` Note that for v >> z both functions tend rapidly to 0, and for v << -z, they tend to infinity. The floating-point functions over/underflow in the lower left and right corners of the figure. Figure legend ============= Red region Power series is clo...
bsd-3-clause
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/api/scatter_piecharts.py
3
1196
""" This example makes custom 'pie charts' as the markers for a scatter plotqu Thanks to Manuel Metz for the example """ import math import numpy as np import matplotlib.pyplot as plt # first define the ratios r1 = 0.2 # 20% r2 = r1 + 0.4 # 40% # define some sizes of the scatter marker sizes = [60,80,120] # ca...
gpl-2.0
kjung/scikit-learn
examples/decomposition/plot_pca_vs_fa_model_selection.py
29
4470
""" =============================================================== Model selection with Probabilistic PCA and Factor Analysis (FA) =============================================================== Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the likelihood of new data can be u...
bsd-3-clause
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/scipy/cluster/hierarchy.py
2
94437
""" ======================================================== Hierarchical clustering (:mod:`scipy.cluster.hierarchy`) ======================================================== .. currentmodule:: scipy.cluster.hierarchy These functions cut hierarchical clusterings into flat clusterings or find the roots of the forest f...
mit
uqyge/combustionML
FPV_ANN_pureResNet/data_reader.py
1
5026
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import json from sklearn import preprocessing #%% def read_csv_data(path = 'premix_data', labels = ['T','CH4','O2','CO2','CO','H2O','H2','OH','PVs']): df = pd.DataFrame() # path = 'data' for fn in os.listdir(path): #...
mit
dsm054/pandas
pandas/tests/indexes/datetimes/test_arithmetic.py
4
4190
# -*- coding: utf-8 -*- from datetime import datetime import pytest import pytz from pandas.errors import NullFrequencyError import pandas as pd from pandas import DatetimeIndex, Series, date_range import pandas.util.testing as tm class TestDatetimeIndexArithmetic(object): # ----------------------------------...
bsd-3-clause
Saran-nns/SORN
chartmann/plot_single.py
2
101253
from __future__ import division from pylab import * from scipy.optimize import curve_fit from scipy import stats import tables import sys sys.path.insert(0,"../") import utils utils.backup(__file__) from scipy.io import savemat import datetime from utils.pca import pca from mpl_toolkits.mplot3d import Axes3D from sci...
mit
davidgbe/scikit-learn
examples/calibration/plot_calibration_curve.py
225
5903
""" ============================== Probability Calibration curves ============================== When performing classification one often wants to predict not only the class label, but also the associated probability. This probability gives some kind of confidence on the prediction. This example demonstrates how to di...
bsd-3-clause
ZhiangChen/soft_arm
example_nets/DQN.py
1
7190
""" This part of code is the Deep Q Network (DQN) brain. view the tensorboard picture about this DQN structure on: https://morvanzhou.github.io/tutorials/machine-learning/reinforcement-learning/4-3-DQN3/#modification View more on my tutorial page: https://morvanzhou.github.io/tutorials/ Using: Tensorflow: r1.2 """ ...
mit
teolisitza/turtleart
ipython_histories/avagraph2.py
1
23034
Last login: Fri Mar 27 17:42:36 on ttys003 MBPro ~> ipython Python 2.7.5 (default, Mar 9 2014, 22:15:05) Type "copyright", "credits" or "license" for more information. IPython 2.3.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help ...
apache-2.0
kcompher/thunder
thunder/utils/ec2.py
3
31603
#!/usr/bin/env python """ Wrapper for the Spark EC2 launch script that additionally installs Anaconda, Thunder, and its dependencies, and optionally loads example data sets """ # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed wit...
apache-2.0
bnaul/scikit-learn
sklearn/utils/deprecation.py
3
3624
import warnings import functools __all__ = ["deprecated"] class deprecated: """Decorator to mark a function or class as deprecated. Issue a warning when the function is called/the class is instantiated and adds a warning to the docstring. The optional extra argument will be appended to the depreca...
bsd-3-clause
seckcoder/lang-learn
python/sklearn/sklearn/naive_bayes.py
1
14346
# -*- coding: utf-8 -*- """ The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These are supervised learning methods based on applying Bayes' theorem with strong (naive) feature independence assumptions. """ # Author: Vincent Michel <vincent.michel@inria.fr> # Minor fixes by Fabian Pedre...
unlicense
francois-durand/svvamp
setup.py
1
1467
#!/usr/bin/env python # -*- coding: utf-8 -*- import setuptools try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace...
gpl-3.0
Lysxia/dissemin
doc/sphinx/conf.py
1
11447
# -*- coding: utf-8 -*- # # Dissemin documentation build configuration file, created by # sphinx-quickstart on Fri Jun 12 13:30:53 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. # # ...
agpl-3.0
bavardage/statsmodels
statsmodels/stats/tests/test_statstools.py
3
5251
import numpy as np import pandas as pd from numpy.testing import assert_almost_equal from statsmodels.stats.stattools import (omni_normtest, jarque_bera, durbin_watson) from statsmodels.stats.adnorm import normal_ad #a random array, rounded to 4 decimals x = np.array([-0.1184, -1.3403, ...
bsd-3-clause
hrjn/scikit-learn
sklearn/ensemble/voting_classifier.py
19
9888
""" Soft Voting/Majority Rule classifier. This module contains a Soft Voting/Majority Rule classifier for classification estimators. """ # Authors: Sebastian Raschka <se.raschka@gmail.com>, # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator f...
bsd-3-clause
Erotemic/local
homelinks/ipython/profile_default/ipython_config.py
1
3431
# import six c = get_config() # NOQA c.InteractiveShellApp.exec_lines = [] # if six.PY2: # future_line = ( # 'from __future__ import absolute_import, division, print_function, with_statement, unicode_literals') # c.InteractiveShellApp.exec_lines.append(future_line) # # Fix sip versions # try: #...
gpl-3.0
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/series/test_replace.py
8
7896
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import numpy as np import pandas as pd import pandas.lib as lib import pandas.util.testing as tm from .common import TestData class TestSeriesReplace(TestData, tm.TestCase): _multiprocess_can_split_ = True def test_replace(self): N = 100 ser...
mit
zuku1985/scikit-learn
sklearn/linear_model/ridge.py
2
51487
""" 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
trenton3983/Data_Science_from_Scratch
code-python3/recommender_systems.py
12
6248
import math, random from collections import defaultdict, Counter from linear_algebra import dot users_interests = [ ["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"], ["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"], ["Python", "scikit-learn", "scipy", "numpy", "statsmodels", "pa...
unlicense
ky822/scikit-learn
examples/cluster/plot_affinity_propagation.py
349
2304
""" ================================================= Demo of affinity propagation clustering algorithm ================================================= Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Points", Science Feb. 2007 """ print(__doc__) from sklearn.cluster impor...
bsd-3-clause
thypad/brew
test/dataset.py
3
1583
import numpy as np import sklearn.datasets as datasets # this indices will always be used so that we get reproduceable results in the tests iris_index = np.array([ 69, 63, 32, 131, 13, 94, 10, 17, 4, 108, 29, 96, 100, 143, 20, 86, 35, 144, 78, 18, 11, 33, 72, 106, 24, 84, ...
mit
statsmodels/statsmodels.github.io
devel/plots/graphics_gofplots_qqplot.py
10
1927
# -*- coding: utf-8 -*- """ Created on Sun May 06 05:32:15 2012 Author: Josef Perktold editted by: Paul Hobson (2012-08-19) """ # example with the new ProbPlot class from matplotlib import pyplot as plt import numpy as np from scipy import stats import statsmodels.api as sm #example from docstring data = sm.datasets...
bsd-3-clause
BillMills/AutoQC
util/dbutils.py
1
8715
import io, math import numpy import pandas import sqlite3 import util.main as main def unpack_qc(value): 'unpack a qc result from the db' try: qc = numpy.load(io.BytesIO(value), allow_pickle=True) except: print('failed to unpack qc data - check db for missing entries.') qc = numpy....
mit
mavenlin/tensorflow
tensorflow/python/estimator/canned/linear_testing_utils.py
11
67872
# 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
odlgroup/dipp
examples/pytorch/haarpsi_eval.py
1
3464
"""Demonstration of the components of the HaarPSI figure of merit. This example shows the individual steps of computing the HaarPSI FOM, including comparison images. Required additional packages: - ``scipy`` to generate the example image - ``matplotlib`` to display images """ import matplotlib.pyplot as plt...
mpl-2.0
mmottahedi/neuralnilm_prototype
scripts/e512.py
2
6453
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectiona...
mit
yuxiang-zhou/deepmachine
deepmachine/contrib/training/3DMMCamera.py
1
12537
# basic library import os import shutil import math import time import menpo.io as mio import menpo3d.io as m3io import numpy as np import h5py import pandas as pd from menpo.shape import ColouredTriMesh, PointCloud from menpo.transform import Homogeneous from menpo3d.rasterize import rasterize_mesh from pathlib impor...
mit
Nyker510/scikit-learn
examples/calibration/plot_calibration_curve.py
225
5903
""" ============================== Probability Calibration curves ============================== When performing classification one often wants to predict not only the class label, but also the associated probability. This probability gives some kind of confidence on the prediction. This example demonstrates how to di...
bsd-3-clause
robclewley/DataScotties
SnakesLadders/csv_utils.py
1
1679
""" Utilities for working with CSV files representing all game move data. EXAMPLE USAGE: all_data = multi_run(game, n) save_csv(all_data, filename) all_data = load_csv(filename) ... for a given number of runs, n, and a string filename parameter. """ import pandas as pd def save_csv(all_data, filename): """Sav...
cc0-1.0
grehx/spark-tk
regression-tests/sparktkregtests/testcases/dicom/dicom_filter_keyword_test.py
1
9362
# 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
PrashntS/scikit-learn
sklearn/metrics/cluster/__init__.py
312
1322
""" The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: - supervised, which uses a ground truth class values for each sample. - unsupervised, which does not and measures the 'quality' of the model itself. """ from .supervised import ...
bsd-3-clause
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/matplotlib/tests/test_mlab.py
3
1722
import numpy as np import matplotlib.mlab as mlab import tempfile from nose.tools import raises def test_colinear_pca(): a = mlab.PCA._get_colinear() pca = mlab.PCA(a) assert(np.allclose(pca.fracs[2:], 0.)) assert(np.allclose(pca.Y[:,2:], 0.)) def test_recarray_csv_roundtrip(): expected = np.reca...
gpl-2.0
ghislainp/iris
lib/iris/tests/test_mapping.py
11
8113
# (C) British Crown Copyright 2010 - 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...
gpl-3.0
developerator/Maturaarbeit
GenerativeAdversarialNets/CelebA64 with DCGAN/CelebA64_dcgan.py
1
6815
''' By Tim Ehrensberger The base of the functions for the network's training is taken from https://github.com/Zackory/Keras-MNIST-GAN/blob/master/mnist_gan.py by Zackory Erickson The network architecture is perhaps loosely inspired by https://github.com/aleju/face-generator by Alexander Jung ''' import os import num...
mit
huzq/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
9
21205
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np import pytest from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils._testing import assert_a...
bsd-3-clause
ZenDevelopmentSystems/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
83
17276
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true from sklearn.utils.testing import assert_raises...
bsd-3-clause
IEEE-NITK/DeepNLP
Training-Sessions/Session II - Word Embeddings/word2vec/run.py
2
2166
import random import numpy as np from cs224d.data_utils import * import matplotlib.pyplot as plt from word2vec import * from sgd import * # Reset the random seed to make sure that everyone gets the same results random.seed(314) dataset = StanfordSentiment() tokens = dataset.tokens() nWords = len(tokens) # We are goi...
mit
ywcui1990/htmresearch
projects/sequence_classification/run_encoder_with_union.py
9
8995
# ---------------------------------------------------------------------- # 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
MadsJensen/RP_scripts
sk_sliding_degrees_bin.py
1
3121
import numpy as np from sklearn.externals import joblib from mne import create_info, EpochsArray from mne.decoding import GeneralizationAcrossTime from sklearn.model_selection import (StratifiedKFold) from sklearn.metrics import roc_auc_score from sklearn.linear_model import LogisticRegression import matplotlib matplo...
bsd-3-clause
bradmontgomery/ml
book/ch10/neighbors.py
21
1787
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing import numpy as np import mahotas as mh from glob import glob from features import texture, color_histogram from matplotlib import pyplot as plt from ...
mit
rderradi/AliPhysics
PWGPP/FieldParam/fitsol.py
39
8343
#!/usr/bin/env python debug = True # enable trace def trace(x): global debug if debug: print(x) trace("loading...") from itertools import combinations, combinations_with_replacement from glob import glob from math import * import operator from os.path import basename import matplotlib.pyplot as plt import numpy as...
bsd-3-clause
weissercn/MLTools
Dalitz_simplified/optimisation/bdt_complicated_base_estimator/classifier_eval_wrapper.py
1
1411
import numpy as np import math import sys sys.path.insert(0,'../..') import os import classifier_eval_simplified from sklearn import tree from sklearn.ensemble import AdaBoostClassifier # Write a function like this called 'main' def main(job_id, params): print 'Anything printed here will end up in the output dire...
mit
NMTHydro/Recharge
utils/LandFire_TAW/raster_grouping_deprecated.py
1
6028
# =============================================================================== # Copyright 2018 gabe-parrish # # 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/licen...
apache-2.0
cybernet14/scikit-learn
sklearn/feature_extraction/dict_vectorizer.py
234
12267
# 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
pySTEPS/pysteps
pysteps/tests/test_tracking_tdating.py
1
1617
# -*- coding: utf-8 -*- import numpy as np import pytest from pysteps.tracking.tdating import dating from pysteps.utils import to_reflectivity from pysteps.tests.helpers import get_precipitation_fields arg_names = ("source", "dry_input") arg_values = [ ("mch", False), ("mch", False), ("mch", True), ] ...
bsd-3-clause
yask123/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
enakai00/ml4se
scripts/07-mix_em.py
1
3089
# -*- coding: utf-8 -*- # # 混合ベルヌーイ分布による手書き文字分類 # # 2015/04/24 ver1.0 # import numpy as np import matplotlib.pyplot as plt import pandas as pd from pandas import Series, DataFrame from numpy.random import randint, rand #------------# # Parameters # #------------# K = 3 # 分類する文字数 N = 10 # 反復回数 # 分類結果の表示 def show_...
gpl-2.0
joshbohde/scikit-learn
sklearn/cross_validation.py
1
32337
"""Utilities for cross validation and performance evaluation""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD Style. from math import ceil import operator import numpy as np fro...
bsd-3-clause
hlin117/statsmodels
statsmodels/examples/ex_feasible_gls_het.py
34
4267
# -*- coding: utf-8 -*- """Examples for linear model with heteroscedasticity estimated by feasible GLS These are examples to check the results during developement. The assumptions: We have a linear model y = X*beta where the variance of an observation depends on some explanatory variable Z (`exog_var`). linear_model...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/scipy/signal/spectral.py
6
13467
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import lombscargle import warnings from scipy.lib.six import string_types __all__ = ['periodogra...
agpl-3.0
vighneshbirodkar/scikit-image
doc/examples/segmentation/plot_segmentations.py
4
5367
""" ==================================================== Comparison of segmentation and superpixel algorithms ==================================================== This example compares four popular low-level image segmentation methods. As it is difficult to obtain good segmentations, and the definition of "good" ofte...
bsd-3-clause
keiserlab/e3fp-paper
project/analysis/visualization/draw_graph.py
1
3950
"""Draw graph showing fingerprint process from shell images. Author: Seth Axen E-mail: seth.axen@gmail.com """ import os import json import sys import numpy as np from matplotlib import pyplot as plt import seaborn as sns import pygraphviz as pgv sns.set_style("white") DPI = 1200 SIZE = "11,4" if __name__ == "__m...
lgpl-3.0
Mistobaan/tensorflow
tensorflow/tools/dist_test/python/census_widendeep.py
48
11896
# 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
julienmalard/Tikon
tikon/datos/dibs.py
1
4687
import os import numpy as np import pandas as pd from matplotlib.backends.backend_agg import FigureCanvasAgg as TelaFigura from matplotlib.figure import Figure as Figura from pandas.plotting import register_matplotlib_converters from tikon.utils import EJE_PARÁMS, EJE_ESTOC, EJE_TIEMPO register_matplotlib_converters...
agpl-3.0
mne-tools/mne-tools.github.io
0.15/_downloads/plot_decoding_time_generalization_conditions.py
7
3200
""" ========================================================================= Decoding sensor space data with generalization across time and conditions ========================================================================= This example runs the analysis described in [1]_. It illustrates how one can fit a linear cla...
bsd-3-clause
cqychen/quants
quants/loaddata/skyeye_ods_classified_area.py
1
1152
#coding=utf8 import tushare as ts; import pymysql; import time as dt from datashape.coretypes import string from pandas.io.sql import SQLDatabase import sqlalchemy import datetime from sqlalchemy import create_engine from pandas.io import sql import threading import pandas as pd; import sys sys.path.append('../') #添加配...
epl-1.0
ajdawson/numpy
numpy/lib/function_base.py
3
126640
from __future__ import division, absolute_import, print_function import warnings import sys import collections import operator import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d from numpy.core.numeric import ( ones, zeros, arange, concatenate, array, asarr...
bsd-3-clause
eteq/bokeh
bokeh/charts/builder/tests/test_step_builder.py
33
2495
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
bsd-3-clause
dgwakeman/mne-python
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
dr-rodriguez/Exploring-Goodreads
explore.py
1
4366
# Script to explore the data import pickle import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from collections import Counter from nltk.corpus import stopwords from nltk.tokenize import wordpunct_tokenize from nltk.stem.porter import PorterStemmer import string from utilities import my_replaceme...
mit
L3nzian/AutoPermit
wxmpl_plus.py
1
34441
""" These are some features we've added to wxmpl (on which this code relies), such as -- 1) Simplified center mouse button events 2) allowed zoom function to be constrained to x direction only 3) allowed zoom function to be constrained to y direction only 4) cross-shaped cursor-related stuff 5) autoscaleUnzoom Some...
gpl-2.0
vortex-ape/scikit-learn
sklearn/utils/tests/test_fixes.py
7
1778
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Justin Vincent # Lars Buitinck # License: BSD 3 clause import pickle import numpy as np import pytest from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import ass...
bsd-3-clause
vzmehta/BigData2016
py/mapper_zip2.py
1
3198
#!/usr/bin/env python import csv,sys,os os.environ['MPLCONFIGDIR'] = '/tmp' import numpy from matplotlib.path import Path from rtree import index as rtree import shapefile from pyproj import Proj, transform def findNeighborhood(location, index_rtree, neighborhoods): match = index_rtree.intersection((location[0],...
mit
pratapvardhan/pandas
pandas/tests/frame/test_repr_info.py
6
17679
# -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime, timedelta import re import sys import textwrap from numpy import nan import numpy as np import pytest from pandas import (DataFrame, Series, compat, option_context, date_range, period_range, Categorical)...
bsd-3-clause
AlexanderFabisch/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
tosolveit/scikit-learn
sklearn/tests/test_kernel_ridge.py
342
3027
import numpy as np import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils.testing import ignore_warnings from sklearn.utils.testing import assert...
bsd-3-clause
mattgiguere/scikit-learn
examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py
252
3490
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================================================== Gaussian Processes classification example: exploiting the probabilistic output ============================================================================== A two-dimensional regression exerci...
bsd-3-clause
xubenben/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
Bioinformatics-Support-Unit/python-scripts
get_gipz_passengers.py
1
1047
import argparse import sys import pandas as pd def get_passengers(gipz, fasta): common5s = [] passengers = [] loops = [] dd = pd.read_table(gipz) titles = dd['pSM2c Oligo ID'] hairpins = dd['Hairpin Sequence'] for hairpin in hairpins: common5s.append(hairpin[0:18]) passenger...
mit
toobaz/pandas
pandas/tests/sparse/test_format.py
2
5759
import warnings import numpy as np import pytest from pandas.compat import is_platform_32bit, is_platform_windows import pandas as pd from pandas import option_context import pandas.util.testing as tm use_32bit_repr = is_platform_windows() or is_platform_32bit() @pytest.mark.filterwarnings("ignore:Sparse:FutureWa...
bsd-3-clause
pycomlink/pycomlink
pycomlink/processing/baseline.py
2
5480
from builtins import range import numpy as np import pandas as pd from numba import jit from .xarray_wrapper import xarray_loop_vars_over_dim ################################################ # Functions for setting the RSL baseline level # ################################################ @xarray_loop_vars_over_di...
bsd-3-clause
starsriver/ML
5/SVM Facial Recognition.py
1
3110
# -*- coding: utf-8 -*- from __future__ import print_function from time import time from sklearn.cross_validation import train_test_split from sklearn.datasets import fetch_lfw_people from sklearn.grid_search import GridSearchCV from sklearn.metrics import classification_report from sklearn.metrics import confusion_mat...
bsd-2-clause
brchiu/tensorflow
tensorflow/contrib/timeseries/examples/known_anomaly.py
24
7880
# 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
lukas/ml-class
examples/scikit/pipeline-custom-features.py
2
1497
import pandas as pd import numpy as np from sklearn.base import BaseEstimator, TransformerMixin class NumBangExtractor(BaseEstimator, TransformerMixin): def __init__(self): pass def num_bang(self, str): """Helper code to compute number of exclamation points""" return str.count('!') ...
gpl-2.0
phoenixstar7/pmtk3
python/demos/ch02/gaussPlot2Ddemo.py
7
1165
#!/usr/bin/env python import numpy as np import matplotlib.pylab as pl from mpl_toolkits.mplot3d import Axes3D def mvn2d(x, y, sigma): xx, yy = np.meshgrid(x, y) u = np.array([np.mean(x), np.mean(y)]) xy = np.c_[xx.ravel(), yy.ravel()] sigma_inv = np.linalg.inv(sigma) z = np.dot((xy - u), sigma_i...
mit
amirajdhawan/eYSIP_2015_Depth_Mapping_Kinect
Resources/Examples/Python freenect examples/demo_mp_async.py
4
1034
#!/usr/bin/env python import freenect import matplotlib.pyplot as mp import signal import frame_convert mp.ion() image_rgb = None image_depth = None keep_running = True def display_depth(dev, data, timestamp): global image_depth data = frame_convert.pretty_depth(data) mp.gray() mp.figure(1) if im...
cc0-1.0
MatthieuBizien/scikit-learn
examples/cluster/plot_ward_structured_vs_unstructured.py
320
3369
""" =========================================================== Hierarchical clustering: structured vs unstructured ward =========================================================== Example builds a swiss roll dataset and runs hierarchical clustering on their position. For more information, see :ref:`hierarchical_clus...
bsd-3-clause
joshgabriel/dft-crossfilter
benchmark-api/api/endpoints/query_api.py
1
12700
import json from flask.ext.api import status import flask as fk from api import app, API_URL, crossdomain, api_response from benchdb.common.models import Row from benchdb.common.models import Attribute import mimetypes import json import traceback import datetime import random import string import os from io import ...
mit
dharmasam9/moose-core
tests/python/mus/rc19.py
1
9791
# -*- coding: utf-8 -*- # rc19.py --- # # Filename: rc19.py # Description: # Author: Subhasis Ray # Maintainer: # Created: Sat May 24 14:10:22 2014 (+0530) # Version: # Last-Updated: # By: # Update #: 0 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: # # # # # This program is...
gpl-3.0
MortimerGoro/servo
tests/heartbeats/process_logs.py
139
16143
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import matplotlib.pyplot as plt import numpy as np import os from os import path ...
mpl-2.0
saiwing-yeung/scikit-learn
sklearn/ensemble/tests/test_iforest.py
9
6928
""" Testing for Isolation Forest algorithm (sklearn.ensemble.iforest). """ # Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.u...
bsd-3-clause
e-q/scipy
scipy/interpolate/fitpack2.py
4
73106
""" fitpack --- curve and surface fitting with splines fitpack is based on a collection of Fortran routines DIERCKX by P. Dierckx (see http://www.netlib.org/dierckx/) transformed to double routines by Pearu Peterson. """ # Created by Pearu Peterson, June,August 2003 __all__ = [ 'UnivariateSpline', 'Interpolate...
bsd-3-clause
RedhawkSDR/integration-gnuhawk
gnuradio/gr-digital/examples/example_costas.py
17
4430
#!/usr/bin/env python from gnuradio import gr, digital from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser try: import scipy except ImportError: print "Error: could not import scipy (http://www.scipy.org/)" sys.exit(1) try: import pylab excep...
gpl-3.0
sumspr/scikit-learn
examples/linear_model/plot_lasso_model_selection.py
311
5431
""" =================================================== Lasso model selection: Cross-Validation / AIC / BIC =================================================== Use the Akaike information criterion (AIC), the Bayes Information criterion (BIC) and cross-validation to select an optimal value of the regularization paramet...
bsd-3-clause
bsipocz/astropy
examples/coordinates/plot_galactocentric-frame.py
3
8006
# -*- coding: utf-8 -*- """ ======================================================================== Transforming positions and velocities to and from a Galactocentric frame ======================================================================== This document shows a few examples of how to use and customize the `~ast...
bsd-3-clause
ngoix/OCRF
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
ckuethe/gnuradio
gr-utils/python/utils/plot_data.py
59
5818
# # Copyright 2007,2008,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later ve...
gpl-3.0
tbenthompson/LMS_public
lms_code/analysis/qi_inverse.py
1
2527
import numpy as np import matplotlib.pyplot as plt import lms_code.lib.rep2 as rep2 import lms_code.plots.plot_all as lms_plot solns = rep2.load("bem_all_details_inverse1") width = 0.2 qi_gps = rep2.load('qi_gps_near_' + str(width)) # plt.plot(solns['detachment']['x'][0, :], solns['detachment']['u_soln'][0, :]) # plt....
mit
tedmeeds/tcga_encoder
tcga_encoder/analyses/kmeans_from_z_space_local_learn_survival.py
1
18008
from tcga_encoder.utils.helpers import * from tcga_encoder.data.data import * from tcga_encoder.definitions.tcga import * #from tcga_encoder.definitions.nn import * from tcga_encoder.definitions.locations import * #from tcga_encoder.algorithms import * import seaborn as sns from sklearn.manifold import TSNE, locally_li...
mit
shusenl/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