repo_name
stringlengths
6
100
path
stringlengths
4
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
935
727k
license
stringclasses
15 values
eig-2017/the-magical-csv-merge-machine
merge_machine/test_es.py
1
8679
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Aug 18 16:42:41 2017 @author: m75380 # Ideas: Learn analysers and weights for blocking on ES directly # Put all fields to learn blocking by exact match on other fields https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html ...
mit
elkingtonmcb/scikit-learn
sklearn/neighbors/regression.py
100
11017
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output support by Arna...
bsd-3-clause
shangwuhencc/scikit-learn
examples/plot_kernel_approximation.py
262
8004
""" ================================================== Explicit feature map approximation for RBF kernels ================================================== An example illustrating the approximation of the feature map of an RBF kernel. .. currentmodule:: sklearn.kernel_approximation It shows how to use :class:`RBFSa...
bsd-3-clause
deepesch/scikit-learn
examples/svm/plot_svm_margin.py
318
2328
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
hjanime/VisTrails
vistrails/packages/matplotlib/artists.py
3
230248
from __future__ import division from vistrails.core.modules.vistrails_module import Module from bases import MplProperties import matplotlib.artist import matplotlib.cbook def translate_color(c): return c.tuple def translate_MplLine2DProperties_marker(val): translate_dict = {'caretright': 5, 'star': '*'...
bsd-3-clause
stonneau/cwc_tests
src/tools/plot_utils.py
2
11856
# -*- coding: utf-8 -*- """ Created on Fri Jan 16 09:16:56 2015 @author: adelpret """ import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np DEFAULT_FONT_SIZE = 40; DEFAULT_AXIS_FONT_SIZE = DEFAULT_FONT_SIZE; DEFAULT_LINE_WIDTH = 8; #13; DEFAULT_MARKER_SIZE = 6;...
gpl-3.0
kashif/scikit-learn
sklearn/ensemble/tests/test_voting_classifier.py
22
6543
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestCl...
bsd-3-clause
kagayakidan/scikit-learn
sklearn/metrics/cluster/supervised.py
207
27395
"""Utilities to evaluate the clustering performance of models Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # License: BSD 3 clause fr...
bsd-3-clause
rs2/pandas
pandas/tests/groupby/test_function.py
1
33782
import builtins from io import StringIO import numpy as np import pytest from pandas.errors import UnsupportedFunctionCall import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series, Timestamp, date_range, isna import pandas._testing as tm import pandas.core.nanops as nanops from pandas.util import ...
bsd-3-clause
sinhrks/pandas-ml
pandas_ml/snsaccessors/base.py
1
7540
#!/usr/bin/env python import pandas as pd from pandas_ml.core.accessor import _AccessorMethods, _attach_methods class SeabornMethods(_AccessorMethods): """Accessor to ``sklearn.cluster``.""" _module_name = 'seaborn' _module_attrs = ['palplot', 'set', 'axes_style', 'plotting_context', ...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/matplotlib/backends/backend_wxagg.py
8
5866
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import matplotlib from matplotlib.figure import Figure from .backend_agg import FigureCanvasAgg from . import wx_compat as wxc from . import backend_wx from .backend_wx i...
mit
mugizico/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
NMTHydro/Recharge
utils/tornadoPlot_SA.py
1
4933
# =============================================================================== # Copyright 2016 dgketchum # # 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/licens...
apache-2.0
466152112/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
230
2386
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset. Plot the class probabilities of the first sample in a toy dataset pred...
bsd-3-clause
TomAugspurger/pandas
pandas/core/arrays/sparse/scipy_sparse.py
1
5381
""" Interaction with scipy.sparse matrices. Currently only includes to_coo helpers. """ from pandas.core.indexes.api import Index, MultiIndex from pandas.core.series import Series def _check_is_partition(parts, whole): whole = set(whole) parts = [set(x) for x in parts] if set.intersection(*parts) != set(...
bsd-3-clause
JosmanPS/scikit-learn
sklearn/decomposition/tests/test_online_lda.py
48
12645
import numpy as np from scipy.linalg import block_diag from scipy.sparse import csr_matrix from scipy.special import psi from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d, _dirichlet_expect...
bsd-3-clause
NicholasBermuda/transit-fitting
transitfit/kepler.py
1
5322
from __future__ import print_function, division import re import pandas as pd import numpy as np import kplr from .lightcurve import LightCurve, Planet, BinaryLightCurve KEPLER_CADENCE = 1626./86400 def lc_dataframe(lc): """Returns a pandas DataFrame of given lightcurve data """ with lc.open() as f: ...
mit
equialgo/scikit-learn
sklearn/datasets/base.py
5
26099
""" 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 sys import shutil from os import environ...
bsd-3-clause
KawalMusikIndonesia/kimi
kimiserver/apps/run_tests.py
16
6040
from dejavu.testing import * from dejavu import Dejavu from optparse import OptionParser import matplotlib.pyplot as plt import time import shutil usage = "usage: %prog [options] TESTING_AUDIOFOLDER" parser = OptionParser(usage=usage, version="%prog 1.1") parser.add_option("--secs", action="store", ...
gpl-3.0
DrSkippy/php_books_database
tools/bookdbtool/visualizations.py
1
1064
import logging import pandas as pd import matplotlib.pyplot as plt def running_total_comparison(df1, window=15): fig_size = [12,12] xlim = [0,365] ylim = [0,max(df1.Pages)] years = df1.Year.unique()[-window:].tolist() y = years.pop(0) _df = df1.loc[df1.Year == y] ax = _df.plot("Day", "Page...
bsd-2-clause
tomaslaz/KLMC_Analysis
DM_DOS.py
2
6477
#!/usr/bin/env python """ A script to plot DOS (integrated) @author Tomas Lazauskas, David Mora Fonz, 2016 @web www.lazauskas.net @email tomas.lazauskas[a]gmail.com """ import copy import math import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from optparse import OptionPars...
gpl-3.0
yl565/statsmodels
statsmodels/examples/ex_kernel_regression.py
34
1785
# -*- coding: utf-8 -*- """ Created on Wed Jan 02 09:17:40 2013 Author: Josef Perktold based on test file by George Panterov """ from __future__ import print_function import numpy as np import numpy.testing as npt import statsmodels.nonparametric.api as nparam #import statsmodels.api as sm #nparam = sm.nonparametri...
bsd-3-clause
bthirion/scikit-learn
sklearn/decomposition/tests/test_nmf.py
28
17934
import numpy as np import scipy.sparse as sp import numbers from scipy import linalg from sklearn.decomposition import NMF, non_negative_factorization from sklearn.decomposition import nmf # For testing internals from scipy.sparse import csc_matrix from sklearn.utils.testing import assert_true from sklearn.utils.te...
bsd-3-clause
simonsfoundation/CaImAn
caiman/source_extraction/volpy/mrcnn/visualize.py
2
19666
""" Mask R-CNN Display and Visualization Functions. Copyright (c) 2017 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by Waleed Abdulla """ import os import sys import random import itertools import colorsys import numpy as np from skimage.measure import find_contours import matplo...
gpl-2.0
lhilt/scipy
scipy/signal/wavelets.py
4
10504
from __future__ import division, print_function, absolute_import import numpy as np from numpy.dual import eig from scipy.special import comb from scipy.signal import convolve __all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'cwt'] def daub(p): """ The coefficients for the FIR low-pass filter produc...
bsd-3-clause
alekz112/statsmodels
statsmodels/sandbox/examples/example_crossval.py
33
2232
import numpy as np from statsmodels.sandbox.tools import cross_val if __name__ == '__main__': #A: josef-pktd import statsmodels.api as sm from statsmodels.api import OLS #from statsmodels.datasets.longley import load from statsmodels.datasets.stackloss import load from statsmodels.iolib.tab...
bsd-3-clause
elijah513/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
PhasesResearchLab/ESPEI
espei/plot.py
1
46082
""" Plotting of input data and calculated database quantities """ import warnings from collections import OrderedDict import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np import tinydb from sympy import Symbol from pycalphad import Model, calculate, equilibrium, variables as v from pyca...
mit
costypetrisor/scikit-learn
sklearn/grid_search.py
4
34405
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
bsd-3-clause
nhuntwalker/astroML
book_figures/chapter10/fig_arrival_time.py
3
4743
""" Arrival Time Analysis --------------------- Figure 10.24 Modeling time-dependent flux based on arrival time data. The top-right panel shows the rate r(t) = r0[1 + a sin(omega t + phi)], along with the locations of the 104 detected photons. The remaining panels show the model contours calculated via MCMC; dotted li...
bsd-2-clause
mahak/spark
python/pyspark/pandas/data_type_ops/categorical_ops.py
5
2506
# # 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
nhejazi/scikit-learn
sklearn/utils/testing.py
2
31011
"""Testing utilities.""" # Copyright (c) 2011, 2012 # Authors: Pietro Berkes, # Andreas Muller # Mathieu Blondel # Olivier Grisel # Arnaud Joly # Denis Engemann # Giorgio Patrini # Thierry Guillemot # License: BSD 3 clause import os import inspect import p...
bsd-3-clause
kpespinosa/BuildingMachineLearningSystemsWithPython
ch09/02_ceps_based_classifier.py
24
3574
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import numpy as np from collections import defaultdict from sklearn.metrics import precision_recall_cu...
mit
benitesf/Skin-Lesion-Analysis-Towards-Melanoma-Detection
test/gabor/gabor_fourier_plots.py
1
3944
import numpy as np import matplotlib.pyplot as plt from scipy import fftpack def plot_surface3d(Z): from matplotlib.ticker import LinearLocator, FormatStrFormatter from matplotlib import cm from mpl_toolkits.mplot3d import axes3d fig = plt.figure() ax = fig.gca(projection='3d') x = np.floor(...
mit
chairmanmeow50/Brainspawn
brainspawn/plots/plot.py
1
2326
""" Module for plots. Plots with one matplotlib subplot should extend from this class. Otherwise if multiple plots are needed, must extend from actual BasePlot. """ import gtk from abc import ABCMeta, abstractmethod from plots.base_plot import BasePlot from plots.configuration import Configuration import settings cl...
bsd-3-clause
IshankGulati/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
sonnyhu/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
161
1380
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
abelfunctions/abelfunctions
abelfunctions/differentials.py
1
23366
r"""Differentials :mod:`abelfunctions.differentials` ================================================ This module contains functions for computing a basis of holomorphic differentials of a Riemann surface given by a complex plane algebraic curve :math:`f \in \mathbb{C}[x,y]`. A differential :math:`\omega = h(x,y)dx` d...
mit
3324fr/spinalcordtoolbox
dev/tamag/old/msct_get_centerline_from_labels.py
1
10205
#!/usr/bin/env python import numpy as np import commands, sys # Get path of the toolbox status, path_sct = commands.getstatusoutput('echo $SCT_DIR') # Append path that contains scripts, to be able to load modules sys.path.append(path_sct + '/scripts') sys.path.append('/home/tamag/code') from msct_image import Imag...
mit
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/sklearn/neighbors/regression.py
8
10967
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck # Multi-output support by Arnaud Joly <a.joly@ulg.ac...
mit
bchappet/dnfpy
src/dnfpyUtils/stats/clusterMap1.py
1
1863
from dnfpy.core.map2D import Map2D import numpy as np from sklearn.cluster import DBSCAN import scipy.spatial.distance as dist from dnfpyUtils.stats.clusteMap import ClusterMap class ClusterMap1(ClusterMap): """ For 1 bubble!! 1 cluster is computed simply as barycenter Params: "continuity" : float ...
gpl-2.0
kevalds51/sympy
sympy/plotting/plot.py
55
64797
"""Plotting module for Sympy. A plot is represented by the ``Plot`` class that contains a reference to the backend and a list of the data series to be plotted. The data series are instances of classes meant to simplify getting points and meshes from sympy expressions. ``plot_backends`` is a dictionary with all the bac...
bsd-3-clause
ysig/BioClassSim
source/classify/classifier.py
1
1697
import numpy as np from sklearn import svm def kernelization(X,t=0): # for 1 to 3 array is considered symmetric if(t==1): #spectrum clip e,v = np.linalg.eig(X) ep = np.maximum.reduce([e,np.zeros(e.shape[0])]) S = np.dot(v.T,np.dot(np.diag(ep),v)) ...
apache-2.0
ucbtrans/sumo-project
examples/10_cars/runner-update_6_9_16.py
1
18135
#!/usr/bin/env python #@file runner.py import os import sys import optparse import subprocess import random import pdb import matplotlib.pyplot as plt import math import numpy, scipy.io sys.path.append(os.path.join('..', '..', 'utils')) # import python modules from $SUMO_HOME/tools directory try: sys.path.appen...
bsd-2-clause
mne-tools/mne-python
logo/generate_mne_logos.py
13
7174
# -*- coding: utf-8 -*- """ =============================================================================== Script 'mne logo' =============================================================================== This script makes the logo for MNE. """ # @author: drmccloy # Created on Mon Jul 20 11:28:16 2015 # License: BSD ...
bsd-3-clause
Achuth17/scikit-learn
sklearn/linear_model/__init__.py
270
3096
""" The :mod:`sklearn.linear_model` module implements generalized linear models. It includes Ridge regression, Bayesian Regression, Lasso and Elastic Net estimators computed with Least Angle Regression and coordinate descent. It also implements Stochastic Gradient Descent related algorithms. """ # See http://scikit-le...
bsd-3-clause
sinkap/trappy
tests/test_baretrace.py
2
3406
# Copyright 2015-2016 ARM Limited # # 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 w...
apache-2.0
NunoEdgarGub1/scikit-learn
examples/ensemble/plot_ensemble_oob.py
259
3265
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bsd-3-clause
herow/planning_qgis
python/plugins/processing/algs/qgis/PolarPlot.py
5
3040
# -*- coding: utf-8 -*- """ *************************************************************************** BarPlot.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com ******************************...
gpl-2.0
vermouthmjl/scikit-learn
sklearn/decomposition/tests/test_fastica.py
272
7798
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from nose.tools import assert_raises 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 skl...
bsd-3-clause
glennq/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
Erotemic/plottool
plottool_ibeis/__MPL_INIT__.py
1
8661
# -*- coding: utf-8 -*- """ Notes: To use various backends certian packages are required PyQt ... Tk pip install sudo apt-get install tk sudo apt-get install tk-dev Wx pip install wxPython GTK pip install PyGTK pip install pygobject pip install pygobject Cair...
apache-2.0
Aasmi/scikit-learn
sklearn/externals/joblib/__init__.py
36
4795
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
jswanljung/iris
docs/iris/src/userguide/plotting_examples/1d_with_legend.py
12
1235
from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa import matplotlib.pyplot as plt import iris import iris.plot as iplt fname = iris.sample_data_path('air_temp.pp') # Load exactly one cube from the given file temperature = iris.load_cu...
lgpl-3.0
danstowell/markovrenewal
experiments/chiffchaff.py
1
35302
#!/bin/env python # script to analyse mixtures of chiffchaff audios # by Dan Stowell, summer 2012 from glob import glob from subprocess import call import os.path import csv from math import log, exp, pi, sqrt, ceil, floor from numpy import array, mean, cov, linalg, dot, median, std import numpy as np import tempfile...
gpl-2.0
acaciawater/spaarwater
spaarwater/management/commands/dump_resprobes.py
1
1958
''' Created on Mar 15, 2018 @author: theo ''' ''' Created on Feb 13, 2014 @author: theo ''' from django.core.management.base import BaseCommand from acacia.data.models import Series import os,logging import pandas as pd logger = logging.getLogger('acacia.data') resprobes = (502,687) class Command(BaseCommand): ...
apache-2.0
gamahead/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtkcairo.py
69
2207
""" GTK+ Matplotlib interface using cairo (not GDK) drawing operations. Author: Steve Chaplin """ import gtk if gtk.pygtk_version < (2,7,0): import cairo.gtk from matplotlib.backends import backend_cairo from matplotlib.backends.backend_gtk import * backend_version = 'PyGTK(%d.%d.%d) ' % gtk.pygtk_version + \ ...
gpl-3.0
jreback/pandas
pandas/tests/frame/methods/test_compare.py
8
6158
import numpy as np import pytest import pandas as pd import pandas._testing as tm @pytest.mark.parametrize("align_axis", [0, 1, "index", "columns"]) def test_compare_axis(align_axis): # GH#30429 df = pd.DataFrame( {"col1": ["a", "b", "c"], "col2": [1.0, 2.0, np.nan], "col3": [1.0, 2.0, 3.0]}, ...
bsd-3-clause
hhbyyh/spark
python/pyspark/sql/tests/test_pandas_udf_grouped_map.py
4
20450
# # 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
geoscixyz/em_examples
em_examples/InductionSphereTEM.py
1
19333
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import numpy as np import scipy as sp import matplotlib.pyplot as plt from matplotlib.ticker import ScalarFormatter, FormatStrFormatter from matplotlib.path import Path import matplotlib.patches as patc...
mit
lenovor/scikit-learn
sklearn/svm/tests/test_svm.py
116
31653
""" Testing for Support Vector Machine module (sklearn.svm) TODO: remove hard coded numerical results when possible """ import numpy as np import itertools from numpy.testing import assert_array_equal, assert_array_almost_equal from numpy.testing import assert_almost_equal from scipy import sparse from nose.tools im...
bsd-3-clause
sanketloke/scikit-learn
examples/covariance/plot_robust_vs_empirical_covariance.py
73
6451
r""" ======================================= Robust vs Empirical covariance estimate ======================================= The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers in the data set. In such a case, it would be better to use a robust estimator of covariance to guar...
bsd-3-clause
berkeley-stat159/project-epsilon
code/utils/scripts/eda.py
3
3524
""" This script plots some exploratory analysis plots for the raw and filtered data: - Moisaic of the mean voxels values for each brain slices Run with: python eda.py from this directory """ from __future__ import print_function, division import sys, os, pdb import numpy as np import matplotlib.pyplot as ...
bsd-3-clause
elijah513/scikit-learn
examples/classification/plot_lda_qda.py
164
4806
""" ==================================================================== Linear and Quadratic Discriminant Analysis with confidence ellipsoid ==================================================================== Plot the confidence ellipsoids of each class and decision boundary """ print(__doc__) from scipy import lin...
bsd-3-clause
wavelets/pandashells
pandashells/test/p_df_test.py
7
5636
#! /usr/bin/env python import os import subprocess import tempfile from mock import patch, MagicMock from unittest import TestCase import pandas as pd try: from StringIO import StringIO except ImportError: from io import StringIO from pandashells.bin.p_df import ( needs_plots, get_modules_and_shortcu...
bsd-2-clause
quheng/scikit-learn
examples/svm/plot_svm_nonlinear.py
268
1091
""" ============== Non-linear SVM ============== Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a XOR of the inputs. The color map illustrates the decision function learned by the SVC. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn imp...
bsd-3-clause
jason-neal/equanimous-octo-tribble
octotribble/SpectralTools.py
1
8065
# SpectralTools.py # Collection of useful tools for dealing with spectra: from __future__ import division import time import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import interp1d def BERVcorr(wl, Berv): """Barycentric Earth Radial Velocity correction from tapas. A wavelength W...
mit
ahoyosid/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
3
10258
import pickle import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dis...
bsd-3-clause
LEX2016WoKaGru/pyClamster
pyclamster/coordinates.py
1
38336
# -*- coding: utf-8 -*- """ Created on 25.06.2016 Created for pyclamster Copyright (C) {2016} 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 ...
gpl-3.0
akrherz/iem
htdocs/plotting/auto/scripts/p94.py
1
3424
"""Bias computing hi/lo""" import datetime import numpy as np import pandas as pd import psycopg2.extras from pyiem.plot import figure_axes from pyiem.util import get_autoplot_context, get_dbconn from pyiem.exceptions import NoDataFound def get_description(): """ Return a dict describing how to call this plotter...
mit
shusenl/scikit-learn
sklearn/ensemble/tests/test_bagging.py
72
25573
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause import numpy as np from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.te...
bsd-3-clause
anntzer/scikit-learn
sklearn/linear_model/_ridge.py
5
77086
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
mcdeaton13/dynamic
Data/Calibration/Firm_Calibration_Python/parameters/employment/script_wages.py
6
1821
''' ------------------------------------------------------------------------------- Date created: 5/22/2015 Last updated 5/22/2015 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Packages: --------------...
mit
r-mart/scikit-learn
sklearn/decomposition/nmf.py
100
19059
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck <L.J.Buitinck@uva.nl> # Author: Chih-Jen Lin, National Taiwan University (original projected gradient # NMF implementation) # Author: Anthony Di Franco (original Python and NumPy port) # License: BSD 3 clause from __future__ ...
bsd-3-clause
pianomania/scikit-learn
sklearn/mixture/gmm.py
19
32365
""" Gaussian Mixture Models. This implementation corresponds to frequentist (non-Bayesian) formulation of Gaussian Mixture Models. """ # Author: Ron Weiss <ronweiss@gmail.com> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Bertrand Thirion <bertrand.thirion@inria.fr> # Important note for the deprec...
bsd-3-clause
fabianp/scikit-learn
examples/linear_model/plot_lasso_model_selection.py
311
5431
""" =================================================== Lasso model selection: Cross-Validation / AIC / BIC =================================================== Use the Akaike information criterion (AIC), the Bayes Information criterion (BIC) and cross-validation to select an optimal value of the regularization paramet...
bsd-3-clause
IndraVikas/scikit-learn
sklearn/manifold/locally_linear.py
206
25061
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
Manolo94/manolo94.github.io
MLpython/HW5.py
1
7050
import pandas as pd import numpy as np import sys import random import copy # Task 1 task1_data = {'Wins_2016': [3, 3, 2, 2, 6, 6, 7, 7, 8, 7], 'Wins_2017': [5, 4, 8, 3, 2, 4, 3, 4, 5, 6]} task1_pd = pd.DataFrame(data=task1_data) iris_df = pd.read_csv('./iris_input/iris.data', names=['sepal_length', 'sepal_width', 'p...
apache-2.0
datapythonista/pandas
pandas/tests/plotting/common.py
3
21514
""" Module consolidating common testing functions for checking plotting. Currently all plotting tests are marked as slow via ``pytestmark = pytest.mark.slow`` at the module level. """ from __future__ import annotations import os from typing import ( TYPE_CHECKING, Sequence, ) import warnings import numpy as...
bsd-3-clause
bradmontgomery/ml
book/ch01/analyze_webstats.py
23
5113
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import os from utils import DATA_DIR, CHART_DIR import scipy as sp import matplotlib.pyplot as plt sp....
mit
arabenjamin/scikit-learn
sklearn/metrics/regression.py
175
16953
"""Metrics to assess performance on regression task 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.gramfort@inria.fr> # Ma...
bsd-3-clause
roofit-dev/parallel-roofit-scripts
tensorflow_testing/tensorflow_roofit_demo.py
1
13599
# -*- coding: utf-8 -*- # @Author: patrick # @Date: 2016-09-01 17:04:53 # @Last Modified by: patrick # @Last Modified time: 2016-10-04 15:44:41 import tensorflow as tf import numpy as np # import scipy as sc import matplotlib.pyplot as plt from timeit import default_timer as timer def apply_constraint(var, const...
apache-2.0
nmartensen/pandas
pandas/tests/indexes/timedeltas/test_setops.py
15
2556
import numpy as np import pandas as pd import pandas.util.testing as tm from pandas import TimedeltaIndex, timedelta_range, Int64Index class TestTimedeltaIndex(object): _multiprocess_can_split_ = True def test_union(self): i1 = timedelta_range('1day', periods=5) i2 = timedelta_range('3day',...
bsd-3-clause
socrata/arcs
setup.py
1
2008
import os import sys from setuptools import setup from setuptools.command.test import test as TestCommand def read(fname): """Utility function to read the README file into the long_description.""" return open(os.path.join(os.path.dirname(__file__), fname)).read() install_requires_list = ['pandas>=0.18.1', ...
mit
ldirer/scikit-learn
sklearn/metrics/cluster/tests/test_bicluster.py
394
1770
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
bsd-3-clause
canast02/csci544_fall2016_project
yelp-sentiment/experiments/sentiment_decisiontree.py
1
2591
import numpy as np from nltk import TweetTokenizer, accuracy from nltk.stem.snowball import EnglishStemmer from sklearn import tree from sklearn.cross_validation import StratifiedKFold from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import accuracy_score from sklearn.metrics import clas...
gpl-3.0
GuessWhoSamFoo/pandas
pandas/tests/series/test_repr.py
1
14865
# coding=utf-8 # pylint: disable-msg=E1101,W0612 from datetime import datetime, timedelta import numpy as np import pandas.compat as compat from pandas.compat import lrange, range, u import pandas as pd from pandas import ( Categorical, DataFrame, Index, Series, date_range, option_context, period_range, tim...
bsd-3-clause
gnagel/backtrader
backtrader/plot/multicursor.py
3
12203
# LICENSE AGREEMENT FOR MATPLOTLIB 1.2.0 # -------------------------------------- # # 1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the # Individual or Organization ("Licensee") accessing and otherwise using # matplotlib software in source or binary form and its associated # documentation. # # 2. Sub...
gpl-3.0
gbrammer/unicorn
object_examples.py
2
57686
import os import pyfits import numpy as np import glob import shutil import matplotlib.pyplot as plt USE_PLOT_GUI=False from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg import threedhst import threedhst.eazyPy as eazy import threedhst.catIO as catIO import unicorn imp...
mit
AndreasMadsen/tensorflow
tensorflow/contrib/learn/python/learn/estimators/classifier_test.py
16
5175
# 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
gandalf221553/CodeSection
kivy_matplotlib.py
1
25927
import kivy kivy.require('1.9.1') # replace with your current kivy version ! ############ #per installare i garden components #C:\Users\Von Braun\Downloads\WinPython-64bit-3.5.2.3Qt5\python-3.5.2.amd64\Scripts #https://docs.scipy.org/doc/numpy/f2py/index.html #!python garden install nomefile ############ from kivy.app...
mit
xuleiboy1234/autoTitle
tensorflow/tensorflow/contrib/learn/python/learn/estimators/linear_test.py
58
71789
# 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...
mit
vybstat/scikit-learn
examples/text/hashing_vs_dict_vectorizer.py
284
3265
""" =========================================== FeatureHasher and DictVectorizer Comparison =========================================== Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. The example demonstrates syntax and speed only; it doesn't actually do anything useful with the e...
bsd-3-clause
eWaterCycle/ewatercycle
ewatercycle/config/_validators.py
1
5383
"""List of config validators.""" import warnings from collections.abc import Iterable from functools import lru_cache from pathlib import Path class ValidationError(ValueError): """Custom validation error.""" # The code for this function was taken from matplotlib (v3.3) and modified # to fit the needs of eWate...
apache-2.0
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/subplots_axes_and_figures/fahrenheit_celsius_scales.py
1
1776
""" ================================= Different scales on the same axes ================================= Demo of how to display two scales on the left and right y axis. This example uses the Fahrenheit and Celsius scales. """ import matplotlib.pyplot as plt import numpy as np # nodebox section if __name__ == '__bui...
mit
tmhm/scikit-learn
sklearn/utils/tests/test_multiclass.py
128
12853
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
sposs/DIRAC
Core/Utilities/Graphs/Legend.py
11
7713
######################################################################## # $HeadURL$ ######################################################################## """ Legend encapsulates a graphical plot legend drawing tool The DIRAC Graphs package is derived from the GraphTool plotting package of the CMS/Phed...
gpl-3.0
hrjn/scikit-learn
examples/linear_model/plot_ard.py
32
3912
""" ================================================== Automatic Relevance Determination Regression (ARD) ================================================== Fit regression model with Bayesian Ridge Regression. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary l...
bsd-3-clause
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/IPython/lib/tests/test_latextools.py
8
3869
# encoding: utf-8 """Tests for IPython.utils.path.py""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. try: from unittest.mock import patch except ImportError: from mock import patch import nose.tools as nt from IPython.lib import latextools from IPython...
mit
pratapvardhan/scikit-learn
sklearn/datasets/svmlight_format.py
19
16759
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
bsd-3-clause