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
AzamYahya/shogun
examples/undocumented/python_modular/graphical/interactive_kmm_demo.py
16
12372
# # This program is free software you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation either version 3 of the License, or # (at your option) any later version. # # Written (C) 2013 Cameron Lai, based on interactive_svm_demo by Chris...
gpl-3.0
TitasNandi/Summer_Project
yodaqa/data/ml/fbpath/test_classifier.py
3
3215
#!/usr/bin/python # # Usage: fbpath_train_logistic.py TRAIN.JSON VAL.JSON [print] # # Trains and validate classifier for branched paths. The optional print parameter tells whether # to print question text, predicted paths and gold standard for branched paths or not. # The last line of output contains information about ...
apache-2.0
vortex-ape/scikit-learn
sklearn/kernel_ridge.py
12
7382
"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression.""" # Authors: Mathieu Blondel <mathieu@mblondel.org> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, RegressorMixin from .metrics.pairwise import pairwise...
bsd-3-clause
guorendong/iridium-browser-ubuntu
native_client/pnacl/driver/pnacl-ld.py
2
23962
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from driver_tools import ArchMerge, DriverChain, GetArch, \ ParseArgs, ParseTriple, RunDriver, RunWithEnv, SetArch, \ SetE...
bsd-3-clause
JoshDaly/scriptShed
separate_connected_components.py
1
4413
#!/usr/bin/env python ############################################################################### # # separate_connected_components # ############################################################################### # # # This program is ...
gpl-2.0
jlegendary/scikit-learn
sklearn/linear_model/tests/test_ransac.py
216
13290
import numpy as np from numpy.testing import assert_equal, assert_raises from numpy.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises_regexp from scipy import sparse from sklearn.utils.testing import assert_less from sklearn.linear_model import LinearRegression, RANSACRegressor f...
bsd-3-clause
massmutual/scikit-learn
examples/applications/plot_species_distribution_modeling.py
254
7434
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
huaj1101/ML-PY
SCIKIT_LEARN/plot_lasso_lars.py
363
1080
#!/usr/bin/env python """ ===================== Lasso path using LARS ===================== Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes dataset. Each color represents a different feature of the coefficient vector, and this is displayed as a function of the regulariza...
apache-2.0
schets/scikit-learn
examples/classification/plot_lda.py
164
2224
""" ==================================================================== 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
jzt5132/scikit-learn
examples/plot_multilabel.py
236
4157
# Authors: Vlad Niculae, Mathieu Blondel # License: BSD 3 clause """ ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ...
bsd-3-clause
fierval/retina
DiabeticRetinopathy/Learning/learn_boost.py
1
1310
import pandas as pd from sklearn.ensemble import AdaBoostClassifier from sklearn.tree import DecisionTreeClassifier from sklearn.cross_validation import train_test_split from kobra.tr_utils import time_now_str import numpy as np import sklearn.preprocessing as prep from sklearn import metrics sample_file = '/kaggle/re...
mit
toastedcornflakes/scikit-learn
examples/hetero_feature_union.py
4
6236
""" ============================================= Feature Union with Heterogeneous Data Sources ============================================= Datasets can often contain components of that require different feature extraction and processing pipelines. This scenario might occur when: 1. Your dataset consists of hetero...
bsd-3-clause
elkingtonmcb/scikit-learn
sklearn/metrics/cluster/unsupervised.py
230
8281
""" Unsupervised evaluation metrics. """ # Authors: Robert Layton <robertlayton@gmail.com> # # License: BSD 3 clause import numpy as np from ...utils import check_random_state from ..pairwise import pairwise_distances def silhouette_score(X, labels, metric='euclidean', sample_size=None, random...
bsd-3-clause
vshtanko/scikit-learn
examples/linear_model/plot_sgd_penalties.py
249
1563
""" ============== SGD: Penalties ============== Plot the contours of the three penalties. All of the above are supported by :class:`sklearn.linear_model.stochastic_gradient`. """ from __future__ import division print(__doc__) import numpy as np import matplotlib.pyplot as plt def l1(xs): return np.array([np....
bsd-3-clause
jplourenco/bokeh
examples/interactions/us_marriages_divorces/us_marriages_divorces_interactive.py
26
3437
# coding: utf-8 # Plotting U.S. marriage and divorce statistics # # Example code by Randal S. Olson (http://www.randalolson.com) from bokeh.plotting import figure, show, output_file, ColumnDataSource from bokeh.models import HoverTool, NumeralTickFormatter from bokeh.models import SingleIntervalTicker, LinearAxis imp...
bsd-3-clause
hitszxp/scikit-learn
examples/cluster/plot_color_quantization.py
297
3443
# -*- coding: utf-8 -*- """ ================================== Color Quantization using K-Means ================================== Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reducing the number of colors required to show the image from 96,615 unique colors to 64, while pre...
bsd-3-clause
mike-seeber/Character
code/model_step2_run9.py
1
5331
# To run on ec2 import matplotlib matplotlib.use('Agg') from keras import backend as K from keras.callbacks import EarlyStopping from keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPool2D from keras.models import Sequential from keras.preprocessing.image import ImageDataGenerator import numpy as np import os i...
mit
maxlikely/scikit-learn
examples/feature_stacker.py
8
1941
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is benefitial to combine several methods to obtain good performance. Th...
bsd-3-clause
MatthieuBizien/scikit-learn
sklearn/feature_selection/tests/test_mutual_info.py
56
6268
from __future__ import division import numpy as np from numpy.testing import run_module_suite from scipy.sparse import csr_matrix from sklearn.utils.testing import (assert_array_equal, assert_almost_equal, assert_false, assert_raises, assert_equal) from sklearn.feature_selection.mut...
bsd-3-clause
pkreissl/espresso
src/python/espressomd/visualization_opengl.py
1
115343
# Copyright (C) 2010-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 v...
gpl-3.0
lindsayberry/lindsayberry.github.io
markdown_generator/publications.py
197
3887
# coding: utf-8 # # Publications markdown generator for academicpages # # Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_g...
mit
frank-tancf/scikit-learn
sklearn/feature_selection/variance_threshold.py
123
2572
# Author: Lars Buitinck # License: 3-clause BSD import numpy as np from ..base import BaseEstimator from .base import SelectorMixin from ..utils import check_array from ..utils.sparsefuncs import mean_variance_axis from ..utils.validation import check_is_fitted class VarianceThreshold(BaseEstimator, SelectorMixin): ...
bsd-3-clause
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/matplotlib/stackplot.py
7
4266
""" Stacked area plot for 1D arrays inspired by Douglas Y'barbo's stackoverflow answer: http://stackoverflow.com/questions/2225995/how-can-i-create-stacked-line-graph-with-matplotlib (http://stackoverflow.com/users/66549/doug) """ from __future__ import (absolute_import, division, print_function, ...
apache-2.0
rolandwz/pymisc
ustrader/voters/maVoter.py
2
2157
# -*- coding: utf-8 -*- import datetime, time, csv, os import numpy as np import matplotlib.pyplot as plt from utils.db import SqliteDB from utils.rwlogging import log from utils.rwlogging import strategyLogger as logs from utils.rwlogging import balLogger as logb from indicator import ma, macd, bolling, rsi, kdj from ...
mit
zooniverse/aggregation
experimental/milkway/dbscan.py
2
4437
#!/usr/bin/env python import pymongo from sklearn.cluster import DBSCAN import matplotlib.pyplot as plt from pylab import figure, show, rand import numpy as np from sklearn.datasets.samples_generator import make_blobs from matplotlib.patches import Ellipse from copy import deepcopy __author__ = 'greghines' client = py...
apache-2.0
Totoketchup/das
utils/postprocessing/reconstruction.py
1
1631
import numpy as np from audio import istft_, create_spectrogram from sklearn.cluster import KMeans import config # Compute the reconstruction of the signal from the filtered spectrogram def reconstruct_signal(filtered_spec, orig_spec, fs=config.fs, fftsize=config.fftsize): if orig_spec != None : angle = np.angle(...
mit
annarev/tensorflow
tensorflow/python/keras/preprocessing/image.py
3
48694
# 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
gotomypc/scikit-learn
examples/model_selection/randomized_search.py
201
3214
""" ========================================================================= Comparing randomized search and grid search for hyperparameter estimation ========================================================================= Compare randomized search and grid search for optimizing hyperparameters of a random forest. ...
bsd-3-clause
evgchz/scikit-learn
sklearn/linear_model/tests/test_passive_aggressive.py
31
6147
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
terhorst/psmcpp
util/posterior_decoding.py
2
10345
#!/usr/bin/env python2.7 from __future__ import division, print_function import numpy as np import scipy.optimize import scipy.ndimage import pprint import multiprocessing import sys import itertools from collections import Counter import sys import argparse import os, os.path import logging from stepfun import StepF...
gpl-3.0
samuel1208/scikit-learn
sklearn/utils/__init__.py
132
14185
""" The :mod:`sklearn.utils` module includes various utilities. """ from collections import Sequence import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, assert_all_finite, ...
bsd-3-clause
oliverlee/sympy
examples/advanced/autowrap_ufuncify.py
45
2446
#!/usr/bin/env python """ Setup ufuncs for the legendre polynomials ----------------------------------------- This example demonstrates how you can use the ufuncify utility in SymPy to create fast, customized universal functions for use with numpy arrays. An autowrapped sympy expression can be significantly faster tha...
bsd-3-clause
jmmease/pandas
pandas/tests/plotting/test_groupby.py
7
2412
# coding: utf-8 """ Test cases for GroupBy.plot """ from pandas import Series, DataFrame import pandas.util.testing as tm import numpy as np from pandas.tests.plotting.common import TestPlotBase tm._skip_if_no_mpl() class TestDataFrameGroupByPlots(TestPlotBase): def test_series_groupby_plotting_nominally_w...
bsd-3-clause
zaxtax/scikit-learn
sklearn/tests/test_metaestimators.py
57
4958
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.pipeline import Pipeline...
bsd-3-clause
nvoron23/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
69
8605
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises...
bsd-3-clause
loretoparisi/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/legend.py
69
30705
""" Place a legend on the axes at location loc. Labels are a sequence of strings and loc can be a string or an integer specifying the legend location The location codes are 'best' : 0, (only implemented for axis legends) 'upper right' : 1, 'upper left' : 2, 'lower left' : 3, 'lower right' : 4...
agpl-3.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/mpl_axes.py
10
5045
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import warnings import matplotlib.axes as maxes from matplotlib.artist import Artist from matplotlib.axis import XAxis, YAxis class SimpleChainedObjects(object): def __init__(self, objects): ...
gpl-3.0
vibhorag/scikit-learn
examples/cluster/plot_color_quantization.py
297
3443
# -*- coding: utf-8 -*- """ ================================== Color Quantization using K-Means ================================== Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reducing the number of colors required to show the image from 96,615 unique colors to 64, while pre...
bsd-3-clause
giorgiop/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
ast0815/likelihood-machine
tests.py
2
68409
from __future__ import division import sys import unittest2 as unittest import yaml from remu.binning import * from remu.migration import * from remu.likelihood import * from remu.plotting import * from remu.matrix_utils import * from remu.likelihood_utils import * import numpy as np from numpy import array, inf import...
mit
dmytroKarataiev/MachineLearning
learning/ud120-projects/choose_your_own/your_algorithm.py
1
2647
#!/usr/bin/python import matplotlib.pyplot as plt from prep_terrain_data import makeTerrainData from class_vis import prettyPicture from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import AdaBoostClassifier features_train, labels_train, featu...
mit
SEMAFORInformatik/femagtools
docs/conf.py
1
11932
# -*- coding: utf-8 -*- # # femagtools documentation build configuration file, created by # sphinx-quickstart on Sun Dec 13 12:36:51 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
bsd-2-clause
elastic/examples
Exploring Public Datasets/nyc_restaurants/scripts/ingestRestaurantData.py
3
5504
# coding: utf-8 # In[ ]: import pandas as pd import elasticsearch import json import re import certifi # If you are using the Elastic cloud, or need https/ssl, toggle the below # commented sections. Note that the Elastic cloud may be using port 9243 # es = elasticsearch.Elasticsearch( # ['host1'], # http_...
apache-2.0
sodafree/backend
build/ipython/build/lib.linux-i686-2.7/IPython/frontend/qt/console/rich_ipython_widget.py
3
13670
#----------------------------------------------------------------------------- # Copyright (c) 2010, IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #--------------------------------------------------...
bsd-3-clause
gkno/gkno_launcher
src/networkx/readwrite/gml.py
32
11854
""" Read graphs in GML format. "GML, the G>raph Modelling Language, is our proposal for a portable file format for graphs. GML's key features are portability, simple syntax, extensibility and flexibility. A GML file consists of a hierarchical key-value lists. Graphs can be annotated with arbitrary data structures. The...
mit
alexandrebarachant/mne-python
tutorials/plot_stats_cluster_methods.py
6
8607
# doc:slow-example """ .. _tut_stats_cluster_methods: ====================================================== Permutation t-test on toy data with spatial clustering ====================================================== Following the illustrative example of Ridgway et al. 2012, this demonstrates some basic ideas behin...
bsd-3-clause
dashmoment/facerecognition
py/facerec/svm.py
1
2341
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) Philipp Wagner. All rights reserved. # Licensed under the BSD license. See LICENSE file in the project root for full license information. from facerec.classifier import SVM from facerec.validation import KFoldCrossValidation from facerec.model import Predi...
bsd-3-clause
manahl/arctic
arctic/chunkstore/date_chunker.py
1
5275
import pandas as pd from arctic.date import DateRange, to_pandas_closed_closed from ._chunker import Chunker, START, END class DateChunker(Chunker): TYPE = 'date' def to_chunks(self, df, chunk_size='D', func=None, **kwargs): """ chunks the dataframe/series by dates Parameters ...
lgpl-2.1
anntzer/scipy
scipy/stats/_stats_mstats_common.py
12
16438
import numpy as np import scipy.stats.stats from . import distributions from .._lib._bunch import _make_tuple_bunch __all__ = ['_find_repeats', 'linregress', 'theilslopes', 'siegelslopes'] # This is not a namedtuple for backwards compatibility. See PR #12983 LinregressResult = _make_tuple_bunch('LinregressResult', ...
bsd-3-clause
ThomasMiconi/nupic.research
projects/capybara/anomaly_detection/plot_results.py
9
1755
__author__ = 'mleborgne' import matplotlib.pyplot as plt import csv import os from settings import (METRICS, SENSORS, PATIENT_IDS, ANOMALY_LIKELIHOOD_THRESHOLD, MODEL_RESULTS_DIR, PLOT_RESULTS_DIR) for patie...
agpl-3.0
denimalpaca/293n
regression_berkeley.py
1
3991
import csv import sys from datetime import datetime from sklearn import svm from sklearn.ensemble import RandomForestRegressor import numpy numpy.set_printoptions(threshold=numpy.nan) data = [] target = [] num_comments_max = 0 score_max = 0 title_max = 0 gilded_max = 0 # Domain Categories school_list = {"alumni.berk...
gpl-3.0
mr3bn/DAT210x
Module4/assignment3.py
1
3450
import pandas as pd import matplotlib.pyplot as plt import matplotlib import assignment2_helper as helper from sklearn.decomposition import PCA # Look pretty... # matplotlib.style.use('ggplot') plt.style.use('ggplot') # Do * NOT * alter this line, until instructed! scaleFeatures = True # TODO: Load up the dataset ...
mit
eg-zhang/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
CameronTEllis/brainiak
tests/funcalign/test_rsrm.py
7
5042
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/nltk/parse/transitionparser.py
5
31354
# Natural Language Toolkit: Arc-Standard and Arc-eager Transition Based Parsers # # Author: Long Duong <longdt219@gmail.com> # # Copyright (C) 2001-2015 NLTK Project # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import absolute_import from __future__ import division from __future...
gpl-2.0
QuantScientist/JupyterGPUBidMach
jupyter_notebook_config.py
1
22383
# Configuration file for jupyter-notebook. #------------------------------------------------------------------------------ # Configurable configuration #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Logg...
mit
vermouthmjl/scikit-learn
benchmarks/bench_plot_svd.py
325
2899
"""Benchmarks of Singular Value Decomposition (Exact and Approximate) The data is mostly low rank but is a fat infinite tail. """ import gc from time import time import numpy as np from collections import defaultdict from scipy.linalg import svd from sklearn.utils.extmath import randomized_svd from sklearn.datasets.s...
bsd-3-clause
Achuth17/scikit-learn
sklearn/manifold/isomap.py
229
7169
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_array from ..utils.graph import...
bsd-3-clause
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/tseries/tests/test_offsets.py
2
143864
import os from datetime import date, datetime, timedelta from dateutil.relativedelta import relativedelta from pandas.compat import range, iteritems from pandas import compat import nose from nose.tools import assert_raises import numpy as np from pandas.core.datetools import ( bday, BDay, CDay, BQuarterEnd, BMo...
gpl-2.0
keflavich/fil_finder
examples/paper_figures/ks_plots.py
3
1672
# Licensed under an MIT open source license - see LICENSE ''' KS p-values for different properties. ''' import numpy as np from pandas import read_csv import matplotlib.pyplot as p import numpy as np import seaborn as sn sn.set_context('talk') sn.set_style('ticks') # sn.mpl.rc("figure", figsize=(7, 9)) # Widths wid...
mit
jenhantao/nuclearReceptorOverlap
plotThresholdSummary.py
1
2503
# given results from compareFilterThresholds.sh, produces a plot summarizing the number of peaks per factor at each threshold and the number of groups at each threshold; also accepts a mapping file to convert file names to factors ### imports ### import sys import math import matplotlib matplotlib.use('Agg') import m...
mit
MJuddBooth/pandas
pandas/tests/arrays/categorical/test_analytics.py
1
11988
# -*- coding: utf-8 -*- import sys import numpy as np import pytest from pandas.compat import PYPY from pandas import Categorical, Index, Series from pandas.api.types import is_scalar import pandas.util.testing as tm class TestCategoricalAnalytics(object): def test_min_max(self): # unordered cats ha...
bsd-3-clause
ppizarror/Hero-of-Antair
bin/pympler/classtracker_stats.py
1
27299
""" Provide saving, loading and presenting gathered `ClassTracker` statistics. """ from copy import deepcopy import os import sys from pympler.asizeof import Asized from pympler.util.compat import pickle from pympler.util.stringutils import trunc, pp, pp_timestamp __all__ = ["Stats", "ConsoleStats", "HtmlStats"] ...
gpl-2.0
pradyu1993/scikit-learn
examples/plot_roc_crossval.py
4
2035
""" ============================================================= Receiver operating characteristic (ROC) with cross validation ============================================================= Example of Receiver operating characteristic (ROC) metric to evaluate the quality of the output of a classifier using cross-valid...
bsd-3-clause
jseabold/statsmodels
statsmodels/tsa/arima/estimators/yule_walker.py
5
2517
""" Yule-Walker method for estimating AR(p) model parameters. Author: Chad Fulton License: BSD-3 """ from statsmodels.compat.pandas import deprecate_kwarg from statsmodels.regression import linear_model from statsmodels.tools.tools import Bunch from statsmodels.tsa.arima.params import SARIMAXParams from statsmodels.t...
bsd-3-clause
fredhusser/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
farhaanbukhsh/sympy
sympy/plotting/plot.py
55
64797
"""Plotting module for Sympy. A plot is represented by the ``Plot`` class that contains a reference to the backend and a list of the data series to be plotted. The data series are instances of classes meant to simplify getting points and meshes from sympy expressions. ``plot_backends`` is a dictionary with all the bac...
bsd-3-clause
hardingnj/xpclr
xpclr/util.py
1
5388
import pandas as pd import allel import numpy as np import logging logger = logging.getLogger(__name__) # FUNCTIONS def load_hdf5_data(hdf5_fn, chrom, s1, s2, gdistkey=None): import hdf5 samples1 = get_sample_ids(s1) samples2 = get_sample_ids(s2) samples_x = h5py.File(hdf5_fn)[chrom]["samples"][:] ...
mit
Miiha/FilmAnalyzerKit
analyzer/shot_detection.py
1
12581
import glob import math import os import shlex import subprocess from os.path import join from pprint import pprint from shutil import copy2 from statistics import mean import cv2 import matplotlib.pyplot as plt import numpy as np from scipy.spatial import distance as dist from tqdm import tqdm from analyzer import p...
mit
bavardage/statsmodels
statsmodels/graphics/plot_grids.py
4
5667
'''create scatterplot with confidence ellipsis Author: Josef Perktold License: BSD-3 TODO: update script to use sharex, sharey, and visible=False see http://www.scipy.org/Cookbook/Matplotlib/Multiple_Subplots_with_One_Axis_Label for sharex I need to have the ax of the last_row when editing the earlier row...
bsd-3-clause
sdh11/gnuradio
gr-fec/python/fec/polar/channel_construction_awgn.py
7
8712
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation, Inc. # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is...
gpl-3.0
jamesblunt/sympy
examples/intermediate/sample.py
107
3494
""" Utility functions for plotting sympy functions. See examples\mplot2d.py and examples\mplot3d.py for usable 2d and 3d graphing functions using matplotlib. """ from sympy.core.sympify import sympify, SympifyError from sympy.external import import_module np = import_module('numpy') def sample2d(f, x_args): """ ...
bsd-3-clause
jmschrei/scikit-learn
sklearn/datasets/tests/test_samples_generator.py
181
15664
from __future__ import division from collections import defaultdict from functools import partial import numpy as np import scipy.sparse as sp from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing imp...
bsd-3-clause
andaag/scikit-learn
sklearn/decomposition/tests/test_nmf.py
130
6059
import numpy as np from scipy import linalg from sklearn.decomposition import nmf from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import raises from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_gr...
bsd-3-clause
evature/android
EvaSDK/evasdk/src/main/jni/webrtc/modules/audio_coding/audio_network_adaptor/parse_ana_dump.py
9
4718
#!/usr/bin/python2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All...
mit
mwv/scikit-learn
sklearn/feature_extraction/tests/test_text.py
110
34127
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
bsd-3-clause
ibis-project/ibis
ibis/backends/parquet/__init__.py
1
3026
from typing import Optional import pyarrow as pa import pyarrow.parquet as pq import regex as re from pkg_resources import parse_version import ibis.expr.datatypes as dt import ibis.expr.operations as ops import ibis.expr.schema as sch import ibis.expr.types as ir from ibis.backends.base import BaseBackend from ibis....
apache-2.0
usnistgov/SimpleFactory
Analysis/SimpleFactoryHistogram.py
1
5726
# -*- coding: utf-8 -*- #Created on Wed Jul 20 10:15:07 2016 #@author: nmc1 #*** Occasionally (<0.1%), client time subtracted shifts decimal places? (e.g. turns from 1469131829 to 14691); Only when buffer overflows & messages dump all at once #Inputting a multiple of 7 uses suggested values ##########################...
mit
wanggang3333/scikit-learn
sklearn/tests/test_base.py
216
7045
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing impo...
bsd-3-clause
abhitopia/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimators_test.py
37
5114
# 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
jhayworth/config
.emacs.d/elpy/rpc-venv/lib/python2.7/site-packages/jedi/api/completion.py
2
23715
import re from textwrap import dedent from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines from jedi._compatibility import Parameter from jedi import debug from jedi import settings from jedi.api import classes from je...
gpl-3.0
kevin-kaixu/grass_pytorch
python2/dynamicplot.py
1
1311
from __future__ import absolute_import import matplotlib.pyplot as plt from itertools import izip class DynamicPlot(object): def __init__(self, title, xdata, ydata): if len(xdata) == 0: return plt.ion() self.fig = plt.figure() self.ax = self.fig.add_subplot(111) ...
apache-2.0
e-koch/TurbuStat
Examples/paper_plots/test_fBM_wavelet_normalization.py
2
1754
''' Make a plot of Wavelets with and without normalization ''' # from turbustat.data_reduction import Mask_and_Moments from turbustat.statistics import Wavelet from turbustat.simulator import make_extended import astropy.io.fits as fits import matplotlib.pyplot as plt import astropy.units as u import seaborn as sb ...
mit
sssllliang/edx-analytics-pipeline
edx/analytics/tasks/reports/tests/test_total_enrollments.py
1
11337
"""Tests for Total Users and Enrollment report.""" import datetime import textwrap from StringIO import StringIO import luigi import luigi.hdfs from mock import MagicMock from numpy import isnan import pandas from edx.analytics.tasks.user_registrations import UserRegistrationsPerDay from edx.analytics.tasks.reports....
agpl-3.0
rohit21122012/DCASE2013
runs/2016/dnn2016med_traps/traps2/src/evaluation.py
56
43426
#!/usr/bin/env python # -*- coding: utf-8 -*- import math import numpy import sys from sklearn import metrics class DCASE2016_SceneClassification_Metrics(): """DCASE 2016 scene classification metrics Examples -------- >>> dcase2016_scene_metric = DCASE2016_SceneClassification_Metrics(class_lis...
mit
beepee14/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
jonwright/ImageD11
sandbox/ev78/integrate_them.py
1
14573
#!/usr/bin/python from __future__ import print_function import sys #sys.path.append('/users/wright/software/lib/python') import os, time, fabio, numpy import pyFAI print(pyFAI.__file__) SOLID_ANGLE = True #print "PATH:", sys.path from pyFAI.azimuthalIntegrator import AzimuthalIntegrator class darkflood(object): ...
gpl-2.0
wenhuchen/ETHZ-Bootstrapped-Captioning
visual-concepts/eval.py
1
11962
from __future__ import division from _init_paths import * import os import os.path as osp import sg_utils as utils import numpy as np import skimage.io import skimage.transform import h5py import pickle import json import math import argparse import time import cv2 from collections import Counter from json import encod...
bsd-3-clause
siutanwong/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
aselle/tensorflow
tensorflow/contrib/timeseries/examples/predict.py
69
5579
# 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
akhilaananthram/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py
70
9051
from __future__ import division """ backend_wxagg.py A wxPython backend for Agg. This uses the GUI widgets written by Jeremy O'Donoghue (jeremy@o-donoghue.com) and the Agg backend by John Hunter (jdhunter@ace.bsd.uchicago.edu) Copyright (C) 2003-5 Jeremy O'Donoghue, John Hunter, Illinois Institute of Technolo...
agpl-3.0
ZhuangER/hackerrank_solution
python/Laptop-Battery-Life/Laptop_Battery_Life.py
1
1028
# Enter your code here. Read input from STDIN. Print output to STDOUT import sys data = float(sys.stdin.readline()) # Enter your code here import numpy as np training_data = np.genfromtxt('trainingdata.txt', delimiter=',') #data preprocessing features = training_data[:,0] targets = training_data[:,1] maximum_battery...
mit
fabianp/scikit-learn
benchmarks/bench_plot_svd.py
325
2899
"""Benchmarks of Singular Value Decomposition (Exact and Approximate) The data is mostly low rank but is a fat infinite tail. """ import gc from time import time import numpy as np from collections import defaultdict from scipy.linalg import svd from sklearn.utils.extmath import randomized_svd from sklearn.datasets.s...
bsd-3-clause
KjongLehmann/m53
libs/viz.py
1
2586
import matplotlib matplotlib.use('AGG') import matplotlib.pyplot as plt import scipy as sp import pdb def plotBias(vals, fn_plot, myidx, logScale = False, refname = 'TCGA'): iqr = ( (sp.percentile(vals[~myidx],75) - sp.percentile(vals[~myidx],25) ) * 1.5) iqr2 = ( (sp.percentile(vals[myidx],75) - sp.pe...
mit
dvornikita/blitznet
training.py
1
14424
#!/usr/bin/env python3 from config import get_logging_config, args, train_dir from config import config as net_config import time import os import sys import socket import logging import logging.config import subprocess import tensorflow as tf import numpy as np import matplotlib matplotlib.use('Agg') from vgg imp...
mit
losonczylab/Zaremba_NatNeurosci_2017
losonczy_analysis_bundle/lab/analysis/calc_activity.py
1
26015
import numpy as np import pandas as pd from scipy.integrate import trapz from itertools import count, izip import cPickle as pkl # import imaging_analysis as ia from ..classes.interval import Interval, ImagingInterval def calc_activity( experiment, method, interval=None, dF='from_file', channel='Ch2', ...
mit
huongttlan/seaborn
seaborn/tests/test_matrix.py
4
32492
import itertools import tempfile import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd from scipy.spatial import distance from scipy.cluster import hierarchy import nose.tools as nt import numpy.testing as npt import pandas.util.testing as pdt from numpy.testing.decorators im...
bsd-3-clause
Joukahainen/trading-with-python
lib/cboe.py
76
4433
# -*- coding: utf-8 -*- """ toolset working with cboe data @author: Jev Kuznetsov Licence: BSD """ from datetime import datetime, date import urllib2 from pandas import DataFrame, Index from pandas.core import datetools import numpy as np import pandas as pd def monthCode(month): """ perfo...
bsd-3-clause
aetilley/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
andrespires/python-buildpack
cf_spec/fixtures/miniconda_simple_app_python_2/app.py
12
2078
from flask import Flask import pytest import os import importlib import sys MODULE_NAMES = ['numpy', 'scipy', 'sklearn', 'pandas'] modules = {} for m in MODULE_NAMES: try: modules[m] = importlib.import_module(m) except ImportError: modules[m] = None app = Flask(__name__) @app.route('/<modul...
mit