repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
mindriot101/srw | srw/plotting.py | 1 | 1154 | import matplotlib.pyplot as plt
from astropy import units as u
from .logs import get_logger
logger = get_logger(__name__)
try:
import ds9
except ImportError:
logger.warning('No ds9 package available. '
'Related functions are not available')
no_ds9 = True
else:
no_ds9 = False
def p... | mit |
FerranGarcia/shape_learning | scripts/visualize_dataset.py | 3 | 3246 | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button
from shape_learning.shape_modeler import ShapeModeler
import argparse
parser = argparse.ArgumentParser(description='Displays all the characters in the given dataset')
parser.add_arg... | isc |
radjkarl/imgProcessor | imgProcessor/interpolate/interpolate2dUnstructuredIDW.py | 1 | 1926 | from __future__ import division
import numpy as np
from numba import njit
@njit
def interpolate2dUnstructuredIDW(x, y, v, grid, power=2):
'''
x,y,v --> 1d numpy.array
grid --> 2d numpy.array
fast if number of given values is small relative to grid resolution
'''
n = len(v)
... | gpl-3.0 |
jzt5132/scikit-learn | sklearn/metrics/ranking.py | 79 | 25426 | """Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | bsd-3-clause |
pylayers/pylayers | pylayers/simul/examples/ex_simulem_fur.py | 3 | 1157 | from pylayers.simul.simulem import *
from pylayers.signal.bsignal import *
from pylayers.measures.mesuwb import *
import matplotlib.pyplot as plt
from pylayers.gis.layout import *
#M=UWBMesure(173)
M=UWBMesure(13)
#M=UWBMesure(1)
cir=TUsignal()
cirf=TUsignal()
#cir.readcir("where2cir-tx001-rx145.mat","Tx001")
#cir... | mit |
rahul-c1/scikit-learn | sklearn/cross_decomposition/pls_.py | 6 | 28685 | """
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..utils import check_array, check_consistent_length
from ..externals import six
import w... | bsd-3-clause |
treycausey/scikit-learn | sklearn/externals/joblib/__init__.py | 3 | 4468 | """ 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 |
linebp/pandas | pandas/tests/util/test_hashing.py | 12 | 12908 | import pytest
import datetime
from warnings import catch_warnings
import numpy as np
import pandas as pd
from pandas import DataFrame, Series, Index, MultiIndex
from pandas.util import hash_array, hash_pandas_object
from pandas.core.util.hashing import hash_tuples, hash_tuple, _hash_scalar
import pandas.util.testing ... | bsd-3-clause |
rahul-c1/scikit-learn | sklearn/linear_model/tests/test_logistic.py | 19 | 22876 | import numpy as np
import scipy.sparse as sp
from scipy import linalg, optimize, sparse
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.util... | bsd-3-clause |
snnn/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimators_test.py | 46 | 6682 | # 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 |
ericl1u/eece7398 | controllers/pydmps/cs.py | 1 | 4378 | '''
Copyright (C) 2013 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope t... | gpl-3.0 |
lucidfrontier45/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 5 | 2555 | import unittest
import nose
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less
from .test_gmm import GMMTester
np.seterr(all='warn')
def test_class_weights():
# ... | bsd-3-clause |
JudoWill/glue | glue/core/roi.py | 1 | 34433 | from __future__ import absolute_import, division, print_function
from functools import wraps
import numpy as np
from matplotlib.patches import Polygon, Rectangle, Ellipse, PathPatch
from matplotlib.patches import Path as mplPath
from matplotlib.transforms import IdentityTransform, blended_transform_factory
import cop... | bsd-3-clause |
SunilProgramer/stimfit | src/pystfio/stfio_plot.py | 1 | 21243 | """
Some plotting utilities to use scale bars rather than coordinate axes.
04 Feb 2011, C. Schmidt-Hieber, University College London
From the stfio module:
http://code.google.com/p/stimfit
"""
# TODO: Pin scale bars to their position
# TODO: Implement 2-channel plots
import os
import sys
import numpy as np
import n... | gpl-2.0 |
lpsinger/astropy | astropy/utils/compat/optional_deps.py | 5 | 1183 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Checks for optional dependencies using lazy import from
`PEP 562 <https://www.python.org/dev/peps/pep-0562/>`_.
"""
import importlib
# First, the top-level packages:
# TODO: This list is a duplicate of the dependencies in setup.cfg "all", but
# some of... | bsd-3-clause |
plorch/FocusOnWildlifeCMPScripts | sessions_inproj_byuser.py | 1 | 28167 | #Python 2.7.9 (default, Apr 5 2015, 22:21:35)
# the full environment I've tested this in is in basic_project_stats.yml
# note: this code replicates a lot of what's in basic_project_stats.py
# and then builds on it.
'''
sessions_inproj_byuser:
Computes session statistics for each user who has classified on your proj... | gpl-2.0 |
manderelee/csc2521_final | scripts/svm.py | 1 | 1045 | import sys
from utils import *
from sklearn import decomposition
from sklearn import svm
from sklearn.model_selection import train_test_split
if __name__ == "__main__":
if len(sys.argv) != 3:
print ("python svm.py /path/to/pos/ex /path/to/neg/ex")
else:
# Truncate data to equalize number of ex... | mpl-2.0 |
dalejung/trtools | trtools/core/timeseries.py | 1 | 12879 | from datetime import datetime, time, date
from functools import partial
from dateutil import relativedelta
import calendar
from pandas import DateOffset, datetools, DataFrame, Series, Panel
from pandas.tseries.index import DatetimeIndex
from pandas.tseries.resample import _get_range_edges
from pandas.core.groupby impo... | mit |
jjberry/Autotrace | matlab-version/image_diversityNEW.py | 3 | 17500 | #!/usr/bin/env python
"""
image_diversityNEW.py
Rewritten by Gus Hahn-Powell on March 7 2014
based on ~2010 code by Jeff Berry
purpose:
This script measures the distance from average for each image in the
input set, and copies the specified number of highest scoring images
to a new folder called 'diverse'. If ROI_... | mit |
MartinSavc/scikit-learn | sklearn/metrics/cluster/tests/test_unsupervised.py | 230 | 2823 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn.metrics.cluster.unsupervised import silhouette_score
from sklearn.metrics import pairwise_distances
from sklearn.utils.testing import assert_false, assert_almost_equal
from sklearn.utils.testing import assert_raises_regexp... | bsd-3-clause |
JeanKossaifi/scikit-learn | examples/decomposition/plot_pca_3d.py | 354 | 2432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Principal components analysis (PCA)
=========================================================
These figures aid in illustrating how a point cloud
can be very flat in one direction--which is where PCA
comes in to ch... | bsd-3-clause |
JazzeYoung/VeryDeepAutoEncoder | pylearn2/testing/skip.py | 49 | 1363 | """
Helper functions for determining which tests to skip.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from nose.plugins.skip import SkipT... | bsd-3-clause |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/pandas/tseries/offsets.py | 9 | 87012 | from datetime import date, datetime, timedelta
from pandas.compat import range
from pandas import compat
import numpy as np
from pandas.tseries.tools import to_datetime
from pandas.tseries.timedeltas import to_timedelta
from pandas.core.common import ABCSeries, ABCDatetimeIndex
# import after tools, dateutil check
fr... | artistic-2.0 |
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 153 | 6723 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
luo66/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_scalability.py | 225 | 5719 | """
============================================
Scalability of Approximate Nearest Neighbors
============================================
This example studies the scalability profile of approximate 10-neighbors
queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200``
when varying the number of sa... | bsd-3-clause |
nrhine1/scikit-learn | examples/tree/plot_tree_regression.py | 206 | 1476 | """
===================================================================
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 |
sniemi/SamPy | plot/colorbarExample2.py | 1 | 1675 | import pylab as P
import numpy
from mpl_toolkits.axes_grid import make_axes_locatable
import matplotlib.axes as maxes
from matplotlib import cm
if __name__ == '__main__':
fig = P.figure(figsize=(10,10))
ax1 = fig.add_subplot(221)
ax2 = fig.add_subplot(222)
ax3 = fig.add_subplot(223)
ax4 = fig.add... | bsd-2-clause |
justincassidy/scikit-learn | sklearn/metrics/ranking.py | 79 | 25426 | """Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | bsd-3-clause |
dongjoon-hyun/spark | python/setup.py | 14 | 13273 | #!/usr/bin/env python3
#
# 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 "L... | apache-2.0 |
mfjb/scikit-learn | sklearn/ensemble/__init__.py | 217 | 1307 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | bsd-3-clause |
rvraghav93/scikit-learn | sklearn/linear_model/sag.py | 30 | 12959 | """Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import make_dataset
from .sag_fast import sag
from ..exceptions import ConvergenceWarning
from ..utils import check_arra... | bsd-3-clause |
schets/scikit-learn | sklearn/mixture/gmm.py | 7 | 31031 | """
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import warnings
import numpy as... | bsd-3-clause |
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/tests/types/test_dtypes.py | 1 | 6899 | # -*- coding: utf-8 -*-
from itertools import product
import nose
import numpy as np
from pandas import Series, Categorical, date_range
import pandas.core.common as com
from pandas.types.api import CategoricalDtype
from pandas.core.common import (is_categorical_dtype,
is_categorical, Da... | mit |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/tests/frame/test_indexing.py | 7 | 104529 | # -*- coding: utf-8 -*-
from __future__ import print_function
from warnings import catch_warnings
from datetime import datetime, date, timedelta, time
from pandas.compat import map, zip, range, lrange, lzip, long
from pandas import compat
from numpy import nan
from numpy.random import randn
import pytest
import nu... | agpl-3.0 |
CCBatIIT/bayesian-itc | bitc/experiments.py | 2 | 36275 | """
Contains Experiment and Injection classes.
"""
import os
import logging
import numpy
from pint import DimensionalityError
from bitc.units import ureg, Quantity
# Use logger with name of module
logger = logging.getLogger(__name__)
class Injection(object):
"""
Data from a single injection.
Severa... | gpl-3.0 |
aewhatley/scikit-learn | sklearn/manifold/tests/test_mds.py | 324 | 1862 | import numpy as np
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_raises
from sklearn.manifold import mds
def test_smacof():
# test metric smacof using the data of "Modern Multidimensional Scaling",
# Borg & Groenen, p 154
sim = np.array([[0, 5, 3, 4],
... | bsd-3-clause |
Alex-Ian-Hamilton/sunpy | sunpy/lightcurve/sources/norh.py | 1 | 4421 | """Provides programs to process and analyse NoRH lightcurve data."""
from __future__ import absolute_import
import datetime
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
import pandas
from sunpy.lightcurve import LightCurve
from sunpy.time import... | bsd-2-clause |
trankmichael/scikit-learn | benchmarks/bench_tree.py | 297 | 3617 | """
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... | bsd-3-clause |
roshantha9/AbstractManycoreSim | src/RunSim_Exp_HEVCTile_Mapping_varCCR.py | 1 | 19318 | import sys, os, csv, pprint, math
import argparse
import numpy as np
import random
import shutil
import time
import json
## uncomment when running under CLI only version ##
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import scipy.stats
from matplotl... | gpl-3.0 |
PrashntS/scikit-learn | examples/svm/plot_oneclass.py | 249 | 2302 | """
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
An example using a one-class SVM for novelty detection.
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
... | bsd-3-clause |
adaptive-learning/proso-apps | proso_models/management/commands/recompute_model.py | 1 | 15912 | from clint.textui import progress
from contextlib import closing
from django.conf import settings
from django.core.cache import cache
from django.core.management.base import BaseCommand, CommandError
from django.db import connection
from django.db import transaction
from optparse import make_option
from proso.list impo... | mit |
rahulgayatri23/moose-core | setup.py | 1 | 14427 | # setup.py ---
#
# Filename: setup.py
# Description:
# Author: subha
# Maintainer:
# Created: Sun Dec 7 20:32:02 2014 (+0530)
# Version:
# Last-Updated: Wed Mar 2 12:23:55 2016 (-0500)
# By: Subhasis Ray
# Update #: 32
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
#
# Change log:
#
#
#
#... | gpl-3.0 |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pandas/stats/fama_macbeth.py | 2 | 7257 | from pandas.core.base import StringMixin
from pandas.compat import StringIO, range
import numpy as np
from pandas.core.api import Series, DataFrame
import pandas.stats.common as common
from pandas.util.decorators import cache_readonly
# flake8: noqa
def fama_macbeth(**kwargs):
"""Runs Fama-MacBeth regression.
... | gpl-2.0 |
maxalbert/tohu | tests/v7/test_item_list.py | 1 | 1616 | import pandas as pd
from pandas.util.testing import assert_frame_equal
from .context import tohu
from tohu.v7.item_list import ItemList
from tohu.v7.custom_generator.tohu_items_class import make_tohu_items_class
def test_item_list():
values = [11, 55, 22, 66, 33]
item_list = ItemList(values)
assert item_... | mit |
Titan-C/scikit-learn | sklearn/metrics/cluster/bicluster.py | 359 | 2797 | from __future__ import division
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from sklearn.utils.validation import check_consistent_length, check_array
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks their shap... | bsd-3-clause |
vybstat/scikit-learn | examples/model_selection/plot_learning_curve.py | 250 | 4171 | """
========================
Plotting Learning Curves
========================
On the left side the learning curve of a naive Bayes classifier is shown for
the digits dataset. Note that the training score and the cross-validation score
are both not very good at the end. However, the shape of the curve can be found
in ... | bsd-3-clause |
kevin-intel/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 25 | 1818 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
sh1ng/imba | create_products.py | 1 | 1559 | import gc
import pandas as pd
import numpy as np
import os
if __name__ == '__main__':
path = "data"
order_prior = pd.read_csv(os.path.join(path, "order_products__prior.csv"), dtype={'order_id': np.uint32,
'product_id': np.ui... | agpl-3.0 |
Intel-Corporation/tensorflow | tensorflow/contrib/timeseries/examples/known_anomaly.py | 24 | 7880 | # 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 |
cielling/jupyternbs | tests/tester_nrp.py | 1 | 3821 | from __future__ import print_function
import pandas as pd
from bs4 import BeautifulSoup as BSoup
from sys import path as syspath
syspath.insert(0, "..")
from CanslimParams import CanslimParams
from myAssert import areEqual
from os import path as ospath
testDir = ospath.join("..", "TestData")
all10Ks = pd.read_csv(osp... | agpl-3.0 |
hlin117/scikit-learn | sklearn/manifold/tests/test_locally_linear.py | 85 | 5600 | from itertools import product
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.testing import assert_less
from sklearn.... | bsd-3-clause |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/sklearn/utils/setup.py | 296 | 2884 | import os
from os.path import join
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('utils', parent_package, top_path)
config.add_subpackage('sparsetools')
... | gpl-2.0 |
smartscheduling/scikit-learn-categorical-tree | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
abhishekkrthakur/scikit-learn | sklearn/svm/tests/test_sparse.py | 27 | 10643 | from nose.tools import assert_raises, assert_true, assert_false
import numpy as np
from scipy import sparse
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classif... | bsd-3-clause |
yavalvas/yav_com | build/matplotlib/lib/mpl_examples/api/sankey_demo_old.py | 6 | 7147 | #!/usr/bin/env python
from __future__ import print_function
__author__ = "Yannick Copin <ycopin@ipnl.in2p3.fr>"
__version__ = "Time-stamp: <10/02/2010 16:49 ycopin@lyopc548.in2p3.fr>"
import numpy as np
def sankey(ax,
outputs=[100.], outlabels=None,
inputs=[100.], inlabels='',
dx=4... | mit |
CSB-IG/natk | ninnx/jaccard/jinx_network.py | 2 | 5154 | #This is a piece of code for generating a network using as input a
#dictionary file (dictionary.py).
### TO-DO: To generate a pickle
import networkx as nx
import matplotlib.pyplot as plt
import itertools as itools
from math import log, log10
def jaccard_index( first, *others ):
return float( len ( first.intersecti... | gpl-3.0 |
synthicity/urbansim | urbansim/models/tests/test_dcm.py | 3 | 22138 | import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
import os
import tempfile
import yaml
from pandas.util import testing as pdt
from ...utils import testing
from .. import dcm
@pytest.fixture
def seed(request):
current = np.random.get_state()
def fin():
np.random.set_s... | bsd-3-clause |
dhruv13J/scikit-learn | sklearn/neighbors/tests/test_approximate.py | 142 | 18692 | """
Testing for the approximate neighbor search using
Locality Sensitive Hashing Forest module
(sklearn.neighbors.LSHForest).
"""
# Author: Maheshakya Wijewardena, Joel Nothman
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
jkarnows/scikit-learn | sklearn/svm/tests/test_sparse.py | 95 | 12156 | from nose.tools import assert_raises, assert_true, assert_false
import numpy as np
from scipy import sparse
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classif... | bsd-3-clause |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/quandl/model/merged_dataset.py | 1 | 9646 | from more_itertools import unique_everseen
import pandas as pd
from six import string_types
from .model_base import ModelBase
from quandl.util import Util
from .merged_data_list import MergedDataList
from .data import Data
from quandl.message import Message
from .dataset import Dataset
class MergedDataset(ModelBase):... | mit |
dr-nate/msmbuilder | msmbuilder/commands/implied_timescales.py | 12 | 5214 | # Author: Robert McGibbon <rmcgibbo@gmail.com>
# Contributors:
# Copyright (c) 2014, Stanford University
# All rights reserved.
"""Scan the implied timescales of MarkovStateModels with respect to lag time.
This command will build a series of MarkovStateModels at different lag times,
and save a file to disk containing ... | lgpl-2.1 |
uqyge/combustionML | ode/mlp.py | 1 | 3568 | import autograd.numpy as np
from autograd import grad, jacobian
import autograd.numpy.random as npr
from matplotlib import pyplot as plt
from matplotlib import pyplot, cm
from mpl_toolkits.mplot3d import Axes3D
#%matplotlib inline
nx = 10
ny = 10
dx = 1. / nx
dy = 1. / ny
x_space = np.linspace(0, 1, nx)
y_space = n... | mit |
badlogicmanpreet/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/collections.py | 69 | 39876 | """
Classes for the efficient drawing of large collections of objects that
share most properties, e.g. a large number of line segments or
polygons.
The classes are not meant to be as flexible as their single element
counterparts (e.g. you may not be able to select all line styles) but
they are meant to be fast for com... | agpl-3.0 |
roselleebarle04/opencog | opencog/python/spatiotemporal/temporal_events/composition/emperical_distribution.py | 34 | 6615 | import csv
import numpy
from spatiotemporal.temporal_events.relation_formulas import TemporalRelation
from spatiotemporal.temporal_events.trapezium import TemporalEventTrapezium, generate_random_events
from spatiotemporal.time_intervals import TimeInterval
__author__ = 'keyvan'
def trim_float(float_object, no_digits... | agpl-3.0 |
chandupatilgithub/ml_lab_ecsc_306 | labwork/lab2/sci-learn/non_linear_regression.py | 120 | 1520 | """
===================================================================
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
... | apache-2.0 |
RamaneekGill/Emotion-Recognition- | svm.py | 1 | 7136 | '''
==================
RBF SVM parameters
==================
This example illustrates the effect of the parameters ``gamma`` and ``C`` of
the Radial Basis Function (RBF) kernel SVM.
Intuitively, the ``gamma`` parameter defines how far the influence of a single
training example reaches, with low values meaning 'far' a... | apache-2.0 |
Loisel/tmr3 | cartesian.py | 1 | 1488 | import numpy as np
def cartesian(arrays, out=None):
"""
Generate a cartesian product of input arrays.
Parameters
----------
arrays : list of array-like
1-D arrays to form the cartesian product of.
out : ndarray
Array to place the cartesian product in.
Returns
-------
... | gpl-3.0 |
rvswift/EB | EB/builder/postanalysis/postanalysis.py | 1 | 10848 | __author__ = 'robswift'
import os
import sys
import copy
import EB.builder.utilities.csv_interface as csv_interface
import EB.builder.utilities.classification as classification
import EB.builder.utilities.output as output
def run(itf):
"""
Run postanalyze functions.
"""
if not itf:
return 1
#... | bsd-3-clause |
mjudsp/Tsallis | sklearn/ensemble/tests/test_weight_boosting.py | 58 | 17158 | """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, assert_true
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
nhmc/xastropy | xastropy/spec/analysis.py | 6 | 4784 | """
#;+
#; NAME:
#; analysis
#; Version 1.0
#;
#; PURPOSE:
#; Module for Analysis of Spectra
#; 07-Sep-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import xa... | bsd-3-clause |
zorroblue/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | 20 | 4271 | """
Testing for mean shift clustering methods
"""
import numpy as np
import warnings
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.... | bsd-3-clause |
Shinichi-Nakagawa/no-ball-db-server | site-cookbooks/sean_lahman/files/default/script/sabr_metrics.py | 2 | 4890 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Shinichi Nakagawa'
from script.tables import Team
class SabrMetrics(object):
OUTPUT_DATA_TYPE_JSON = 'json'
OUTPUT_DATA_TYPE_FLAME = 'flame'
def __init__(self, session=None):
# パスとか設定
self.session = session
def get_pytag... | mit |
nuclear-wizard/moose | python/peacock/tests/postprocessor_tab/test_LineGroupWidgetPostprocessor.py | 12 | 6298 | #!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | lgpl-2.1 |
pdamodaran/yellowbrick | yellowbrick/text/tsne.py | 1 | 14415 | # yellowbrick.text.tsne
# Implements TSNE visualizations of documents in 2D space.
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Author: Rebecca Bilbro <bilbro@gmail.com>
# Created: Mon Feb 20 06:33:29 2017 -0500
#
# Copyright (C) 2016 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: tsne.... | apache-2.0 |
karthikvadla16/spark-tk | regression-tests/sparktkregtests/testcases/models/linear_regression_test.py | 10 | 6006 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
accosmin/nanocv | exp/plotter.py | 1 | 4570 | import os
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
SMALL_SIZE = 6
MEDIUM_SIZE = 8
BIGGER_SIZE = 10
plt.rc('font', size=SMALL_SIZE) # controls default text sizes
plt.rc('axes', titlesize=SMALL_SIZE) # fontsize of the axes title
plt... | mit |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/pandas/util/decorators.py | 9 | 9665 | from pandas.compat import StringIO, callable
from pandas.lib import cache_readonly
import sys
import warnings
from functools import wraps
def deprecate(name, alternative, alt_name=None):
alt_name = alt_name or alternative.__name__
def wrapper(*args, **kwargs):
warnings.warn("%s is deprecated. Use %s ... | apache-2.0 |
untom/scikit-learn | sklearn/metrics/__init__.py | 52 | 3394 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... | bsd-3-clause |
Biles430/FPF_PIV | FPF_PIV_CODE/Drummonds_Scripts/PIV_readin.py | 1 | 11334 | #create movie
#from __future__ import print_function
#import os
import pandas as pd
import numpy as np
import PIV
import time
import sys
import h5py
from scipy.signal import medfilt
import matplotlib.pyplot as plt
import hotwire as hw
################################################################
# PURPOSE
# 1... | mit |
bigswitch/snac-nox | src/scripts/buildtest/performance.py | 1 | 10895 | #!/usr/bin/python
#
# TARP
# 3/13/08
# Prototype to print out results of running a couple million packets
# through various configurations of NOX and packet handling
#
# TARP
# 3/14/08
# Corrected resource consumption, switched from time() to getrusage(),
# print out a few more statistics to get a feel for the ranges e... | gpl-3.0 |
wdwvt1/scikit-bio | skbio/stats/distance/tests/test_bioenv.py | 13 | 9972 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
pyamg/pyamg | pyamg/tests/aggviz.py | 1 | 3165 | import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse as sparse
import pyamg
import shapely.geometry as sg
from shapely.ops import cascaded_union
def plotaggs(AggOp, V, E, G, ax, **kwargs):
"""
Parameters
----------
AggOp : CSR sparse matrix
n x nagg encoding of the aggregates... | mit |
CompPhysics/ComputationalPhysics2 | doc/src/NeuralNet/figures/plotEnergies.py | 10 | 1487 | import sys
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
try:
dataFileName = sys.argv[1]
except IndexError:
print("USAGE: python plotEnergies.py 'filename'")
sys.exit(0)
HFEnergy3 = 3.161921401722216
HFEnergy6 = 20.71924844033019
numPart... | cc0-1.0 |
joernhees/scikit-learn | sklearn/metrics/cluster/__init__.py | 91 | 1468 | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... | bsd-3-clause |
dgwakeman/mne-python | examples/time_frequency/plot_source_power_spectrum.py | 19 | 1929 | """
=========================================================
Compute power spectrum densities of the sources with dSPM
=========================================================
Returns an STC file containing the PSD (in dB) of each of the sources.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-pariste... | bsd-3-clause |
HolgerPeters/scikit-learn | benchmarks/bench_multilabel_metrics.py | 276 | 7138 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import scipy.sparse as... | bsd-3-clause |
loli/sklearn-ensembletrees | sklearn/datasets/tests/test_20news.py | 42 | 2416 | """Test the 20news downloader, if the data is available."""
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import SkipTest
from sklearn import datasets
def test_20news():
try:
data = dat... | bsd-3-clause |
YcheLanguageStudio/PythonStudy | bioinformatics/hypothesis_test/binomial_distribution.py | 1 | 1571 | # Author: Jake VanderPlas
# License: BSD
# The figure produced by this code is published in the textbook
# "Statistics, Data Mining, and Machine Learning in Astronomy" (2013)
# For more information, see http://astroML.github.com
# To report a bug or issue, use the following forum:
# https://groups.google.com... | mit |
jaidevd/scikit-learn | examples/datasets/plot_random_dataset.py | 348 | 2254 | """
==============================================
Plot randomly generated classification dataset
==============================================
Plot several randomly generated 2D classification datasets.
This example illustrates the :func:`datasets.make_classification`
:func:`datasets.make_blobs` and :func:`datasets.... | bsd-3-clause |
RayMick/scikit-learn | sklearn/metrics/metrics.py | 233 | 1262 | import warnings
warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in "
"0.18. Please import from sklearn.metrics",
DeprecationWarning)
from .ranking import auc
from .ranking import average_precision_score
from .ranking import label_ranking_average_precision_score
fro... | bsd-3-clause |
MTgeophysics/mtpy | mtpy/modeling/modem/data_model_analysis.py | 1 | 17022 | """
Description:
Extract info from a pair of files (namely .dat and .rho) of modem inversion results
re-write the data into other formats such as csv.
Get a slice of the model data for analysis and plotting visualization.
The output CSV file include StationName, Lat, Long, X, Y, Z, Log(Resistivity)
... | gpl-3.0 |
PrefPy/prefpy | prefpy/mechanism.py | 1 | 85490 | """
Authors: Kevin J. Hwang
Jun Wang
Tyler Shepherd
"""
import io
import math
import time
from numpy import *
import itertools
from preference import Preference
from profile import Profile
import copy
import sys
import networkx as nx
from collections import defaultdict
import matplotlib.pyplot as plt
... | gpl-3.0 |
deepesch/scikit-learn | sklearn/feature_extraction/text.py | 110 | 50157 | # -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gma... | bsd-3-clause |
terkkila/scikit-learn | examples/svm/plot_rbf_parameters.py | 57 | 8096 | '''
==================
RBF SVM parameters
==================
This example illustrates the effect of the parameters ``gamma`` and ``C`` of
the Radius Basis Function (RBF) kernel SVM.
Intuitively, the ``gamma`` parameter defines how far the influence of a single
training example reaches, with low values meaning 'far' a... | bsd-3-clause |
BennerLab/atg | etc/merge_fastq.py | 1 | 1389 | #!/usr/bin/env python3
import os
import subprocess
import pandas
def merge_fastq(filename_list, execute=False):
"""
concatenate fastq.gz files that have been split across multiple sequencing lanes.
"""
fastq_df = pandas.DataFrame(filename_list, columns=['filename'])
fastq_merge_df = fastq_df.file... | gpl-3.0 |
wangyum/beam | sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py | 6 | 4519 | #
# 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 |
CartoDB/cartoframes | setup.py | 1 | 2389 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def walk_subpkg(name):
data_files = []
package_dir = 'cartoframes'
for parent, _, files in os.walk(os.path.join(package_dir, name)):
# Remove package_dir from the path.
sub_dir = os.sep.joi... | bsd-3-clause |
shamidreza/unitselection | generate_speech.py | 1 | 36237 | """
Author: Seyed Hamidreza Mohammadi
This file is part of the shamidreza/uniselection software.
Please refer to the LICENSE provided alongside the software (which is GPL v2,
http://www.gnu.org/licenses/gpl-2.0.html).
This file includes the code for synthesizing speech as output by getting the
unit sequence as input... | gpl-2.0 |
jakevdp/seaborn | setup.py | 6 | 3621 | #! /usr/bin/env python
#
# Copyright (C) 2012-2014 Michael Waskom <mwaskom@stanford.edu>
import os
# temporarily redirect config directory to prevent matplotlib importing
# testing that for writeable directory which results in sandbox error in
# certain easy_install versions
os.environ["MPLCONFIGDIR"] = "."
DESCRIPTIO... | bsd-3-clause |
shadowleaves/acr | parse.py | 1 | 1774 | #!/usr/bin/env python
import os
# import csv
import gzip
import bson
import pandas as pd
from collections import OrderedDict
def main():
# file = '~/Dropbox/intraday/DOW_dates.csv'
# dates = pd.read_csv(file, index_col=1, header=None)
# dates = pd.DatetimeIndex(dates.index)
path = '$HOME/Dropbox/in... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.