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
yuanming-hu/taichi
examples/tree_gravity.py
1
11571
# N-body gravity simulation in 300 lines of Taichi, tree method, no multipole, O(N log N) # Author: archibate <1931127624@qq.com>, all left reserved import taichi_glsl as tl import taichi as ti ti.init() if not hasattr(ti, 'jkl'): ti.jkl = ti.indices(1, 2, 3) kUseTree = True #kDisplay = 'tree mouse pixels cmap s...
mit
ahoyosid/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
aewhatley/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
droundy/deft
papers/fuzzy-fmt/plot-FE_vs_gw.py
1
2561
#!/usr/bin/python2 #This program creates a plot of Free Energy difference vs gw at a specified #temperature and density from data in kT*n*alldat.dat (or kT*n*alldat_tensor.dat) files #which are generated as output data files by figs/new-melting.cpp #NOTE: Run this plot script from directory deft/papers/fuzzy-fmt #w...
gpl-2.0
cybernet14/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
rohangoel96/IRCLogParser
IRCLogParser/lib/deprecated/scripts/parser-time_series.py
2
6235
#This code generates a time-series graph. Such a graph has users on the y axis and msg transmission time on x axis.This means that if there exit 4 users- A,B,C,D. #Then if any of these users send a message at time t, then we put a dot infront of that user at time t in the graph. import os.path import re import network...
mit
ZENGXH/scikit-learn
sklearn/covariance/robust_covariance.py
198
29735
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
bsd-3-clause
Ziqi-Li/bknqgis
bokeh/bokeh/plotting/tests/test_helpers.py
1
5233
import pytest from bokeh.models import ColumnDataSource from bokeh.models.ranges import Range1d, DataRange1d, FactorRange from bokeh.models.scales import LinearScale, LogScale, CategoricalScale from bokeh.plotting.helpers import _get_legend_item_label, _get_scale, _get_range, _stack def test__stack_raises_when_spec_i...
gpl-2.0
rhyolight/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_fltkagg.py
69
20839
""" A backend for FLTK Copyright: Gregory Lielens, Free Field Technologies SA and John D. Hunter 2004 This code is released under the matplotlib license """ from __future__ import division import os, sys, math import fltk as Fltk from backend_agg import FigureCanvasAgg import os.path import matplotli...
agpl-3.0
plissonf/scikit-learn
examples/classification/plot_lda.py
70
2413
""" ==================================================================== Normal and Shrinkage Linear Discriminant Analysis for classification ==================================================================== Shows how shrinkage improves classification. """ from __future__ import division import numpy as np import...
bsd-3-clause
justincassidy/scikit-learn
examples/svm/plot_rbf_parameters.py
132
8096
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radial Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
bsd-3-clause
evgchz/scikit-learn
benchmarks/bench_glmnet.py
297
3848
""" To run this, you'll need to have installed. * glmnet-python * scikit-learn (of course) Does two benchmarks First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of...
bsd-3-clause
surgebiswas/poker
PokerBots_2017/Johnny/scipy/special/add_newdocs.py
8
137472
# 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 # generate_ufuncs.py to generate the docstrings for the ufuncs in # scipy.special at the C lev...
mit
WhatDo/FlowFairy
examples/denoise_reg_mult/stages.py
1
3899
import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np import os import io from datetime import datetime import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from flowfairy.core.stage import register, Stage, stage from flowfairy.conf import settings def get_log_dir(): ...
mit
mojoboss/scikit-learn
sklearn/neighbors/classification.py
106
13987
"""Nearest Neighbor Classification""" # 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 support by ...
bsd-3-clause
joonaslomps/hiragana-ocr
code/test.py
1
20424
# import the necessary packages import argparse import datetime import imutils import time import cv2 import numpy as np from random import shuffle from matplotlib import pyplot as plt from os import listdir from os.path import isfile, join letters = ["a","i","u","e","o","ka","ki","ku","ke","ko","sa","shi","su","se","...
mit
thientu/scikit-learn
sklearn/cluster/setup.py
263
1449
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause 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 cblas_libs, blas_info = ...
bsd-3-clause
thientu/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
btabibian/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
86
1234
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
meduz/scikit-learn
sklearn/decomposition/tests/test_online_lda.py
24
14430
import numpy as np from scipy.linalg import block_diag from scipy.sparse import csr_matrix from scipy.special import psi from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d, _dirichlet_expect...
bsd-3-clause
samnashi/howdoflawsgetlonger
generator_columns_tester.py
1
10893
from __future__ import print_function import numpy as np from random import shuffle import matplotlib.pyplot as plt from keras.models import Sequential, Model from keras.utils import plot_model from keras.layers import Dense, LSTM, GRU, Flatten, Input, Reshape, TimeDistributed, Bidirectional, Dense, Dropout, \ Acti...
gpl-3.0
achim1/HErmes
HErmes/selection/dataset.py
2
29071
""" Datasets group categories together. Method calls on datasets invoke the individual methods on the individual categories. Cuts applied to datasets will act on each individual category. """ import pandas as pd import numpy as np from collections import OrderedDict from copy import deepcopy as copy from ..visual i...
gpl-2.0
alemottura/PyCAPI
uob_scripts/timeline.py
1
6159
# # timeline.py # # This code will create a timeline plot for a university year of all # assignment deadlines for all courses against key dates such as holidays # # # Things that need to be set: # # year - the university year the timeline is plotted for year = 2016 import uob_utils import ...
mit
hdzierz/Kaka
mongcore/connectors.py
1
12040
# -*- coding: utf-8 -*- # Django imports from django.db import connection, connections # import data serializers import gzip import csv import xlrd import pandas as pd import vcf # Project imports from .logger import * from .algorithms import * ############################ ## Data connectors are building on teh alg...
gpl-2.0
zetaris/zeppelin
python/src/main/resources/python/mpl_config.py
41
3653
# 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 use ...
apache-2.0
rohit21122012/DCASE2013
runs/2016/baseline32/src/dataset.py
37
78389
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import urllib2 import socket import locale import zipfile import tarfile from sklearn.cross_validation import StratifiedShuffleSplit, KFold from ui import * from general import * from files import * class Dataset(object): """Dataset base class. The sp...
mit
nickabattista/IB2d
pyIB2d/Examples/Rubberband_with_Beams/Rubberband.py
1
10247
'''------------------------------------------------------------------------- IB2d is an Immersed Boundary Code (IB) for solving fully coupled non-linear fluid-structure interaction models. This version of the code is based off of Peskin's Immersed Boundary Method Paper in Acta Numerica, 2002. Author: Nicholas A...
gpl-3.0
BiaDarkia/scikit-learn
examples/applications/wikipedia_principal_eigenvector.py
17
7819
""" =============================== Wikipedia principal eigenvector =============================== A classical way to assert the relative importance of vertices in a graph is to compute the principal eigenvector of the adjacency matrix so as to assign to each vertex the values of the components of the first eigenvect...
bsd-3-clause
henridwyer/scikit-learn
examples/cluster/plot_agglomerative_clustering.py
343
2931
""" Agglomerative clustering with and without structure =================================================== This example shows the effect of imposing a connectivity graph to capture local structure in the data. The graph is simply the graph of 20 nearest neighbors. Two consequences of imposing a connectivity can be s...
bsd-3-clause
plotly/python-api
packages/python/plotly/plotly/graph_objs/_carpet.py
1
63024
from plotly.basedatatypes import BaseTraceType as _BaseTraceType import copy as _copy class Carpet(_BaseTraceType): # class properties # -------------------- _parent_path_str = "" _path_str = "carpet" _valid_props = { "a", "a0", "aaxis", "asrc", "b", ...
mit
Soya93/Extract-Refactoring
python/helpers/pydev/pydev_ipython/matplotlibtools.py
12
5436
import sys backends = {'tk': 'TkAgg', 'gtk': 'GTKAgg', 'wx': 'WXAgg', 'qt': 'Qt4Agg', # qt3 not supported 'qt4': 'Qt4Agg', 'osx': 'MacOSX'} # We also need a reverse backends2guis mapping that will properly choose which # GUI support to activate based on the...
apache-2.0
w1kke/pylearn2
pylearn2/models/independent_multiclass_logistic.py
44
2491
""" Multiclass-classification by taking the max over a set of one-against-rest logistic classifiers. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googleg...
bsd-3-clause
thomasaarholt/hyperspy
hyperspy/tests/drawing/test_plot_signal.py
3
10437
# Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
gpl-3.0
iModels/demos
demos/ethane_box/ethane_box.py
1
2466
import os import time import matplotlib.pyplot as plt import seaborn as sns import mbuild as mb import metamds as mds import mdtraj as md def build_ethane_box(box, n_molecules, **kwargs): from mbuild.examples import Ethane ethane = Ethane() full_box = mb.fill_box(ethane, n_molecules, box) full_box.n...
mit
tillahoffmann/tensorflow
tensorflow/python/estimator/inputs/inputs.py
94
1290
# 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
mne-tools/mne-tools.github.io
0.11/_downloads/plot_ems_filtering.py
19
2981
""" ============================================== Compute effect-matched-spatial filtering (EMS) ============================================== This example computes the EMS to reconstruct the time course of the experimental effect as described in: Aaron Schurger, Sebastien Marti, and Stanislas Dehaene, "Reducing mu...
bsd-3-clause
ngoix/OCRF
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
ankurankan/scikit-learn
sklearn/metrics/setup.py
299
1024
import os import os.path import numpy from numpy.distutils.misc_util import Configuration from sklearn._build_utils import get_blas_info def configuration(parent_package="", top_path=None): config = Configuration("metrics", parent_package, top_path) cblas_libs, blas_info = get_blas_info() if os.name ==...
bsd-3-clause
birdsarah/bokeh
bokeh/mplexporter/renderers/base.py
11
14395
from __future__ import absolute_import import warnings import itertools from contextlib import contextmanager import numpy as np from matplotlib import transforms from .. import utils from .. import _py3k_compat as py3k class Renderer(object): @staticmethod def ax_zoomable(ax): return bool(ax and a...
bsd-3-clause
schets/scikit-learn
examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
jayshonzs/ESL
PropertypeMethodsAndKNN/LVQ.py
1
2783
''' Created on 2014-8-7 @author: xiajie ''' import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import simulate_data import K_means def euclidean(x1, x2): return np.linalg.norm(x1-x2) def move(center, x, eps): d = x - center center = center + eps*d def train(X, model, distance=eu...
mit
quimaguirre/diana
diana/classes/drug.py
1
51685
import os, sys, re import pickle import pandas as pd import hashlib class Drug(object): """ Class defining a Drug object """ def __init__(self, drug_name): """ @param: drug_name @pdef: Name of the drug @ptype: {String} @raises: {IncorrectTypeID} if t...
mit
gpotter2/scapy
setup.py
2
3463
#! /usr/bin/env python """ Distutils setup file for Scapy. """ try: from setuptools import setup, find_packages except: raise ImportError("setuptools is required to install scapy !") import io import os def get_long_description(): """Extract description from README.md, for PyPI's usage""" def proces...
gpl-2.0
fzenke/morla
scripts/compute_gramian.py
1
5542
#!/usr/bin/python3 from __future__ import print_function import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import numpy as np import scipy from scipy import sparse from tqdm import tqdm i...
mit
blaisb/cfdemUtilities
mixing/pca/pcaGenerator.py
2
4377
#-------------------------------------------------------------------------------------------------- # # Description : Sample program to generate random trajectories and to analyse them using PCA # # Usage : python pcaMixingRadial # # # Author : Bruno Blais # #----------------------------------------------------...
lgpl-3.0
manashmndl/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
348
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
mbaumBielefeld/popkin
popkin/visualization/placefieldvisualizer.py
1
3753
import matplotlib.pyplot as plt import numpy as np import math class PlaceFieldVisualizer: def __init__(self, fields): self.fields=fields self.n_fields=len(fields) self.callbacks={} self.callbacks_click={} self.fignum=56 fig=plt.figure(self.fignum) cid = f...
gpl-2.0
Xinglab/rmats2sashimiplot
src/MISO/misopy/sashimi_plot/plot_utils/plot_gene.py
1
33223
## ## Draw gene structure from a GFF file ## import os, sys, operator, subprocess import math import pysam import numpy as np import glob from pylab import * from matplotlib.patches import PathPatch from matplotlib.path import Path import matplotlib.cm as cm import misopy import misopy.gff_utils as gff_utils import mi...
gpl-2.0
JPFrancoia/scikit-learn
benchmarks/bench_plot_omp_lars.py
28
4471
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle regression (:ref:`least_angle_regression`) The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function import gc import sys from time import time import numpy as np from sklearn.linear_model impo...
bsd-3-clause
nathanhilbert/ulmo
ulmo/util/misc.py
3
9838
from contextlib import contextmanager import datetime import email.utils import ftplib import functools import os import re import urlparse import warnings import appdirs from lxml import etree import numpy as np import pandas import requests # pre-compiled regexes for underscore conversion first_cap_re = re.compile...
bsd-3-clause
idf/scipy_util
scipy_util/regressions/logistic_regression.py
1
1748
import numpy as np from scipy.stats import logistic import matplotlib.pyplot as plt class LogisticRegressioner(object): def __init__(self, tol=1e-6): self.tol = tol def first_derivative(self, X, Y, w): """ Calculate the 1st derivative of log-loss function """ d, T = X.s...
bsd-3-clause
studywolf/blog
tracking_control/tracking_control5.py
1
4790
""" An implementation based on the 2-link arm plant and controller from (Slotine & Sastry, 1983). """ import matplotlib.pyplot as plt import numpy as np import seaborn class plant: def __init__(self, dt=.001, theta1=[0.0, 0.0], theta2=[0.0, 0.0]): """ dt float: simulation time step th...
gpl-3.0
srgblnch/MeasuredFillingPattern
tango-ds/MeasuredFillingPatternPhCt/phAnalyser.py
1
25406
#! /usr/bin/env python # -*- coding:utf-8 -*- ############################################################################## ## license : GPLv3+ ##============================================================================ ## ## File : phAnalyser.py ## ## Project : Filling Pattern from the Photon Counter...
gpl-3.0
airanmehr/bio
Scripts/HLI/Kyrgyz/IBD.py
1
3336
import os import matplotlib as mpl import pandas as pd; import numpy as np; import seaborn as sns np.set_printoptions(linewidth=200, precision=5, suppress=True) import pandas as pd; from matplotlib.backends.backend_pdf import PdfPages pd.options.display.max_rows = 50; pd.options.display.expand_frame_repr = False i...
mit
laurensdeprez/RMPCDMD
experiments/01-single-dimer/plot_msd.py
1
1627
#!/usr/bin/env python from __future__ import print_function, division import argparse description = "Plot the mean square displacement of the dimer's center of mass." parser = argparse.ArgumentParser(description=description) parser.add_argument('file', type=str, help='H5MD datafile', nargs='+') args = parser.parse_ar...
bsd-3-clause
christopher-gillies/MultiplePhenotypeAssociationBayesianNetwork
tests/test_normal.py
1
2226
from .context import mpabn from mpabn import bayesian_network as bn import numpy as np from scipy import stats import pandas as pd from mpabn import helpers from scipy.stats import norm np.random.seed(0) """ py.test -s tests/test_normal.py """ def test_prob(): node = bn.LinearGaussianNode("X1") #set intercept...
mit
chatcannon/scipy
scipy/interpolate/ndgriddata.py
39
7457
""" Convenience interface to N-D interpolation .. versionadded:: 0.9 """ from __future__ import division, print_function, absolute_import import numpy as np from .interpnd import LinearNDInterpolator, NDInterpolatorBase, \ CloughTocher2DInterpolator, _ndim_coords_from_arrays from scipy.spatial import cKDTree _...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/neural_network/rbm.py
206
12292
"""Restricted Boltzmann Machine """ # Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca> # Vlad Niculae # Gabriel Synnaeve # Lars Buitinck # License: BSD 3 clause import time import numpy as np import scipy.sparse as sp from ..base import BaseEstimator from ..base import TransformerMixi...
bsd-3-clause
dblalock/bolt
experiments/python/datasets/caltech.py
1
2804
#!/bin/env python # from __future__ import absolute_import, division, print_function from __future__ import division, print_function import numpy as np from . import paths from . import image_utils as imgs from joblib import Memory _memory = Memory('.', verbose=1) DATADIR_101 = paths.CALTECH_101 DATADIR_256 = pat...
mpl-2.0
webmasterraj/GaSiProMo
flask/lib/python2.7/site-packages/pandas/tools/rplot.py
4
29150
import random import warnings from copy import deepcopy from pandas.core.common import _values_from_object import numpy as np from pandas.compat import range, zip # # TODO: # * Make sure legends work properly # warnings.warn("\n" "The rplot trellis plotting interface is deprecated and will be " ...
gpl-2.0
gawrysz/piernik
python/interactive_plot_crs.py
3
29896
#!/usr/bin/python # -*- coding: utf-8 -*- from colored_io import die, prtinfo, prtwarn, read_var from copy import copy from crs_h5 import crs_initialize, crs_plot_main, crs_plot_main_fpq from crs_pf import initialize_pf_arrays from math import isnan, pi import matplotlib.pyplot as plt from matplotlib.colors import LogN...
gpl-3.0
tapomayukh/projects_in_python
classification/Classification_with_kNN/Single_Contact_Classification/Scaled_Features/best_kNN_PCA/4_categories/test11_cross_validate_categories_1200ms_scaled_method_i.py
1
5041
# Principal Component Analysis Code : from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import ro...
mit
NunoEdgarGub1/scikit-learn
sklearn/decomposition/__init__.py
147
1421
""" 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 from .incrementa...
bsd-3-clause
xyguo/scikit-learn
examples/svm/plot_svm_anova.py
85
2024
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature selection before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc_...
bsd-3-clause
ibukanov/boulder
test/load-generator/latency-charter.py
3
5438
#!/usr/bin/python import matplotlib import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np import datetime import json import pandas import matplotlib import argparse import os matplotlib.style.use('ggplot') # sacrifical plot for single legend matplotlib.rcParams['figure.figsize'] = 1, 1 r...
mpl-2.0
ndingwall/scikit-learn
examples/model_selection/plot_learning_curve.py
5
7001
""" ======================== Plotting Learning Curves ======================== In the first column, first row the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can...
bsd-3-clause
sangwook236/general-development-and-testing
sw_dev/python/rnd/test/image_processing/skimage/skimage_thresholding.py
2
6105
#!/usr/bin/env python # -*- coding: UTF-8 -*- import numpy as np import skimage import skimage.filters, skimage.morphology import matplotlib import matplotlib.pyplot as plt # REF [site] >> https://scikit-image.org/docs/dev/auto_examples/segmentation/plot_thresholding.html def try_all_threshold_example(): img = skima...
gpl-2.0
Chaparqanatoos/kaggle-knowledge
src/main/python/BagOfWords.py
1
4030
#!/usr/bin/env python # Author: Angela Chapman # Date: 8/6/2014 # # This file contains code to accompany the Kaggle tutorial # "Deep learning goes to the movies". The code in this file # is for Part 1 of the tutorial on Natural Language Processing. # # *************************************** # import os from sk...
apache-2.0
bousmalis/models
autoencoder/AutoencoderRunner.py
12
1660
import numpy as np import sklearn.preprocessing as prep import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from autoencoder_models.Autoencoder import Autoencoder mnist = input_data.read_data_sets('MNIST_data', one_hot = True) def standard_scale(X_train, X_test): preprocessor = pr...
apache-2.0
chrinide/theanets
examples/recurrent-text.py
1
2017
#!/usr/bin/env python import climate import matplotlib.pyplot as plt import numpy as np import theanets import utils climate.enable_default_logging() COLORS = ['#d62728', '#1f77b4', '#2ca02c', '#9467bd', '#ff7f0e', '#e377c2', '#8c564b', '#bcbd22', '#7f7f7f', '#17becf'] URL = 'http://www.gutenberg.org/cac...
mit
google/audio-to-tactile
extras/python/phonetics/phone_model.py
1
22911
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
JJGO/Parallel-Computing
4 Homework 4/3 Testing/2 Analysis OLD/13/time_analysis.py
1
3821
from matplotlib import pyplot # from mpltools import style import prettyplotlib as ppl # from mpltools import layout # style.use('ggplot') # figsize = layout.figaspect(scale=1.2) ps = [1,2,4,6,8,12,16,24,28,30,31,32,33,34] # ps = [1,2,4,8] # ps = range(1,9) best_paths = {} best_paths[13] = [0, 9, 1, 8, 7, 2, 3, 4, 1...
gpl-2.0
NunoEdgarGub1/scikit-learn
sklearn/cluster/mean_shift_.py
106
14056
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
bsd-3-clause
eroicaleo/MachineLearningUW
course1/week2/quiz2/PredictingHousePrices.py
1
6201
# coding: utf-8 # #Fire up graphlab create # In[35]: import graphlab # #Load some house sales data # # Dataset is from house sales in King County, the region where the city of Seattle, WA is located. # In[36]: sales = graphlab.SFrame('home_data.gl/') # In[37]: sales # #Exploring the data for housing sales...
mit
bthirion/scikit-learn
examples/decomposition/plot_pca_3d.py
354
2432
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Principal components analysis (PCA) ========================================================= These figures aid in illustrating how a point cloud can be very flat in one direction--which is where PCA comes in to ch...
bsd-3-clause
fbcotter/dataset_loading
dataset_loading/tensorboard_logging.py
1
2987
"""Simple example on how to log scalars and images to tensorboard without tensor ops.""" __author__ = "Michael Gygli" import tensorflow as tf from io import StringIO import matplotlib.pyplot as plt import numpy as np class Logger(object): """Logging in tensorboard without tensorflow ops.""" def __init__(sel...
mit
ak681443/mana-deep
conv_ae/final_model.py
2
3922
from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, UpSampling2D from keras.models import Model from keras.callbacks import ModelCheckpoint, EarlyStopping ,LearningRateScheduler from keras import regularizers import tensorflow as tf tf.python.control_flow_ops = tf import os from os import listdir from...
apache-2.0
gundramleifert/exp_tf
models/lp_stn/lp_stn_v1.py
1
19610
''' Author: Tobi and Gundram ''' from __future__ import print_function from itertools import chain import tensorflow as tf from util.spatial_transformer import transformer from tensorflow.python.ops import ctc_ops as ctc from tensorflow.contrib.layers import batch_norm from tensorflow.python.ops import rnn_cell fro...
apache-2.0
matthew-tucker/mne-python
mne/viz/tests/test_topomap.py
5
6899
# 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> # # License: Simplified BSD import os.path as op import warnings import numpy as np from ...
bsd-3-clause
AOSP-S4-KK/platform_external_chromium_org
chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py
26
11131
#!/usr/bin/python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Do all the steps required to build and test against nacl.""" import optparse import os.path import re import shutil import subproc...
bsd-3-clause
MartinSavc/scikit-learn
doc/conf.py
210
8446
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # 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. ...
bsd-3-clause
Vimos/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/io/tests/test_json/test_ujson.py
5
53941
# -*- coding: utf-8 -*- from unittest import TestCase try: import json except ImportError: import simplejson as json import math import nose import platform import sys import time import datetime import calendar import re import decimal from functools import partial from pandas.compat import range, zip, Strin...
gpl-2.0
pfnet/chainercv
chainercv/visualizations/vis_bbox.py
2
5273
import numpy as np from chainercv.visualizations.vis_image import vis_image def vis_bbox(img, bbox, label=None, score=None, label_names=None, instance_colors=None, alpha=1., linewidth=3., sort_by_score=True, ax=None): """Visualize bounding boxes inside image. Example: >>> ...
mit
yyjiang/scikit-learn
examples/manifold/plot_manifold_sphere.py
258
5101
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
cuguilke/Treelogy
Treelogy_Server/Treelogy_Identifier.py
1
5673
#!/usr/bin/env python import numpy as np import pickle import sys from time import gmtime, strftime from sklearn.externals import joblib #one must change 'cuguilke' to his own username caffe_root = '/home/cuguilke/caffe/' svm_root = caffe_root + 'SVM' sys.path.insert(0, caffe_root + 'python') import caffe import os #C...
gpl-3.0
tosolveit/scikit-learn
sklearn/cluster/tests/test_dbscan.py
176
12155
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
bsd-3-clause
PrashntS/scikit-learn
sklearn/svm/tests/test_bounds.py
280
2541
import nose from nose.tools import assert_equal, assert_true from sklearn.utils.testing import clean_warning_registry import warnings import numpy as np from scipy import sparse as sp from sklearn.svm.bounds import l1_min_c from sklearn.svm import LinearSVC from sklearn.linear_model.logistic import LogisticRegression...
bsd-3-clause
uhjish/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
zooniverse/aggregation
experimental/penguins/clusterAnalysis/distance_.py
2
3492
#!/usr/bin/env python __author__ = 'greghines' import numpy as np import os import sys import cPickle as pickle import math import matplotlib.pyplot as plt import pymongo import urllib import matplotlib.cbook as cbook if os.path.exists("/home/ggdhines"): sys.path.append("/home/ggdhines/PycharmProjects/reduction/ex...
apache-2.0
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/jupyter_core/tests/dotipython_empty/profile_default/ipython_console_config.py
24
21691
# Configuration file for ipython-console. c = get_config() #------------------------------------------------------------------------------ # ZMQTerminalIPythonApp configuration #------------------------------------------------------------------------------ # ZMQTerminalIPythonApp will inherit config from: TerminalIP...
apache-2.0
timmeinhardt/ProxImaL
proximal/examples/test_noise_est.py
2
1703
# Proximal import sys sys.path.append('../../') from proximal.utils.utils import * from proximal.utils.metrics import * from proximal.lin_ops import * from proximal.prox_fns import * import cvxpy as cvx import numpy as np from scipy import ndimage import matplotlib.pyplot as plt from PIL import Image import cv2 imp...
mit
pnedunuri/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
tridesclous/tridesclous
doc/script_for_figures/generate_peeler_sequence_example.py
1
7284
""" Find a good example of collision in striatum rat dataset. """ import os,shutil from tridesclous import DataIO, CatalogueConstructor, Peeler from tridesclous import download_dataset from tridesclous.cataloguetools import apply_all_catalogue_steps from tridesclous.peeler import make_prediction_signals from tridesc...
mit
MohammedWasim/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
159
10196
import pickle import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dis...
bsd-3-clause
jlee335/cells
cells python/source_predator.py
1
8877
import math import numpy as np import random import pickle import matplotlib.pyplot as plt import threading from matplotlib.pyplot import plot, draw, ion, show import os from multiprocessing import Process maparray = np.zeros((1024,1024,1)) totalscore = 0 fitness = 0 def sigmoid(x): output = 1 / (1 + np.exp(-x))...
apache-2.0
Ambuj-UF/ConCat-1.0
src/Utils/Bio/Phylo/BaseTree.py
1
45007
# Copyright (C) 2009 by Eric Talevich (eric.talevich@gmail.com) # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Base classes for Bio.Phylo objects. All object representations for phylogenetic tree...
gpl-2.0
empeeu/numpy
doc/example.py
81
3581
"""This is the docstring for the example.py module. Modules names should have short, all-lowercase names. The module name may have underscores if this improves readability. Every module should have a docstring at the very top of the file. The module's docstring may extend over multiple lines. If your docstring doe...
bsd-3-clause
kastman/lyman
conftest.py
1
10615
import numpy as np import pandas as pd import nibabel as nib import pytest from moss import Bunch # TODO change to lyman version when implemented @pytest.fixture() def execdir(tmpdir): origdir = tmpdir.chdir() yield tmpdir origdir.chdir() @pytest.fixture() def lyman_info(tmpdir): data_dir = tmp...
bsd-3-clause
tinghuiz/learn-reflectance
caffe/python/detect.py
23
5743
#!/usr/bin/env python """ detector.py is an out-of-the-box windowed detector callable from the command line. By default it configures and runs the Caffe reference ImageNet model. Note that this model was trained for image classification and not detection, and finetuning for detection can be expected to improve results...
mit