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
cbmoore/statsmodels
statsmodels/sandbox/examples/example_gam_0.py
33
4574
'''first examples for gam and PolynomialSmoother used for debugging This example was written as a test case. The data generating process is chosen so the parameters are well identified and estimated. Note: uncomment plt.show() to display graphs ''' example = 2 #3 # 1,2 or 3 import numpy as np from statsmodels.com...
bsd-3-clause
AlexRobson/scikit-learn
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
robince/pyentropy
docs/sphinxext/inheritance_diagram.py
98
13648
""" Defines a docutils directive for inserting inheritance diagrams. Provide the directive with one or more classes or modules (separated by whitespace). For modules, all of the classes in that module will be used. Example:: Given the following classes: class A: pass class B(A): pass class C(A): pass ...
gpl-2.0
wilsonkichoi/zipline
zipline/protocol.py
3
4172
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
btabibian/scikit-learn
examples/model_selection/plot_nested_cross_validation_iris.py
46
4415
""" ========================================= Nested versus non-nested cross-validation ========================================= This example compares non-nested and nested cross-validation strategies on a classifier of the iris data set. Nested cross-validation (CV) is often used to train a model in which hyperparam...
bsd-3-clause
sandeepkbhat/pylearn2
pylearn2/expr/tests/test_probabilistic_max_pooling.py
44
24662
from __future__ import print_function import numpy as np import warnings from theano.compat.six.moves import xrange from theano import config from theano import function import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams from pylearn2.expr.probabilistic_max_pooling import max_pool_python ...
bsd-3-clause
wavemoth/wavemoth
wavemoth/cuda/sht.py
1
5893
import os import tempita import numpy as np from numpy import int32 from . import flatcuda as cuda #from .flatcuda import InOut, In, Out, from .legendre_transform import CudaLegendreKernel from .. import healpix, compute_normalized_associated_legendre from ..streamutils import write_int64, write_array def plot_ma...
gpl-2.0
vigilv/scikit-learn
sklearn/feature_selection/__init__.py
244
1088
""" The :mod:`sklearn.feature_selection` module implements feature selection algorithms. It currently includes univariate filter selection methods and the recursive feature elimination algorithm. """ from .univariate_selection import chi2 from .univariate_selection import f_classif from .univariate_selection import f_...
bsd-3-clause
Juanlu001/aquagpusph
examples/3D/spheric_testcase9_tld/cMake/plot_m.py
1
6861
#****************************************************************************** # * # * ** * * * * * # * * * * * * * * * * ...
gpl-3.0
liyu1990/sklearn
sklearn/neural_network/tests/test_rbm.py
225
6278
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
CGATOxford/CGATPipelines
obsolete/reports/pipeline_chipseq/trackers/Manuscript.py
1
2172
import os import sys import re import types import itertools import matplotlib.pyplot as plt import numpy import numpy.ma from ChipseqReport import * class ReproducibilityBetweenSamples(DefaultTracker): def __call__(self, track, slice=None): set1 = track + "R1" set2 = track + "R2" stat...
mit
TNick/pylearn2
pylearn2/train_extensions/roc_auc.py
30
4854
""" TrainExtension subclass for calculating ROC AUC scores on monitoring dataset(s), reported via monitor channels. """ __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "3-clause BSD" import numpy as np try: from sklearn.metrics import roc_auc_score except ImportEr...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/datasets/tests/test_mldata.py
384
5221
"""Test functionality of mldata fetching utilities.""" import os import shutil import tempfile import scipy as sp from sklearn import datasets from sklearn.datasets import mldata_filename, fetch_mldata from sklearn.utils.testing import assert_in from sklearn.utils.testing import assert_not_in from sklearn.utils.test...
bsd-3-clause
anhaidgroup/py_entitymatching
py_entitymatching/blocker/attr_equiv_blocker.py
1
25900
import logging import pandas as pd import numpy as np import pyprind import six from joblib import Parallel, delayed import py_entitymatching.catalog.catalog_manager as cm from py_entitymatching.blocker.blocker import Blocker from py_entitymatching.utils.catalog_helper import log_info, get_name_for_key, add_key_colum...
bsd-3-clause
zuku1985/scikit-learn
examples/cluster/plot_face_compress.py
71
2479
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Vector Quantization Example ========================================================= Face, a 1024 x 768 size image of a raccoon face, is used here to illustrate how `k`-means is used for vector quantization. """ ...
bsd-3-clause
mattilyra/scikit-learn
examples/classification/plot_digits_classification.py
34
2409
""" ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual <introduction>`. """ print(__doc__) # Autho...
bsd-3-clause
466152112/scikit-learn
sklearn/linear_model/ransac.py
191
14261
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from ..utils.valid...
bsd-3-clause
cbmoore/statsmodels
statsmodels/graphics/tests/test_correlation.py
31
1112
import numpy as np from numpy.testing import dec from statsmodels.graphics.correlation import plot_corr, plot_corr_grid from statsmodels.datasets import randhie try: import matplotlib.pyplot as plt have_matplotlib = True except: have_matplotlib = False @dec.skipif(not have_matplotlib) def test_plot_cor...
bsd-3-clause
expectocode/telegramAnalysis
activedays.py
2
5649
#!/usr/bin/env python3 """ A program to plot the activity of a chat over 24 hours """ import argparse from json import loads from datetime import date,timedelta,datetime from os import path from collections import defaultdict import matplotlib.pyplot as plt from sys import maxsize def extract_info(event): text_...
mit
smartscheduling/scikit-learn-categorical-tree
sklearn/metrics/metrics.py
233
1262
import warnings warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in " "0.18. Please import from sklearn.metrics", DeprecationWarning) from .ranking import auc from .ranking import average_precision_score from .ranking import label_ranking_average_precision_score fro...
bsd-3-clause
btabibian/scikit-learn
sklearn/ensemble/tests/test_voting_classifier.py
15
14956
"""Testing for the VotingClassifier""" import numpy as np from sklearn.utils.testing import assert_almost_equal, assert_array_equal from sklearn.utils.testing import assert_equal, assert_true, assert_false from sklearn.utils.testing import assert_raise_message from sklearn.exceptions import NotFittedError from sklearn...
bsd-3-clause
riveridea/gnuradio
gr-digital/examples/example_fll.py
9
5717
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # 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 opt...
gpl-3.0
benoitsteiner/tensorflow-xsmm
tensorflow/examples/learn/iris_custom_model.py
43
3449
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
eg-zhang/scikit-learn
examples/calibration/plot_calibration.py
225
4795
""" ====================================== Probability calibration of classifiers ====================================== When performing classification you often want to predict not only the class label, but also the associated probability. This probability gives you some kind of confidence on the prediction. However,...
bsd-3-clause
jonnor/FreeCAD
src/Mod/Plot/Plot.py
16
12328
#*************************************************************************** #* * #* Copyright (c) 2011, 2012 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
fabioticconi/scikit-learn
examples/mixture/plot_gmm_sin.py
18
3242
""" ================================= Gaussian Mixture Model Sine Curve ================================= This example highlights the advantages of the Dirichlet Process: complexity control and dealing with sparse data. The dataset is formed by 100 points loosely spaced following a noisy sine curve. The fit by the GMM...
bsd-3-clause
themrmax/scikit-learn
sklearn/decomposition/tests/test_pca.py
9
21107
import numpy as np import scipy as sp from itertools import product from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_gre...
bsd-3-clause
thientu/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
Srisai85/scikit-learn
sklearn/datasets/__init__.py
176
3671
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
kaushik94/tardis
tardis/model/base.py
1
25604
import os import logging import numpy as np import pandas as pd from astropy import units as u from tardis import constants from tardis.util.base import quantity_linspace from tardis.io.parsers.csvy import load_csvy from tardis.io.model_reader import read_density_file, \ read_abundances_file, read_uniform_abundanc...
bsd-3-clause
amonszpart/globOpt
RAPter/scripts/normal_distr.py
2
1814
import healpy as hp import numpy as np import matplotlib.pyplot as plt def load_ply(path): lines = [] verts = [] norms = [] f = open(path, "r") for line in f: lines.append(line) if (lines[0] != "ply\n"): return 0 i = 1 #get number of ve...
apache-2.0
mne-tools/mne-python
tutorials/io/30_reading_fnirs_data.py
3
10521
# -*- coding: utf-8 -*- r""" .. _tut-importing-fnirs-data: ================================= Importing data from fNIRS devices ================================= fNIRS devices consist of two kinds of optodes: light sources (AKA "emitters" or "transmitters") and light detectors (AKA "receivers"). Channels are defined a...
bsd-3-clause
ElDeveloper/scikit-learn
sklearn/neighbors/approximate.py
30
22370
"""Approximate nearest neighbor search""" # Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk> # Joel Nothman <joel.nothman@gmail.com> import numpy as np import warnings from scipy import sparse from .base import KNeighborsMixin, RadiusNeighborsMixin from ..base import BaseEstimator from ..utils.va...
bsd-3-clause
ClimbsRocks/scikit-learn
examples/cluster/plot_kmeans_stability_low_dim_dense.py
338
4324
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
bsd-3-clause
rrader/cdr-tools
generator/test.py
1
7514
# Author: Jendrik Poloczek <jendrik.poloczek@madewithtea.com> # License: BSD 3 clause from windml.datasets.nrel import NREL from windml.visualization.plot_timeseries import plot_timeseries from windml.preprocessing.preprocessing import destroy from windml.preprocessing.preprocessing import interpolate from windml.prep...
mit
costypetrisor/scikit-learn
sklearn/cluster/birch.py
18
22657
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Joel Nothman <joel.nothman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings import numpy as np from scipy import sparse from math import sqrt fro...
bsd-3-clause
sibis-platform/ncanda-datacore
scripts/reporting/mri_dvd_burning_script.py
4
3005
#!/usr/bin/env python ## ## See COPYING file distributed along with the ncanda-data-integration package ## for the copyright and license terms ## """ mri_dvd_burning_script ====================== Generate a list of eids for a special subset of subjects. this list can be used in script/xnat/check_object_names """ impo...
bsd-3-clause
usc-isi-i2/WEDC
wedc/domain/core/ml/classifier/label_propagation/knn.py
1
4394
from sklearn.neighbors import NearestNeighbors from sklearn import preprocessing import numpy as np import random def build(graph_input, output=None, n_neighbors=10, algorithm='ball_tree', top_k_rate=None): n_neighbors += 1 # load data pid_set = [_[0] for _ in graph_input] X = [_[1] for _ in graph_i...
apache-2.0
moinulkuet/machine-learning
Part 2 - Regression/Section 4 - Simple Linear Regression/simple_linear_regression.py
4
1442
# Simple Linear Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Salary_Data.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 1].values # Splitting the dataset into the Training set and Test set from sk...
gpl-3.0
cauchycui/scikit-learn
examples/cluster/plot_kmeans_silhouette_analysis.py
242
5885
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
bsd-3-clause
Obus/scikit-learn
examples/covariance/plot_lw_vs_oas.py
248
2903
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotically optimal shrinkage parameter (minimizing a MSE criterion), yielding th...
bsd-3-clause
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/matplotlib/testing/jpl_units/EpochConverter.py
3
5331
#=========================================================================== # # EpochConverter # #=========================================================================== """EpochConverter module containing class EpochConverter.""" #=========================================================================== # Pla...
gpl-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/backends/backend_gtk3agg.py
21
3815
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np import sys import warnings from . import backend_agg from . import backend_gtk3 from .backend_cairo import cairo, HAS_CAIRO_CFFI from matplotlib.figure import Figure from matplot...
gpl-3.0
anntzer/scikit-learn
sklearn/tests/test_kernel_ridge.py
9
3320
import pytest import numpy as np import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils._testing import ignore_warnings from sklearn.utils._test...
bsd-3-clause
tynn/numpy
numpy/core/tests/test_multiarray.py
2
274846
from __future__ import division, absolute_import, print_function try: # Accessing collections abstract classes from collections # has been deprecated since Python 3.3 import collections.abc as collections_abc except ImportError: import collections as collections_abc import tempfile import sys import sh...
bsd-3-clause
andreabedini/PyTables
doc/sphinxext/ipython_directive.py
12
19507
# -*- coding: utf-8 -*- """Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. To enable this directive, simply list it in you...
bsd-3-clause
Roboticmechart22/sms-tools
lectures/06-Harmonic-model/plots-code/f0-TWM-errors-1.py
22
3586
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackman import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF def TWM (pfreq, p...
agpl-3.0
sandeepgupta2k4/tensorflow
tensorflow/examples/learn/wide_n_deep_tutorial.py
29
8985
# 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
nan86150/ImageFusion
lib/python2.7/site-packages/matplotlib/backends/backend_gtk3agg.py
21
3815
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np import sys import warnings from . import backend_agg from . import backend_gtk3 from .backend_cairo import cairo, HAS_CAIRO_CFFI from matplotlib.figure import Figure from matplot...
mit
chris-chris/tensorflow
tensorflow/examples/learn/iris_custom_model.py
50
2613
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
DentonJC/virtual_screening
moloi/bin/svc.py
1
3988
#!/usr/bin/env python import os import sys import time import logging import numpy as np import pandas as pd from datetime import datetime from sklearn.svm import SVC from sklearn.model_selection import RandomizedSearchCV from sklearn.preprocessing import MinMaxScaler from moloi.config_processing import read_model_con...
gpl-3.0
magnusax/ml-meta-wrapper
gazer/classifiers/gbm.py
1
3404
import numpy as np from scipy.stats import randint, uniform from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import GradientBoostingClassifier from ..base import BaseClassifier from ..utils.stats import _uniform class MetaGradBoostingClassifier(BaseClassifier): """ Meta classifier wr...
mit
mross-22/dinsdale
src/two_inverted_pendulums/tools/thesis.py
4
1607
import numpy as np import matplotlib def figsize(scale): fig_width_pt = 426.79135 # Get this from LaTeX using \the\textwidth inches_per_pt = 1.0/72.27 # Convert pt to inch golden_mean = (np.sqrt(5.0)-1.0)/2.0 # Aesthetic ratio (you could change this) fig_width = fig_width_pt*inches_per_pt*scale # width...
gpl-3.0
Z2PackDev/Z2Pack
z2pack/plot.py
1
7739
#!/usr/bin/env python # -*- coding: utf-8 -*- """This submodule contains all functions for plotting Z2Pack results.""" import colorsys import decorator import numpy as np from fsc.export import export from ._utils import _pol_step def _plot(proj_3d=False): """Decorator that sets up the figure axes and handles ...
gpl-3.0
ppaulojr/CrazyCorrelation
weather/fill_coords.py
1
2110
#!/usr/bin/env python import math from collections import defaultdict from matplotlib.mlab import griddata import matplotlib.pyplot as plt import numpy as np # http://en.wikipedia.org/wiki/Extreme_points_of_the_United_States#Westernmost top = 49.3457868 # north lat left = -124.7844079 # west long right = -66.9513812 #...
mit
PythonCharmers/bokeh
bokeh/cli/utils.py
42
8119
from __future__ import absolute_import, print_function from collections import OrderedDict from six.moves.urllib import request as urllib2 import io import pandas as pd from .. import charts from . import help_messages as hm def keep_source_input_sync(filepath, callback, start=0): """ Monitor file at filepath ch...
bsd-3-clause
equialgo/scikit-learn
sklearn/cluster/k_means_.py
19
59631
"""K-means clustering""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Thomas Rueckstiess <ruecksti@in.tum.de> # James Bergstra <james.bergstra@umontreal.ca> # Jan Schlueter <scikit-learn@jan-schlueter.de> # Nelle Varoquaux # Peter Prettenhofer <peter.prettenh...
bsd-3-clause
tntnatbry/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/tensorflow_dataframe_test.py
7
12865
# 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
nomadcube/scikit-learn
doc/sphinxext/numpy_ext/docscrape_sphinx.py
408
8061
import re import inspect import textwrap import pydoc from .docscrape import NumpyDocString from .docscrape import FunctionDoc from .docscrape import ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots...
bsd-3-clause
YangLiu928/NDP_Projects
Python_Projects/NLP/keyword assignment/TrashBin/preprosessing_bigram.py
2
2737
import cPickle as pickle from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer import json from sklearn.naive_bayes import MultinomialNB import numpy as np from sklearn.linear_model import SGDClassifier from nltk import word_tokenize from nltk...
mit
mauriceleutenegger/windprofile
PyWindProfile/examples/testOpticalDepth_scalar_vs_2D.py
1
1144
#!/usr/bin/env python from __future__ import print_function # for python 2 backwards compatibility import numpy as np import matplotlib.pyplot as pl import PyWindProfile as wp # calculate t(p,z) for a large grid of points that shows # how much faster it is to calculate using the 2d-array returning function # vs. the ...
gpl-2.0
anntzer/scipy
scipy/optimize/zeros.py
12
50109
import warnings from collections import namedtuple import operator from . import _zeros import numpy as np _iter = 100 _xtol = 2e-12 _rtol = 4 * np.finfo(float).eps __all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth', 'toms748', 'RootResults'] # Must agree with CONVERGED, SIGNERR, CONVERR, ... i...
bsd-3-clause
CVML/scikit-learn
sklearn/linear_model/stochastic_gradient.py
130
50966
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import scipy.sparse as sp from abc import ABCMeta, abstractmethod from ...
bsd-3-clause
bikong2/scikit-learn
examples/plot_kernel_ridge_regression.py
230
6222
""" ============================================= Comparison of kernel ridge regression and SVR ============================================= Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel trick, i.e., they learn a linear function in the space induced by the respective k...
bsd-3-clause
jreback/pandas
pandas/core/config_init.py
1
20304
""" This module is imported from the pandas package __init__.py file in order to ensure that the core.config options registered here will be available as soon as the user loads the package. if register_option is invoked inside specific modules, they will not be registered until that module is imported, which may or may...
bsd-3-clause
AlexanderFabisch/scikit-learn
sklearn/feature_extraction/text.py
4
50320
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Robert Layton <robertlayton@gmail.com> # Jochen Wersdörfer <jochen@wersdoerfer.de> # Roman Sinayev <roman.sinayev@gma...
bsd-3-clause
Jimmy-Morzaria/scikit-learn
examples/semi_supervised/plot_label_propagation_digits_active_learning.py
294
3417
""" ======================================== Label Propagation digits active learning ======================================== Demonstrates an active learning technique to learn handwritten digits using label propagation. We start by training a label propagation model with only 10 labeled points, then we select the t...
bsd-3-clause
mne-tools/mne-tools.github.io
0.16/_downloads/plot_decoding_csp_eeg.py
8
5516
""" =========================================================================== Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP) =========================================================================== Decoding of motor imagery applied to EEG data decomposed using CSP. Here the classifier...
bsd-3-clause
dsullivan7/scikit-learn
sklearn/metrics/classification.py
9
61632
"""Metrics to assess performance on classification task given classe prediction Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gram...
bsd-3-clause
quantopian/alphalens
setup.py
1
1841
#!/usr/bin/env python from setuptools import setup, find_packages import versioneer import sys long_description = '' if 'upload' in sys.argv: with open('README.rst') as f: long_description = f.read() install_reqs = [ 'matplotlib>=1.4.0', 'numpy>=1.9.1', 'pandas>=0.18.0', 'scipy>=0.14.0', ...
apache-2.0
spatialaudio/sweep
log_sweep_kaiser_window_script1/log_sweep_kaiser_window_script1_1.py
2
2181
#!/usr/bin/env python3 """The influence of windowing of log. sweep signals when using a Kaiser Window by fixing beta (=2) and fade_out (=0). fstart = 1 Hz fstop = 22050 Hz Unwindowed Deconvolution """ import sys sys.path.append('..') import measurement_chain import plotting import calculation import ge...
mit
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/types/test_concat.py
7
3320
# -*- coding: utf-8 -*- import nose import pandas as pd import pandas.types.concat as _concat import pandas.util.testing as tm class TestConcatCompat(tm.TestCase): _multiprocess_can_split_ = True def check_concat(self, to_concat, exp): for klass in [pd.Index, pd.Series]: to_concat_klass...
mit
phobson/statsmodels
statsmodels/datasets/heart/data.py
3
1871
"""Heart Transplant Data, Miller 1976""" __docformat__ = 'restructuredtext' COPYRIGHT = """???""" TITLE = """Transplant Survival Data""" SOURCE = """ Miller, R. (1976). Least squares regression with censored dara. Biometrica, 63 (3). 449-464. """ DESCRSHORT = """Survival times after receiving a hear...
bsd-3-clause
openfisca/openfisca-france-data
openfisca_france_data/__init__.py
1
7336
# -*- coding: utf-8 -*- import inspect import logging import os import pkg_resources import pandas from openfisca_core import reforms # type: ignore import openfisca_france # type: ignore # Load input variables and output variables into entities from openfisca_france_data.model import common, survey_variables, i...
agpl-3.0
thouska/spotpy
spotpy/examples/dds/benchmark_dds.py
2
3254
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from pprint import pprint import numpy as np import matplotlib.pylab as plt import json import time try: import spotpy except ImportError: import sys sys.pa...
mit
cheind/py-motmetrics
motmetrics/metrics.py
1
26009
# py-motmetrics - Metrics for multiple object tracker (MOT) benchmarking. # https://github.com/cheind/py-motmetrics/ # # MIT License # Copyright (c) 2017-2020 Christoph Heindl, Jack Valmadre and others. # See LICENSE file for terms. """Obtain metrics from event logs.""" # pylint: disable=redefined-outer-name from __...
mit
wazeerzulfikar/scikit-learn
sklearn/gaussian_process/gpc.py
18
31958
"""Gaussian processes classification.""" # Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings from operator import itemgetter import numpy as np from scipy.linalg import cholesky, cho_solve, solve from scipy.optimize import fmin_l_bfgs_b from scipy.special import erf...
bsd-3-clause
nyuszika7h/youtube-dl
youtube_dl/extractor/wsj.py
30
4694
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, unified_strdate, ) class WSJIE(InfoExtractor): _VALID_URL = r'''(?x) (?: https?://video-api\.wsj\.com/api-vid...
unlicense
GenericMappingTools/gmt-python
pygmt/src/x2sys_cross.py
1
9403
""" x2sys_cross - Calculate crossovers between track data files. """ import contextlib import os from pathlib import Path import pandas as pd from pygmt.clib import Session from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import ( GMTTempFile, build_arg_string, data_kind, dummy_context, ...
bsd-3-clause
CJ8664/servo
tests/heartbeats/process_logs.py
139
16143
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import matplotlib.pyplot as plt import numpy as np import os from os import path ...
mpl-2.0
KristianJensen/cameo
tests/test_webmodels.py
1
1527
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by ...
apache-2.0
PYPIT/PYPIT
pypeit/core/flat.py
1
52113
""" Core module for methods related to flat fielding """ from __future__ import (print_function, absolute_import, division, unicode_literals) import inspect import numpy as np import os from scipy import interpolate from pypeit import msgs from pypeit.core import parse from pypeit.core import qa from pypeit.core imp...
gpl-3.0
bhargav/scikit-learn
examples/covariance/plot_outlier_detection.py
41
4216
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates three different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assum...
bsd-3-clause
jakobj/nest-simulator
pynest/nest/voltage_trace.py
18
7432
# -*- coding: utf-8 -*- # # voltage_trace.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, ...
gpl-2.0
lucidfrontier45/scikit-learn
examples/linear_model/plot_ols.py
2
1958
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
msyriac/orphics
tests/legacy/testBinOptimization.py
1
2506
import numpy as np import orphics.tools.io as io import matplotlib.pyplot as plt import sys from orphics.tools.catalogs import split_samples, optimize_splits """ This script shows you how to optimize bin edges to get equal S/N. The example used is a fake data set composed of measurements of richness that follow an...
bsd-2-clause
bw4sz/DeepMeerkat
training/Keras/trainer/retrain.py
1
5778
import os import sys import glob import argparse from keras import __version__ from keras.applications.inception_v3 import InceptionV3, preprocess_input from keras.models import Model from keras.layers import Dense, GlobalAveragePooling2D from keras.preprocessing.image import ImageDataGenerator from keras.optimizers i...
gpl-3.0
tracierenea/gnuradio
gr-dtv/examples/atsc_ctrlport_monitor.py
21
6089
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation # # 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, or (at your option) # any later version. # # This program is...
gpl-3.0
meduz/NeuroTools
test/test_stgen.py
2
9471
""" Unit tests for the NeuroTools.stgen module """ import matplotlib matplotlib.use('Agg') import unittest from NeuroTools import stgen from NeuroTools import signals import numpy class StatisticalError(Exception): pass class StGenInitTest(unittest.TestCase): def setUp(self): pass def tearDo...
gpl-2.0
britodasilva/pyhfo
pyhfo/core/pre_processing.py
1
12090
# -*- coding: utf-8 -*- """ Pre-processing using Data_dict Created on Fri Apr 17 13:15:57 2015 @author: anderson """ import scipy.signal as sig import numpy as np from pyhfo.core import DataObj import matplotlib.pyplot as plt import itertools def decimate(Data,q): ''' Use scipy decimate to create a new DataOb...
mit
annahs/atmos_research
WHI_long_term_make_SP2_GC_comparison_table-v2.py
1
12794
import matplotlib.pyplot as plt import sys import os import numpy as np from pprint import pprint from datetime import datetime from datetime import timedelta import mysql.connector import pickle import math import calendar from math import log10, floor GC_error = True test_case = 'Van'#'default' #default, Van, wet_s...
mit
MartinSavc/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
128
4761
""" =================================== Compare cross decomposition methods =================================== Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with multivariate response, a.k.a. PLS2 - PLSRegression, with univariate response, a.k.a. PLS1 - CCA Given 2 multivari...
bsd-3-clause
dp7-PU/QCLAS_public
src/mplCanvasWidget.py
1
3235
""" Define the widget for showing matplotlib in main GUI. """ from PyQt5 import QtCore, QtGui, QtWidgets from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas import sys class mplCanvas(FigureCanvas): def __init__(self, paren...
mit
tmrowco/electricitymap
parsers/CR.py
1
7979
#!/usr/bin/env python3 # coding=utf-8 import logging import arrow import pandas as pd import requests from bs4 import BeautifulSoup TIMEZONE = 'America/Costa_Rica' DATE_FORMAT = 'DD/MM/YYYY' MONTH_FORMAT = 'MM/YYYY' POWER_PLANTS = { u'Aeroenergía': 'wind', u'Altamira': 'wind', u'Angostura': 'hydro', ...
gpl-3.0
xlhtc007/blaze
blaze/compute/pyfunc.py
7
6410
from __future__ import absolute_import, division, print_function import pandas as pd from ..expr import (Expr, Symbol, Field, Arithmetic, Math, Date, Time, DateTime, Millisecond, Microsecond, broadcast, sin, cos, Map, UTCFromTimestamp, DateTimeTruncate, symbol, ...
bsd-3-clause
mrshu/board2slides
project.py
1
1597
#!/usr/bin/env python import sys import cv2 as cv import numpy as np from matplotlib import pyplot as plt # Returns index of highest and lowest # element in a array def getMinMaxIndex(arr): max = arr[0] min = arr[0] maxi = 0 mini = 0 for i in range(arr.shape[0]): if max < arr[i]: max = arr[i] maxi = i i...
apache-2.0
mwv/scikit-learn
sklearn/linear_model/tests/test_coordinate_descent.py
114
25281
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing ...
bsd-3-clause
cjayb/mne-python
mne/stats/tests/test_regression.py
10
5761
# Authors: Teon Brooks <teon.brooks@gmail.com> # Denis A. Engemann <denis.engemann@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np from numpy.testing import assert_array_equal, assert_allclose, assert_equal import pytest ...
bsd-3-clause
PascalSteger/gravimage
programs/sphere/gi_loglike.py
1
11131
#!/usr/bin/env ipython3 ## @file # define log likelihood function to be called by multinest # spherical version # (c) GPL v3 2015 ETHZ Pascal Steger, pascal@steger.aero import numpy as np import pdb from scipy.interpolate import splev, splrep #from pylab import * #from multiprocessing import Pool # import matplotli...
gpl-2.0
astrodsg/latbin
latbin/interpolation.py
1
1953
from copy import copy import numpy as np import scipy.sparse import pandas as pd from latbin.lattice import * from latbin.matching import MatchingIndexer class KernelWeightedMatchingInterpolator(object): def __init__(self, x, y, x_scale, weighting_kernel=None, match_tolerance=6.0): if weighting_kern...
bsd-3-clause