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
LuciusV/ORCA-pyPDOS
PlotPartialDOS.py
1
2508
from functions import Gaussian, dump import numpy as np import matplotlib.pyplot as plt def PlotPartialDOS(args, fig, ax, Type, SpeciesToPlot, PlotParameters, Eigenvalues, Occupations, ContributionMatrix, **kwargs): Domain = PlotParameters['Domain'] MoInEnergyRange = PlotParameters['MoInEnergyRange'] MoIn...
gpl-3.0
NiclasEriksen/py-towerwars
src/numpy/doc/creation.py
54
5503
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
cc0-1.0
ssaeger/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
228
11221
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
bsd-3-clause
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/core/computation/expressions.py
7
7864
""" Expressions ----------- Offer fast expression evaluation through numexpr """ import warnings import numpy as np from pandas.core.common import _values_from_object from pandas.core.computation import _NUMEXPR_INSTALLED from pandas.core.config import get_option if _NUMEXPR_INSTALLED: import numexpr as ne _TE...
mit
ratschlab/RGAN
RVAE/sine_generation_RVAE_concatenated_input.py
1
18775
# Targets not used, not possible to condition generated sequences import data_utils_2 import pandas as pd import numpy as np import tensorflow as tf import math, random, itertools import pickle import time import json import os import math from data_utils_2 import get_data import tensorflow as tf import numpy as np ...
mit
SheffieldML/GPy
GPy/testing/plotting_tests.py
1
21759
#=============================================================================== # Copyright (c) 2015, Max Zwiessele # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source...
bsd-3-clause
marionleborgne/nupic.research
projects/nlp/run_tm_learning.py
11
5601
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
agpl-3.0
ilyes14/scikit-learn
sklearn/neighbors/base.py
71
31147
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
bsd-3-clause
tawsifkhan/scikit-learn
benchmarks/bench_plot_nmf.py
206
5890
""" Benchmarks of Non-Negative Matrix Factorization """ from __future__ import print_function from collections import defaultdict import gc from time import time import numpy as np from scipy.linalg import norm from sklearn.decomposition.nmf import NMF, _initialize_nmf from sklearn.datasets.samples_generator import...
bsd-3-clause
jdavidrcamacho/Tests_GP
04 - Code tests/Tests.py
1
6809
# -*- coding: utf-8 -*- import Gedi as gedi import numpy as np import matplotlib.pylab as pl pl.close() ##### INITIAL DATA ########################################################### #np.random.seed(12345) x = 10 * np.sort(np.random.rand(101)) yerr = 0.2 * np.ones_like(x) y = np.sin(x) + yerr * np.random.randn(len(...
mit
GauravBh1010tt/DeepLearn
fake news challenge (FNC-1)/cnn_stop.py
1
12257
# -*- coding: utf-8 -*- import utility import warnings import numpy as np import gensim as gen from keras.preprocessing import sequence from keras.models import Sequential, Model from keras.layers import Dense, Dropout, Activation, Input, Merge from keras.layers import Embedding from keras.layers import Conv...
mit
JsNoNo/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
APPIAN-PET/APPIAN
src/qc.py
1
42641
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 mouse=a import matplotlib matplotlib.rcParams['figure.facecolor'] = '1.' matplotlib.use('Agg') import ants import numpy as np import pandas as pd import os import imageio import nipype.pipeline.engine as pe import nipype.interfaces.utility as niu import nibabel as...
mit
muendelezaji/workload-automation
wlauto/utils/doc.py
4
10459
# Copyright 2014-2015 ARM Limited # # 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 w...
apache-2.0
nlaanait/pyxrim
pyxrim/PlotLib.py
1
6186
# -*- coding: utf-8 -*- """ Created on Fri Oct 9 10:23:05 2015 @author: nouamanelaanait """ import numpy as np from matplotlib import pyplot as plt def imageGallery(n_col, n_row, Title , images, **kwargs): ''' Plots a bunch of images. num := figure num n_col := # of columns n_rows := ... titleLi...
mit
jkarnows/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
cggh/scikit-allel
allel/stats/selection.py
1
39470
# -*- coding: utf-8 -*- import multiprocessing from multiprocessing.pool import ThreadPool import numpy as np from allel.compat import memoryview_safe from allel.util import asarray_ndim, check_dim0_aligned, check_integer_dtype from allel.model.ndarray import HaplotypeArray, AlleleCountsArray from allel.stats.windo...
mit
hdmetor/scikit-learn
sklearn/feature_extraction/hashing.py
15
5727
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
bsd-3-clause
yyjiang/scikit-learn
sklearn/ensemble/weight_boosting.py
97
40773
"""Weight Boosting This module contains weight boosting estimators for both classification and regression. The module structure is the following: - The ``BaseWeightBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regression and classification only differ from each ot...
bsd-3-clause
pythonvietnam/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
tongwang01/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_functions_test.py
30
4777
# 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
m4rx9/rna-pdb-tools
rna_tools/tools/pdbs_measure_atom_dists/pdbs_measure_atom_dists.py
2
5992
#!/usr/bin/env python # -*- coding: utf-8 -*- """This is a quick and dirty method of comparison two RNA structures (stored in pdb files). It measures the distance between the relevan atoms (C4') for nucleotides defined as "x" in the sequence alignment. author: F. Stefaniak, modified by A. Zyla, supervision of mmagnu...
mit
ActiveState/code
recipes/Python/578834_Hierarchical_Clustering_Heatmap/recipe-578834.py
1
11406
""" This code was adapted from the following recipe: * http://altanalyze.blogspot.se/2012/06/hierarchical-clustering-heatmaps-in.html * http://code.activestate.com/recipes/578175/ Which was in turn inspired by many other posts: * http://stackoverflow.com/questions/7664826 * http://stackoverflow.com/quest...
mit
darylsew/potato
caffe/examples/finetune_flickr_style/assemble_data.py
38
3636
#!/usr/bin/env python """ Form a subset of the Flickr Style data, download images to dirname, and write Caffe ImagesDataLayer training file. """ import os import urllib import hashlib import argparse import numpy as np import pandas as pd from skimage import io import multiprocessing # Flickr returns a special image i...
apache-2.0
hugobowne/scikit-learn
sklearn/linear_model/bayes.py
50
16145
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
francesco-mannella/dmp-esn
parametric/parametric_dmp/bin/data/results/plot.py
18
1043
#!/usr/bin/env python import glob import numpy as np import matplotlib.pyplot as plt import os import sys pathname = os.path.dirname(sys.argv[0]) if pathname: os.chdir(pathname) n_dim = None trains = [] for fname in glob.glob("tl*"): t = np.loadtxt(fname) trains.append(t) tests = [] for fname in glob...
gpl-2.0
rew4332/tensorflow
tensorflow/examples/skflow/resnet.py
12
5640
# 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
hugobowne/scikit-learn
sklearn/linear_model/tests/test_sparse_coordinate_descent.py
34
9987
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_true from sklearn.utils.t...
bsd-3-clause
TravisCouture/GtManipulator
gtmanipulator/gtmanipulator.py
1
14359
import pandas as pd import numpy as np import operator class GtManipulator: """Class for handling Illumina iScan microarray data. Args: file (str): Filepath for file to be loaded as a DataFrame object. (default None) data (DataFrame object): Alternative to loading in data from...
mit
corburn/scikit-bio
skbio/stats/power.py
7
51714
r""" Empirical Power Estimation (:mod:`skbio.stats.power`) ===================================================== .. currentmodule:: skbio.stats.power The purpose of this module is to provide empirical, post-hoc power estimation of normally and non-normally distributed data. It also provides support to subsample data ...
bsd-3-clause
AlirezaShahabi/zipline
tests/risk/answer_key.py
39
11989
# # Copyright 2014 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 wr...
apache-2.0
ddsc/ddsc-worker
ddsc_worker/import_auth.py
1
4685
# (c) Fugro Geoservices. MIT licensed, see LICENSE.rst. from __future__ import absolute_import from uuid import UUID import logging from django.contrib.auth.models import User import pandas from ddsc_core.auth import PERMISSION_CHANGE from ddsc_core.models import Folder from ddsc_core.models import IPAddr...
mit
ikki407/stacking
examples/Santander/ikki_feat_ver1.py
1
20266
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd import numpy as np import os #os.chdir('/Users/IkkiTanaka/Documents/kaggle/Santander/') #各種PATH from stacking.base import FOLDER_NAME, PATH, INPUT_PATH, OUTPUT_PATH, ORIGINAL_TRAIN_FORMAT, SUBMIT_FORMAT #import bloscpack from datetime import date fr...
mit
zorojean/tushare
tushare/stock/reference.py
27
25190
# -*- coding:utf-8 -*- """ 投资参考数据接口 Created on 2015/03/21 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ from __future__ import division from tushare.stock import cons as ct from tushare.stock import ref_vars as rv from tushare.util import dateu as dt import pandas as pd import time i...
bsd-3-clause
jrversteegh/softsailor
deps/scipy-0.10.0b2/scipy/interpolate/ndgriddata.py
3
6229
""" Convenience interface to N-D interpolation .. versionadded:: 0.9 """ import numpy as np from interpnd import LinearNDInterpolator, NDInterpolatorBase, \ CloughTocher2DInterpolator, _ndim_coords_from_arrays from scipy.spatial import cKDTree __all__ = ['griddata', 'NearestNDInterpolator', 'LinearNDInterpolat...
gpl-3.0
hlin117/statsmodels
statsmodels/sandbox/examples/try_multiols.py
33
1243
# -*- coding: utf-8 -*- """ Created on Sun May 26 13:23:40 2013 Author: Josef Perktold, based on Enrico Giampieri's multiOLS """ #import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.sandbox.multilinear import multiOLS, multigroup data = sm.datasets.longley.load_pandas() df = data.e...
bsd-3-clause
sinhrks/scikit-learn
examples/calibration/plot_calibration_multiclass.py
272
6972
""" ================================================== Probability Calibration for 3-class classification ================================================== This example illustrates how sigmoid calibration changes predicted probabilities for a 3-class classification problem. Illustrated is the standard 2-simplex, wher...
bsd-3-clause
pombredanne/metamorphosys-desktop
metamorphosys/META/analysis_tools/PYTHON_RICARDO/output_ergonomics/scripts/ergonomics.py
1
55890
"""Perform ergonomics tests on assembly """ import logging, operator, os, sys, _winreg import numpy as np import matplotlib.pyplot as plt from matplotlib.tri import Triangulation from matplotlib.patches import Wedge from matplotlib.ticker import NullFormatter def query_analysis_tools(): analysis_too...
mit
cpcloud/dask
dask/dataframe/tests/test_format.py
1
12438
# coding: utf-8 import pandas as pd import dask.dataframe as dd def test_repr(): df = pd.DataFrame({'x': list(range(100))}) ddf = dd.from_pandas(df, 3) for x in [ddf, ddf.index, ddf.x]: assert type(x).__name__ in repr(x) assert str(x.npartitions) in repr(x) def test_repr_meta_mutation(...
bsd-3-clause
NunoEdgarGub1/scikit-learn
sklearn/covariance/graph_lasso_.py
127
25626
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
bsd-3-clause
deepakantony/sms-tools
lectures/09-Sound-description/plots-code/spectralFlux-onsetFunction.py
25
1330
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') flux = ess.Flux() onsetDetection = ess.OnsetDetection(method='hfc') x = ess.MonoLoader(filename = '../../../sounds/speech-m...
agpl-3.0
SKA-ScienceDataProcessor/algorithm-reference-library
deprecated_code/workflows/mpi/imaging-pipelines-predict-mpi.py
1
9477
# coding: utf-8 # # Pipeline processing using serial workflows. # # This is a serial unrolled version of the predict step # In[1]: #get_ipython().run_line_magic('matplotlib', 'inline') import os import sys sys.path.append(os.path.join('..', '..')) from data_models.parameters import arl_path from mpi4py import ...
apache-2.0
alberlab/alabtools
docs/conf.py
1
5369
# -*- coding: utf-8 -*- # # alabtools documentation build configuration file, created by # sphinx-quickstart on Thu Mar 23 14:06:15 2017. # # 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. # #...
gpl-3.0
treycausey/scikit-learn
sklearn/decomposition/__init__.py
11
1307
""" 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...
bsd-3-clause
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/anchored_artists.py
8
8116
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib.patches import Rectangle, Ellipse import numpy as np from matplotlib.offsetbox import AnchoredOffsetbox, AuxTransformBox, VPacker,\ TextArea, AnchoredText, DrawingArea, Annota...
mit
anewmark/galaxy_dark_matter
def_age_plots.py
1
2969
import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np import math outdir='/Users/amandanewmark/repositories/galaxy_dark_matter/lumprofplots/clumps/' def age_plot(x,y, start, end, tag=[]): #print('x spacing: ', xspace) print('x_center values: ', x) print('y values= ', y) start=np.arr...
mit
shennjia/weblte
matplot/test_subframe.py
1
6044
__author__ = 'shenojia' import pprint import re import sys import unittest import weakref import numpy as np from matplotlib.path import Path from matplotlib.patches import PathPatch import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec sys.path.insert(0, '..') from R12_36211.RE import RE from R12_362...
mit
lmd-in-learning/MachineLearning
RegressionTree/treeExplore.py
1
2311
#treeExplore.py from numpy import * from Tkinter import * import regTrees import matplotlib matplotlib.use('TkAgg') from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure def reDraw(tolS, tolN): reDraw.f.clf() reDraw.a = reDraw.f.add_subplot(111) if chkBtnVar.g...
gpl-3.0
pratapvardhan/scikit-learn
examples/svm/plot_svm_nonlinear.py
268
1091
""" ============== Non-linear SVM ============== Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a XOR of the inputs. The color map illustrates the decision function learned by the SVC. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn imp...
bsd-3-clause
mavlyutovrus/interval_index
python/graphs_2_time_individ_query_len.py
1
8416
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib from pylab import * import numpy from copy_reg import remove_extension from heapq import heappush from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA algo2index = [] def load_data(filename): all_results = ...
apache-2.0
AvengersPy/MyPairs
zipline/examples/pairtrade.py
11
4925
#!/usr/bin/env python # # Copyright 2013 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 ...
apache-2.0
YihaoLu/statsmodels
statsmodels/sandbox/rls.py
33
5179
"""Restricted least squares from pandas License: Simplified BSD """ from __future__ import print_function import numpy as np from statsmodels.regression.linear_model import WLS, GLS, RegressionResults class RLS(GLS): """ Restricted general least squares model that handles linear constraints Parameters ...
bsd-3-clause
bhargav/scikit-learn
sklearn/linear_model/tests/test_sgd.py
14
44270
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
procoder317/scikit-learn
sklearn/decomposition/dict_learning.py
104
44632
""" Dictionary learning """ from __future__ import print_function # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause import time import sys import itertools from math import sqrt, ceil import numpy as np from scipy import linalg from numpy.lib.stride_tricks import as_strided from ..b...
bsd-3-clause
warith-harchaoui/TensorflowWrappers4NeuralNetworks
conv_example.py
1
6853
""" Tensorflow Personal Toolbox for Neural Networks Convolutional Neural Network for MNIST Demo -- Warith HARCHAOUI, Astrid MERCKLING 2017 """ print(" === Convolutional Neural Network for MNIST Demo === ") import tensorflow as tf import numpy as np import math from utils import * from matplotlib import pyplot as p...
bsd-3-clause
irockafe/revo_healthcare
src/data/data_exploration.py
1
6439
import numpy as np import pandas as pd import seaborn as sns import os import matplotlib.pyplot as plt # Code to explore raw data # and get a feel for it def plot_feature_sparsity(data, class_dict=None, fxn=None, **kwargs): # data is in (samples x features) # sum all nans in each sample (true zeros) # di...
mit
tapomayukh/projects_in_python
sandbox_tapo/src/skin_related/Stiffness/calc_stiffness_all_taxels.py
1
6127
#!/usr/bin/env python import math, numpy as np #from enthought.mayavi import mlab import matplotlib.pyplot as pp import matplotlib.cm as cm import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy import tf #import hrl_lib.mayavi2_util as mu import hrl_lib.viz as hv import...
mit
jlegendary/scikit-learn
examples/cluster/plot_dict_face_patches.py
337
2747
""" Online learning of a dictionary of parts of faces ================================================== This example uses a large dataset of faces to learn a set of 20 x 20 images patches that constitute faces. From the programming standpoint, it is interesting because it shows how to use the online API of the sciki...
bsd-3-clause
arjoly/scikit-learn
sklearn/utils/tests/test_class_weight.py
90
12846
import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_blobs from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testin...
bsd-3-clause
anupam-mitra/PySpikeSort
spikesort/cluster/__init__.py
1
2703
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ${FILENAME} # # Copyright 2015 Anupam Mitra <anupam.mitra@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2...
gpl-3.0
sserrot/champion_relationships
venv/share/doc/networkx-2.4/examples/graph/plot_football.py
1
1470
#!/usr/bin/env python """ ======== Football ======== Load football network in GML format and compute some network statistcs. Shows how to download GML graph in a zipped file, unpack it, and load into a NetworkX graph. Requires Internet connection to download the URL http://www-personal.umich.edu/~mejn/netdata/footba...
mit
kylerbrown/scikit-learn
sklearn/cluster/tests/test_affinity_propagation.py
341
2620
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
bsd-3-clause
kyleabeauchamp/HMCNotes
code/correctness/old/test_hmc_correctness_ljbox_converger.py
1
2651
import lb_loader import pandas as pd import simtk.openmm.app as app import numpy as np import simtk.openmm as mm from simtk import unit as u from openmmtools import hmc_integrators, testsystems pd.set_option('display.width', 1000) collision_rate = 10000.0 / u.picoseconds sysname = "ljbox" system, positions, groups, ...
gpl-2.0
berkeley-stat222/mousestyles
doc/source/report/plots/plot_kernel_smoothing.py
3
1288
import matplotlib.pyplot as plt import numpy as np from mousestyles.distribution import (powerlaw_pdf, exp_pdf, powerlaw_inverse_cdf, exp_inverse_cdf) from mousestyles.est_power_param import (fit_powerlaw, fit_exponential, getdistance) from ...
bsd-2-clause
thesuperzapper/tensorflow
tensorflow/examples/learn/hdf5_classification.py
60
2190
# 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
legacysurvey/legacypipe
validationtests/DESIccdManera.py
2
38903
# import numpy as np import healpy as hp import astropy.io.fits as pyfits from multiprocessing import Pool import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from quicksipManera import * import fitsio ### ------------ A couple of useful conversions ----------------------- def zeropointToScale(z...
bsd-3-clause
tosolveit/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
230
2386
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset. Plot the class probabilities of the first sample in a toy dataset pred...
bsd-3-clause
mxjl620/scikit-learn
examples/linear_model/plot_sparse_recovery.py
243
7461
""" ============================================================ Sparse recovery: feature selection for sparse linear models ============================================================ Given a small number of observations, we want to recover which features of X are relevant to explain y. For this :ref:`sparse linear ...
bsd-3-clause
tomlof/scikit-learn
sklearn/tests/test_dummy.py
186
17778
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.base import clone from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_eq...
bsd-3-clause
fidelram/deepTools
deeptools/plotCorrelation.py
1
10795
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import argparse import numpy as np import matplotlib matplotlib.use('Agg') matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['svg.fonttype'] = 'none' import matplotlib.pyplot as plt from deeptools.correlation import Correlation from deeptools.parserC...
gpl-3.0
andaag/scikit-learn
sklearn/covariance/tests/test_robust_covariance.py
213
3359
# 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
TimKreienkamp/TextMiningProject
Code/deeplearning.py
1
5657
""" Created on Tue Jun 9 10:24:53 2015 @author: timkreienkamp """ ################################################################ # 0. Load Data and Libraries ################################################################ import pandas as pd import numpy as np from nltk.stem import * from h2o import * from sklea...
cc0-1.0
aabadie/scikit-learn
examples/neighbors/plot_digits_kde_sampling.py
108
2026
""" ========================= Kernel Density Estimation ========================= This example shows how kernel density estimation (KDE), a powerful non-parametric density estimation technique, can be used to learn a generative model for a dataset. With this generative model in place, new samples can be drawn. These...
bsd-3-clause
q1ang/seaborn
examples/structured_heatmap.py
24
1304
""" Discovering structure in heatmap data ===================================== _thumb: .4, .2 """ import pandas as pd import seaborn as sns sns.set(font="monospace") # Load the brain networks example dataset df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0) # Select a subset of the networks use...
bsd-3-clause
mrgloom/h2o-3
h2o-py/tests/testdir_algos/glm/pyunit_link_functions_poissonGLM.py
3
2252
import sys sys.path.insert(1, "../../../") import h2o import pandas as pd import zipfile import statsmodels.api as sm def link_functions_poisson(ip,port): print("Read in prostate data.") h2o_data = h2o.import_file(path=h2o.locate("smalldata/prostate/prostate_complete.csv.zip")) sm_data = pd.rea...
apache-2.0
NickiRom/SetList
scripts/Beats2EchoNest.py
1
2202
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> # search for EchoNest ids based on track name and duration import requests import json from json import load from pprint import pprint import urllib2 from urllib2 import urlopen import pandas as pd from pandas import * import numpy as np import urllib ...
mit
intfloat/weibo-emotion-analyzer
scripts/process_data.py
1
3689
# -*- coding: utf-8 -*- import argparse import numpy as np import cPickle from collections import defaultdict import sys, re import pandas as pd def build_data_cv(data_folder): """ Loads data """ revs = [] vocab = defaultdict(float) # idx = 0 corresponds to training data, # idx = 1 corr...
gpl-2.0
yavalvas/yav_com
build/matplotlib/examples/statistics/histogram_demo_multihist.py
7
1032
""" Demo of the histogram (hist) function with multiple data sets. Plot histogram with multiple sample sets and demonstrate: * Use of legend with multiple sample sets * Stacked bars * Step curve with a color fill * Data sets of different sample sizes """ import numpy as np import matplotlib.pyplot as ...
mit
phobson/statsmodels
statsmodels/examples/ex_generic_mle_t.py
29
10826
# -*- coding: utf-8 -*- """ Created on Wed Jul 28 08:28:04 2010 Author: josef-pktd """ from __future__ import print_function import numpy as np from scipy import stats, special import statsmodels.api as sm from statsmodels.base.model import GenericLikelihoodModel #redefine some shortcuts np_log = np.log np_pi = np...
bsd-3-clause
kgullikson88/TS23-Scripts
PlotFits.py
1
2665
import sys import itertools import matplotlib.pyplot as plt import numpy as np import FitsUtils if __name__ == "__main__": fileList = [] tellurics = False normalize = False byorder = False # Plots one order at a time pixelscale = False oneplot = False for arg in sys.argv[1:]: if...
gpl-3.0
gyanderson/SimColumn
simulation.py
1
16850
#!/usr/bin/python -tt """ Simulate a distillation """ import sys from scipy.integrate import odeint import numpy as np import matplotlib.pyplot as plt eps = sys.float_info.epsilon def Antoine(T, species): """ Find individual vapor pressure as a function of temperature. Each species has characteristic cons...
gpl-3.0
BRML/climin
climin/util.py
1
13906
# -*- coding: utf-8 -*- from __future__ import absolute_import import inspect import itertools import random import warnings import numpy as np from .gd import GradientDescent from .bfgs import Lbfgs from .cg import NonlinearConjugateGradient from .rprop import Rprop from .rmsprop import RmsProp from .adadelta impo...
bsd-3-clause
KristianJensen/cameo
cameo/config.py
1
1676
# Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU. # # 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 requi...
apache-2.0
gertingold/scipy
scipy/stats/_multivariate.py
5
121436
# # Author: Joris Vankerschaver 2013 # from __future__ import division, print_function, absolute_import import math import numpy as np from numpy import asarray_chkfinite, asarray import scipy.linalg from scipy._lib import doccer from scipy.special import gammaln, psi, multigammaln, xlogy, entr from scipy._lib._util i...
bsd-3-clause
untom/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
ssaeger/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
rcrowder/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/texmanager.py
69
16818
""" This module supports embedded TeX expressions in matplotlib via dvipng and dvips for the raster and postscript backends. The tex and dvipng/dvips information is cached in ~/.matplotlib/tex.cache for reuse between sessions Requirements: * latex * \*Agg backends: dvipng * PS backend: latex w/ psfrag, dvips, and Gh...
agpl-3.0
mfjb/scikit-learn
sklearn/datasets/lfw.py
141
19372
"""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
jorge2703/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
228
11221
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
bsd-3-clause
pranavtbhat/EE219
project2/a.py
2
1417
from sklearn.datasets import fetch_20newsgroups import matplotlib.pyplot as plt from collections import Counter def fetch_all_categories(): return [ "comp.graphics", "comp.os.ms-windows.misc", "comp.sys.ibm.pc.hardware", "comp.sys.mac.hardware" ] + [ "rec.autos", "rec...
unlicense
openstack/openstack-health
openstack_health/run_aggregator.py
1
4510
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
vdrhtc/Measurement-automation
resonator_tools/resonator_tools/calibration.py
1
4324
import numpy as np from scipy import sparse from scipy.interpolate import interp1d class calibration(object): ''' some useful tools for manual calibration ''' def normalize_zdata(self,z_data,cal_z_data): return z_data/cal_z_data def normalize_amplitude(self,z_data,cal_ampdata): return z_data/cal_ampdata ...
gpl-3.0
karstenw/nodebox-pyobjc
examples/Extended Application/sklearn/examples/covariance/plot_sparse_cov.py
1
5889
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
mit
jaeilepp/mne-python
mne/viz/tests/test_ica.py
1
10966
# Authors: Denis Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: Simplified BSD import os.path as op import warnings from numpy.testing import assert_raises, assert_equal, assert_array_equal from nose.tools import assert_true from mne import re...
bsd-3-clause
wesm/statsmodels
scikits/statsmodels/sandbox/examples/ex_cusum.py
1
3231
# -*- coding: utf-8 -*- """ Created on Fri Apr 02 11:41:25 2010 Author: josef-pktd """ import numpy as np from scipy import stats from numpy.testing import assert_almost_equal import scikits.statsmodels.api as sm from scikits.statsmodels.sandbox.regression.onewaygls import OneWayLS from scikits.statsmodels.sandbox.s...
bsd-3-clause
pklaus/brother_ql
setup.py
1
2263
# -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup try: import pypandoc LDESC = open('README.md', 'r').read() LDESC = pypandoc.convert(LDESC, 'rst', format='md') except (ImportError, IOError, RuntimeError) as e: print("Could not creat...
gpl-3.0
enricopal/STEM
src/scorer/scorer.py
1
5690
import numpy as np import pandas as pd import optparse #INPUTS: gold_standard and output file class Scorer: def __init__(self,file_name,gs): self.file_name = file_name self.gs = gs def scorer(self): file_input = open(self.file_name,'rU') #output of the algorithm gold...
apache-2.0
jlund3/ankura
ankura/validate.py
1
9962
"""Functionality for evaluating topic models""" import collections import itertools import scipy.stats import numpy as np from sklearn.linear_model import LogisticRegression class Contingency(object): """Contingency is a table which gives the multivariate frequency distribution across known (or gold) label...
gpl-3.0
fzalkow/scikit-learn
sklearn/datasets/species_distributions.py
198
7923
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
mdeff/ntds_2017
projects/reports/crunchbase_startups/helpers.py
1
13876
""" Helper functions """ from graph_tool.all import * import pandas as pd import numpy as np import matplotlib.pyplot as plt import scipy from pygsp import graphs, filters, plotting import configparser import requests from mpl_toolkits.basemap import Basemap from tqdm import tqdm credentials = configparser.ConfigPars...
mit