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
AlphaDeeX/LSTM-Python
lstm_execution.py
1
2828
import numpy as np #import pandas as pd import matplotlib.pyplot as plt from lstm_class_object import LSTMPopulation import sys def normalise(signal): mu = np.mean(signal) variance = np.mean((signal - mu)**2) signal_normalised = (signal - mu)/(np.sqrt(variance + 1e-8)) return signal_normalise...
mit
jungla/ICOM-fluidity-toolbox
Detectors/offline_advection/advect_particles_C_3Dv.py
1
4066
import os, sys import myfun import numpy as np import lagrangian_stats import scipy.interpolate as interpolate import csv import matplotlib.pyplot as plt import advect_functions import fio from intergrid import Intergrid ## READ archive (too many points... somehow) # args: name, dayi, dayf, days #label = 'm_25_2_512'...
gpl-2.0
adamtiger/tensorflow
tensorflow/python/estimator/inputs/pandas_io_test.py
89
8340
# 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
axbaretto/beam
sdks/python/apache_beam/dataframe/expressions.py
1
15120
# # 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
ryfeus/lambda-packs
Spacy/source2.7/numpy/lib/polynomial.py
18
38572
""" Functions to operate on polynomials. """ from __future__ import division, absolute_import, print_function __all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd', 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d', 'polyfit', 'RankWarning'] import re import warnings import numpy.core....
mit
EnergieID/ediel
setup.py
1
2771
# -*- coding: utf-8 -*- """ A setuptools based setup module for smappy. Adapted from https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs impo...
mit
xaibeing/cn-deep-learning
face-generation/dlnd_face_generation.py
1
22781
# coding: utf-8 # # 人脸生成(Face Generation) # 在该项目中,你将使用生成式对抗网络(Generative Adversarial Nets)来生成新的人脸图像。 # ### 获取数据 # 该项目将使用以下数据集: # - MNIST # - CelebA # # 由于 CelebA 数据集比较复杂,而且这是你第一次使用 GANs。我们想让你先在 MNIST 数据集上测试你的 GANs 模型,以让你更快的评估所建立模型的性能。 # # 如果你在使用 [FloydHub](https://www.floydhub.com/), 请将 `data_dir` 设置为 "/input" 并使用 ...
mit
IEOR242-16S-Group6/IEOR242
src/Feb17_IEOR242_Harry_Python.py
1
1658
#!/usr/bin/env python # Some exploratory tests # Harry Sun # Feb 17 2016 import pandas as pd # Get the files and import to DataFrames !wget -c http://funglab.berkeley.edu/pub/tic_company_gics gics_df = pd.read_table("tic_company_gics") !wget -c funglab.berkeley.edu/pub/sec.list.txt -o sec_list.txt sec_list_df = pd.re...
bsd-3-clause
daniaki/Enrich2
enrich2/base/dataframe.py
1
11023
# Copyright 2016-2017 Alan F Rubin, Daniel Esposito # # This file is part of Enrich2. # # Enrich2 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) an...
gpl-3.0
sinhrks/pandas-ml
pandas_ml/skaccessors/covariance.py
3
1575
#!/usr/bin/env python from pandas_ml.core.accessor import _AccessorMethods class CovarianceMethods(_AccessorMethods): """ Accessor to ``sklearn.covariance``. """ _module_name = 'sklearn.covariance' def empirical_covariance(self, *args, **kwargs): """ Call ``sklearn...
bsd-3-clause
platinhom/ManualHom
Coding/Python/scipy-html-0.16.1/generated/scipy-stats-genpareto-1.py
1
1100
from scipy.stats import genpareto import matplotlib.pyplot as plt fig, ax = plt.subplots(1, 1) # Calculate a few first moments: c = 0.1 mean, var, skew, kurt = genpareto.stats(c, moments='mvsk') # Display the probability density function (``pdf``): x = np.linspace(genpareto.ppf(0.01, c), genpareto.p...
gpl-2.0
sunshineatnoon/sunshineatnoon.github.io
markdown_generator/talks.py
199
4000
# coding: utf-8 # # Talks markdown generator for academicpages # # Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i...
mit
flennerhag/mlens
mlens/estimators/tests/test_transformer.py
1
3620
"""ML-ENSEMBLE Test classes. """ import numpy as np from mlens.index import FullIndex, FoldIndex from mlens.utils.dummy import OLS, Scale from mlens.utils.exceptions import ParameterChangeWarning from mlens.testing import Data from mlens.estimators import LearnerEstimator, TransformerEstimator, LayerEnsemble from mlen...
mit
jschueller/numpy
numpy/core/code_generators/ufunc_docstrings.py
51
90047
""" Docstrings for generated ufuncs The syntax is designed to look like the function add_newdoc is being called from numpy.lib, but in this file add_newdoc puts the docstrings in a dictionary. This dictionary is used in numpy/core/code_generators/generate_umath.py to generate the docstrings for the ufuncs in numpy.co...
bsd-3-clause
kjung/scikit-learn
examples/cluster/plot_mini_batch_kmeans.py
86
4092
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
bsd-3-clause
kylerbrown/scikit-learn
examples/cluster/plot_birch_vs_minibatchkmeans.py
333
3694
""" ================================= Compare BIRCH and MiniBatchKMeans ================================= This example compares the timing of Birch (with and without the global clustering step) and MiniBatchKMeans on a synthetic dataset having 100,000 samples and 2 features generated using make_blobs. If ``n_clusters...
bsd-3-clause
lscheinkman/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt4.py
69
20664
from __future__ import division import math import os import sys import matplotlib from matplotlib import verbose from matplotlib.cbook import is_string_like, onetrue from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \ FigureManagerBase, FigureCanvasBase, NavigationToolbar2, IdleEvent, curso...
agpl-3.0
greytip/data-science-utils
datascienceutils/sklearnUtils.py
1
7274
import copy import fnmatch import numpy as np import os import pandas as pd import json from collections import defaultdict from sklearn.externals import joblib from sklearn.preprocessing import LabelEncoder, MultiLabelBinarizer, LabelBinarizer from . import settings def feature_scale_or_normalize(dataframe, col_na...
gpl-3.0
ryanfobel/dmf_control_board
pavement.py
3
6155
import os import re import subprocess as sp import sys from paver.easy import task, needs, path, sh from paver.setuputils import setup import conda_helpers as ch import path_helpers as ph import platformio_helpers as pioh import versioneer DEFAULT_ARDUINO_BOARDS = ['mega2560'] setup(name='dmf-control-board-firmwar...
gpl-3.0
SpaceKatt/CSPLN
apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/matplotlib/projections/geo.py
3
21839
import math import numpy as np import numpy.ma as ma import matplotlib rcParams = matplotlib.rcParams from matplotlib.axes import Axes from matplotlib import cbook from matplotlib.patches import Circle from matplotlib.path import Path import matplotlib.spines as mspines import matplotlib.axis as maxis from matplotlib...
gpl-3.0
AWNystrom/SparseInteraction
old/random_matrix_compare.py
1
4171
from time import time from scipy.sparse import rand from sparse_interaction import SparsePolynomialFeatures import matplotlib.pyplot as plt from sklearn.preprocessing import PolynomialFeatures from code import interact from numpy import arange, median from memory_profiler import profile import StringIO N = 1000 iters=...
apache-2.0
febert/DeepRL
easy21/sarsa_lambda_fa.py
1
5922
import cPickle import matplotlib.pyplot as plt from sklearn.metrics import mean_squared_error from math import sqrt from mpl_toolkits.mplot3d import axes3d import os os.environ["FONTCONFIG_PATH"]="/etc/fonts" # # import time # # def procedure(): # time.sleep(2.5) # # # measure process time # t0 = time.clock() #...
gpl-3.0
runawayhorse001/LearningApacheSpark
doc/code/mcmc.py
1
2389
# coding: utf-8 # In[1]: import numpy as np # In[2]: from scipy.stats import norm def rnorm(n,mean,sd): """ same functions as rnorm in r r: rnorm(n, mean=0, sd=1) py: rvs(loc=0, scale=1, size=1, random_state=None) """ return norm.rvs(loc=mean,scale=sd,size=n) def dnorm(x,mean,sd, log=Fal...
mit
wubr2000/zipline
zipline/data/ffc/loaders/us_equity_pricing.py
16
21283
# Copyright 2015 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
cloud-fan/spark
python/pyspark/pandas/typedef/string_typehints.py
15
1599
# # 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
lorenzo-desantis/mne-python
examples/inverse/plot_compute_mne_inverse_raw_in_label.py
19
1614
""" ============================================= Compute sLORETA inverse solution on raw data ============================================= Compute sLORETA inverse solution on raw dataset restricted to a brain label and stores the solution in stc files for visualisation. """ # Author: Alexandre Gramfort <alexandre.g...
bsd-3-clause
LunarLanding/Pythics
pythics/libcontrol.py
1
4477
# -*- coding: utf-8 -*- # # Copyright 2008 - 2013 Brian R. D'Urso # # This file is part of Python Instrument Control System, also known as Pythics. # # Pythics 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, e...
gpl-3.0
appapantula/scikit-learn
sklearn/linear_model/tests/test_passive_aggressive.py
121
6117
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.base import ClassifierMixin from skle...
bsd-3-clause
lamastex/scalable-data-science
db/studentProjects/07_MatthewHendtlass/054_Yuki_Katoh_GSW_Passing_Analysis.py
2
12223
# Databricks notebook source exported at Tue, 28 Jun 2016 11:17:28 UTC # MAGIC %md # MAGIC # Analyzing Golden State Warriors' passing network using GraphFrames # MAGIC # MAGIC ** This notebook is created by [Yuki Katoh](https://de.linkedin.com/in/yukiegosapporo) and is a modified version of the article originally post...
unlicense
jluttine/bayespy
doc/source/conf.py
1
11116
# -*- coding: utf-8 -*- # # BayesPy documentation build configuration file, created by # sphinx-quickstart on Mon Aug 27 12:22:11 2012. # # 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...
mit
jakirkham/bokeh
bokeh/core/json_encoder.py
3
9053
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
bsd-3-clause
shyamalschandra/copperhead
samples/mandelbrot.py
5
1382
from copperhead import * @cu def z_square(z): real, imag = z return real * real - imag * imag, 2 * real * imag @cu def z_magnitude(z): real, imag = z return sqrt(real * real + imag * imag) @cu def z_add((z0r, z0i), (z1r, z1i)): return z0r + z1r, z0i + z1i @cu def mandelbrot_iteration(z0, z, i, m...
apache-2.0
varun-invent/Autism-Connectome-Analysis
postProcessingFcVolMatchedModularDynamicPipeline.py
1
38729
# coding: utf-8 # ## Post processing: # * Global Signal Regression using orthogonalization # * Band Pass filtering 0.1 - 0.01 Hz # * Motion regression using GLM # # # In[460]: from nipype.interfaces.fsl import (BET, ExtractROI, FAST, FLIRT, ImageMaths, MCFLIRT, SliceTimer, Thres...
apache-2.0
adaptive-learning/flocs
analysis/taskInstance/flow_on_time.py
3
1278
import numpy as np import matplotlib.pyplot as plt import pandas as pd # TODO: Create infrastructure for analysis and desribe it on our wiki. def show_flow_on_time_plot(name, show, store): data = pd.read_csv('data/{name}.csv'.format(name=name)) plot_practice_session(data) if store: plt.savefig('p...
gpl-2.0
xuleiboy1234/autoTitle
tensorflow/tensorflow/examples/learn/boston.py
75
2549
# 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...
mit
magic2du/contact_matrix
Contact_maps/DeepLearning/DeepLearningTool/DL_contact_matrix_load2-new10fold_12_01_2014_server2.py
1
41830
# coding: utf-8 # In[3]: import sys, os sys.path.append('../../../libs/') import os.path import IO_class from IO_class import FileOperator from sklearn import cross_validation import sklearn import numpy as np import csv from dateutil import parser from datetime import timedelta from sklearn import svm import numpy ...
gpl-2.0
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/matplotlib/spines.py
2
21267
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import matplotlib import matplotlib.artist as martist from matplotlib.artist import allow_rasterization from matplotlib import docstring import matplotlib.transforms as mtransforms import matplotli...
mit
andaag/scikit-learn
sklearn/datasets/__init__.py
176
3671
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
neohanju/GarbageDumping
EventEncoder/legacy/test_.py
1
3267
######################################## # import requirement libraries # ######################################## from keras.models import Sequential from keras.layers import Dense, Activation from keras.layers import Flatten from keras.layers.normalization import BatchNormalization from keras.layers im...
bsd-2-clause
lbishal/scikit-learn
examples/applications/face_recognition.py
48
5691
""" =================================================== Faces recognition example using eigenfaces and SVMs =================================================== The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", aka LFW_: http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2...
bsd-3-clause
jmontoyam/mne-python
mne/decoding/tests/test_time_gen.py
3
19294
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD (3-clause) import warnings import copy import os.path as op from nose.tools import assert_equal, assert_true, assert_raises import numpy as np from numpy.testing import assert_ar...
bsd-3-clause
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/pandas/tests/scalar/test_period.py
6
50302
import pytest import numpy as np from datetime import datetime, date, timedelta import pandas as pd import pandas.util.testing as tm import pandas.core.indexes.period as period from pandas.compat import text_type, iteritems from pandas.compat.numpy import np_datetime64_compat from pandas._libs import tslib, period a...
mit
likelyzhao/mxnet
docs/conf.py
11
6195
# -*- coding: utf-8 -*- import sys, os, re, subprocess import mock from recommonmark import parser curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) libpath = os.path.join(curr_path, '../python/') sys.path.insert(0, libpath) sys.path.insert(0, curr_path) # -- mock out modules MOCK_MODULES = [...
apache-2.0
udrg/rpg_svo
svo_analysis/src/svo_analysis/analyse_trajectory.py
17
8764
#!/usr/bin/python import os import yaml import argparse import numpy as np import matplotlib.pyplot as plt import svo_analysis.tum_benchmark_tools.associate as associate import vikit_py.transformations as transformations import vikit_py.align_trajectory as align_trajectory from matplotlib import rc rc('font',**{'famil...
gpl-3.0
jmargeta/scikit-learn
doc/datasets/mldata_fixture.py
3
1205
"""Fixture module to skip the datasets loading when offline Mock urllib2 access to mldata.org """ from os import makedirs from os.path import join import numpy as np import tempfile import shutil from sklearn import datasets from sklearn.utils.testing import mock_mldata_urlopen def globs(globs): # setup mock u...
bsd-3-clause
asarnow/pyem
pyem/metadata.py
1
20458
# Copyright (C) 2017 Daniel Asarnow # University of California, San Francisco # # I/O routines in pyem. # See README file for more information. # # 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, ...
gpl-3.0
dfm/kpsf
test2.py
1
4612
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = [] import kplr import numpy as np from simplexy import simplexy import matplotlib.pyplot as pl from kpsf import TimeSeries, PSF client = kplr.API() tpf = client.k2_star(202137899).get_target_pixel_files()[0] da...
mit
vigilv/scikit-learn
examples/bicluster/bicluster_newsgroups.py
142
7183
""" ================================================================ Biclustering documents with the Spectral Co-clustering algorithm ================================================================ This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset. The 'comp.os.ms-windows...
bsd-3-clause
ssh0/growing-string
constant_length_model/constant_length.py
1
2571
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Numerical simulation of growing strings 成長する線素群のシミュレーションを行う。 以前のモデルのように自然長が時間と共に大きくなっていくようなモデルとは異なり, 自然長,バネ定数Kを一定に保ったまま,ある時間でランダムに点を1つずつ追加して いくことによって線素群の成長を記述することにする。 また,自己回避的な挙動を示すようにするために,各点ごとにポテンシャルを設けて, この範囲内に入った他の結節点に対して,斥力が働くようにする。 オイラー法または4次のルンゲクッタ法でこれを解き、matplo...
mit
paulrbrenner/GOS
examples/migration/migration.py
2
6675
import numpy as np import pandas as pd import data as data from constants import POPULATION_SCALE, MIGRATION_THRESHOLD, PROCESSES, SPLITS, BRAIN_DRAIN_THRESHOLD from gos import Globe import sys # The attributes for each agent. world_columns = ["Country", "Income", "High Income", "Employed", "Attachment", ...
apache-2.0
victorbergelin/scikit-learn
sklearn/decomposition/nmf.py
30
19208
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck <L.J.Buitinck@uva.nl> # Author: Chih-Jen Lin, National Taiwan University (original projected gradient # NMF implementation) # Author: Anthony Di Franco (original Python and NumPy port) # License: BSD 3 clause from __future__ ...
bsd-3-clause
mlperf/training_results_v0.5
v0.5.0/google/cloud_v3.8/resnet-tpuv3-8/code/resnet/model/staging/models/rough/nmt/nmt.py
2
28086
# Copyright 2017 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 applicable law or a...
apache-2.0
LamaHamadeh/Microsoft-DAT210x
Parallel_Coordinates.py
1
2124
# -*- coding: utf-8 -*- """ Spyder Editor Authot: Lama Hamadeh 28/11/2016 This file is to create a 6-D parallel coordinate chart for x=[0, 2pi] and the relations with its sin, cos, tan, exp, sqrt and sqruare values. *Still working on it!* """ import pandas as pd import math import numpy as np import m...
mit
imsparsh/librosa
librosa/feature/spectral.py
2
38170
#!/usr/bin/env python # -*- coding: utf-8 -*- """Spectral feature extraction""" import numpy as np from .. import util from .. import filters from ..util.exceptions import ParameterError from ..core.time_frequency import fft_frequencies from ..core.audio import zero_crossings from ..core.spectrum import logamplitude...
isc
schen496/auditory-hallucinations
model_tester/CNN_LSTM_scratch_Tester.py
1
3493
from __future__ import print_function import os import numpy as np from keras.models import load_model import h5py import math from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt import math from tqdm import tqdm ## This code tests the model trai...
apache-2.0
MachineLearningProject/flight-delay-prediction
app/predict.py
1
10539
from collections import defaultdict import thread import numpy as np from datetime import datetime, timedelta from dateutil.parser import parse from sklearn import preprocessing from sklearn import linear_model from sklearn import cross_validation from sklearn.ensemble import RandomForestClassifier from sklearn import...
mit
supriyagarg/pydatalab
google/datalab/contrib/mlworkbench/commands/_ml.py
2
33262
# Copyright 2017 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 applicable law or agre...
apache-2.0
evanbiederstedt/RRBSfun
epiphen/total_chr12.py
2
32998
import glob import pandas as pd import numpy as np pd.set_option('display.max_columns', 50) # print all rows import os os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files") normalB = glob.glob("binary_position_RRBS_normal_B_cell*") mcell = glob.glob("binary_position_RRBS_NormalBCD19pCD27...
mit
draperjames/bokeh
bokeh/util/serialization.py
2
8701
""" Functions for helping with serialization and deserialization of Bokeh objects. Certain NunPy array dtypes can be serialized to a binary format for performance and efficiency. The list of supported dtypes is: %s """ from __future__ import absolute_import import base64 from six import iterkeys from .dependencie...
bsd-3-clause
great-expectations/great_expectations
great_expectations/expectations/metrics/column_map_metrics/column_values_non_null.py
1
2633
from typing import Optional from great_expectations.core import ExpectationConfiguration from great_expectations.execution_engine import ( ExecutionEngine, PandasExecutionEngine, SparkDFExecutionEngine, ) from great_expectations.execution_engine.sqlalchemy_execution_engine import ( SqlAlchemyExecutionE...
apache-2.0
scienceopen/python-matlab-examples
PlotContour/contour_demo.py
1
3495
#!/usr/bin/env python """ Illustrate simple contour plotting, contours on an image with a colorbar for the contours, and labelled contours. See also contour_image.py. """ import matplotlib import numpy as np import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt matplotlib.rcParams[...
mit
arahuja/scikit-learn
examples/svm/plot_svm_margin.py
318
2328
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
muku42/seaborn
seaborn/utils.py
19
15509
"""Small plotting-related utility functions.""" from __future__ import print_function, division import colorsys import warnings import os import numpy as np from scipy import stats import pandas as pd import matplotlib.colors as mplcol import matplotlib.pyplot as plt from distutils.version import LooseVersion pandas_...
bsd-3-clause
simon-r/dr14_t.meter
dr14tmeter/lev_histogram.py
1
1499
# dr14_t.meter: compute the DR14 value of the given audiofiles # Copyright (C) 2011 - 2012 Simone Riva # # 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 # (a...
gpl-3.0
IndraVikas/scikit-learn
examples/cluster/plot_adjusted_for_chance_measures.py
286
4353
""" ========================================================== Adjustment for chance in clustering performance evaluation ========================================================== The following plots demonstrate the impact of the number of clusters and number of samples on various clustering performance evaluation me...
bsd-3-clause
bhargav/scikit-learn
sklearn/metrics/base.py
46
4627
""" Common code for all metrics """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Arnaud Joly <a.joly@ulg.ac.be> # Jochen Wersdorfer <jochen@wersdoerfer.de> # Lars Buitinck ...
bsd-3-clause
vfine/webplatform
pmModules/taskBuffer.py
1
5868
""" Invoke the PanDA Server TaskBuffer API """ # $Id: taskBuffer.py 15860 2013-06-12 22:13:47Z fine $ # Display DB status and stats from pmUtils.pmState import pmstate from pmCore.pmModule import pmRoles from pmTaskBuffer.pmTaskBuffer import pmtaskbuffer as pmt try: from pmTaskBuffer.pmTaskBuffer import pmgrislias...
lgpl-3.0
boland1992/SeisSuite
build/lib.linux-x86_64-2.7/seissuite/ant/stack.py
8
12789
# -*- coding: utf-8 -*- """ Created on Tue Aug 11 12:17:56 2015 @author: boland The following script is being used in order to explore and develop python methods for phase-stacking, and phase-weighted stacking between two seismic waveforms. Input uses one file per station waveform. Needs a minimum of two channels to...
gpl-3.0
neurospin/pylearn-epac
epac/tests/test_warm_start_methods.py
1
2149
# -*- coding: utf-8 -*- """ Created on Mon Oct 7 11:44:30 2013 @author: jinpeng.li@cea.fr """ import unittest import numpy as np from sklearn import datasets from epac import Methods from epac.workflow.splitters import WarmStartMethods from epac.tests.utils import comp_2wf_reduce_res from epac.tests.utils import com...
bsd-3-clause
laurensdeprez/RMPCDMD
scripts/h5md_plot.py
1
2375
#!/usr/bin/env python from __future__ import print_function, division import argparse parser = argparse.ArgumentParser() parser.add_argument('file', type=str, help='H5MD datafile') parser.add_argument('--obs', type=str, help='Observables to plot, e.g. \'temperature\'', nargs='+...
bsd-3-clause
tobegit3hub/deep_cnn
java_predict_client/src/main/proto/tensorflow/contrib/learn/python/learn/estimators/estimator.py
3
47786
# 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
zhenv5/scikit-learn
sklearn/externals/joblib/__init__.py
72
4795
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
XiaopeiZhang/user-timeline-tools
twitterWordCloud.py
1
1984
from os import path import matplotlib.pyplot as plt from scipy.misc import imread from wordcloud import WordCloud, STOPWORDS from np_extractor import NPExtractor import json from ConfigParser import SafeConfigParser from getUserTimeline import get_users # load config file config = SafeConfigParser() script_dir = path....
mit
cg31/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py
30
4727
# 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
MashiMaroLjc/ML-and-DM-in-action
DouBanMovie/datas.py
1
14113
#coding:utf-8 # 分析脚本 import json import glob import matplotlib.pyplot as plt import matplotlib.font_manager ZH = matplotlib.font_manager.FontProperties(fname='C:\Windows\Fonts\simsun.ttc') from queue import PriorityQueue # PATH = "data/" #载入json数据 def load_json(path:str): file_list = glob.glob(path + "*.txt") prin...
apache-2.0
YuepengGuo/backtrader
backtrader/plot/utils.py
4
2915
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
fyffyt/scikit-learn
benchmarks/bench_sample_without_replacement.py
397
8008
""" Benchmarks for sampling without replacement of integer. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import operator import matplotlib.pyplot as plt import numpy as np import random from sklearn.externals.six.moves i...
bsd-3-clause
RapidApplicationDevelopment/tensorflow
tensorflow/contrib/learn/python/learn/estimators/linear_test.py
3
60352
# 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
JonasWallin/BayesFlow
setup_KJ.py
1
2810
# -*- coding: utf-8 -*- from distutils.core import setup from distutils.extension import Extension #from Cython.Distutils import build_ext from Cython.Build import cythonize from numpy import get_include setup(name='BayesFlow', version='0.1', author='Jonas Wallin', url='', author_email='jonas.w...
gpl-2.0
ZacBlanco/ChefBoyRD
chefboyrd/controllers/model_controller.py
1
5128
'''ModelController This is a preprocessor for the prediction_controller. Given data in the form of our local models, it converts it into numbers usable by the prediction controller. ''' from peewee import Model import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit from date...
gpl-3.0
cainiaocome/scikit-learn
sklearn/linear_model/__init__.py
270
3096
""" The :mod:`sklearn.linear_model` module implements generalized linear models. It includes Ridge regression, Bayesian Regression, Lasso and Elastic Net estimators computed with Least Angle Regression and coordinate descent. It also implements Stochastic Gradient Descent related algorithms. """ # See http://scikit-le...
bsd-3-clause
nmmarquez/pymc
pymc3/glm/glm.py
2
6438
import numpy as np from pymc import * import patsy import theano import pandas as pd from collections import defaultdict from statsmodels.formula.api import glm as glm_sm import statsmodels.api as sm from pandas.tools.plotting import scatter_matrix from . import links from . import families def linear_component(formu...
apache-2.0
r-mart/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
Dapid/GPy
GPy/plotting/matplot_dep/kernel_plots.py
8
6216
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from matplotlib import pyplot as pb import Tango from matplotlib.textpath import TextPath from matplotlib.transforms import offset_copy from .base_plots import ax_default def add_bar_l...
bsd-3-clause
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/mpl_toolkits/axisartist/grid_finder.py
8
11969
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np import matplotlib.cbook as mcbook from matplotlib.transforms import Bbox from . import clip_path clip_line_to_rect = clip_path.clip_line_to_rect import matplotlib.ticker as mtick...
gpl-2.0
cxysteven/Paddle
python/paddle/v2/dataset/uci_housing.py
2
3303
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
bhargavasana/activitysim
activitysim/defaults/models/mode.py
1
3907
import os import yaml import orca import pandas as pd import yaml from activitysim import activitysim as asim from activitysim import skim as askim from .util.mode import _mode_choice_spec """ Mode choice is run for all tours to determine the transportation mode that will be used for the tour """ @orca.injectable(...
agpl-3.0
keflavich/pyspeckit-obsolete
pyspeckit/spectrum/models/hcn.py
1
5464
""" ==================== HCN Hyperfine Fitter ==================== This is an HCN fitter... ref for line params: http://www.strw.leidenuniv.nl/~moldata/datafiles/hcn@hfs.dat """ import numpy as np from .. import units from . import fitter,model,modelgrid import matplotlib.cbook as mpcb import copy try: # for model grid...
mit
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/pandas/stats/ols.py
9
40004
""" Ordinary least squares regression """ # pylint: disable-msg=W0201 from pandas.compat import zip, range, StringIO from itertools import starmap from pandas import compat import numpy as np from pandas.core.api import DataFrame, Series, isnull from pandas.core.base import StringMixin from pandas.core.common import...
apache-2.0
cuiwei0322/cost_analysis
tall_building_zero_attack_angle_cost_analysis/Result/plot_cost_stem.py
1
1229
from pylab import * import scipy.io from matplotlib.font_manager import FontProperties from scipy.interpolate import interp1d from matplotlib import rc import matplotlib.pyplot as plt rc('font',**{'family':'serif','serif':['Times New Roman'],'size':7}) mat_contents = scipy.io.loadmat('cost.mat') n_50 = mat_contents[...
apache-2.0
kiyoto/statsmodels
statsmodels/datasets/china_smoking/data.py
3
1336
"""Smoking and lung cancer in eight cities in China.""" __docformat__ = 'restructuredtext' COPYRIGHT = """Intern. J. Epidemiol. (1992)""" TITLE = __doc__ SOURCE = """ Transcribed from Z. Liu, Smoking and Lung Cancer Incidence in China, Intern. J. Epidemiol., 21:197-201, (1992). """ DESCRSHORT = """Co-o...
bsd-3-clause
bibsian/database-development
test/manual_test_dialogsession.py
1
5780
#!/usr/bin/env python import pytest import pytestqt from pandas import to_numeric from PyQt4 import QtCore, QtGui, QtWebKit import sys,os from Views import ui_mainrefactor as mw from Views import ui_dialog_session as dsess from poplerGUI import class_inputhandler as ini from poplerGUI.logiclayer import class_userfacade...
mit
aflaxman/scikit-learn
sklearn/cluster/affinity_propagation_.py
15
13973
"""Affinity Propagation clustering algorithm.""" # Author: Alexandre Gramfort alexandre.gramfort@inria.fr # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import numpy as np import warnings from sklearn.exceptions import ConvergenceWarning from ..base import BaseEstimator, ClusterMixin ...
bsd-3-clause
ndingwall/scikit-learn
sklearn/preprocessing/_encoders.py
6
32932
# Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Joris Van den Bossche <jorisvandenbossche@gmail.com> # License: BSD 3 clause import numpy as np from scipy import sparse import numbers from ..base import BaseEstimator, TransformerMixin from ..utils import check_array, is_scalar_nan from ..utils.valida...
bsd-3-clause
AIML/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
caseyclements/bokeh
examples/plotting/server/boxplot.py
42
2372
# The plot server must be running # Go to http://localhost:5006/bokeh to view this plot import numpy as np import pandas as pd from bokeh.plotting import figure, show, output_server # Generate some synthetic time series for six different categories cats = list("abcdef") data = np.random.randn(2000) g = np.random.cho...
bsd-3-clause
aburgasser/splat
splat/empirical.py
1
100089
# -*- coding: utf-8 -*- from __future__ import print_function, division """ .. note:: These are the empirical relations functions for SPLAT """ # imports: internal import copy import sys # imports - external import numpy from astropy import units as u # standard units #from astropy import const...
mit
lancezlin/ml_template_py
lib/python2.7/site-packages/matplotlib/pylab.py
8
11110
""" This is a procedural interface to the matplotlib object-oriented plotting library. The following plotting commands are provided; the majority have MATLAB |reg| [*]_ analogs and similar arguments. .. |reg| unicode:: 0xAE _Plotting commands acorr - plot the autocorrelation function annotate - annotate som...
mit
polyaxon/polyaxon
examples/in_cluster/sklearn/iris/model.py
1
1100
import joblib from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn import metrics from sklearn.datasets import load_iris def train_and_eval( n_neighbors=3, leaf_size=30, metric='minkowski', p=2, weights='uniform', test_size=0.3, ...
apache-2.0
tjhei/burnman-original
example_averaging.py
2
6557
# BurnMan - a lower mantle toolkit # Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S. # Released under GPL v2 or later. """ This example shows the effect of different averaging schemes. Currently four averaging schemes are available: 1. Voight-Reuss-Hill 2. Voight averaging 3. Reuss avera...
gpl-2.0