repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
WangWenjun559/Weiss | summary/sumy/sklearn/datasets/tests/test_lfw.py | 230 | 7880 | """This test for the LFW require medium-size data dowloading and processing
If the data has not been already downloaded by running the examples,
the tests won't run (skipped).
If the test are run, the first execution will be long (typically a bit
more than a couple of minutes) but as the dataset loader is leveraging
... | apache-2.0 |
nuclear-wizard/moose | test/tests/variables/fe_hermite_convergence/plot.py | 12 | 1471 | #!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | lgpl-2.1 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/scipy/interpolate/fitpack2.py | 8 | 61876 | """
fitpack --- curve and surface fitting with splines
fitpack is based on a collection of Fortran routines DIERCKX
by P. Dierckx (see http://www.netlib.org/dierckx/) transformed
to double routines by Pearu Peterson.
"""
# Created by Pearu Peterson, June,August 2003
from __future__ import division, print_function, abs... | mit |
donbright/piliko | experiment/bernoulli/pythbern_leaf.py | 1 | 1366 | from fractions import Fraction as Fract
import sys
# rational paramterization / approximation of bernoulli's lemniscate
# traditional form: ( x^2 + y^2 ) ^2 = 2*( x^2 - y^2 )
# chromogeometry form:
# x = (blueq/redq) / blueq( blueq/redq, greenq/redq )
# y = (greenq/redq) / blueq( blueq/redq, greenq/redq )
# where q =... | bsd-3-clause |
nguy/artview | docs/sphinxext/numpydoc/docscrape_sphinx.py | 3 | 8249 | from __future__ import division, absolute_import, print_function
import re, inspect, textwrap, pydoc
import sphinx
import collections
from .docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('u... | bsd-3-clause |
MechCoder/scikit-learn | sklearn/metrics/setup.py | 69 | 1061 | 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 |
masterkeywikz/seq2graph | src/theanets-0.6.1/examples/utils.py | 2 | 3867 | import climate
import pickle
import gzip
import numpy as np
import os
import tempfile
logging = climate.get_logger(__name__)
climate.enable_default_logging()
try:
import matplotlib.pyplot as plt
except ImportError:
logging.critical('please install matplotlib to run the examples!')
raise
try:
import ... | mit |
rahul-c1/scikit-learn | examples/cluster/plot_dbscan.py | 346 | 2479 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn... | bsd-3-clause |
pythonvietnam/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 162 | 9771 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises_regexp
... | bsd-3-clause |
djgagne/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 234 | 9928 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
mtbc/openmicroscopy | components/tools/OmeroPy/src/omero/install/perf_test.py | 5 | 11697 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Add: screen/plate
# Add: plotting
#
import re
import os
import Ice
import sys
import path
import time
import omero
import logging
import optparse
import fileinput
import omero.cli
import omero.util
import omero.util.temp_files
import omero_ext.uuid as uuid # see tick... | gpl-2.0 |
tntnatbry/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 5 | 69097 | # 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 |
mihail911/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/font_manager.py | 69 | 42655 | """
A module for finding, managing, and using fonts across platforms.
This module provides a single :class:`FontManager` instance that can
be shared across backends and platforms. The :func:`findfont`
function returns the best TrueType (TTF) font file in the local or
system font path that matches the specified :class... | gpl-3.0 |
NvanAdrichem/networkx | examples/drawing/sampson.py | 8 | 1383 | #!/usr/bin/env python
"""
Sampson's monastery data.
Shows how to read data from a zip file and plot multiple frames.
"""
# Author: Aric Hagberg (hagberg@lanl.gov)
# Copyright (C) 2010-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rig... | bsd-3-clause |
CGATOxford/CGATPipelines | obsolete/pipeline_annotations.py | 1 | 90231 | """===================
Annotation pipeline
===================
The annotation pipeline imports various third party annotations
or creates them for use in other pipelines.
The purpose of this pipeline is to automate and standardize the
way we retrieve and build genomic annotations but also to allow
sharing of annotati... | mit |
thorwhalen/ut | ml/decomp/tsne.py | 1 | 6045 | #
# tsne.py
#
# Implementation of t-SNE in Python. The implementation was tested on Python 2.7.10, and it requires a working
# installation of NumPy. The implementation comes with an example on the MNIST dataset. In order to plot the
# results of this example, a working installation of matplotlib is required.
#
# The ... | mit |
shyamalschandra/scikit-learn | examples/linear_model/plot_logistic_multinomial.py | 24 | 2480 | """
====================================================
Plot multinomial and One-vs-Rest Logistic Regression
====================================================
Plot decision surface of multinomial and One-vs-Rest Logistic Regression.
The hyperplanes corresponding to the three One-vs-Rest (OVR) classifiers
are repre... | bsd-3-clause |
PeterSchichtel/hepstore | hepstore/core/plotter/subplot.py | 2 | 16980 | #!/usr/bin/env python
# imports
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import math,os,sys
from itertools import cycle
from hepstore.core.utility import *
import numpy as np
class SubPlot(object):
def __init__(self,options,subnumber):
self.subnumber = subnumber
self.o... | gpl-3.0 |
zycdragonball/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py | 62 | 5053 | # 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 |
Vrekrer/magdynlab | experiments/VNA_FMR_Escola.py | 1 | 4746 | # -*- coding: utf-8 -*-
import numpy
import time
import os
import magdynlab.instruments
import magdynlab.controlers
import magdynlab.data_types
import threading_decorators as ThD
import matplotlib.pyplot as plt
@ThD.gui_safe
def MyPlot(Data):
f = plt.figure('VNA-FMR', (5, 4))
extent = numpy.array([Data.x.mi... | mit |
Elixeus/infoviz_refugee_project | dataProcessing/mainProcess.py | 3 | 2467 | #!/usr/bin/env python
import pandas as pd
import numpy as np
import re
from sentianalyze import SentiAnalyze
from countrytocity import CountryToCity
from wordcount import WordCount
import pickle
def main():
print 'cleaning data.'
data = pd.read_csv('../output/twitterDB_all.csv', header=None) # read data
... | mit |
treycausey/scikit-learn | benchmarks/bench_plot_parallel_pairwise.py | 297 | 1247 | # Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import time
import pylab as pl
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metrics.pairwise import pairwise_kernels
def plot(func):
random_state = check_random_state(0)
... | bsd-3-clause |
aquemy/HCBR | utils/roc.py | 1 | 1502 | import numpy as np
import matplotlib.pyplot as plt
import sys
ID_ROW=0
REAL_ROW=1
GUESS_ROW=2
SCORE_1=5
SCORE_0=6
path = sys.argv[1]
file_name = path.split('/')[-1].split('.')[0]
with open(path) as f:
data = f.readlines()
p = 1000
n = len(data)
Y = np.ndarray(shape=(n,1), dtype=int, order='F')
T = np.ndarray(s... | mit |
probml/pyprobml | scripts/vanishing_gradients.py | 1 | 1043 | # Vanishing gradients for certain activation functions
# Based on
#https://medium.com/@karpathy/yes-you-should-understand-backprop-e2f06eab496b
import numpy as np
import matplotlib.pyplot as plt
import os
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_grad(x):
p = sigmoid(x)
return p*(1-p)
d... | mit |
DistrictDataLabs/03-censusables | source/Model/Model.py | 1 | 6255 | #!~/anaconda/bin/ python
###############################################################################
#
# This uses PCA analysis tools to save the Final.csv file which
# will be used to rank zip codes according to the 4 parameters (income,
# housing, diversity, and population density
#
#
#########################... | apache-2.0 |
wronk/mne-python | examples/visualization/plot_channel_epochs_image.py | 9 | 2662 | """
=========================================
Visualize channel over epochs as an image
=========================================
This will produce what is sometimes called an event related
potential / field (ERP/ERF) image.
2 images are produced. One with a good channel and one with a channel
that does not see any e... | bsd-3-clause |
dtrckd/pymake | pymake/frontend/manager.py | 1 | 7343 | import sys, os
import inspect
import fnmatch
from pymake import Model, Corpus
from pymake.core.types import resolve_model_name
from pymake.core.logformatter import logger
class FrontendManager(object):
""" Utility Class who aims at mananing/Getting the datastructure at the higher level.
Parameters
... | gpl-3.0 |
dhruv13J/scikit-learn | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | 2601 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... | bsd-3-clause |
galfaroi/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 |
josephmisiti/nolearn | nolearn/lasagne/tests/test_base.py | 1 | 22544 | import pickle
from lasagne.layers import ConcatLayer
from lasagne.layers import DenseLayer
from lasagne.layers import InputLayer
from lasagne.layers import Layer
from lasagne.nonlinearities import identity
from lasagne.nonlinearities import softmax
from lasagne.objectives import categorical_crossentropy
from lasagne.u... | mit |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/mpl_toolkits/axisartist/axislines.py | 7 | 26173 | """
Axislines includes modified implementation of the Axes class. The
biggest difference is that the artists responsible to draw axis line,
ticks, ticklabel and axis labels are separated out from the mpl's Axis
class, which are much more than artists in the original
mpl. Originally, this change was motivated to support... | apache-2.0 |
chrisburr/scikit-learn | sklearn/gaussian_process/kernels.py | 18 | 66251 | """Kernels for Gaussian process regression and classification.
The kernels in this module allow kernel-engineering, i.e., they can be
combined via the "+" and "*" operators or be exponentiated with a scalar
via "**". These sum and product expressions can also contain scalar values,
which are automatically converted to... | bsd-3-clause |
loli/sklearn-ensembletrees | sklearn/hmm.py | 2 | 48577 | # Hidden Markov Models
#
# Author: Ron Weiss <ronweiss@gmail.com>
# and Shiqiao Du <lucidfrontier.45@gmail.com>
# API changes: Jaques Grobler <jaquesgrobler@gmail.com>
"""
The :mod:`sklearn.hmm` module implements hidden Markov models.
**Warning:** :mod:`sklearn.hmm` is orphaned, undocumented and has known
numerical s... | bsd-3-clause |
enigmampc/catalyst | catalyst/utils/cache.py | 1 | 10635 | """
Caching utilities for catalyst
"""
from collections import MutableMapping
import errno
import os
import pickle
from distutils import dir_util
from shutil import rmtree, move
from tempfile import mkdtemp, NamedTemporaryFile
import pandas as pd
from .context_tricks import nop_context
from .paths import ensure_direc... | apache-2.0 |
klocey/ScalingMicroBiodiversity | fig-scripts/AppFigs/DiversityProperties/Richness.py | 2 | 9418 | from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import random
import scipy as sc
from scipy import stats
import os
import sys
from scipy.stats.distributions import t
import statsmodels.stats.api as sms
import statsmodels.api as sm
import statsmodels.formula.api as smf
from statsmo... | gpl-3.0 |
johandahlberg/arteria-bcl2fastq | bcl2fastq/lib/illumina.py | 3 | 4258 |
from pandas import read_csv
class SampleRow:
"""
Provides a representation of the information presented in a Illumina Samplesheet.
Different samplesheet types (e.g. HiSeq, MiSeq, etc) will provide slightly different
information for each sample. This class aims at providing a interface to this that wil... | mit |
bthirion/scikit-learn | examples/gaussian_process/plot_gpc_isoprobability.py | 64 | 3049 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=================================================================
Iso-probability lines for Gaussian Processes classification (GPC)
=================================================================
A two-dimensional classification example showing iso-probability lines for... | bsd-3-clause |
mengli/PcmAudioRecorder | utils/udacity_data.py | 2 | 2876 | import scipy.misc
import random
import pandas as pd
import tensorflow as tf
#points to the end of the last batch
train_batch_pointer = 0
val_batch_pointer = 0
train_xs = []
train_ys = []
val_xs = []
val_ys = []
TRAIN_IMG_PREFIX = "/usr/local/google/home/limeng/Downloads/udacity/ch2_002/output/HMB_%s/"
TRAIN_CSV = "/... | apache-2.0 |
mhue/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 142 | 5990 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | bsd-3-clause |
rollend/trading-with-python | lib/csvDatabase.py | 77 | 6045 | # -*- coding: utf-8 -*-
"""
intraday data handlers in csv format.
@author: jev
"""
from __future__ import division
import pandas as pd
import datetime as dt
import os
from extra import ProgressBar
dateFormat = "%Y%m%d" # date format for converting filenames to dates
dateTimeFormat = "%Y%m%d %H:%M:%S"... | bsd-3-clause |
ContinuumIO/dask | dask/array/tests/test_slicing.py | 2 | 28582 | import itertools
from operator import getitem
import pytest
from tlz import merge
np = pytest.importorskip("numpy")
import dask
import dask.array as da
from dask.array.slicing import (
_sanitize_index_element,
_slice_1d,
new_blockdim,
sanitize_index,
slice_array,
take,
normalize_index,
... | bsd-3-clause |
fpetitjean/DBA | DBA_multivariate.py | 1 | 7329 | '''
/*******************************************************************************
* Copyright (C) 2018 Francois Petitjean
*
* 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, version 3 of t... | gpl-3.0 |
BMJHayward/numpy | numpy/lib/polynomial.py | 82 | 37957 | """
Functions to operate on polynomials.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import re
import warnings
import numpy.core.... | bsd-3-clause |
JosmanPS/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 |
macks22/fastFM | fastFM/sgd.py | 1 | 5433 | # Author: Immanuel Bayer
# License: BSD 3 clause
import numpy as np
from sklearn.base import RegressorMixin
import ffm
from utils import check_array, check_consistent_length
from base import FactorizationMachine, BaseFMClassifier, _validate_class_labels
class FMRegression(FactorizationMachine, RegressorMixin):
... | bsd-3-clause |
ldirer/scikit-learn | sklearn/tests/test_random_projection.py | 141 | 14040 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
appapantula/scikit-learn | sklearn/cross_decomposition/pls_.py | 187 | 28507 | """
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..utils import check_array, check_consistent_length
from ..externals import six
import w... | bsd-3-clause |
richardotis/scipy | doc/source/tutorial/examples/normdiscr_plot2.py | 84 | 1642 | import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
npoints = 20 # number of integer support points of the distribution minus 1
npointsh = npoints / 2
npointsf = float(npoints)
nbound = 4 #bounds for the truncated normal
normbound = (1 + 1 / npointsf) * nbound #actual bounds of truncated normal
... | bsd-3-clause |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/SoftContact_ElPPlShear/Shear_Zone_Length/SZ_h_1e3/Normalized_Shear_Stress_Plot.py | 24 | 3505 | #!/usr/bin/python
import h5py
import matplotlib.pylab as plt
import matplotlib as mpl
import sys
import numpy as np;
plt.rcParams.update({'font.size': 28})
# set tick width
mpl.rcParams['xtick.major.size'] = 10
mpl.rcParams['xtick.major.width'] = 5
mpl.rcParams['xtick.minor.size'] = 10
mpl.rcParams['xtick.minor.width... | cc0-1.0 |
arunhotra/tensorflow | tensorflow/python/client/notebook.py | 5 | 3918 | """Notebook front-end to TensorFlow.
When you run this binary, you'll see something like below, which indicates
the serving URL of the notebook:
The IPython Notebook is running at: http://127.0.0.1:8888/
Press "Shift+Enter" to execute a cell
Press "Enter" on a cell to go into edit mode.
Press "Escape" to go back ... | apache-2.0 |
mne-tools/mne-tools.github.io | 0.11/_downloads/plot_decoding_xdawn_eeg.py | 8 | 3397 | """
=============================
XDAWN Decoding From EEG data
=============================
ERP decoding with Xdawn. For each event type, a set of spatial Xdawn filters
are trained and applied on the signal. Channels are concatenated and rescaled
to create features vectors that will be fed into a Logistic Regression... | bsd-3-clause |
bert9bert/statsmodels | statsmodels/tools/data.py | 2 | 3604 | """
Compatibility tools for various data structure inputs
"""
from statsmodels.compat.python import range
import numpy as np
import pandas as pd
def _check_period_index(x, freq="M"):
from pandas import PeriodIndex, DatetimeIndex
if not isinstance(x.index, (DatetimeIndex, PeriodIndex)):
raise ValueErro... | bsd-3-clause |
gustavovaliati/ci724-ppginfufpr-2016 | exerc-3c/main.py | 1 | 1897 | import numpy as np
import argparse, cv2, glob, sys
import datetime
ap = argparse.ArgumentParser()
ap.add_argument("-t", "--target", required = True, help = "Is the file used as reference for the comparison")
ap.add_argument("-d", "--dataset", required = True, help = "Path to the directory of images")
args = vars(ap.pa... | gpl-3.0 |
MartinDelzant/scikit-learn | sklearn/metrics/tests/test_ranking.py | 127 | 40813 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projec... | bsd-3-clause |
mfjb/scikit-learn | sklearn/tests/test_learning_curve.py | 225 | 10791 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.learning_curve import learning_curve, validation_curve
from sklearn.u... | bsd-3-clause |
h2educ/scikit-learn | sklearn/metrics/scorer.py | 211 | 13141 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py | 26 | 6490 | # 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 |
mdpiper/topoflow | topoflow/components/smooth_DEM.py | 2 | 75891 |
#-------------------------------------------------------------------
# Note: We can now compute a new D8 flow grid and area grid for
# the new DEM and repeat this process until the flow grid
# no longer changes. Need to use d8_global.py (which
# computes flow and area grids; used by Erode) instead o... | mit |
herilalaina/scikit-learn | sklearn/tests/test_pipeline.py | 15 | 33955 | """
Test the pipeline module.
"""
from tempfile import mkdtemp
import shutil
import time
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regex
from sklearn.utils.testing import asse... | bsd-3-clause |
nesterione/scikit-learn | sklearn/metrics/tests/test_ranking.py | 127 | 40813 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projec... | bsd-3-clause |
andyh616/mne-python | examples/inverse/plot_label_source_activations.py | 32 | 2269 | """
====================================================
Extracting the time series of activations in a label
====================================================
We first apply a dSPM inverse operator to get signed activations
in a label (with positive and negative values) and we then
compare different strategies to ... | bsd-3-clause |
shenzebang/scikit-learn | examples/text/document_clustering.py | 230 | 8356 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
NDManh/numbbo | code-postprocessing/bbob_pproc/pprldistr.py | 3 | 35794 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""For generating empirical cumulative distribution function figures.
The outputs show empirical cumulative distribution functions (ECDFs) of
the running times of trials. These ECDFs show on the y-axis the fraction
of cases for which the running time (left subplots) or t... | bsd-3-clause |
keflavich/scikit-image | doc/examples/applications/plot_rank_filters.py | 14 | 18001 | """
============
Rank filters
============
Rank filters are non-linear filters using the local gray-level ordering to
compute the filtered value. This ensemble of filters share a common base: the
local gray-level histogram is computed on the neighborhood of a pixel (defined
by a 2-D structuring element). If the filter... | bsd-3-clause |
SiLab-Bonn/Scarce | scarce/deprecated/python_files/getResistivity.py | 1 | 1656 | import numpy as np
from scipy import constants
from siliconproperties.python_files.getMobility import get_mobility
def get_resistivity(n_eff, is_n_type=True, temperature=300, e_field=1e3):
# Calculate the resitivity from:
# The effective doping concentration n_eff [10^12 / cm^3]
# the mobility [cm^2/Vs]
... | mit |
brodoll/sms-tools | lectures/06-Harmonic-model/plots-code/monophonic-polyphonic.py | 21 | 2258 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import sineModel as SM
import stft as STFT
import utilFunctions as UF
plt.f... | agpl-3.0 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/matplotlib/mathtext.py | 10 | 111285 | r"""
:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
TeX math syntax and drawing them to a matplotlib backend.
For a tutorial of its usage see :ref:`mathtext-tutorial`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _p... | mit |
andreadelprete/pinocchio_inv_dyn | python/pinocchio_inv_dyn/convex_hull_util.py | 1 | 2769 | # -*- coding: utf-8 -*-
"""
Function to compute the convex hull of a set of points (using the cdd library).
Created on Fri Jul 3 17:52:35 2015
@author: adelpret
"""
import cdd
import numpy as np
import matplotlib.pyplot as plt
NUMBER_TYPE = 'float' # 'float' or 'fraction'
''' Compute the convex hull of the given ... | gpl-2.0 |
xzh86/scikit-learn | examples/ensemble/plot_adaboost_twoclass.py | 347 | 3268 | """
==================
Two-class AdaBoost
==================
This example fits an AdaBoosted decision stump on a non-linearly separable
classification dataset composed of two "Gaussian quantiles" clusters
(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision
boundary and decision scores. The di... | bsd-3-clause |
mantidproject/mantid | Framework/PythonInterface/mantid/plots/resampling_image/samplingimage.py | 3 | 10843 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
sebalander/VisionUNQ | visionUNQ/varglobal.py | 1 | 8900 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 23 12:19:42 2014
Variables globales que sirven para saber enq ue etapa del programa
estamos y para guardar todo lo que hay que ir comunicando de una
función a otra.
funciones
- importVar
- dumpVar
Clases
- VariablesGlobales
- MultiThreadingGlobales
- VideoGlobales()
@... | bsd-3-clause |
cuemacro/findatapy | findatapy/market/fxclsvolume.py | 1 | 2932 | from findatapy.timeseries import Calculations
from findatapy.util import LoggerManager
from findatapy.market import MarketDataRequest
import pandas
#######################################################################################################################
class FXCLSVolume(object):
def __init__(self,... | apache-2.0 |
kevin-intel/scikit-learn | sklearn/cluster/_affinity_propagation.py | 2 | 17258 | """Affinity Propagation clustering algorithm."""
# Author: Alexandre Gramfort alexandre.gramfort@inria.fr
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
import numpy as np
import warnings
from ..exceptions import ConvergenceWarning
from ..base import BaseEstimator, ClusterMixin
from .... | bsd-3-clause |
hitszxp/scikit-learn | examples/applications/wikipedia_principal_eigenvector.py | 41 | 7742 | """
===============================
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 |
neilpat1995/IMDb-Movie-Rating-Predictor | knn.py | 1 | 5382 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 22 13:08:12 2017
Running KNN on Movies Dataset
@author: Sangini
"""
from __future__ import print_function
from sklearn.neighbors import KNeighborsClassifier as KNN
from sklearn.decomposition import PCA
import numpy as np
import csv
TRAINING_CSV_FILE = 'training-movies.c... | apache-2.0 |
jm-begon/scikit-learn | sklearn/semi_supervised/label_propagation.py | 128 | 15312 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
wzbozon/scikit-learn | sklearn/metrics/__init__.py | 214 | 3440 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... | bsd-3-clause |
JT5D/scikit-learn | examples/applications/face_recognition.py | 12 | 5368 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... | bsd-3-clause |
MartinThoma/algorithms | ML/filter-kernels/main.py | 1 | 1538 | #!/usr/bin/env
"""Show how different downsampling methods look like."""
import matplotlib.pyplot as plt
import numpy as np
import scipy.misc
def maxpooling(im):
im_height, im_width, im_channels = im.shape
im_small = np.zeros((im_height / 2, im_width / 2, im_channels))
for y in range(im_height / 2):
... | mit |
Twistbioscience/incubator-airflow | airflow/contrib/plugins/metastore_browser/main.py | 62 | 5773 | # -*- coding: utf-8 -*-
#
# 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 writing, software
... | apache-2.0 |
zak-k/cartopy | lib/cartopy/tests/mpl/test_ticker.py | 3 | 8796 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | lgpl-3.0 |
linglaiyao1314/SFrame | oss_src/unity/python/sframe/deps/__init__.py | 9 | 2628 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from distutils.version import StrictVersion
import logging
import re
def __get_version(version):
# matching 1.6.1, and 1.6.1rc, 1.6.1.dev
... | bsd-3-clause |
manashmndl/scikit-learn | sklearn/feature_extraction/tests/test_feature_hasher.py | 258 | 2861 | from __future__ import unicode_literals
import numpy as np
from sklearn.feature_extraction import FeatureHasher
from nose.tools import assert_raises, assert_true
from numpy.testing import assert_array_equal, assert_equal
def test_feature_hasher_dicts():
h = FeatureHasher(n_features=16)
assert_equal("dict",... | bsd-3-clause |
ilo10/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 |
DeercoderResearch/CoCo | PythonAPI/build/lib.linux-x86_64-2.7/pycocotools/coco.py | 5 | 12534 | __author__ = 'tylin'
__version__ = 1.0
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visualizing the annotations in COCO.
# Please ... | bsd-2-clause |
gfyoung/scipy | doc/source/conf.py | 3 | 12805 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys, os, re
from datetime import date
# Check Sphinx version
import sphinx
if sphinx.__version__ < "1.6":
raise RuntimeError("Sphinx 1.6 or newer required")
needs_sphinx = '1.6'
# ----------------------------------------------------------------... | bsd-3-clause |
jwdebelius/break_4w | break4w/categorical.py | 1 | 11443 | import copy
import numpy as np
import pandas as pd
from break4w.question import Question
class Categorical(Question):
def __init__(self, name, description, dtype, order, ref_value=None,
ambiguous=None, frequency_cutoff=None, var_labels=None,
ordinal=False, code_delim='=', **kwargs):
u""... | bsd-2-clause |
Olek-Diachuk/Authorship-Attribution | src/FindK.py | 1 | 7420 |
import os
from nltk import word_tokenize
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import metrics
from sklearn.model_selection import train_test_split, cross_val_predict
import simplejson as json
import re
import codecs
from Classifiers import MutableKNeighborsClassifier, Mutabl... | mit |
prashantas/MyDataScience | DeepNetwork/TransferLearning/transfer_learning_vgg16_custom_data.py | 1 | 6065 | ######## VGG16:: https://www.youtube.com/watch?v=L7qjQu2ry2Q
##Resnet-50 :: https://www.youtube.com/watch?v=m5RjXjvAAhQ
import numpy as np
import os
import time
#from vgg16 import VGG16
from keras.applications.vgg16 import VGG16 # I added
from keras.preprocessing import image
from keras.applications.imagenet_... | bsd-2-clause |
yanlend/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
mayblue9/bokeh | bokeh/charts/builder/dot_builder.py | 43 | 6160 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Dot class which lets you build your Dot charts just
passing the arguments to the Chart class and calling the proper functions.
"""
#-------------------------------------------------------------------... | bsd-3-clause |
akpetty/ibtopo2016 | plot_flines_icetype_winds2plotside.py | 1 | 5778 | ##############################################################
# Date: 20/01/16
# Name: plot_ridges_bulk.py
# Author: Alek Petty
# Description: Script to plot wind and ice type and IB flight lines
# Input requirements: ERA-I wind data, ice type, and IB flines
# Extra info: check the wind/ice_type/IB flightline functio... | gpl-3.0 |
Bhare8972/LOFAR-LIM | LIM_scripts/FractionImagedEnergy.py | 1 | 19938 | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import simps
from LoLIM.utilities import v_air
from LoLIM.findRFI import window_and_filter
from LoLIM.antenna_response import LBA_antenna_model
from LoLIM.signal_processing import num_double_zeros
from LoLIM.getTrace_fromLo... | mit |
hbenniou/trunk | examples/simple-scene/simple-scene-energy-tracking.py | 8 | 4783 | #!/usr/bin/python
# -*- coding: utf-8 -*-
############################################
##### interesting parameters #####
############################################
# Cundall non-viscous damping
# try zero damping and watch total energy...
damping = 0.2
# initial angular velocity
angVel = 3.0
# use two sphe... | gpl-2.0 |
ebigelow/LOTlib | LOTlib/Testing/TreeTesters.py | 1 | 6111 |
import unittest
import re
from collections import Counter
from math import exp
from scipy.stats import chisquare
from LOTlib import break_ctrlc
from LOTlib.Miscellaneous import logsumexp
from LOTlib.FunctionNode import FunctionNode, BVUseFunctionNode, BVAddFunctionNode
from LOTlib.Hypotheses.LOTHypothesis import LOT... | gpl-3.0 |
ilo10/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 129 | 7848 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
maciejkula/scipy | scipy/optimize/nonlin.py | 1 | 46481 | r"""
=================
Nonlinear solvers
=================
.. currentmodule:: scipy.optimize
This is a collection of general-purpose nonlinear multidimensional
solvers. These solvers find *x* for which *F(x) = 0*. Both *x*
and *F* can be multidimensional.
Routines
========
Large-scale nonlinear solvers:
.. autos... | bsd-3-clause |
swift-lang/swift-e-lab | parsl/monitoring/web_app/apps/tabs.py | 1 | 1307 | import pandas as pd
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from parsl.monitoring.web_app.app import app, get_db, close_db
from parsl.monitoring.web_app.utils import dropdown
from parsl.monitoring.web_app.apps import workflow_details, tasks_deta... | apache-2.0 |
sho-87/python-machine-learning | CNN/mw/9_eeg_mw_xcorr.py | 1 | 17213 | from __future__ import print_function
import os
import time
import numpy as np
import theano
import theano.tensor as T
import lasagne
import matplotlib.pyplot as plt
from tqdm import tqdm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from lasagne.layers import InputLayer, Conv2DLayer, Pool2DLayer
from lasag... | mit |
LohithBlaze/scikit-learn | sklearn/datasets/samples_generator.py | 35 | 56035 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing import MultiLabelBin... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.