repo_name stringlengths 7 90 | path stringlengths 5 191 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 976 581k | license stringclasses 15
values |
|---|---|---|---|---|---|
dpressel/baseline | scripts/lr_visualize.py | 1 | 8549 | import os
import math
import json
import inspect
import argparse
from hashlib import sha1
from collections import defaultdict
import numpy as np
import baseline as bl
import matplotlib.pyplot as plt
from lr_compare import plot_learning_rates
# Collect possible Schedulers
OPTIONS = {}
WARMUP = {}
base_classes = (
... | apache-2.0 |
kennethdecker/MagnePlane | paper/images/trade_scripts/pressure_trades_plot.py | 4 | 2273 | import numpy as np
import matplotlib.pyplot as plt
p_tunnel = np.loadtxt('../data_files/pressure_trades/p_tunnel.txt', delimiter = '\t')
Re = np.loadtxt('../data_files/pressure_trades/Re.txt', delimiter = '\t')
A_tube = np.loadtxt('../data_files/pressure_trades/A_tube.txt', delimiter = '\t')
T_tunnel = np.loadtxt('../... | apache-2.0 |
Darthone/Informed-Finance-Canary | tinkering/ml/sklearn_svr.py | 2 | 3910 | #!/usr/bin/env python -W ignore::DeprecationWarning
import numpy as np
import pandas as pd
from sklearn import preprocessing, cross_validation, neighbors, svm, metrics, grid_search
import peewee
from peewee import *
import ifc.ta as ta
import math
def addDailyReturn(dataset):
"""
Adding in daily return to... | mit |
mblondel/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
feranick/Pi-bot | Old/3_ML-splrcbxyz/piRC_ML.py | 1 | 10653 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
**********************************************************
*
* PiRC - Machine learning train and predict
* version: 20170518b
*
* By: Nicola Ferralis <feranick@hotmail.com>
*
***********************************************************
'''
print(__doc__)
import numpy a... | gpl-3.0 |
belteshassar/cartopy | lib/cartopy/tests/mpl/test_set_extent.py | 3 | 6485 | # (C) British Crown Copyright 2011 - 2016, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | gpl-3.0 |
scikit-optimize/scikit-optimize.github.io | 0.8/_downloads/365fdab27864494141feaa35987b301b/partial-dependence-plot-2D.py | 3 | 3291 | """
===========================
Partial Dependence Plots 2D
===========================
Hvass-Labs Dec 2017
Holger Nahrstaedt 2020
.. currentmodule:: skopt
Simple example to show the new 2D plots.
"""
print(__doc__)
import numpy as np
from math import exp
from skopt import gp_minimize
from skopt.space import Real, ... | bsd-3-clause |
MMKrell/pyspace | pySPACE/missions/nodes/classification/base.py | 1 | 89554 | """ Base classes for classification """
import numpy
# import matplotlib as mpl
# mpl.rcParams['text.usetex']=True
# mpl.rcParams['text.latex.unicode']=True
import matplotlib.pyplot as plt
import os
import cPickle
import logging
import math
import numpy
import os
import timeit
import warnings
# base class
from pyS... | gpl-3.0 |
Odingod/mne-python | mne/viz/raw.py | 2 | 30957 | """Functions to plot raw M/EEG data
"""
from __future__ import print_function
# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import copy
from functools import partial
import numpy as np
from ..externals.six import string_types
from ..io.pick import pick_types
from ..io.proj import setu... | bsd-3-clause |
XENON1T/pax | pax/PatternFitter.py | 1 | 18942 | from __future__ import division
from collections import namedtuple
import json
import gzip
import re
import logging
import numpy as np
import numexpr as ne
import matplotlib.pyplot as plt
try:
from matplotlib import _cntr
except ImportError:
print("matplotlib._cntr did not import, confidence tuple generation i... | bsd-3-clause |
haiweiosu/Optical-Character-Recognition-using-Template-Matching-Object-Detection-in-Images | task2_4.py | 1 | 1734 | # USAGE
# python sliding_window.py --image images/adrian_florida.jpg
# import the necessary packages
from imagesearch.helpers import pyramid
from imagesearch.helpers import sliding_window
from task2_2_step_3 import lin_svc
from config import negative_training_1, negative_training_2, negative_training_3, negative_trai... | apache-2.0 |
ndingwall/scikit-learn | sklearn/datasets/tests/test_20news.py | 10 | 5098 | """Test the 20news downloader, if the data is available,
or if specifically requested via environment variable
(e.g. for travis cron job)."""
from functools import partial
from unittest.mock import patch
import pytest
import numpy as np
import scipy.sparse as sp
from sklearn.datasets.tests.test_common import check_a... | bsd-3-clause |
av8ramit/tensorflow | tensorflow/tools/dist_test/python/census_widendeep.py | 48 | 11896 | # 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 |
plissonf/scikit-learn | sklearn/cluster/__init__.py | 364 | 1228 | """
The :mod:`sklearn.cluster` module gathers popular unsupervised clustering
algorithms.
"""
from .spectral import spectral_clustering, SpectralClustering
from .mean_shift_ import (mean_shift, MeanShift,
estimate_bandwidth, get_bin_seeds)
from .affinity_propagation_ import affinity_propagati... | bsd-3-clause |
nhejazi/scikit-learn | examples/applications/plot_stock_market.py | 5 | 9800 | """
=======================================
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 |
Ninjakow/TrueSkill | lib/numpy/lib/recfunctions.py | 148 | 35012 | """
Collection of utilities to manipulate structured arrays.
Most of these functions were initially implemented by John Hunter for
matplotlib. They have been rewritten and extended for convenience.
"""
from __future__ import division, absolute_import, print_function
import sys
import itertools
import numpy as np
im... | gpl-3.0 |
natsutan/cocytus | tools/cqt_diff/cqt_diff_yolo.py | 1 | 2396 | import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn
import sys
keras_dir = '../../example/tiny-yolo/keras/output/'
cqt_dir = '../../example/tiny-yolo/c_sdsoc/output/'
qp_file = '../../example/tiny-yolo/c_sdsoc/weight/'
fix16mode = False
def layer_dump(i, q, fnum = 3):
"""
引数で指定されたレイヤー... | mit |
mattilyra/scikit-learn | sklearn/linear_model/logistic.py | 7 | 67572 |
"""
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
im... | bsd-3-clause |
soylentdeen/BlurryApple | Disturbances/calc_TF.py | 1 | 1679 | import scipy
import pyfits
import numpy
import matplotlib.pyplot as pyplot
from scipy.optimize import leastsq as lsq
fig = pyplot.figure(0)
fig.clear()
df = '/home/deen/Data/GRAVITY/Disturbance/disturb_0_0.1_open/disturb_0_0.1_open.fits'
CMf = '/home/deen/Code/Python/BlurryApple/Control/Output/HODM_CM20.fits'
data =... | gpl-2.0 |
longzhi/Zappa | tests/tests.py | 1 | 71351 | # -*- coding: utf8 -*-
import base64
import collections
import json
from io import BytesIO, StringIO
import flask
import mock
import os
import random
import string
import zipfile
import re
import unittest
import shutil
import sys
import tempfile
if sys.version_info[0] < 3:
from contextlib import nested
from c... | mit |
jlandmann/oggm | oggm/sandbox/run_alps.py | 2 | 3819 | """Run with a subset of benchmark glaciers"""
from __future__ import division
# Log message format
import logging
logging.basicConfig(format='%(asctime)s: %(name)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S', level=logging.DEBUG)
# Module logger
log = logging.getLogger(__name__)
# Python imports
i... | gpl-3.0 |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/matplotlib/sphinxext/ipython_directive.py | 11 | 27706 | # -*- coding: utf-8 -*-
"""Sphinx directive to support embedded IPython code.
This directive allows pasting of entire interactive IPython sessions, prompts
and all, and their code will actually get re-executed at doc build time, with
all prompts renumbered sequentially. It also allows you to input code as a pure
pytho... | mit |
stulp/dmpbbo | demo_robot/step2_defineTask.py | 1 | 1989 | # This file is part of DmpBbo, a set of libraries and programs for the
# black-box optimization of dynamical movement primitives.
# Copyright (C) 2014 Freek Stulp, ENSTA-ParisTech
#
# DmpBbo is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publis... | lgpl-2.1 |
IshankGulati/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 84 | 7866 | # Important note for the deprecation cleaning of 0.20 :
# All the function and classes of this file have been deprecated in 0.18.
# When you remove this file please also remove the related files
# - 'sklearn/mixture/dpgmm.py'
# - 'sklearn/mixture/gmm.py'
# - 'sklearn/mixture/test_gmm.py'
import unittest
import sys
imp... | bsd-3-clause |
jmetzen/scikit-learn | benchmarks/bench_plot_incremental_pca.py | 374 | 6430 | """
========================
IncrementalPCA benchmark
========================
Benchmarks for IncrementalPCA
"""
import numpy as np
import gc
from time import time
from collections import defaultdict
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_lfw_people
from sklearn.decomposition import Incre... | bsd-3-clause |
fivejjs/pyhsmm-autoregressive | examples/demo.py | 1 | 1813 | from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
plt.ion()
np.random.seed(0)
import pyhsmm
from pyhsmm.util.text import progprint_xrange
from pyhsmm.util.stats import whiten, cov
import autoregressive.models as m
import autoregressive.distributions as d
###################
# g... | gpl-2.0 |
glue-viz/glue-vispy-viewers | glue_vispy_viewers/scatter/tests/test_scatter_viewer.py | 3 | 11133 | import numpy as np
from glue.core import DataCollection, Data
from glue.app.qt.application import GlueApplication
from glue.core.component import Component
from matplotlib import cm
from ..scatter_viewer import VispyScatterViewer
def make_test_data():
data = Data(label="Test Cat Data 1")
np.random.seed(1... | bsd-2-clause |
alkyl1978/gnuradio | gr-filter/examples/chirp_channelize.py | 58 | 7169 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
Lucaszw/DIGITS | digits/layer_outputs/get_deconv.py | 1 | 2763 | import sys
import os
import numpy as np
import matplotlib.pyplot as plt
import argparse
script_location = os.path.dirname(os.path.realpath(sys.argv[0]))
sys.path.insert(0,script_location+"/../..")
import digits
from digits import utils
import argparse
from subprocess import call
import h5py
sys.path.insert(0,"/home... | bsd-3-clause |
mmp2/megaman | megaman/embedding/tests/test_lle.py | 4 | 4114 | # LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE
import sys
import numpy as np
import scipy as sp
import scipy.sparse as sparse
from scipy.spatial.distance import squareform, pdist
from itertools import product
from numpy.testing import assert_array_almost_equal
from sklearn import manifo... | bsd-2-clause |
qifeigit/scikit-learn | sklearn/linear_model/tests/test_base.py | 120 | 10082 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model.... | bsd-3-clause |
avistous/QSTK | Tools/Visualizer/FormatData.py | 3 | 3430 | '''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on April, 20, 2012
@author: Sourabh Bajaj
@contact: sourabhbajaj90@gmail.com
@summary: Visualizer - Random Da... | bsd-3-clause |
dreuven/SampleSparse | SampleSparse/tests/classicLAHMCSampling/PersonalPlotting.py | 3 | 9713 | import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm as cm
class PPlotting:
root_directory = None
def __init__(self, directory):
# try:
# str(directory)
# except:
# print("Cannot convert input to string. Put in a name!")
self.root_directory = st... | gpl-3.0 |
yaroslavvb/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/arithmetic_transform_test.py | 62 | 2343 | # 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 |
MonoCloud/zipline | tests/history_cases.py | 7 | 21388 | """
Test case definitions for history tests.
"""
import pandas as pd
import numpy as np
from zipline.finance.trading import TradingEnvironment
from zipline.history.history import HistorySpec
from zipline.protocol import BarData
from zipline.utils.test_utils import to_utc
_cases_env = TradingEnvironment()
def mixed... | apache-2.0 |
antepsis/anteplahmacun | sympy/physics/quantum/tensorproduct.py | 23 | 13565 | """Abstract tensor product."""
from __future__ import print_function, division
from sympy import Expr, Add, Mul, Matrix, Pow, sympify
from sympy.core.compatibility import range
from sympy.core.trace import Tr
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumError... | bsd-3-clause |
xyguo/scikit-learn | examples/exercises/plot_cv_diabetes.py | 53 | 2861 | """
===============================================
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 |
tetherless-world/setlr | setup.py | 1 | 1523 | import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.... | apache-2.0 |
Nyker510/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 127 | 25365 | """
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 |
plissonf/scikit-learn | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
sanketloke/scikit-learn | sklearn/model_selection/_split.py | 21 | 57608 | """
The :mod:`sklearn.model_selection._split` module includes classes and
functions to split the data based on a preset strategy.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Girsel <olivier.grisel@ensta.org>
# Ragha... | bsd-3-clause |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/examples/user_interfaces/interactive2.py | 3 | 10375 | #!/usr/bin/env python
# GTK Interactive Console
# (C) 2003, Jon Anderson
# See www.python.org/2.2/license.html for
# license details.
#
import gtk
import gtk.gdk
import code
import os, sys
import pango
import __builtin__
import __main__
banner = """GTK Interactive Python Console
Thanks to Jon Anderson
%s
""" %... | gpl-2.0 |
hms-dbmi/clodius | clodius/tiles/bigbed.py | 1 | 10629 | import bbi
import functools as ft
import logging
import numpy as np
import pandas as pd
import random
import clodius.tiles.bigwig as hgbw
from concurrent.futures import ThreadPoolExecutor
DEFAULT_RANGE_MODE = "significant"
MIN_ELEMENTS = 1
MAX_ELEMENTS = 200
DEFAULT_SCORE = 0
logger = logging.getLogger(__name__)
ra... | mit |
LeBarbouze/tunacell | tunacell/plotting/dynamics.py | 1 | 34918 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module defines plotting functions for the statistics of the dynamics.
"""
from __future__ import print_function
import os
import numpy as np
import collections
import logging
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import ticker
... | mit |
trankmichael/scikit-learn | sklearn/cluster/tests/test_bicluster.py | 226 | 9457 | """Testing for Spectral Biclustering methods"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.grid_search import ParameterGrid
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from... | bsd-3-clause |
ningchi/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 26 | 1523 | """
======================================
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 |
zaxtax/scikit-learn | sklearn/tree/tree.py | 23 | 40423 | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... | bsd-3-clause |
kjung/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 294 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/matplotlib/contour.py | 3 | 69667 | """
These are classes to support contour plotting and
labelling for the axes class
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
from matplotlib.externals.six.moves import xrange
import warnings
import matplotlib ... | apache-2.0 |
sshleifer/object_detection_kitti | learned_optimizer/problems/datasets.py | 7 | 7404 | # Copyright 2017 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 |
shusenl/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 |
ianknowles/EarTimeWrangler | src/PDF/table_transformer.py | 1 | 19834 | import logging
import math
import os
from collections import defaultdict
import pdfminer
from pdfminer.converter import PDFPageAggregator
from pdfminer.layout import LAParams
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfinterp import PDFTextExtractionNotAllowed
from pdfminer.p... | mit |
JT5D/scikit-learn | examples/grid_search_digits.py | 8 | 2665 | """
=====================================================================
Parameter estimation using grid search with a nested cross-validation
=====================================================================
This examples shows how a classifier is optimized by "nested"
cross-validation, which is done using the
:... | bsd-3-clause |
fbagirov/scikit-learn | benchmarks/bench_plot_nmf.py | 206 | 5890 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... | bsd-3-clause |
bartromgens/climatemaps | bin/create_contour.py | 1 | 4856 | #!/usr/bin/env python3
import sys
import os
import math
import numpy
import matplotlib.pyplot as plt
sys.path.append('../climatemaps')
import climatemaps
from climatemaps.logger import logger
DATA_OUT_DIR = 'website/data'
TYPES = {
'precipitation': {
'filepath': 'data/precipitation/cpre6190.dat',
... | mit |
Lucas-Armand/genetic-algorithm | dev/6ºSemana/testes of speed.py | 5 | 3255 | # -*- coding: utf-8 -*-
import os
import csv
import random
import numpy as np
import timeit
import time as Time
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from itertools import product, combinations
class Block:
def __init__(self,point,a,b,c,weight,btype):
self.p=point
... | gpl-3.0 |
tosolveit/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 |
nikitasingh981/scikit-learn | examples/ensemble/plot_isolation_forest.py | 39 | 2361 | """
==========================================
IsolationForest example
==========================================
An example using IsolationForest for anomaly detection.
The IsolationForest 'isolates' observations by randomly selecting a feature
and then randomly selecting a split value between the maximum and minimu... | bsd-3-clause |
RachitKansal/scikit-learn | sklearn/cluster/tests/test_dbscan.py | 176 | 12155 | """
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from scipy.spatial import distance
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing im... | bsd-3-clause |
tayebzaidi/HonorsThesisTZ | ThesisCode/DES_Pipeline/gen_lightcurves/visualizeLCurves.py | 1 | 3137 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import json
import os
import sys
import numpy as np
import math
import pickle
def main():
path = "./des_sn.p"
output_lightcurves_file = 'selectedLightcurves'
output_lightcurves = []
with open(path, 'rb') as f:... | gpl-3.0 |
ChangLe008/iarc007_hitcsc | iarc/src/pilot/scripts/lidar.py | 2 | 2836 | #coding:UTF-8
"""
Created on 2017/04/07
@author: Leonidas
"""
import matplotlib.pyplot as plt
import string
import math
#ResultFormat = "%0.4f"
#Usage: ResultFormat%(1/3)
str = '/home/hitcsc/catkin_ws/log/iarc/lidar.txt'
a = open(str)
text = a.readlines()
obs_num = 0
class obs:
def __init__(self):
self.rea... | bsd-2-clause |
yunfeilu/scikit-learn | examples/classification/plot_classifier_comparison.py | 66 | 4895 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=====================
Classifier comparison
=====================
A comparison of a several classifiers in scikit-learn on synthetic datasets.
The point of this example is to illustrate the nature of decision boundaries
of different classifiers.
This should be taken with ... | bsd-3-clause |
fermiPy/lcpipe | runLCWeekly.py | 1 | 1277 | import sys
from fermipy import utils
utils.init_matplotlib_backend()
from fermipy.gtanalysis import GTAnalysis
from fermipy.utils import *
import yaml
import pprint
import numpy
import argparse
from fermipy.gtanalysis import GTAnalysis
def main():
usage = "usage: %(prog)s [config file]"
description =... | bsd-3-clause |
MattNolanLab/ei-attractor | grid_cell_model/simulations/007_noise/figures/paper/ee_connections/config.py | 1 | 2573 |
'''Configuration file for the noise paper.'''
from __future__ import absolute_import, print_function
import os.path
import matplotlib.ticker as ti
from noisefigs.plotters.base import SeparateMultipageSaver
def get_config():
return _config
ROOT_DIR = ['simulation_data', 'ee_connections']
_config = {
'grid... | gpl-3.0 |
Eward5513/oceanbase | oceanbase_0.4/tools/deploy/perf/1.py | 12 | 1857 | import datetime
import re
import sys
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
time_format = "%Y-%m-%d %H:%M:%S"
d = dict()
start_time = None
start_time = None
sql_count = 0
sql_time = 0
sql_time_dist = dict()
rpc_time = 0
urpc_time = 0
wait_time = 0
qps2time = dict()
rpc_times = []
urpc_... | gpl-2.0 |
memo/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_test.py | 9 | 59208 | # 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 |
toastedcornflakes/scikit-learn | examples/model_selection/plot_precision_recall.py | 74 | 6377 | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
In information retrieval, precision is a measure of result relevancy, while
recall is a measure of how many truly relevant results are returned. A high
area under the curve represents both ... | bsd-3-clause |
bigdataelephants/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 |
liberatorqjw/scikit-learn | sklearn/datasets/lfw.py | 28 | 17953 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
jazcollins/models | cognitive_mapping_and_planning/scripts/script_plot_trajectory.py | 9 | 12900 | # 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 applicab... | apache-2.0 |
uvNikita/image-proc-demo | app/main/views.py | 1 | 6528 | import os
import numpy as np
from scipy import ndimage
from scipy import fftpack as fp
from matplotlib import pyplot, cm
from PIL import Image
from flask import Blueprint, render_template, url_for, send_file
from flask import redirect, request, g, current_app
from .util import get_image_path, get_no_image_path, cl... | mit |
tntnatbry/tensorflow | tensorflow/examples/learn/iris_run_config.py | 86 | 2087 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
Titan-C/scikit-learn | sklearn/decomposition/base.py | 5 | 5613 | """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 <denis-alexander.engemann@inria.fr>
# Kyle Kastner <kastnerkyle@gmail.com>
... | bsd-3-clause |
DataReplyUK/datareplyuk | GenesAssociation/__init__.py | 1 | 6038 | """
Program: RUNNING GRAPH ANALYTICS WITH SPARK GRAPH-FRAMES:
Author: Dr. C. Hadjinikolis
Date: 14/09/2016
Description: This is the application's core module from where everything is executed.
The module is responsible for:
1. Loading Spark
2. Loading Grap... | apache-2.0 |
reiinakano/ensemble_helper | src/parameterspinner.py | 1 | 2420 | # This module contains the class for a parameter spinner, containing different methods to automatically generate valid
# hyperparameters from a hyperparameter information dictionary i.e. dictionary "hyperparam" in a hyperparam.py file,
from sklearn.grid_search import ParameterGrid
from collections import Mapping
clas... | mit |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Dynamic_Shear_Behaviour/Total_Energy_Verification/dt_1e-4/Plot_Results.py | 2 | 2935 | #!/usr/bin/env python
#!/usr/bin/python
import h5py
from matplotlib import pylab
import matplotlib.pylab as plt
import sys
from matplotlib.font_manager import FontProperties
import math
import numpy as np
import h5py
import matplotlib.pylab as plt
import matplotlib as mpl
import sys
import numpy as np;
plt.rcParams.u... | cc0-1.0 |
matthew-tucker/mne-python | examples/time_frequency/plot_source_label_time_frequency.py | 19 | 3767 | """
=========================================================
Compute power and phase lock in label of the source space
=========================================================
Compute time-frequency maps of power and phase lock in the source space.
The inverse method is linear based on dSPM inverse operator.
The ex... | bsd-3-clause |
DGrady/pandas | pandas/tests/indexes/datetimes/test_missing.py | 15 | 2132 | import pandas as pd
import pandas.util.testing as tm
class TestDatetimeIndex(object):
def test_fillna_datetime64(self):
# GH 11343
for tz in ['US/Eastern', 'Asia/Tokyo']:
idx = pd.DatetimeIndex(['2011-01-01 09:00', pd.NaT,
'2011-01-01 11:00'])
... | bsd-3-clause |
blackball/an-test6 | util/sip_plot_distortion.py | 1 | 2423 | import matplotlib
matplotlib.use('Agg')
import sys
from optparse import *
import numpy as np
from pylab import *
from numpy import *
#from astrometry.util.sip import *
from astrometry.util.util import *
def plot_distortions(wcsfn, ex=1, ngridx=10, ngridy=10, stepx=10, stepy=10):
wcs = Sip(wcsfn)
W,H = wcs.wcstan.i... | gpl-2.0 |
Nyker510/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 182 | 1743 | """
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | bsd-3-clause |
robertwb/incubator-beam | sdks/python/apache_beam/dataframe/convert.py | 6 | 9567 | #
# 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 |
pap/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/pylab.py | 70 | 10245 | """
This is a procedural interface to the matplotlib object-oriented
plotting library.
The following plotting commands are provided; the majority have
Matlab(TM) analogs and similar argument.
_Plotting commands
acorr - plot the autocorrelation function
annotate - annotate something in the figure
arrow ... | agpl-3.0 |
clsb/miles | miles/plot.py | 1 | 12891 | """Module for plotting routines.
"""
__all__ = ['plot']
import os
import sys
from typing import Optional, Tuple
import scipy.ndimage
import scipy.linalg
import scipy.spatial
matplotlib = None # type: Optional[module]
plt = None # type: Optional[module]
sns = None ... | mit |
ldirer/scikit-learn | examples/linear_model/plot_multi_task_lasso_support.py | 102 | 2319 | #!/usr/bin/env python
"""
=============================================
Joint feature selection with multi-task Lasso
=============================================
The multi-task lasso allows to fit multiple regression problems
jointly enforcing the selected features to be the same across
tasks. This example simulates... | bsd-3-clause |
misterwindupbird/IBO | demo.py | 1 | 7518 | # Copyright (C) 2010, 2011 by Eric Brochu
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publis... | mit |
andaag/scikit-learn | sklearn/externals/joblib/__init__.py | 86 | 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 |
tonyao-/iozone-results-comparator | old_version/iozone_results_comparator.py | 7 | 56394 | #!/usr/bin/python
# iozone_results_comparator.py - parse iozone output files and write stats and plots to output html
# Copyright (C) 2011
# Adam Okuliar aokuliar at redhat dot com
# Jiri Hladky hladky dot jiri at gmail dot com
# Petr Benas petrbenas at gmail dot com
#
# This progra... | gpl-3.0 |
3drobotics/MAVProxy | MAVProxy/modules/lib/live_graph.py | 4 | 8385 | #!/usr/bin/env python
"""
MAVProxy realtime graphing module, partly based on the wx graphing
demo by Eli Bendersky (eliben@gmail.com)
http://eli.thegreenplace.net/files/prog_code/wx_mpl_dynamic_graph.py.txt
"""
from MAVProxy.modules.lib import mp_util
class LiveGraph():
'''
a live graph object using ... | gpl-3.0 |
idiap/zentas | python/experiments/skl_eak_zen.py | 1 | 5111 | # Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/
# Written by James Newling <jnewling@idiap.ch>
"""
experiments comparing:
- scikit-learn,
- eakmeans and
- zentas.
"""
import matplotlib.pyplot as pl
import sys
import random
import numpy as np
import numpy.random as npr
#where is pyze... | gpl-3.0 |
bigdataelephants/scikit-learn | examples/ensemble/plot_forest_importances.py | 241 | 1761 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
brev/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qtagg.py | 73 | 4972 | """
Render to qt from agg
"""
from __future__ import division
import os, sys
import matplotlib
from matplotlib import verbose
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\
show, draw_if_interactive, backend_version, \
... | agpl-3.0 |
vasudevk/sklearn_pycon2015 | notebooks/fig_code/ML_flow_chart.py | 61 | 4970 | """
Tutorial Diagrams
-----------------
This script plots the flow-charts used in the scikit-learn tutorials.
"""
import numpy as np
import pylab as pl
from matplotlib.patches import Circle, Rectangle, Polygon, Arrow, FancyArrow
def create_base(box_bg = '#CCCCCC',
arrow1 = '#88CCFF',
... | bsd-3-clause |
yavalvas/yav_com | build/matplotlib/lib/matplotlib/offsetbox.py | 11 | 53384 | """
The OffsetBox is a simple container artist. The child artist are meant
to be drawn at a relative position to its parent. The [VH]Packer,
DrawingArea and TextArea are derived from the OffsetBox.
The [VH]Packer automatically adjust the relative postisions of their
children, which should be instances of the OffsetBo... | mit |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/learn/python/learn/tests/dataframe/arithmetic_transform_test.py | 62 | 2343 | # 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 |
neuropoly/spinalcordtoolbox | spinalcordtoolbox/registration/landmarks.py | 1 | 14660 | #!/usr/bin/env python
#########################################################################################
#
# This file contains an implementation of the iterative closest point algorithm.
# This algo registers two sets of points (3D coordinates) together.
#
# Adapted from:
# http://stackoverflow.com/questions/20... | mit |
nigroup/pypet | pypet/environment.py | 1 | 148936 | """ Module containing the environment to run experiments.
An :class:`~pypet.environment.Environment` provides an interface to run experiments based on
parameter exploration.
The environment contains and might even create a :class:`~pypet.trajectory.Trajectory`
container which can be filled with parameters and results... | bsd-3-clause |
salma1601/process-asl | procasl/externals/nistats/first_level_model.py | 2 | 21160 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
This module presents an interface to use the glm implemented in
nistats.regression.
It contains the GLM and contrast classes that are meant to be the main objects
of fMRI data analyses.
"""
from warni... | bsd-3-clause |
viisar/brew | brew/selection/dynamic/base.py | 3 | 1144 | from sklearn.neighbors.classification import KNeighborsClassifier
from abc import abstractmethod
class DCS(object):
@abstractmethod
def select(self, ensemble, x):
pass
def __init__(self, Xval, yval, K=5, weighted=False, knn=None):
self.Xval = Xval
self.yval = yval
self.K... | mit |
luo66/scikit-learn | sklearn/metrics/scorer.py | 211 | 13141 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
zaxtax/scikit-learn | sklearn/linear_model/stochastic_gradient.py | 34 | 50761 | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
from abc import ABCMeta, abstractmethod
from ..externals.joblib import ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.