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 |
|---|---|---|---|---|---|
WangWenjun559/Weiss | summary/sumy/sklearn/ensemble/tests/test_weight_boosting.py | 32 | 15697 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raises, assert_rais... | apache-2.0 |
vipullakhani/mi-instrument | mi/core/instrument/file_publisher.py | 5 | 4306 | """
@package mi.core.instrument.publisher
@file /mi-instrument/mi/core/instrument/file_publisher.py
@author Peter Cable
@brief Event file publisher
Release notes:
initial release
"""
import cPickle as pickle
import json
import numpy as np
import pandas as pd
import xarray as xr
from mi.core.instrument.publisher impor... | bsd-2-clause |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/backend_bases.py | 10 | 106046 | """
Abstract base classes define the primitives that renderers and
graphics contexts must implement to serve as a matplotlib backend
:class:`RendererBase`
An abstract base class to handle drawing/rendering operations.
:class:`FigureCanvasBase`
The abstraction layer that separates the
:class:`matplotlib.fi... | mit |
costypetrisor/scikit-learn | examples/mixture/plot_gmm_sin.py | 248 | 2747 | """
=================================
Gaussian Mixture Model Sine Curve
=================================
This example highlights the advantages of the Dirichlet Process:
complexity control and dealing with sparse data. The dataset is formed
by 100 points loosely spaced following a noisy sine curve. The fit by
the GMM... | bsd-3-clause |
cpcloud/ibis | ibis/expr/window.py | 1 | 15482 | """Encapsulation of SQL window clauses."""
import functools
from typing import NamedTuple, Union
import numpy as np
import pandas as pd
import ibis.common.exceptions as com
import ibis.expr.operations as ops
import ibis.expr.types as ir
import ibis.util as util
def _sequence_to_tuple(x):
return tuple(x) if uti... | apache-2.0 |
econpy/google-ngrams | getngrams.py | 2 | 6725 | #!/usr/bin/env python
# -*- coding: utf-8 -*
from ast import literal_eval
from pandas import DataFrame # http://github.com/pydata/pandas
import re
import requests # http://github.com/kennethreitz/requests
import subprocess
import sys
corpora = dict(eng_us_2012=17, eng_us_2009=5, eng_gb_2012=18, eng_gb_2... | mit |
gregreen/legacypipe | py/legacypipe/write_initial_catalog.py | 1 | 3639 | from __future__ import print_function
if __name__ == '__main__':
import matplotlib
matplotlib.use('Agg')
import numpy as np
from common import *
from tractor import *
if __name__ == '__main__':
import optparse
parser = optparse.OptionParser()
parser.add_option('-b', '--brick', type=int, help='Bric... | gpl-2.0 |
SuLab/scheduled-bots | scheduled_bots/phenotypes/mitodb_bot.py | 1 | 6364 | import argparse
import json
import os
from datetime import datetime
from itertools import groupby
from time import gmtime, strftime, strptime
import pandas as pd
from tqdm import tqdm
from scheduled_bots import PROPS, ITEMS
from wikidataintegrator import wdi_core, wdi_helpers, wdi_login
from wikidataintegrator.ref_ha... | mit |
pbreach/pysd | tests/unit_test_utils.py | 2 | 7923 | from unittest import TestCase
import xarray as xr
import pandas as pd
from . import test_utils
import doctest
class TestUtils(TestCase):
def test_get_return_elements_subscirpts(self):
from pysd.utils import get_return_elements
self.assertEqual(
get_return_elements(["Inflow A[Entry 1,C... | mit |
mayblue9/scikit-learn | sklearn/datasets/mlcomp.py | 289 | 3855 | # Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
"""Glue code to load http://mlcomp.org data as a scikit.learn dataset"""
import os
import numbers
from sklearn.datasets.base import load_files
def _load_document_classification(dataset_path, metadata, set_=None, **kwargs):
if ... | bsd-3-clause |
dpshelio/sunpy | examples/plotting/simple_differential_rotation.py | 1 | 3061 | """
============================
Simple Differential Rotation
============================
The Sun is known to rotate differentially, meaning that the rotation rate
near the poles (rotation period of approximately 35 days) is not the same as
the rotation rate near the equator (rotation period of approximately 25 days)... | bsd-2-clause |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/api/histogram_path.py | 1 | 2441 | """
========================================================
Building histograms using Rectangles and PolyCollections
========================================================
This example shows how to use a path patch to draw a bunch of
rectangles. The technique of using lots of Rectangle instances, or
the faster met... | mit |
eustislab/horton | scripts/horton-entanglement.py | 1 | 7461 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | gpl-3.0 |
Eric89GXL/scikit-learn | examples/cluster/plot_kmeans_stability_low_dim_dense.py | 8 | 4308 | """
============================================================
Empirical evaluation of the impact of k-means initialization
============================================================
Evaluate the ability of k-means initializations strategies to make
the algorithm convergence robust as measured by the relative stan... | bsd-3-clause |
florian-f/sklearn | examples/cluster/plot_segmentation_toy.py | 4 | 3309 | """
===========================================
Spectral clustering for image segmentation
===========================================
In this example, an image with connected circles is generated and
:ref:`spectral_clustering` is used to separate the circles.
In these settings, the spectral clustering approach solve... | bsd-3-clause |
person142/scipy | scipy/spatial/_plotutils.py | 8 | 6957 | import numpy as np
from scipy._lib.decorator import decorator as _decorator
__all__ = ['delaunay_plot_2d', 'convex_hull_plot_2d', 'voronoi_plot_2d']
@_decorator
def _held_figure(func, obj, ax=None, **kw):
import matplotlib.pyplot as plt # type: ignore[import]
if ax is None:
fig = plt.figure()
... | bsd-3-clause |
michigraber/scikit-learn | examples/gaussian_process/gp_diabetes_dataset.py | 223 | 1976 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
========================================================================
Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset
========================================================================
In this example, we fit a Gaussian Process model onto... | bsd-3-clause |
PatrickOReilly/scikit-learn | examples/tree/plot_tree_regression.py | 95 | 1516 | """
===================================================================
Decision Tree Regression
===================================================================
A 1D regression with decision tree.
The :ref:`decision trees <tree>` is
used to fit a sine curve with addition noisy observation. As a result, it
learns ... | bsd-3-clause |
wronk/mne-python | examples/time_frequency/plot_source_space_time_frequency.py | 9 | 2323 | """
===================================================
Compute induced power in the source space with dSPM
===================================================
Returns STC files ie source estimates of induced power
for different bands in the source space. The inverse method
is linear based on dSPM inverse operator.
"... | bsd-3-clause |
JPFrancoia/scikit-learn | sklearn/gaussian_process/gpr.py | 13 | 18747 | """Gaussian processes regression. """
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base im... | bsd-3-clause |
adrn/streams | streams/io/tests/test_sgr.py | 1 | 5403 | # coding: utf-8
""" Test different reading data from different mass runs """
from __future__ import absolute_import, unicode_literals, division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import astropy.units as u
from astropy.constants import G
from... | mit |
airanmehr/bio | Scripts/TimeSeriesPaper/Simulation/msmsData2.py | 1 | 3534 | '''
Copyleft Jul 24, 2016 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com
'''
import numpy as np;
np.set_printoptions(linewidth=200, precision=5, suppress=True)
import pandas as pd;
pd.options.display.max_rows = 20;
pd.options.display.expand_frame_repr = False
import pylab as plt;
imp... | mit |
suranap/qiime | qiime/compare_distance_matrices.py | 15 | 11259 | #!/usr/bin/env python
from __future__ import division
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["Jai Ram Rideout", "Michael Dwan", "Logan Knecht",
"Damien Coy", "Levi McCracken", "Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__main... | gpl-2.0 |
kjung/scikit-learn | sklearn/datasets/mlcomp.py | 289 | 3855 | # Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
"""Glue code to load http://mlcomp.org data as a scikit.learn dataset"""
import os
import numbers
from sklearn.datasets.base import load_files
def _load_document_classification(dataset_path, metadata, set_=None, **kwargs):
if ... | bsd-3-clause |
gengho/Car2know | hw7only/cheng_hw7.py | 1 | 3031 |
# coding: utf-8
# before use this script, you should have the following packages
# you can install GeoPandas git clone https://github.com/kjordahl/geopandas
# and then install it with
# <pre><code>
# python setup.py install
# conda install fiona
# conda install pysal
# </code></pre>
#
# yxcheng@uw.edu
... | mit |
vishnumani2009/OpenSource-Open-Ended-Statistical-toolkit | FRONTEND/heirarfrontend.py | 1 | 6985 | # -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
from scipy.cluster.hierarchy import linkage, dendrogram
from DM import *
import scipy.cluster.hierarchy as hac
import pandas as pd
import matplotlib.pyplot as plt
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
... | gpl-3.0 |
yyjiang/scikit-learn | examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py | 252 | 3490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
==============================================================================
Gaussian Processes classification example: exploiting the probabilistic output
==============================================================================
A two-dimensional regression exerci... | bsd-3-clause |
Nyker510/scikit-learn | sklearn/decomposition/truncated_svd.py | 199 | 7744 | """Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).
"""
# Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# Olivier Grisel <olivier.grisel@ensta.org>
# Michael Becker <mike@beckerfuffle.com>
# License: 3-clause BSD.
import numpy as np
import scipy.sparse as sp
try:
from scipy.sp... | bsd-3-clause |
lukeiwanski/tensorflow-opencl | 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 |
AnasGhrab/scikit-learn | sklearn/linear_model/tests/test_omp.py | 272 | 7752 | # Author: Vlad Niculae
# Licence: BSD 3 clause
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_array_almost_equa... | bsd-3-clause |
nomadcube/scikit-learn | examples/linear_model/plot_robust_fit.py | 238 | 2414 | """
Robust linear estimator fitting
===============================
Here a sine function is fit with a polynomial of order 3, for values
close to zero.
Robust fitting is demoed in different situations:
- No measurement errors, only modelling errors (fitting a sine with a
polynomial)
- Measurement errors in X
- M... | bsd-3-clause |
ngoix/OCRF | examples/cluster/plot_face_ward_segmentation.py | 71 | 2460 | """
=========================================================================
A demo of structured Ward hierarchical clustering on a raccoon face image
=========================================================================
Compute the segmentation of a 2D image with Ward hierarchical
clustering. The clustering is s... | bsd-3-clause |
ChanChiChoi/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 105 | 22788 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
gabhijit/tickdownload | read_sql_data.py | 2 | 3015 | #pylint: disable-msg=broad-except, global-statement
import pandas as pd
from sqlalchemy import desc
from tickerplot.sql.sqlalchemy_wrapper import execute_one
from tickerplot.sql.sqlalchemy_wrapper import create_or_get_all_scrips_table
from tickerplot.sql.sqlalchemy_wrapper import create_or_get_nse_equities_hist_data
... | mit |
haijieg/SFrame | oss_src/unity/python/sframe/test/test_graph.py | 1 | 16298 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
# from nose import with_setup
from ..data_structures.sgraph import SGraph, Vertex, Edge, load_graph
from ..data_structures.sframe import SFrame
... | bsd-3-clause |
mwalton/artificial-olfaction | experiments/multiBGc/plotResults.py | 2 | 3928 | import matplotlib.pyplot as plt
#from Image import NEAREST
#from matplotlib.cm import cmap_d
import argparse
import os.path
import numpy as np
from casuarius import required
from sklearn.metrics import accuracy_score
from os import listdir
#import pylab as pl
def evaluateNS(path):
d = np.genfromtxt(path, delimiter... | mit |
eickenberg/scikit-learn | benchmarks/bench_covertype.py | 6 | 9212 | """
===========================
Covertype dataset benchmark
===========================
Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART
(decision tree), RandomForest and Extra-Trees on the forest covertype dataset
of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ... | bsd-3-clause |
gbrammer/pygrism | utils_c/interp.py | 2 | 7337 | """
Test suite for Cython utilities.
"""
import numpy as np
def interp_conserve(x, xp, fp, left=0., right=0.):
"""
Interpolate `xp`,`yp` array to the output x array, conserving flux.
`xp` can be irregularly spaced.
"""
midpoint = (x[1:]-x[:-1])/2.+x[:-1]
midpoint = np.append(midpoint, np.arra... | mit |
phev8/dataset_tools | playground/object_recognition_playground.py | 1 | 7568 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from experiment_handler.object_recognition.object_detection_reader import read_filtered_object_detection_results, read_object_detections
from experiment_handler.label_data_reader import read_experiment_phases, read_location_labels, read_activity_lab... | mit |
berkeley-stat222/mousestyles | mousestyles/path_diversity/path_index.py | 3 | 2301 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np
def path_index(movement, stop_threshold, min_path_length):
r"""
Return a list object containing start and end indices
for a specific movement. Each element in the list is
a ... | bsd-2-clause |
xyguo/scikit-learn | examples/plot_isotonic_regression.py | 303 | 1767 | """
===================
Isotonic Regression
===================
An illustration of the isotonic regression on generated data. The
isotonic regression finds a non-decreasing approximation of a function
while minimizing the mean squared error on the training data. The benefit
of such a model is that it does not assume a... | bsd-3-clause |
nkhuyu/airflow | airflow/www/app.py | 3 | 68914 | from __future__ import print_function
from __future__ import division
from builtins import str
from past.utils import old_div
import copy
from datetime import datetime, timedelta
import dateutil.parser
from functools import wraps
import inspect
import json
import logging
import os
import socket
import sys
import time
... | apache-2.0 |
wlamond/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
subutai/NAB | nab/corpus.py | 7 | 7565 | # ----------------------------------------------------------------------
# Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/... | agpl-3.0 |
PatrickChrist/scikit-learn | sklearn/utils/tests/test_estimator_checks.py | 202 | 3757 | import scipy.sparse as sp
import numpy as np
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.testing import assert_raises_regex, assert_true
from sklearn.utils.estimator_checks import check_estimator
from sklearn.utils.... | bsd-3-clause |
jstooks9/mpp | 2d_histogram.py | 1 | 2549 | # create 2D histogram, where histogram height is displayed as color
import numpy as np
import matplotlib.pyplot as plt
import sys
# Arguments:
# 1 - data filename
# 2 - number of bins
# 3 - figure title
# 4 - cutoff for # of stds (default 4)
def make_histogram(data, bins):
range = max(data) - min(data)
binWidth = ... | apache-2.0 |
siutanwong/scikit-learn | sklearn/svm/setup.py | 321 | 3157 | 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('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... | bsd-3-clause |
DonBeo/statsmodels | statsmodels/sandbox/examples/ex_kaplan_meier.py | 33 | 2838 | #An example for the Kaplan-Meier estimator
from __future__ import print_function
from statsmodels.compat.python import lrange
import statsmodels.api as sm
import matplotlib.pyplot as plt
import numpy as np
from statsmodels.sandbox.survival2 import KaplanMeier
#Getting the strike data as an array
dta = sm.datasets.stri... | bsd-3-clause |
soulmachine/scikit-learn | doc/sphinxext/gen_rst.py | 2 | 38923 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
dsullivan7/scikit-learn | sklearn/metrics/pairwise.py | 13 | 41710 | # -*- 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 |
ltiao/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
bzamecnik/ml | instrument-classification/inspect_errors.py | 2 | 1780 | from argparse import ArgumentParser
import os
import pandas as pd
import shutil
import subprocess
from prepare_training_data import load_transformers
def inspect_errors(model_id):
model_dir = 'data/working/single-notes-2000/models/' + model_id
input_dir = 'data/prepared/single-notes-2000'
output_dir = mo... | mit |
luca-heltai/ePICURE | applications/bspline_spiral.py | 1 | 1136 | from interfaces import *
from utilities import *
from numpy import *
from numpy.linalg import lstsq
from matplotlib.pylab import *
from mpl_toolkits.mplot3d import Axes3D
# Spiral parameters:
nturns = 6.0
heigth = 1.0
radius = 1.0
# Spiral analytical expression
cx = lambda x: radius*sin(nturns*2*pi*x)
cy = lambda y: ... | gpl-2.0 |
zedyang/OANDA-Forex | api.py | 2 | 28036 | #encoding: UTF-8
import json
import requests
import pandas as pd
import time
from datetime import datetime, timedelta
from Queue import Queue, Empty, PriorityQueue
from threading import Thread, Timer
from errors import (OANDA_RequestError, OANDA_EnvError,
OANDA_DataConstructorError)
class Config(object):
"""
Json... | mit |
giserh/mpld3 | examples/custom_plugin.py | 21 | 2557 | """
Defining a Custom Plugin
========================
Test the custom plugin demoed on the `Pythonic Perambulations
<http://jakevdp.github.io/blog/2014/01/10/d3-plugins-truly-interactive/>`_
blog. Hover over the points to see the associated sinusoid.
Use the toolbar buttons at the bottom-right of the plot to enable zo... | bsd-3-clause |
iris-edu/ispaq | ispaq/concierge.py | 1 | 68757 | """
ISPAQ Data Access Expediter.
:copyright:
Mazama Science
:license:
GNU Lesser General Public License, Version 3
(http://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import (absolute_import, division, print_function)
import os
import sys
import re
import glob
import math
import fileinput
impor... | lgpl-3.0 |
plotly/plotly.py | packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_data.py | 2 | 2718 | from __future__ import absolute_import
import pytest
from plotly import optional_imports
from plotly.tests.test_optional.optional_utils import run_fig
from plotly.tests.test_optional.test_matplotlylib.data.data import *
matplotlylib = optional_imports.get_module("plotly.matplotlylib")
if matplotlylib:
import ma... | mit |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/pandas/util/clipboard.py | 16 | 6355 | # Pyperclip v1.3
# A cross-platform clipboard module for Python. (only handles plain text for now)
# By Al Sweigart al@coffeeghost.net
# Usage:
# import pyperclip
# pyperclip.copy('The text to be copied to the clipboard.')
# spam = pyperclip.paste()
# On Mac, this module makes use of the pbcopy and pbpaste comm... | mit |
timsnyder/bokeh | examples/custom/parallel_plot/parallel_plot.py | 1 | 4336 | import numpy as np
import pandas as pd
from bokeh.plotting import figure
from bokeh.layouts import column
from bokeh.models import (Range1d, ColumnDataSource, Div, LinearAxis,
LinearColorMapper, MultiLine,
FixedTicker, BasicTickFormatter, FuncTickFormatter)
from par... | bsd-3-clause |
Nikea/pyXPCS | pyxpcs/correlator_online_new_mp.py | 1 | 21931 | #!/usr/bin/env python
# Licensed as BSD by Yuriy Chushkin of the ESRF on 2014-08-06
################################################################################
# Copyright (c) 2014, the European Synchrotron Radiation Facility #
# All rights reserved. ... | bsd-3-clause |
landlab/drivers | component_drivers/cellular_automata/rock_weathering.py | 3 | 5558 | #!/usr/env/python
"""
rock_weathering.py
CellLab-CTS model that simulates the weathering of rock to saprolite around
a network of fractures.
Created (and translated from earlier code by) by Greg Tucker, Jul 2015
"""
from __future__ import print_function
import time
import numpy as np
from landlab import RasterModel... | mit |
springer-math/Mathematics-of-Epidemics-on-Networks | docs/examples/fig9p5.py | 1 | 2607 | import EoN
import networkx as nx
import matplotlib.pyplot as plt
import random
import scipy
print("for figure 9.5, we have not coded up the equations to calculate size as a function of tau (fig a), so this just gives simulations. It does calculate the predicted size as a function of R_0^p. (fig b)")
r'''
Rather than... | mit |
momijiame/rakuza | rakuza/exchanges/bitflyer.py | 1 | 7893 | # -*- coding: utf-8 -*-
import time
import json
import hashlib
import hmac
from datetime import datetime
from urllib import parse
from oslo_config import cfg
import requests
import pandas as pd
from ..autologging import patch as monkey_patch
from ..exceptions import InvalidHTTPStatusCodeError
from .base import Excha... | gpl-3.0 |
michigraber/scikit-learn | examples/linear_model/plot_logistic.py | 312 | 1426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... | bsd-3-clause |
ky822/scikit-learn | examples/svm/plot_svm_kernels.py | 329 | 1971 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM-Kernels
=========================================================
Three different types of SVM-Kernels are displayed below.
The polynomial and RBF are especially useful when the
data-points are not linearly sep... | bsd-3-clause |
TomAugspurger/pandas | pandas/tests/scalar/interval/test_ops.py | 4 | 2336 | """Tests for Interval-Interval operations, such as overlaps, contains, etc."""
import pytest
from pandas import Interval, Timedelta, Timestamp
@pytest.fixture(
params=[
(Timedelta("0 days"), Timedelta("1 day")),
(Timestamp("2018-01-01"), Timedelta("1 day")),
(0, 1),
],
ids=lambda ... | bsd-3-clause |
Vkomini/KU-Leuven | Computer Vision/Assignments/Assign1/smoothing1.py | 1 | 2402 | '''
Gaussian smoothing with Python.
'''
import cv2
import numpy as np
import math
import os
from scipy import signal
import matplotlib.pyplot as plt
def gaussian_filter(sigma, filter_length):
'''
Given a sigma, return a 1-D Gaussian filter.
@param sigma: float, defining the width of the filter
@para... | apache-2.0 |
ovilab/atomify-lammps | libs/lammps/python/examples/matplotlib_plot.py | 22 | 2270 | #!/usr/bin/env python -i
# preceding line should have path for Python on your machine
# matplotlib_plot.py
# Purpose: plot Temp of running LAMMPS simulation via matplotlib
# Syntax: plot.py in.lammps Nfreq Nsteps compute-ID
# in.lammps = LAMMPS input script
# Nfreq = plot data point every this many ... | gpl-3.0 |
teese/pytoxr | pytoxr/parse.py | 1 | 31478 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pytoxr contains tools for the analysis of data from ToxR experiments
Copyright (C) 2016 Mark George Teese
This software is licensed under the permissive MIT License...
"""
import glob
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
im... | mit |
fabioticconi/scikit-learn | examples/svm/plot_svm_anova.py | 85 | 2024 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature selection before running a
SVC (support vector classifier) to improve the classification scores.
"""
print(__doc_... | bsd-3-clause |
cainiaocome/scikit-learn | sklearn/manifold/tests/test_locally_linear.py | 232 | 4761 | from itertools import product
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from scipy import linalg
from sklearn import neighbors, manifold
from sklearn.manifold.locally_linear import barycenter_kneighbors_graph
from sklearn.utils.testi... | bsd-3-clause |
low-sky/simscript | postproc/pipeline_orion.py | 1 | 1278 | import subprocess
import sys
import postproc_yt_orion as pp
import os
import shutil
import matplotlib
matplotlib.use('Agg')
targetdir = sys.argv[1]
# timestep = float(sys.argv[2])
data_file = sys.argv[2]
face = float(sys.argv[3])
level = float(sys.argv[4])
ppdir = os.getenv('PPDIR')
datadir = os.getenv("DATADIR")
ou... | gpl-2.0 |
tum-camp/survival-support-vector-machine | survival/svm/minlip.py | 1 | 12742 | import numpy
from scipy import sparse
from sklearn.base import BaseEstimator
from sklearn.metrics.pairwise import pairwise_kernels
from ..base import SurvivalAnalysisMixin
from ..util import check_arrays_survival
from ._minlip import create_difference_matrix
__all__ = ['MinlipSurvivalAnalysis', 'HingeLossSurvivalSVM'... | gpl-3.0 |
pystockhub/book | ch18/day03/Kiwoom.py | 2 | 8383 | import sys
from PyQt5.QtWidgets import *
from PyQt5.QAxContainer import *
from PyQt5.QtCore import *
import time
import pandas as pd
import sqlite3
TR_REQ_TIME_INTERVAL = 0.2
class Kiwoom(QAxWidget):
def __init__(self):
super().__init__()
self._create_kiwoom_instance()
self._set_signal_sl... | mit |
njwilson23/scipy | scipy/special/add_newdocs.py | 24 | 70839 | # Docstrings for generated ufuncs
#
# The syntax is designed to look like the function add_newdoc is being
# called from numpy.lib, but in this file add_newdoc puts the
# docstrings in a dictionary. This dictionary is used in
# generate_ufuncs.py to generate the docstrings for the ufuncs in
# scipy.special at the C lev... | bsd-3-clause |
gasabr/AtoD | atod/models/match.py | 1 | 2832 | ''' Class to get match description. '''
import dota2api
import pandas as pd
from atod import Hero, Heroes, files
from atod.utils.dota_api import api
class Match(object):
''' Representation of the single match.
Attributes:
id (int) : id of the match
radiant (Heroes): Heroes in radiant ... | mit |
grahesh/Stock-Market-Event-Analysis | qstksim/tests/test_tradesim_SPY_Short.py | 3 | 2617 | '''
(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 May 19, 2012
@author: Sourabh Bajaj
@contact: sourabhbajaj90@gmail.com
@summary: Test cases for tradeSim -... | bsd-3-clause |
rknLA/sms-tools | lectures/09-Sound-description/plots-code/spectralFlux-onsetFunction.py | 25 | 1330 | import numpy as np
import matplotlib.pyplot as plt
import essentia.standard as ess
M = 1024
N = 1024
H = 512
fs = 44100
spectrum = ess.Spectrum(size=N)
window = ess.Windowing(size=M, type='hann')
flux = ess.Flux()
onsetDetection = ess.OnsetDetection(method='hfc')
x = ess.MonoLoader(filename = '../../../sounds/speech-m... | agpl-3.0 |
walterreade/scikit-learn | sklearn/datasets/lfw.py | 31 | 19544 | """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 |
ngaude/cdiscount | sampling.py | 2 | 2087 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
from sklearn.externals import joblib
import time
import pandas as pd
import random
import sys
from utils import ddir,header
ext = '.0' # default value
print '-'*50
import sys
if len(sys.argv)==2:
ext = '.'+str(int(sys.argv[1]))
print 'sampling a... | gpl-2.0 |
siutanwong/scikit-learn | examples/manifold/plot_compare_methods.py | 259 | 4031 | """
=========================================
Comparison of Manifold Learning methods
=========================================
An illustration of dimensionality reduction on the S-curve dataset
with various manifold learning methods.
For a discussion and comparison of these algorithms, see the
:ref:`manifold module... | bsd-3-clause |
hoho/dosido | nodejs/deps/v8/tools/ignition/bytecode_dispatches_report.py | 12 | 9172 | #! /usr/bin/python
#
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
import argparse
import heapq
import json
from matplotlib import colors
from matplotlib import pyplot
import numpy
import struct
impo... | mit |
etkirsch/scikit-learn | examples/applications/plot_prediction_latency.py | 234 | 11277 | """
==================
Prediction Latency
==================
This is an example showing the prediction latency of various scikit-learn
estimators.
The goal is to measure the latency one can expect when doing predictions
either in bulk or atomic (i.e. one by one) mode.
The plots represent the distribution of the pred... | bsd-3-clause |
najmacherrad/master_thesis | Waltz/plotcomp1kg_waltz.py | 1 | 11632 | # Waltz
# Compare results between wild type and mutant
# coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import csv
from scipy import stats
from pylab import plot, show, savefig, xlim, figure, \
hold, ylim, legend, boxplot, setp, axes
import pylab
def getColumn(file... | mit |
bnaul/scikit-learn | build_tools/generate_authors_table.py | 14 | 5018 | """
This script generates an html table of contributors, with names and avatars.
The list is generated from scikit-learn's teams on GitHub, plus a small number
of hard-coded contributors.
The table should be updated for each new inclusion in the teams.
Generating the table requires admin rights.
"""
import sys
import ... | bsd-3-clause |
RayMick/scikit-learn | sklearn/linear_model/least_angle.py | 61 | 54324 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 ... | bsd-3-clause |
thekingofkings/urban-flow-analysis | python/multi_view_learning/multi_view_prediction.py | 2 | 18504 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 10 15:16:43 2016
@author: hxw186
Evaluate multi-view learning framework.
"""
import numpy as np
import statsmodels.api as sm
from sklearn.cross_validation import LeaveOneOut
from sklearn.preprocessing import scale
from sklearn.metrics.pairwise imp... | mit |
rahlk/WarnPlan | warnplan/commons/tools/Discretize.py | 1 | 5764 | """
An instance filter that discretizes a range of numeric attributes in the dataset into nominal attributes. Discretization is by Fayyad & Irani's MDL method (the default).
For more information, see:
Usama M. Fayyad, Keki B. Irani: Multi-interval discretization of continuous valued attributes for classification lear... | mit |
analysiscenter/dataset | setup.py | 1 | 1724 | """
BatchFlow helps you conveniently work with random or sequential batches of your data
and define data processing and machine learning workflows even for datasets that do not fit into memory.
Documentation - https://analysiscenter.github.io/batchflow/
"""
import re
from setuptools import setup, find_packages
with ... | apache-2.0 |
fps7806/Graph-CNN | src/graphcnn/experiment.py | 1 | 25438 | from graphcnn.helper import *
from graphcnn.network import *
from graphcnn.layers import *
from sklearn.model_selection import KFold
import numpy as np
import tensorflow as tf
import glob
import time
from tensorflow.python.training import queue_runner
# This function is used to create tf.cond compatible tf.train.batch... | mit |
ArchaeoPY/ArchaeoPY-Modeller | Res/res3d.py | 1 | 10071 | #def res3D(array, a, a1, a2, x, contrast, )
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as plt
from itertools import izip, product
#Array Info
array = 'tp_broad' #Select from one of the array's above
ps = 1 #for twin-probe, wenner, square, and trapezoid (side 1) arrays. F... | gpl-2.0 |
liberatorqjw/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 16 | 10538 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | bsd-3-clause |
suhelhammoud/omr | src/experimental/distant.py | 1 | 4471 | import numpy as np
import cv2
from matplotlib import pyplot as plt
# from skimage.filters import threshold_adaptive
from utils.learn import detect, detect2
def applyMor(gray):
kernel = np.ones((5, 5), np.uint8)
gray = cv2.morphologyEx(gray, cv2.MORPH_OPEN, kernel)
# gray = cv2.cvtColor(gray, cv2.COLOR_BGR2... | apache-2.0 |
ishank08/scikit-learn | examples/tree/plot_iris.py | 86 | 1965 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
indhub/mxnet | example/gluon/dcgan.py | 7 | 8812 | # 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 u... | apache-2.0 |
dsullivan7/scikit-learn | examples/linear_model/plot_iris_logistic.py | 283 | 1678 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <http://en.wikipedia.org/wiki/Iris_f... | bsd-3-clause |
imochaz/epilepsy-system | seizure detection code/Stacked Autoencoders for Seizure Detection/pylearn2ext/chbmit.py | 1 | 14998 | import numpy as np
import os
import pickle
import pandas as pd
from scipy.io import loadmat
from pylearn2.format.target_format import OneHotFormatter
from scipy.signal import butter, filtfilt
from sklearn import preprocessing
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix, DefaultViewConverter
cla... | bsd-3-clause |
chenjun0210/tensorflow | tensorflow/contrib/keras/python/keras/callbacks.py | 6 | 31200 | # Copyright 2015 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 |
466152112/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 |
billzorn/fpunreal | titanfp/bench.py | 1 | 33022 | import random
import math
import itertools
import multiprocessing
import subprocess
import os
import numpy as np
from .fpbench import fpcparser
from .arithmetic import ieee754, sinking
from .arithmetic import posit
from .arithmetic import mpmf
from .arithmetic import core2math
from .arithmetic import evalctx
from .ti... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.