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
Barmaley-exe/scikit-learn
sklearn/feature_selection/rfe.py
3
15243
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import numpy as np from ..utils import check_X_y, safe_sqr from ..utils.metaes...
bsd-3-clause
PrashntS/scikit-learn
sklearn/datasets/base.py
196
18554
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import shutil from os import environ from os.pa...
bsd-3-clause
f3r/scikit-learn
sklearn/utils/multiclass.py
13
12964
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi # # License: BSD 3 clause """ Multi-class / multi-label utility function ========================================== """ from __future__ import division from collections import Sequence from itertools import chain from scipy.sparse import issparse from scipy.sparse....
bsd-3-clause
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/pandas/io/wb.py
9
12688
# -*- coding: utf-8 -*- from __future__ import print_function from pandas.compat import map, reduce, range, lrange from pandas.io.common import urlopen from pandas.io import json import pandas import numpy as np import warnings warnings.warn("\n" "The pandas.io.wb module is moved to a separate package ...
artistic-2.0
ssaeger/scikit-learn
sklearn/cluster/tests/test_mean_shift.py
150
3651
""" Testing for mean shift clustering methods """ import numpy as np import warnings from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import asser...
bsd-3-clause
nvoron23/python-weka-wrapper
python/weka/plot/classifiers.py
2
13248
# 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. # # This program is distributed in the hope that it will be useful, # bu...
gpl-3.0
JohnOrlando/gnuradio-bitshark
gr-utils/src/python/gr_plot_psd.py
5
11977
#!/usr/bin/env python # # Copyright 2007,2008 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
cosmoharrigan/pylearn2
pylearn2/optimization/test_batch_gradient_descent.py
44
6402
from __future__ import print_function from pylearn2.optimization.batch_gradient_descent import BatchGradientDescent import theano.tensor as T from pylearn2.utils import sharedX import numpy as np from theano.compat.six.moves import xrange from theano import config from theano.printing import min_informative_str def t...
bsd-3-clause
weegreenblobbie/nsound
docs/user_guide/sphinxext/plot_directive.py
1
17849
"""A special directive for including a matplotlib plot. The source code for the plot may be included in one of two ways: 1. A path to a source file as the argument to the directive:: .. plot:: path/to/plot.py When a path to a source file is given, the content of the directive may optionally conta...
gpl-2.0
halmd-org/h5md-tools
h5mdtools/_plot/tcf.py
1
6265
# -*- coding: utf-8 -*- # # tcf - time correlation functions # # Copyright © 2013 Felix Höfling # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your o...
gpl-3.0
henryzord/clustering
src/measures/sswc.py
1
1931
import pandas as pd import numpy as np from scipy.spatial.distance import cdist __author__ = 'Henry Cagnini' def get_partition(medoids, dataset): medoid_index = np.flatnonzero(medoids) medoids_sample = dataset.loc[medoid_index] m_dist = cdist(dataset, medoids_sample, metric='euclidean') closest = ma...
gpl-3.0
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/api/filled_step.py
1
7707
""" ========================= Hatch-filled histograms ========================= This example showcases the hatching capabilities of matplotlib by plotting various histograms. """ import itertools from collections import OrderedDict from functools import partial import numpy as np import matplotlib.pyplot as plt impo...
mit
WarrenWeckesser/scikits-image
doc/ext/notebook_doc.py
44
3042
__all__ = ['python_to_notebook', 'Notebook'] import json import copy import warnings # Skeleton notebook in JSON format skeleton_nb = """{ "metadata": { "name":"" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type":...
bsd-3-clause
macks22/scikit-learn
examples/classification/plot_classification_probability.py
242
2624
""" =============================== Plot classification probability =============================== Plot the classification probability for different classifiers. We use a 3 class dataset, and we classify it with a Support Vector classifier, L1 and L2 penalized logistic regression with either a One-Vs-Rest or multinom...
bsd-3-clause
shyamalschandra/scikit-learn
examples/cluster/plot_mini_batch_kmeans.py
86
4092
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
bsd-3-clause
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/scorer_models/test_statistics/recall_at_fpr.py
1
3635
import io from collections import defaultdict from sklearn.metrics import recall_score from tabulate import tabulate from . import util from .test_statistic import ClassifierStatistic, TestStatistic class recall_at_fpr(ClassifierStatistic): """ Constructs a statistics generator that measures the maximum rec...
mit
roryyorke/python-control
examples/cruise-control.py
1
17056
# cruise-control.py - Cruise control example from FBS # RMM, 16 May 2019 # # The cruise control system of a car is a common feedback system encountered # in everyday life. The system attempts to maintain a constant velocity in the # presence of disturbances primarily caused by changes in the slope of a # road. The cont...
bsd-3-clause
kyleabeauchamp/testrepo
src/make_graph.py
4
1173
import numpy as np import matplotlib.pyplot as plt import networkx as nx pairs = [("openmm", "yank"), ("cmake", "openmm"), ("cuda", "openmm"), ("fftw3f", "openmm"), ("swig", "openmm"), ("mpi4py", "yank"), ("netcdf4", "yank"), ("numpy", "mdtraj"), ("scipy", "mdtraj"), # ("mdtraj", "mixtape"), ("sklearn", "mixtape"), (...
gpl-2.0
pastas/pasta
tests/test_gxg.py
1
4842
# -*- coding: utf-8 -*- """ Author: T. van Steijn, R.A. Collenteur, 2017 """ import numpy as np import pandas as pd import pastas as ps class TestGXG(object): def test_ghg(self): idx = pd.to_datetime(['20160114', '20160115', '20160128', '20160214']) s = pd.Series([10., 3., 30., 20.], index=idx...
mit
nmayorov/scikit-learn
sklearn/decomposition/tests/test_sparse_pca.py
160
6028
# 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
cjayb/mne-python
mne/epochs.py
1
133716
# -*- coding: utf-8 -*- """Tools for working with epoched data.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # Denis Engemann <denis.engemann@gmail.com> # Mainak Jas...
bsd-3-clause
mavrix93/LightCurvesClassifier
lcc_web/web/interface/lcc_views/visualization.py
1
10603
import os import numpy as np import pandas as pd from django.conf import settings from django.shortcuts import render from lcc.data_manager.package_reader import PackageReader from lcc.stars_processing.tools.visualization import plotUnsupProbabSpace from interface.helpers import getFields, load_test_stars from interf...
mit
isomerase/mozziesniff
data/experiments/Dickinson_experiments/dick_pickle.py
2
5178
# -*- coding: utf-8 -*- """ Created on Thu Apr 2 22:17:13 2015 @author: Richard Decal """ from matplotlib import pyplot as plt import seaborn as sns #sns.set_palette("muted", 8) import pickle fname = './mozzie_histograms.pickle' with open(fname) as f: mozzie_hists = pickle.load(f) def main(plotting = True): ...
mit
mmoiozo/IROS
sw/airborne/test/ahrs/ahrs_utils.py
86
4923
#! /usr/bin/env python # Copyright (C) 2011 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later ...
gpl-2.0
potash/scikit-learn
sklearn/exceptions.py
14
4945
""" The :mod:`sklearn.exceptions` module includes all custom warnings and error classes used across scikit-learn. """ __all__ = ['NotFittedError', 'ChangedBehaviorWarning', 'ConvergenceWarning', 'DataConversionWarning', 'DataDimensionalityWarning', 'EfficiencyWarn...
bsd-3-clause
mwv/scikit-learn
sklearn/preprocessing/label.py
137
27165
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Joel Nothman <joel.nothman@gmail.com> # Hamzeh Alsalhi <ha258@cornell.edu> # Licens...
bsd-3-clause
tdhopper/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
vancan1ty/SEAT
DataProcessing.py
1
7008
# Copyright (C) 2015 Currell Berry, Justin Jackson, and Team 41 Epilepsy Modeling # # This file is part of SEAT (Simple EEG Analysis Tool). # # SEAT 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 Foundati...
gpl-3.0
dsm054/pandas
pandas/core/indexes/api.py
2
8350
import textwrap import warnings from pandas.core.indexes.base import (Index, _new_Index, ensure_index, ensure_index_from_sequences, InvalidIndexError) # noqa from pan...
bsd-3-clause
csherwood-usgs/landlab
setup.py
1
5852
#! /usr/bin/env python #from ez_setup import use_setuptools #use_setuptools() from setuptools import setup, find_packages, Extension from setuptools.command.install import install from setuptools.command.develop import develop from distutils.extension import Extension import sys ext_modules = [ Extension('land...
mit
wateraccounting/wa
Generator/Sheet4/main.py
1
13145
# -*- coding: utf-8 -*- """ Authors: Tim Hessels UNESCO-IHE 2017 Contact: t.hessels@unesco-ihe.org Repository: https://github.com/wateraccounting/wa Module: Function/Four """ # import general python modules import os import numpy as np import pandas as pd from netCDF4 import Dataset def Calculate(WA_HOME_fold...
apache-2.0
joshbohde/scikit-learn
sklearn/manifold/tests/test_locally_linear.py
1
3177
import numpy as np from numpy.testing import assert_almost_equal from sklearn import neighbors, manifold from sklearn.utils.fixes import product eigen_solvers = ['dense', 'arpack'] def assert_lower(a, b, details=None): message = "%r is not lower than %r" % (a, b) if details is not None: message += "...
bsd-3-clause
raghavrv/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
33
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
blueshiftofdeath/imessage-counter
imessageCounter.py
1
6291
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates import datetime, sqlite3, os from datetime import timedelta from itertools import groupby from matplotlib.dates import DayLocator, MonthLocator, WeekdayLocator from matplotlib.dates import AutoDateFormatter, Date...
mit
cython-testbed/pandas
pandas/tests/series/test_alter_axes.py
1
11229
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytest from datetime import datetime import numpy as np from pandas import Series, DataFrame, Index, MultiIndex, RangeIndex from pandas.compat import lrange, range, zip import pandas.util.testing as tm class TestSeriesAlterAxes(object): def test_setind...
bsd-3-clause
ssaeger/scikit-learn
sklearn/utils/tests/test_multiclass.py
34
13405
from __future__ import division import numpy as np import scipy.sparse as sp from itertools import product from sklearn.externals.six.moves import xrange from sklearn.externals.six import iteritems from scipy.sparse import issparse from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sp...
bsd-3-clause
eickenberg/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting.py
1
33972
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import numpy as np import warnings from sklearn import datasets from sklearn.base import clone from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble.gra...
bsd-3-clause
ZGainsforth/MultiLaue
BasicProcessing.py
1
7851
# Created 2016, Zack Gainsforth import matplotlib #matplotlib.use('Qt4Agg') import matplotlib.pyplot as plt import numpy as np import h5py import multiprocessing import time def LoadScan(HDF5FileName, readwrite=False): # Read the HDF file if readwrite == False: f = h5py.File(HDF5FileName, 'r') # , swm...
epl-1.0
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/numpy/lib/polynomial.py
32
37972
""" 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....
apache-2.0
UNR-AERIAL/scikit-learn
sklearn/ensemble/tests/test_base.py
284
1328
""" Testing for the base module (sklearn.ensemble.base). """ # Authors: Gilles Louppe # License: BSD 3 clause from numpy.testing import assert_equal from nose.tools import assert_true from sklearn.utils.testing import assert_raise_message from sklearn.datasets import load_iris from sklearn.ensemble import BaggingCla...
bsd-3-clause
Dapid/GPy
GPy/models/bayesian_gplvm.py
8
10126
# Copyright (c) 2012 - 2014 the GPy Austhors (see AUTHORS.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from .. import kern from ..core.sparse_gp_mpi import SparseGP_MPI from ..likelihoods import Gaussian from ..core.parameterization.variational import NormalPosterior, NormalPrior...
bsd-3-clause
marcusrehm/serenata-de-amor
research/src/fetch_yelp_info.py
2
5299
import json import requests import re import os.path import datetime from unicodedata import normalize from decouple import config import numpy as np import pandas as pd from pandas.io.json import json_normalize """ Get your API access token 1. Create an Yelp account. 2. Create an app (https://www.yelp.com/develope...
mit
ManuSchmi88/landlab
setup.py
1
5818
#! /usr/bin/env python #from ez_setup import use_setuptools #use_setuptools() from setuptools import setup, find_packages, Extension from setuptools.command.install import install from setuptools.command.develop import develop from distutils.extension import Extension import sys ext_modules = [ Extension('land...
mit
alvarofierroclavero/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
faner-father/tushare
tushare/stock/classifying.py
11
8914
# -*- coding:utf-8 -*- """ 获取股票分类数据接口 Created on 2015/02/01 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ import pandas as pd from tushare.stock import cons as ct from tushare.stock import ref_vars as rv import json import re from pandas.util.testing import _network_error_classes ...
bsd-3-clause
tkoziara/parmec
tests/spring_contact_moving_plane.py
1
1441
# PARMEC test --> SPRING contact moving plane test matnum = MATERIAL (1E3, 1E9, 0.25) nodes0 = [-0.5, -0.5, -0.2, 1.5, -0.5, -0.2, 1.5, 1.5, -0.2, -0.5, 1.5, -0.2, -0.5, -0.5, 0, 1.5, -0.5, 0, 1.5, 1.5, 0, -0.5, 1.5, 0] nodes1 = [0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0...
mit
meduz/scikit-learn
sklearn/preprocessing/tests/test_data.py
30
61609
# Authors: # # Giorgio Patrini # # License: BSD 3 clause import warnings import numpy as np import numpy.linalg as la from scipy import sparse from distutils.version import LooseVersion from sklearn.utils import gen_batches from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing im...
bsd-3-clause
antkillerfarm/antkillerfarm_crazy
python/ml/keras/hello_gan1.py
1
8363
#!/usr/bin/python # -*- coding: utf-8 -*- import os import matplotlib.pyplot as plt import keras.backend as K from keras.datasets import mnist from keras.layers import * from keras.models import * from keras.optimizers import * from keras.initializers import * from keras.utils.generic_utils import Progbar GPU = "0"...
gpl-3.0
achim1/ctplot
setup.py
2
2879
#!/usr/bin/env python # -*- coding: utf-8 -*- # Have a look at https://pythonhosted.org/setuptools # http://stackoverflow.com/questions/7522250/how-to-include-package-data-with-setuptools-distribute # http://stackoverflow.com/questions/1231688/how-do-i-remove-packages-installed-with-pythons-easy-install # http://stack...
gpl-3.0
zorroblue/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
17
21562
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
equialgo/scikit-learn
sklearn/metrics/classification.py
4
71965
"""Metrics to assess performance on classification task given class 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.gramf...
bsd-3-clause
wazeerzulfikar/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
355
2843
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
gromitsun/sim-xrf-py
others/scatt_bg/scatt_bg3_wpw.py
1
4121
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter from matplotlib.colors import LogNorm RECALC = False if RECALC: from scipy.integrate import dblquad import sys, os sys.path.append(o...
mit
jbloomlab/dms_tools2
dms_tools2/utils.py
1
59560
""" =================== utils =================== Miscellaneous utilities for ``dms_tools2``. """ import os import math import sys import time import platform import importlib import logging import tempfile import textwrap import itertools import collections import random import re import pysam import numpy import ...
gpl-3.0
oesteban/mriqc
mriqc/classifier/sklearn/preprocessing.py
1
22145
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # @Author: oesteban # @Date: 2017-06-08 17:11:58 """ Extensions to the sklearn's default data preprocessing filters """ import numpy as np import pandas as p...
bsd-3-clause
SpencerDodd/CrossBLAST
hist_results.py
1
2749
import matplotlib.pyplot as plt import numpy as np import csv import sys class HistogramParser: def __init__(self, other, superfamily, family, subfamily, genus, species, subspecies): self.other = other self.superfamily = superfamily self.family = family self.subfamily = subfamily self.genus = genus self...
mit
josemao/nilmtk
nilmtk/results.py
6
7403
import abc import pandas as pd import copy from .timeframe import TimeFrame from nilmtk.utils import get_tz, tz_localize_naive class Results(object): """Stats results from each node need to be assigned to a specific class so we know how to combine results from multiple chunks. For example, Energy can be s...
apache-2.0
quasars100/Resonance_testing_scripts
alice/multiplesim.py
1
6288
import rebound import numpy as np import reboundxf import matplotlib.pyplot as plt from pylab import * from rebound.interruptible_pool import InterruptiblePool def anglerange(val): while val < 0: val += 2*np.pi while val > 2*np.pi: val -= 2*np.pi return val*180/np.pi def calc(args): taue=a...
gpl-3.0
sssundar/Drone
motor/quadratic_drag.py
1
2709
# Solves for the dynamics if a linear torque, quadratic drag model of our DC brushed motor. # See notes from 8/4/2018-8/12/2018. We're trying to find the relations between Bd, Bm, Gamma, nd Jprop # that give us linear relations between thrust and the duty cycle, which was measured, # and which match a mechanical timesc...
gpl-3.0
hagabbar/pycbc_copy
pycbc/results/legacy_grb.py
1
22775
#!/usr/bin/env python # Copyright (C) 2015 Andrew R. Williamson # # 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. # # T...
gpl-3.0
ebolyen/q2d2
q2d2/__init__.py
2
16324
#!/usr/bin/env python __version__ = "0.0.0-dev" import random import io import itertools from collections import defaultdict, namedtuple import hashlib import os import shutil import glob import math from functools import partial import numpy as np import pandas as pd from IPython.html import widgets from IPython.h...
bsd-3-clause
wzbozon/statsmodels
statsmodels/stats/tests/test_diagnostic.py
21
40146
# -*- coding: utf-8 -*- """Tests for Regression Diagnostics and Specification Tests Created on Thu Feb 09 13:19:47 2012 Author: Josef Perktold License: BSD-3 currently all tests are against R """ #import warnings #warnings.simplefilter("default") # ResourceWarning doesn't exist in python 2 #warnings.simplefilter("i...
bsd-3-clause
FluVigilanciaBR/seasonality
methods/data_filter/delay_table_4Weeks.py
1
5515
__author__ = 'Marcelo Ferreira da Costa Gomes' import pandas as pd import numpy as np import episem import sys import datetime import calendar import argparse from argparse import RawDescriptionHelpFormatter def readtable(fname): tgt_cols = ['SG_UF_NOT', 'DT_SIN_PRI_epiyear', 'DT_SIN_PRI_epiweek', 'SinPri2Digita...
gpl-3.0
sarahgrogan/scikit-learn
examples/manifold/plot_mds.py
261
2616
""" ========================= Multi-dimensional scaling ========================= An illustration of the metric and non-metric MDS on generated noisy data. The reconstructed points using the metric MDS and non metric MDS are slightly shifted to avoid overlapping. """ # Author: Nelle Varoquaux <nelle.varoquaux@gmail....
bsd-3-clause
embeddedarm/android_external_chromium_org
chrome/browser/nacl_host/test/gdb_rsp.py
99
2431
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This file is based on gdb_rsp.py file from NaCl repository. import re import socket import time def RspChecksum(data): checksum = 0 for char in ...
bsd-3-clause
endolith/scipy
scipy/integrate/odepack.py
21
10740
# Author: Travis Oliphant __all__ = ['odeint'] import numpy as np from . import _odepack from copy import copy import warnings class ODEintWarning(Warning): pass _msgs = {2: "Integration successful.", 1: "Nothing was done; the integration time was 0.", -1: "Excess work done on this call (per...
bsd-3-clause
alvarofierroclavero/scikit-learn
examples/bicluster/bicluster_newsgroups.py
162
7103
""" ================================================================ Biclustering documents with the Spectral Co-clustering algorithm ================================================================ This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset. The 'comp.os.ms-windows...
bsd-3-clause
grlee77/pywt
demo/plot_wavelets.py
8
2656
#!/usr/bin/env python # -*- coding: utf-8 -*- # Plot scaling and wavelet functions for db, sym, coif, bior and rbio families import itertools import matplotlib.pyplot as plt import pywt plot_data = [('db', (4, 3)), ('sym', (4, 3)), ('coif', (3, 2))] for family, (rows, cols) in plot_dat...
mit
MMKrell/pyspace
pySPACE/missions/operations/comp_analysis.py
4
36892
""" Creates various comparing plots on several levels for a :class:`~pySPACE.resources.dataset_defs.performance_result.PerformanceResultSummary` This module contains implementations of an operation and a process for analyzing data contained in a csv file (typically the result of a Weka Classification Operation). A *C...
gpl-3.0
wrshoemaker/ffpopsim
tests/python_lowd.py
2
1442
# vim: fdm=indent ''' author: Fabio Zanini date: 14/05/12 content: Test script for the python bindings to the low-dimensional simulation ''' # Import module import sys sys.path.insert(0, '../pkg/python') import numpy as np import matplotlib.pyplot as plt import FFPopSim as h # Construct class...
gpl-3.0
ChanderG/scikit-learn
examples/ensemble/plot_forest_iris.py
335
6271
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
bsd-3-clause
dsquareindia/scikit-learn
sklearn/feature_extraction/tests/test_image.py
38
11165
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import numpy as np import scipy as sp from scipy import ndimage from numpy.testing import assert_raises from sklearn.feature_extraction.image import ( img_to_gra...
bsd-3-clause
kgullikson88/General
Expectations.py
1
5027
import pandas as pd import numpy as np import pysynphot from scipy.optimize import leastsq from astropy import units as u import SpectralTypeRelations import Mamajek_Table MS = SpectralTypeRelations.MainSequence() MT = Mamajek_Table.MamajekTable() MT.mam_df['radius'] = 10 ** (0.5 * MT.mam_df.logL - 2.0 * MT.mam_df.l...
gpl-3.0
jeffmkw/DAT210x-Lab
Module5/assignment6.py
1
9272
import random, math import pandas as pd import numpy as np import scipy.io import matplotlib from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt # If you'd like to try this lab with PCA instead of Isomap for dimensionality # reduction technique: Test_PCA = False matplotlib.style.use('ggplot') # ...
mit
anirudhjayaraman/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
jakobworldpeace/scikit-learn
examples/svm/plot_custom_kernel.py
93
1562
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
wazeerzulfikar/scikit-learn
sklearn/tests/test_metaestimators.py
30
5040
"""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.utils.validation import...
bsd-3-clause
StongeEtienne/dipy
setup_helpers.py
11
14073
''' Distutils / setuptools helpers ''' import os import sys from os.path import join as pjoin, split as psplit, splitext, dirname, exists import tempfile import shutil from distutils.version import LooseVersion from distutils.command.install_scripts import install_scripts from distutils.errors import CompileError, Li...
bsd-3-clause
moutai/scikit-learn
sklearn/feature_extraction/tests/test_image.py
25
11187
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import numpy as np import scipy as sp from scipy import ndimage from nose.tools import assert_equal, assert_true from numpy.testing import assert_raises from sklearn...
bsd-3-clause
eike-welk/clair
src/clairweb/libclair/test/test_prices.py
1
24394
# -*- coding: utf-8 -*- ############################################################################### # Clair - Project to discover prices on e-commerce sites. # # # # Copyright (C) 2013 by Eike Welk ...
gpl-3.0
ales-erjavec/scipy
scipy/interpolate/interpolate.py
25
80287
""" Classes for interpolating values. """ from __future__ import division, print_function, absolute_import __all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp', 'ppform', 'lagrange', 'PPoly', 'BPoly', 'RegularGridInterpolator', 'interpn'] import itertools from numpy impo...
bsd-3-clause
geopandas/geopandas
geopandas/tools/clip.py
2
8098
""" geopandas.clip ============== A module to clip vector data using GeoPandas. """ import warnings import numpy as np import pandas as pd from shapely.geometry import Polygon, MultiPolygon from geopandas import GeoDataFrame, GeoSeries from geopandas.array import _check_crs, _crs_mismatch_warn def _clip_points(g...
bsd-3-clause
DrigerG/IIITB-ML
project/TexCounter/tex_counter.py
1
9127
#!/usr/bin/env python """TexCounter.py: Counts the number of garments in a shelf""" import cv2 import sys import logging import numpy as np import pandas as pd from matplotlib import pyplot as plt from sklearn.cluster import MeanShift, estimate_bandwidth __author__ = "Pradeep Kumar A.V." logging.basicConfig(filena...
apache-2.0
robotenique/intermediateProgramming
MAC0209/paretoLaw.py
1
2832
''' Problem 1.1 of the book 'Introduction to Computer Simulation Methods', chapter one: Distribution of Money ''' __author__ = "Juliano Garcia de Oliveira" import random as rnd import matplotlib.pyplot as plt import numpy as np def createAgents(n, m0): # Create a dictionary with n pairs of 'agent : m0', and r...
unlicense
gamahead/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/__init__.py
72
2225
import matplotlib import inspect import warnings # ipython relies on interactive_bk being defined here from matplotlib.rcsetup import interactive_bk __all__ = ['backend','show','draw_if_interactive', 'new_figure_manager', 'backend_version'] backend = matplotlib.get_backend() # validates, to match all_bac...
gpl-3.0
sonnyhu/scikit-learn
sklearn/naive_bayes.py
4
30634
# -*- coding: utf-8 -*- """ The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These are supervised learning methods based on applying Bayes' theorem with strong (naive) feature independence assumptions. """ # Author: Vincent Michel <vincent.michel@inria.fr> # Minor fixes by Fabian Pedre...
bsd-3-clause
davidgbe/scikit-learn
sklearn/metrics/cluster/__init__.py
312
1322
""" The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: - supervised, which uses a ground truth class values for each sample. - unsupervised, which does not and measures the 'quality' of the model itself. """ from .supervised import ...
bsd-3-clause
bubae/gazeAssistRecognize
test.py
1
2664
import numpy as np from sklearn import svm from sklearn import datasets from sklearn.multiclass import OneVsRestClassifier from sklearn.svm import LinearSVC # from sklearn.pipeline import Pipeline # from sklearn.feature_extraction.text import CountVectorizer # from sklearn.svm import LinearSVC # from sklearn.feature_ex...
mit
puruckertom/ubertool
ubertool/agdrift/tests/test_agdrift_integration.py
1
10694
from __future__ import division #brings in Python 3.0 mixed type calculation rules import datetime import inspect import numpy.testing as npt import os.path import pandas as pd import pkgutil import sys from tabulate import tabulate import unittest try: from StringIO import StringIO #BitesIO? except ImportError: ...
unlicense
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/matplotlib/backend_bases.py
4
110334
""" Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a matplotlib backend :class:`RendererBase` An abstract base class to handle drawing/rendering operations. :class:`FigureCanvasBase` The abstraction layer that separates the :class:`matplotlib.fi...
mit
dpshelio/sunpy
sunpy/instr/lyra.py
2
31288
import csv import copy import urllib import os.path import sqlite3 import datetime from warnings import warn import numpy as np import pandas from astropy.io import fits from astropy.time import Time from sunpy.time import parse_time from sunpy.util.net import check_download_file from sunpy.util.config import get_an...
bsd-2-clause
michalsenkyr/spark
examples/src/main/python/sql/arrow.py
16
5034
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
hugobowne/scikit-learn
examples/ensemble/plot_gradient_boosting_regression.py
87
2510
""" ============================ Gradient Boosting regression ============================ Demonstrate Gradient Boosting on the Boston housing dataset. This example fits a Gradient Boosting model with least squares loss and 500 regression trees of depth 4. """ print(__doc__) # Author: Peter Prettenhofer <peter.prett...
bsd-3-clause
tobybreckon/bee-wi
examples/pathFollower.py
1
17217
# Copyright (c) 2014 # Joey Green, School of Engineering and Computer Sciences, Durham University, UK # All versions of this software (both binary and source) must retain # and display this copyright notice. # License : GPL - http://www.gnu.org/copyleft/gpl.html # ******************** PATH FOLLOWER MODULE **...
gpl-2.0
PAIR-code/recommendation-rudders
hyperbolic-rs/rudders/graph/analysis/plot_hyperbolicity.py
1
1050
import argparse import logging import numpy as np import matplotlib.pyplot as plt from utils import annotate_vline, remove_extensions parser = argparse.ArgumentParser(description='Plot delta-hyperbolicities') parser.add_argument( '--input', type=str, required=True, help='The hyperbolicities file.') args = pa...
apache-2.0
fengzhyuan/scikit-learn
sklearn/metrics/tests/test_pairwise.py
105
22788
import numpy as np from numpy import linalg from scipy.sparse import dok_matrix, csr_matrix, issparse from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing impo...
bsd-3-clause
BMP-TECH/mavlink
pymavlink/tools/mavgraph.py
8
9809
#!/usr/bin/env python ''' graph a MAVLink log file Andrew Tridgell August 2011 ''' import sys, struct, time, os, datetime import math, re import matplotlib from math import * from pymavlink.mavextra import * # cope with rename of raw_input in python3 try: input = raw_input except NameError: pass colourmap =...
lgpl-3.0
abhishekgahlot/scikit-learn
sklearn/ensemble/tests/test_base.py
28
1334
""" Testing for the base module (sklearn.ensemble.base). """ # Authors: Gilles Louppe # License: BSD 3 clause from numpy.testing import assert_equal from nose.tools import assert_true from sklearn.utils.testing import assert_raise_message from sklearn.datasets import load_iris from sklearn.ensemble import BaggingCla...
bsd-3-clause
cimat/data-visualization-patterns
display-patterns/Discrete Quantities/Pruebas/A36Span_Chart_Pyqtgraph.py
1
1080
from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg from datos import data import pandas as pd d=data('mtcars') subset1, subset2, subset3= d[d.cyl==4], d[d.cyl==6], d[d.cyl==8] datos=pd.DataFrame ({'Max': [max(subset1.mpg), max(subset2.mpg), max(subset3.mpg)], 'Min': [min(subset1.mpg), min(subset2.mpg...
cc0-1.0
fireball-QMD/progs
pyfb/geometry/dinamic.py
1
5380
from pyfb.geometry.step import step from pyfb.geometry.atom import atom import pandas as pd import numpy as np class dinamic: def __init__(self): self.step=[] #lee las cargas de cada atomo despues de las posiciones: # x y z Qtot qs qp qd ..... self.out=[] def print_total_steps(self): print(l...
gpl-3.0