repo_name
stringlengths
6
112
path
stringlengths
4
204
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
714
810k
license
stringclasses
15 values
samuel1208/scikit-learn
sklearn/covariance/tests/test_covariance.py
142
11068
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
e-koch/FilFinder
examples/paper_figures/run_gouldbelt.py
3
6521
# Licensed under an MIT open source license - see LICENSE ''' Script to run fil_finder on the Herschel Gould Belt data set. Can be run on multiple cores. Data can be downloaded at http://www.herschel.fr/cea/gouldbelt/en/Phocea/Vie_des_labos/Ast/ast_visu.php?id_ast=66. ''' from fil_finder import * from astrop...
mit
hrjn/scikit-learn
sklearn/utils/estimator_checks.py
16
64623
from __future__ import print_function import types import warnings import sys import traceback import pickle from copy import deepcopy import numpy as np from scipy import sparse from scipy.stats import rankdata import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memor...
bsd-3-clause
arokem/nipy
doc/conf.py
5
6641
# emacs: -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # sampledoc documentation build configuration file, created by # sphinx-quickstart on Tue Jun 3 12:40:24 2008. # # This file is execfile()d with the current directory set to its containing...
bsd-3-clause
toobaz/pandas
doc/source/conf.py
1
23559
# # pandas documentation build configuration file, created by # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # se...
bsd-3-clause
aewhatley/scikit-learn
sklearn/tests/test_grid_search.py
68
28778
""" Testing for grid search module (sklearn.grid_search) """ from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import sys import numpy as np import scipy.sparse as sp ...
bsd-3-clause
nanophotonics/nplab
nplab/analysis/__init__.py
1
9190
__author__ = 'alansanders' import numpy as np from pathlib import Path import h5py from scipy.ndimage import gaussian_filter from functools import cached_property def load_h5(location='.'): '''return the latest h5 in a given directory. If location is left blank, loads the latest file in the current directory....
gpl-3.0
dinos66/termAnalysis
forTateDataset/quiverTest.py
1
2810
import numpy as np import matplotlib.pyplot as plt from matplotlib import interactive from scipy.spatial import distance from matplotlib.pyplot import cm import matplotlib.colors as colors n_columns, n_rows = 200, 120 X1 = [43, 51, 31, 5, 66, 22, 194, 66, 20, 45] Y1 = [76, 54, 35, 3, 69, 16, 100, 46, 53, 101] X2 = [...
apache-2.0
marcocaccin/scikit-learn
sklearn/linear_model/setup.py
146
1713
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('linear_model', parent_package, top_path) cblas_libs, blas_info = get_blas_info...
bsd-3-clause
sabyasachi087/sp17-i524
project/S17-IO-3012/code/bin/benchmark_replicas_find.py
19
5441
import matplotlib.pyplot as plt import sys import pandas as pd def get_parm(): """retrieves mandatory parameter to program @param: none @type: n/a """ try: return sys.argv[1] except: print ('Must enter file name as parameter') exit() def read_file(filename): """...
apache-2.0
adammenges/statsmodels
statsmodels/datasets/strikes/data.py
25
1951
#! /usr/bin/env python """U.S. Strike Duration Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """This is public domain.""" TITLE = __doc__ SOURCE = """ This is a subset of the data used in Kennan (1985). It was originally published by the Bureau of Labor Statistics. :: Kennan, J. 1985. "The...
bsd-3-clause
marmarko/ml101
tensorflow/examples/skflow/text_classification_builtin_rnn_model.py
11
2984
# 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...
bsd-2-clause
loli/sklearn-ensembletrees
sklearn/tests/test_hmm.py
31
28118
from __future__ import print_function import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal from unittest import TestCase from sklearn.datasets.samples_generator import make_spd_matrix from sklearn import hmm from sklearn import mixture from sklearn.utils.extmath import logsumexp ...
bsd-3-clause
xiaohan2012/lst
util.py
1
4112
import codecs import ujson as json import math import gensim import collections import functools import pandas as pd from datetime import datetime, timedelta from collections import defaultdict def load_items_by_line(path): with codecs.open(path, 'r', 'utf8') as f: items = set([l.strip() ...
mit
riastrad/newSeer
driver/dum.py
1
2292
#!/usr/bin/env python3 # # @Author: Josh Erb <josh.erb> # @Date: 06-Mar-2017 15:03 # @Email: josh.erb@excella.com # @Last modified by: josh.erb # @Last modified time: 24-Apr-2017 22:04 """ Quick script to glob up a bunch of tsv files and insert them into a local sqlite3 database. Will only work if files have bee...
mit
Garrett-R/scikit-learn
examples/applications/plot_stock_market.py
29
8284
""" ======================================= Visualizing the stock market structure ======================================= This example employs several unsupervised learning techniques to extract the stock market structure from variations in historical quotes. The quantity that we use is the daily variation in quote ...
bsd-3-clause
CforED/Machine-Learning
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
fengzhyuan/scikit-learn
examples/model_selection/plot_roc_crossval.py
247
3253
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
lakshayg/tensorflow
tensorflow/contrib/timeseries/examples/multivariate.py
67
5155
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Achuth17/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
dhiapet/PyMC3
pymc3/glm/glm.py
14
5720
import numpy as np from ..core import * from ..distributions import * from ..tuning.starting import find_MAP import patsy import theano import pandas as pd from collections import defaultdict from pandas.tools.plotting import scatter_matrix from . import families def linear_component(formula, data, priors=None, ...
apache-2.0
eickenberg/scikit-learn
sklearn/semi_supervised/label_propagation.py
1
14906
# 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
zimenglan-sysu-512/pose_action_caffe
tools/train_svms.py
42
13247
#!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """ Train post-hoc SVMs using the algorithm and ...
mit
tedunderwood/biographies
topicmodel/interpret/evaluate_hypotheses_docadjusted.py
1
4227
# evaluate_hypotheses_docadjusted.py # This script evaluates our preregistered hypotheses using # the doctopics file produced by MALLET. import sys, csv import numpy as np import pandas as pd from scipy.spatial.distance import euclidean, cosine def getdoc(anid): ''' Gets the docid part of a character id ...
mit
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/examples/pylab_examples/custom_cmap.py
3
4967
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap """ Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use: cdict = {'red': ...
gpl-2.0
kcavagnolo/astroML
book_figures/appendix/fig_fft_text_example.py
3
2376
""" Example of a Fourier Transform ------------------------------ Figure E.1 An example of approximating the continuous Fourier transform of a function using the fast Fourier transform. """ # Author: Jake VanderPlas # License: BSD # The figure produced by this code is published in the textbook # "Statistics, Data ...
bsd-2-clause
mne-tools/mne-tools.github.io
0.17/_downloads/440494db0a9c51c8c5092ad97fd1ce2a/plot_topo_customized.py
13
1927
""" ======================================== Plot custom topographies for MEG sensors ======================================== This example exposes the `iter_topography` function that makes it very easy to generate custom sensor topography plots. Here we will plot the power spectrum of each channel on a topographic la...
bsd-3-clause
GuessWhoSamFoo/pandas
pandas/tests/scalar/timedelta/test_formats.py
9
1068
# -*- coding: utf-8 -*- import pytest from pandas import Timedelta @pytest.mark.parametrize('td, expected_repr', [ (Timedelta(10, unit='d'), "Timedelta('10 days 00:00:00')"), (Timedelta(10, unit='s'), "Timedelta('0 days 00:00:10')"), (Timedelta(10, unit='ms'), "Timedelta('0 days 00:00:00.010000')"), ...
bsd-3-clause
alexeyum/scikit-learn
sklearn/calibration.py
18
19402
"""Calibration of predicted probabilities.""" # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Balazs Kegl <balazs.kegl@gmail.com> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Mathieu Blondel <mathieu@mblondel.org> # # License: BSD 3 clause from __future__ impo...
bsd-3-clause
bmazin/ARCONS-pipeline
examples/Pal2014_throughput/throughputCalc_aperturePhot.py
1
12594
from util import utils import sys,os import tables import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from util.ObsFile import ObsFile from util import MKIDStd from util.readDict import readDict from util.rebin import rebin import matplotlib from scipy import interpolate from scipy.optimize.m...
gpl-2.0
RuthAngus/chronometer
chronometer/chronometer.py
1
16573
""" Now use Gibbs sampling to update individual star parameters and global gyro parameters. """ import os import time import numpy as np import matplotlib.pyplot as plt import pandas as pd from isochrones import StarModel from isochrones.mist import MIST_Isochrone import h5py import corner import priors from models ...
mit
Kleptobismol/scikit-bio
doc/sphinxext/numpydoc/numpydoc/tests/test_docscrape.py
39
18326
# -*- encoding:utf-8 -*- from __future__ import division, absolute_import, print_function import sys, textwrap from numpydoc.docscrape import NumpyDocString, FunctionDoc, ClassDoc from numpydoc.docscrape_sphinx import SphinxDocString, SphinxClassDoc from nose.tools import * if sys.version_info[0] >= 3: sixu = la...
bsd-3-clause
iABC2XYZ/abc
Epics/DataAna11.3.py
1
8055
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Oct 27 15:44:34 2017 @author: p """ import numpy as np import tensorflow as tf import matplotlib.pyplot as plt plt.close('all') def GenWeight(shape): initial = tf.truncated_normal(shape, stddev=1.) return tf.Variable(initial) def GenBi...
gpl-3.0
ai-se/XTREE
src/tools/oracle.py
1
6506
from __future__ import division from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from collections import Counter from scipy.spatial.distance import euclidean from random import choice, seed as rseed, uniform as rand import pandas as pd import numpy as np from texttable import Texttable from st...
mit
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/streamplot.py
10
20629
""" Streamline plotting for 2D vector fields. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import xrange import numpy as np import matplotlib import matplotlib.cm as cm import matplotlib.colors as mcolors import matplotlib....
gpl-3.0
LEX2016WoKaGru/pyClamster
scripts/session/FE3_session_600.py
1
1705
#!/usr/bin/env python3 import pyclamster import logging import pickle import os,sys import matplotlib.pyplot as plt # set up logging logging.basicConfig(level=logging.DEBUG) sessionfile = "data/sessions/FE3_session_new_600.pk" try: # maybe there is already a session session = pickle.load(open(sessionfile,"rb")) e...
gpl-3.0
xubenben/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
ajdawson/windspharm
examples/cdms/sfvp_example.py
1
2297
""" Compute streamfunction and velocity potential from the long-term-mean flow. This example uses the cdms interface. Additional requirements for this example: * cdms2 (http://uvcdat.llnl.gov/) * matplotlib (http://matplotlib.org/) * cartopy (http://scitools.org.uk/cartopy/) """ import cartopy.crs as ccrs import cd...
mit
google/makani
analysis/aero/avl/avl_reader.py
1
21745
#!/usr/bin/python # Copyright 2020 Makani Technologies LLC # # 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 applicabl...
apache-2.0
mfjb/scikit-learn
examples/svm/plot_svm_regression.py
249
1451
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
bsd-3-clause
Anton04/SolarDataRESTfulAPI
SolarDataRESTapi.py
1
16625
#!/bin/python from flask import Flask, jsonify, abort,request,Response import InfluxDBInterface import json import IoTtoolkit #from elasticsearch import Elasticsearch from ElasticsearchInterface import ESinterface import os, sys import time import pandas as pd app = Flask(__name__) app.config.update(dict( # DATAB...
mit
francis-liberty/kaggle
Titanic/Viz/single_class.py
1
2557
# survival rate concerning class, sex and marriage status. from pandas import Series, DataFrame import pandas as pd import matplotlib.pyplot as plt import pylab df = pd.read_csv('../Data/train.csv') # slice idx_male = df.Sex[df.Sex == 'male'].index idx_female = df.index.diff(idx_male) idx_single = df.SibSp[df.SibSp...
gpl-2.0
clemkoa/scikit-learn
doc/conf.py
8
9924
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
bsd-3-clause
dsullivan7/scikit-learn
sklearn/cluster/tests/test_affinity_propagation.py
341
2620
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
bsd-3-clause
zaxtax/scikit-learn
sklearn/neighbors/approximate.py
40
22369
"""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
jorik041/scikit-learn
examples/exercises/plot_cv_diabetes.py
231
2527
""" =============================================== Cross-validation on diabetes Dataset Exercise =============================================== A tutorial exercise which uses cross-validation with linear models. This exercise is used in the :ref:`cv_estimators_tut` part of the :ref:`model_selection_tut` section of ...
bsd-3-clause
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py
24
10036
#!/usr/bin/python # 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. """Do all the steps required to build and test against nacl.""" import optparse import os.path import re import shutil import subproc...
apache-2.0
Windy-Ground/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
madjelan/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
PawarPawan/h2o-v3
py2/h2o_cmd.py
20
16497
import h2o_nodes from h2o_test import dump_json, verboseprint import h2o_util import h2o_print as h2p from h2o_test import OutputObj #************************************************************************ def runStoreView(node=None, **kwargs): print "FIX! disabling runStoreView for now" return {} if no...
apache-2.0
arabenjamin/scikit-learn
benchmarks/bench_plot_approximate_neighbors.py
244
6011
""" Benchmark for approximate nearest neighbor search using locality sensitive hashing forest. There are two types of benchmarks. First, accuracy of LSHForest queries are measured for various hyper-parameters and index sizes. Second, speed up of LSHForest queries compared to brute force method in exact nearest neigh...
bsd-3-clause
tosolveit/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
159
10196
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
anomam/pvlib-python
pvlib/tests/iotools/test_midc.py
1
2919
import pandas as pd from pandas.util.testing import network import pytest import pytz from pvlib.iotools import midc from conftest import DATA_DIR, RERUNS, RERUNS_DELAY @pytest.fixture def test_mapping(): return { 'Direct Normal [W/m^2]': 'dni', 'Global PSP [W/m^2]': 'ghi', 'Rel Humidity ...
bsd-3-clause
anorfleet/kaggle-titanic
KaggleAux/predict.py
6
3114
import numpy as np from pandas import DataFrame from patsy import dmatrices def get_dataframe_intersection(df, comparator1, comparator2): """ Return a dataframe with only the columns found in a comparative dataframe. Parameters ---------- comparator1: DataFrame DataFrame to preform compar...
apache-2.0
gerritholl/pyatmlab
pyatmlab/graphics.py
1
9084
#!/usr/bin/env python # coding: utf-8 """Interact with matplotlib and other plotters """ import os.path import datetime now = datetime.datetime.now import logging import subprocess import sys import pickle import lzma import pathlib import numpy import matplotlib import matplotlib.cbook import matplotlib.pyplot imp...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/matplotlib/delaunay/interpolate.py
8
7288
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import numpy as np from matplotlib._delaunay import compute_planes, linear_interpolate_grid from matplotlib._delaunay import nn_interpolate_grid from matplotlib._delaunay ...
mit
duyhtq/cuda-convnet2
shownet.py
180
18206
# Copyright 2014 Google Inc. 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 applicable law or...
apache-2.0
soligschlager/topography
sandbox/macaque/clustering_embedding_macaque.py
2
1476
#!/usr/bin/python import sys, os, h5py, scipy, numpy as np from sklearn.utils.arpack import eigsh from sklearn.cluster import KMeans from scipy.io.matlab import savemat def main(argv): # Set defaults: n_components_embedding = 25 comp_min = 2 comp_max = 20 + 1 varname = 'data' filename = '...
mit
mkrapp/semic
optimize/plot_costs.py
2
1367
''' plot the best PSO positions. ''' import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import sys from tools import get_params def plot_costs(fnm,show=True,savefig=False): params, par_names = get_params() print params data = np.loadtxt(fnm,unpack=True) mpl.rcParams[...
mit
levjj/rticomp
experiment-jpeg.py
1
5075
''' File compress.py Created on 11 Feb 2014 @author: Christopher Schuster, cschuste@ucsc.edu ''' # General imports from __future__ import print_function import os,sys,subprocess,struct,io # Possible use of matplotlib from http://http://matplotlib.sourceforge.net/ from pylab import * import matplotlib.pyplot as plt #...
mit
ajheaps/cf-plot
cfplot/cfplot.py
1
336361
""" Climate contour/vector plots using cf-python, matplotlib and cartopy. Andy Heaps NCAS-CMS April 2021 """ import numpy as np import subprocess from scipy import interpolate import matplotlib from copy import deepcopy import os import sys import matplotlib.pyplot as plot from matplotlib.collections import PolyCollect...
mit
ephes/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
142
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
paalge/scikit-image
doc/examples/features_detection/plot_multiblock_local_binary_pattern.py
9
2603
""" =========================================================== Multi-Block Local Binary Pattern for texture classification =========================================================== This example shows how to compute multi-block local binary pattern (MB-LBP) features as well as how to visualize them. The features ar...
bsd-3-clause
felipeacsi/python-acoustics
acoustics/_signal.py
1
36315
import itertools import matplotlib.pyplot as plt import numpy as np from scipy.io import wavfile from scipy.signal import detrend, lfilter, bilinear, spectrogram, filtfilt, resample, fftconvolve import acoustics from acoustics.standards.iso_tr_25417_2007 import REFERENCE_PRESSURE from acoustics.standards.iec_61672_1_2...
bsd-3-clause
udacity/ggplot
ggplot/components/smoothers.py
12
2576
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from pandas.lib import Timestamp import pandas as pd import statsmodels.api as sm from statsmodels.nonparametric.smoothers_lowess import lowess as smlowess from statsmodels.sandbox.regression....
bsd-2-clause
appapantula/scikit-learn
sklearn/utils/validation.py
67
24013
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp from ..externals i...
bsd-3-clause
zedoul/AnomalyDetection
test_discretization/test_spectralclustering3.py
1
8781
# -*- coding: utf-8 -*- """ http://www.astroml.org/sklearn_tutorial/dimensionality_reduction.html """ print (__doc__) import numpy as np import copy import matplotlib import matplotlib.mlab import matplotlib.pyplot as plt from matplotlib import gridspec from sklearn.cluster import KMeans import pandas as pd import ...
mit
cactusbin/nyt
matplotlib/lib/mpl_toolkits/mplot3d/proj3d.py
7
6832
#!/usr/bin/python # 3dproj.py # """ Various transforms used for by the 3D code """ from matplotlib.collections import LineCollection from matplotlib.patches import Circle import numpy as np import numpy.linalg as linalg def line2d(p0, p1): """ Return 2D equation of line in the form ax+by+c = 0 """ #...
unlicense
bsautermeister/machine-learning-examples
dnn_classification/tf_learn/custom_dnn_abalone.py
1
8357
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import argparse import tempfile from six.moves import urllib import numpy as np import tensorflow as tf import sklearn.metrics tf.logging.set_verbosity(tf.logging.INFO) def maybe_download(train_d...
mit
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/sklearn/linear_model/setup.py
83
1719
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('linear_model', parent_package, top_path) cblas_libs, blas_info = get_blas_info...
mit
bakfu/benchmark
bench/tools.py
1
2989
import os import random import numpy as np from sklearn.ensemble import RandomForestClassifier import nltk from bakfu.core.routes import register from bakfu.core.classes import Processor import logging log = logger = logging.getLogger('bench') result_logger = logging.getLogger('bench_results') @register('...
bsd-3-clause
depet/scikit-learn
sklearn/tests/test_base.py
9
5815
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing imp...
bsd-3-clause
agartland/pysieve
distance.py
1
31210
""" distance.py Distance functions to be called by the analysis functions. TODO: - Standardize inputs to distance functions to make the architecture more "plug-n-play" - Release a version of seqtools with the required functions to satisfy dependencies Generally a distance function should have the following inputs: ...
mit
marqh/iris
lib/iris/tests/unit/plot/test_contour.py
11
2995
# (C) British Crown Copyright 2014 - 2016, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
SU-ECE-17-7/ibeis
_scripts/win32bootstrap.py
2
23140
# -*- coding: utf-8 -*- r""" Hacky file to download win packages Please only download files as needed. Args: --dl {pkgname:str} : package name to download --run : if true runs installer on win32 CommandLine: python _scripts\win32bootstrap.py --dl winapi --run python _scripts\win32bootstrap.py --dl pyp...
apache-2.0
istellartech/OpenGoddard
examples/04_Goddard_0knot.py
1
6069
# -*- coding: utf-8 -*- # Copyright 2017 Interstellar Technologies Inc. All Rights Reserved. from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from OpenGoddard.optimize import Problem, Guess, Condition, Dynamics class Rocket: g0 = 1.0 # Gravity at surface [-] def __in...
mit
abhishekkrthakur/scikit-learn
sklearn/decomposition/__init__.py
99
1331
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from .nmf import NMF, ProjectedGradientNMF from .pca import PCA, RandomizedPCA from .incrementa...
bsd-3-clause
m3wolf/scimap
scimap/peakfitting.py
1
16766
# -*- coding: utf-8 -*- # # Copyright © 2016 Mark Wolf # # This file is part of scimap. # # Scimap 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 lat...
gpl-3.0
Obus/scikit-learn
sklearn/metrics/pairwise.py
104
42995
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
bsd-3-clause
bowenliu16/deepchem
deepchem/dock/binding_pocket.py
1
11449
""" Computes putative binding pockets on protein. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "Bharath Ramsundar" __copyright__ = "Copyright 2017, Stanford University" __license__ = "GPL" import os import tempfile import numpy as np im...
gpl-3.0
mganeva/mantid
scripts/test/directtools/DirectToolsTest.py
1
17930
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
petebachant/seaborn
seaborn/categorical.py
19
102299
from __future__ import division from textwrap import dedent import colorsys import numpy as np from scipy import stats import pandas as pd from pandas.core.series import remove_na import matplotlib as mpl import matplotlib.pyplot as plt import warnings from .external.six import string_types from .external.six.moves im...
bsd-3-clause
kazemakase/scikit-learn
sklearn/decomposition/base.py
313
5647
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
bsd-3-clause
zhenwendai/RGP
autoreg/benchmark/run.py
1
2773
# Copyright (c) 2015, Zhenwen Dai # Licensed under the BSD 3-clause license (see LICENSE.txt) from __future__ import print_function from evaluation import RMSE from methods import Autoreg_onelayer, Autoreg_onelayer_bfgs from tasks import all_tasks from outputs import PickleOutput, CSV_Summary import numpy as np import...
bsd-3-clause
manashmndl/scikit-learn
sklearn/utils/tests/test_sparsefuncs.py
57
13752
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.datasets import make_classification from sklearn.utils.sparsefuncs import (mean_variance_axis, inplace_column_scale, ...
bsd-3-clause
samzhang111/scikit-learn
examples/gaussian_process/plot_gpr_co2.py
9
5718
""" ======================================================== Gaussian process regression (GPR) on Mauna Loa CO2 data. ======================================================== This example is based on Section 5.4.3 of "Gaussian Processes for Machine Learning" [RW2006]. It illustrates an example of complex kernel engine...
bsd-3-clause
pradyu1993/scikit-learn
sklearn/linear_model/tests/test_omp.py
2
7018
# Author: Vlad Niculae # License: BSD style import warnings import numpy as np from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_arr...
bsd-3-clause
shenzebang/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
Akshay0724/scikit-learn
sklearn/neighbors/tests/test_dist_metrics.py
36
6957
import itertools import pickle import numpy as np from numpy.testing import assert_array_almost_equal import scipy from scipy.spatial.distance import cdist from sklearn.neighbors.dist_metrics import DistanceMetric from sklearn.neighbors import BallTree from sklearn.utils.testing import SkipTest, assert_raises_regex ...
bsd-3-clause
rjeli/scikit-image
doc/examples/features_detection/plot_holes_and_peaks.py
9
2713
""" =============================== Filling holes and finding peaks =============================== We fill holes (i.e. isolated, dark spots) in an image using morphological reconstruction by erosion. Erosion expands the minimal values of the seed image until it encounters a mask image. Thus, the seed image and mask i...
bsd-3-clause
lisitsyn/shogun
applications/easysvm/tutpaper/svm_params.py
12
12908
#from matplotlib import rc #rc('text', usetex=True) fontsize = 16 contourFontsize = 12 showColorbar = False xmin = -1 xmax = 1 ymin = -1.05 ymax = 1 import sys,os import numpy import shogun from shogun import GaussianKernel, LinearKernel, PolyKernel from shogun import RealFeatures, BinaryLabels from shogun import L...
bsd-3-clause
cimat/data-visualization-patterns
display-patterns/Proportions/Pruebas/A42Ring_Chart_Matplotlib.py
1
2204
library(ggplot2) t<-table(mtcars$cyl) x<-as.data.frame(t) colnames(x)<-c("Cylindres", "Frequency") bp <- ggplot(x, aes(x ="",y=Frequency, fill = Cylindres)) + geom_bar(width = 1, stat = "identity") +labs (title="Proportion Cylindres in a Car Distribution") pie <-bp+coord_polar("y", start=0) pie + geom_text(aes(y =...
cc0-1.0
matthewfranglen/spark
python/pyspark/sql/pandas/group_ops.py
9
14192
# # 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...
mit
ericmjl/bokeh
tests/unit/bokeh/document/test_events__document.py
1
20531
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
JPFrancoia/scikit-learn
sklearn/linear_model/coordinate_descent.py
13
81631
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause