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 |
|---|---|---|---|---|---|
zerothi/sisl | sisl/io/siesta/basis.py | 1 | 12093 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from ..sile import add_sile
from .sile import SileSiesta, SileCDFSiesta
from sisl._internal import set_module
from sisl... | lgpl-3.0 |
jpanikulam/experiments | stacko/exp.py | 1 | 1870 | from matplotlib import pyplot as plt
import numpy as np
def ax3d():
from mpl_toolkits.mplot3d import Axes3D # noqa
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
return ax
def vline(ax, pt, h):
plt.plot([pt[0], ... | mit |
akloster/bokeh | examples/plotting/server/burtin.py | 42 | 4826 | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
from collections import OrderedDict
from math import log, sqrt
import numpy as np
import pandas as pd
from six.moves import cStringIO as StringIO
from bokeh.plotting import figure, show, output_server
antibiotics = """
bacteria,... | bsd-3-clause |
pld/bamboo | bamboo/lib/readers.py | 2 | 3579 | from functools import partial
import simplejson as json
import os
import tempfile
from celery.exceptions import RetryTaskError
from celery.task import task
import pandas as pd
from bamboo.lib.async import call_async
from bamboo.lib.datetools import recognize_dates
from bamboo.lib.schema_builder import filter_schema
... | bsd-3-clause |
BiaDarkia/scikit-learn | sklearn/linear_model/omp.py | 7 | 31388 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from math import sqrt
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorMixin
from ..utils imp... | bsd-3-clause |
bdallapi/gpvmc | example.py | 2 | 3010 | #/bin/env python
helpstr="""
# This is a script showing an example to obtain
# the ground state energy, staggered magnetizatio
# and the static spin structure factor of the |SF+N>
# wavefunction.
# In a second step the q=(pi,0) component of the
# dynamical spin structure factor S(q,w) is calculated.
# This script requ... | mit |
IxLabs/vm-traffic-loss | analyzer/plotNormalized.py | 1 | 1832 | #!/usr/bin/env python3
import sys
import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
import matplotlib.ticker as tick
import numpy as np
if len(sys.argv) < 6:
print("Usage: ./plotNormalized.py vm-name info(to vary) info(to measure) info(normalize) input")
sys.exit()
tree = ET.parse(sys.argv[5])
root ... | mit |
rc/sfepy | examples/linear_elasticity/its2D_4.py | 5 | 4331 | r"""
Diametrically point loaded 2-D disk with postprocessing and probes. See
:ref:`sec-primer`.
Use it as follows (assumes running from the sfepy directory; on Windows, you
may need to prefix all the commands with "python " and remove "./"):
1. solve the problem::
./simple.py examples/linear_elasticity/its2D_4.py... | bsd-3-clause |
lazywei/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 |
robertmattmueller/sdac-compiler | sympy/interactive/session.py | 1 | 16069 | """Tools for setting up interactive sessions. """
from __future__ import print_function, division
from distutils.version import LooseVersion as V
from sympy.external import import_module
from sympy.interactive.printing import init_printing
preexec_source = """\
from __future__ import division
from sympy import *
x,... | gpl-3.0 |
fengzhyuan/scikit-learn | sklearn/covariance/graph_lasso_.py | 127 | 25626 | """GraphLasso: sparse inverse covariance estimation with an l1-penalized
estimator.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
# Copyright: INRIA
import warnings
import operator
import sys
import time
import numpy as np
from scipy import linalg
from .empirical_covariance_ im... | bsd-3-clause |
abloomston/sympy | sympy/utilities/runtests.py | 34 | 81153 | """
This is our testing framework.
Goals:
* it should be compatible with py.test and operate very similarly
(or identically)
* doesn't require any external dependencies
* preferably all the functionality should be in this file only
* no magic, just import the test file and execute the test functions, that's it
* po... | bsd-3-clause |
MechCoder/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 |
deeplook/bokeh | bokeh/crossfilter/plotting.py | 42 | 8763 | from __future__ import absolute_import
import numpy as np
import pandas as pd
from bokeh.models import ColumnDataSource, BoxSelectTool
from ..plotting import figure
def cross(start, facets):
"""Creates a unique combination of provided facets.
A cross product of an initial set of starting facets with a new se... | bsd-3-clause |
CallaJun/hackprince | indico/matplotlib/delaunay/testfuncs.py | 21 | 21168 | """Some test functions for bivariate interpolation.
Most of these have been yoinked from ACM TOMS 792.
http://netlib.org/toms/792
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange
import numpy as np
from .triangu... | lgpl-3.0 |
ocefpaf/python-oceans | oceans/sw_extras/gamma_GP_from_SP_pt.py | 2 | 16524 | import numpy as np
def in_polygon(xp, yp, polygon, transform=None, radius=0.0):
"""
Check is points `xp` and `yp` are inside the `polygon`.
Polygon is a `matplotlib.path.Path` object.
https://stackoverflow.com/questions/21328854/shapely-and-matplotlib-point-in-polygon-not-accurate-with-geolocation
... | bsd-3-clause |
wzbozon/scikit-learn | examples/bicluster/plot_spectral_coclustering.py | 276 | 1736 | """
==============================================
A demo of the Spectral Co-Clustering algorithm
==============================================
This example demonstrates how to generate a dataset and bicluster it
using the the Spectral Co-Clustering algorithm.
The dataset is generated using the ``make_biclusters`` f... | bsd-3-clause |
Jimmy-Morzaria/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 |
sumedhasingla/TubeTK | Examples/TubeGraphKernels/permtest.py | 7 | 9961 | ##############################################################################
#
# Library: TubeTK
#
# Copyright 2010 Kitware Inc. 28 Corporate Drive,
# Clifton Park, NY, 12065, USA.
#
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in comp... | apache-2.0 |
alolou/adr | src/ensemble.py | 1 | 3478 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
from concept_matching import run_cm
from maxent_tfidf import run_tfidf
from maxent_nblcr import run_nblcr
from maxent_we import run_we
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.tree... | gpl-2.0 |
NitishMutha/equirectangular-toolbox | nfov.py | 1 | 4309 | # Copyright 2017 Nitish Mutha (nitishmutha.com)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed... | apache-2.0 |
mlucchini/electricitymap | parsers/CR.py | 1 | 6379 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import arrow
import pandas as pd
import requests
from bs4 import BeautifulSoup
TIMEZONE = 'America/Costa_Rica'
DATE_FORMAT = 'DD/MM/YYYY'
MONTH_FORMAT = 'MM/YYYY'
POWER_PLANTS = {
u'Aeroenergía': 'wind',
u'Altamira': 'wind',
u'Angostura': 'hydro',
u'Arenal': '... | gpl-3.0 |
mblondel/scikit-learn | examples/plot_multioutput_face_completion.py | 330 | 3019 | """
==============================================
Face completion with a multi-output estimators
==============================================
This example shows the use of multi-output estimator to complete images.
The goal is to predict the lower half of a face given its upper half.
The first column of images sho... | bsd-3-clause |
grburgess/astromodels | astromodels/core/model.py | 2 | 31324 | __author__ = 'giacomov'
import collections
import os
import pandas as pd
import numpy as np
import scipy.integrate
import warnings
from astromodels.core.my_yaml import my_yaml
from astromodels.core.parameter import Parameter, IndependentVariable
from astromodels.core.tree import Node, DuplicatedNode
from astromodels... | bsd-3-clause |
iproduct/course-social-robotics | 11-dnn-keras/venv/Lib/site-packages/pandas/tests/indexes/datetimes/test_to_period.py | 7 | 6557 | import warnings
import dateutil.tz
from dateutil.tz import tzlocal
import pytest
import pytz
from pandas._libs.tslibs.ccalendar import MONTHS
from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG
from pandas import (
DatetimeIndex,
Period,
PeriodIndex,
Timestamp,
date_range,
period_rang... | gpl-2.0 |
stanleybak/hylaa | tests/test_aggregation.py | 1 | 24158 | '''
Tests for Hylaa aggregation. Made for use with py.test
'''
import math
import random
import matplotlib.pyplot as plt
import numpy as np
from scipy.sparse import csr_matrix
from scipy.linalg import expm
from hylaa.hybrid_automaton import HybridAutomaton
from hylaa.settings import HylaaSettings, PlotSettings
from... | gpl-3.0 |
drandykass/fatiando | doc/conf.py | 5 | 5652 | # -*- coding: utf-8 -*-
import sys
import os
import datetime
import sphinx_bootstrap_theme
import matplotlib as mpl
mpl.use("Agg")
# Sphinx needs to be able to import fatiando to use autodoc
sys.path.append(os.path.pardir)
from fatiando import __version__, __commit__
extensions = [
'sphinx.ext.autodoc',
'sph... | bsd-3-clause |
larsmans/scikit-learn | examples/model_selection/grid_search_digits.py | 16 | 2629 | """
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.grid_search.GridSearc... | bsd-3-clause |
leesavide/pythonista-docs | Documentation/matplotlib/examples/old_animation/animate_decay_tk_blit.py | 3 | 1342 | from __future__ import print_function
import time, sys
import numpy as np
import matplotlib.pyplot as plt
def data_gen():
t = data_gen.t
data_gen.t += 0.05
return np.sin(2*np.pi*t) * np.exp(-t/10.)
data_gen.t = 0
fig, ax = plt.subplots()
line, = ax.plot([], [], animated=True, lw=2)
ax.set_ylim(-1.1, 1.1)... | apache-2.0 |
NunoEdgarGub1/scikit-learn | sklearn/decomposition/tests/test_fastica.py | 272 | 7798 | """
Test the fastica algorithm.
"""
import itertools
import warnings
import numpy as np
from scipy import stats
from nose.tools import assert_raises
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from skl... | bsd-3-clause |
proyan/sot-torque-control | python/dynamic_graph/sot/torque_control/identification/identify_motor_vel.py | 1 | 6862 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 12 18:47:50 2017
@author: adelpret
"""
from scipy import signal
from scipy.cluster.vq import kmeans
import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
from identification_utils import solve1stOrderLeastSquare, solveLeastSquare
from dynamic_graph.... | gpl-3.0 |
IBT-FMI/SAMRI | samri/plotting/tests/test_maps.py | 1 | 2290 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
import samri.plotting.maps as maps
import seaborn as sns
from os import path
import pytest
def test_atlas_labels_longtime():
maps.atlas_labels()
def test_atlas_labels():
mapping = pd.read_csv('/usr/share/m... | gpl-3.0 |
toddheitmann/PetroPy | petropy/download.py | 1 | 9132 | # -*- coding: utf-8 -*-
"""
Download
This module downloads files from different public datasets. Each
function downloads the specific dataset to parse and unzip.
"""
import os
import sys
import time
import fnmatch
from ftplib import FTP
from zipfile import ZipFile
from io import BytesIO
import pand... | mit |
Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/pandas/tools/pivot.py | 9 | 15098 | # pylint: disable=E1103
from pandas import Series, DataFrame
from pandas.core.index import MultiIndex, Index
from pandas.core.groupby import Grouper
from pandas.tools.merge import concat
from pandas.tools.util import cartesian_product
from pandas.compat import range, lrange, zip
from pandas import compat
import panda... | artistic-2.0 |
AlertaDengue/InfoDenguePredict | infodenguepredict/models/visualizations/metrics_viz.py | 1 | 7870 | import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
from sqlalchemy import create_engine
from decouple import config
from infodenguepredict.data.infodengue import get_cluster_data, get_city_names
from infodenguepredict.models.random_forest import build_lagged_features
def l... | gpl-3.0 |
ningchi/scikit-learn | sklearn/linear_model/tests/test_sparse_coordinate_descent.py | 244 | 9986 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_true
from sklearn.utils.t... | bsd-3-clause |
3manuek/scikit-learn | examples/model_selection/plot_validation_curve.py | 229 | 1823 | """
==========================
Plotting Validation Curves
==========================
In this plot you can see the training scores and validation scores of an SVM
for different values of the kernel parameter gamma. For very low values of
gamma, you can see that both the training score and the validation score are
low. ... | bsd-3-clause |
Sentient07/scikit-learn | sklearn/cluster/tests/test_birch.py | 342 | 5603 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
dsquareindia/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 36 | 4076 | """
========================================
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 |
nagamanicg/ml_lab_ecsc_306 | labwork/lab2/sci-learn/logistic_regression.py | 119 | 1679 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <https://en.wikipedia.org/wiki/Iris_... | apache-2.0 |
Averroes/statsmodels | statsmodels/sandbox/tsa/examples/example_var.py | 37 | 1218 | """
Look at some macro plots, then do some VARs and IRFs.
"""
import numpy as np
import statsmodels.api as sm
import scikits.timeseries as ts
import scikits.timeseries.lib.plotlib as tplt
from matplotlib import pyplot as plt
data = sm.datasets.macrodata.load()
data = data.data
### Create Timeseries Representations ... | bsd-3-clause |
vansky/meg_playground | scripts/meg_coherence_linerunner.py | 1 | 20135 | # -*- coding: utf-8; python-indent: 2; -*-
# This script extracts P-values and R^2 values over each frequency band and determines model fits
# Global Vars
# =======
DEV = True # if True: analyze the dev set; if False: analyze the test set ;; DEV is defined on a sentence level using a stepsize of N ;; TEST is the comp... | gpl-2.0 |
mmottahedi/neuralnilm_prototype | scripts/e354.py | 2 | 6215 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mit |
kthyng/tracpy | tracpy/tracpy_class.py | 1 | 26569 | #!/usr/bin/env python
'''
TracPy class
'''
import tracpy
import numpy as np
from . import tracmass
from matplotlib.mlab import find
class Tracpy(object):
"""TracPy class."""
def __init__(self, currents_filename, grid, nsteps=1, ndays=1, ff=1,
tseas=3600., ah=0., av=0., z0='s', zpar=1, do3d... | mit |
blankclemens/tools-iuc | tools/cwpair2/cwpair2_util.py | 3 | 13731 | import bisect
import csv
import os
import sys
import traceback
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot # noqa: E402
# Data outputs
DETAILS = 'D'
MATCHED_PAIRS = 'MP'
ORPHANS = 'O'
# Data output formats
GFF_EXT = 'gff'
TABULAR_EXT = 'tabular'
# Statistics historgrams output directory.
HI... | mit |
massmutual/scikit-learn | sklearn/linear_model/tests/test_passive_aggressive.py | 169 | 8809 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_rais... | bsd-3-clause |
wittawatj/kernel-gof | kgof/test/test_goftest.py | 1 | 6312 | """
Module for testing goftest module.
"""
__author__ = 'wittawat'
import numpy as np
import numpy.testing as testing
import matplotlib.pyplot as plt
import kgof.data as data
import kgof.density as density
import kgof.util as util
import kgof.kernel as kernel
import kgof.goftest as gof
import kgof.glo as glo
import s... | mit |
Garrett-R/scikit-learn | examples/decomposition/plot_pca_iris.py | 253 | 1801 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
PCA example with Iris Data-set
=========================================================
Principal Component Analysis applied to the Iris dataset.
See `here <http://en.wikipedia.org/wiki/Iris_flower_data_set>`_ fo... | bsd-3-clause |
nan86150/ImageFusion | lib/python2.7/site-packages/matplotlib/stackplot.py | 11 | 3978 | """
Stacked area plot for 1D arrays inspired by Douglas Y'barbo's stackoverflow
answer:
http://stackoverflow.com/questions/2225995/how-can-i-create-stacked-line-graph-with-matplotlib
(http://stackoverflow.com/users/66549/doug)
"""
from __future__ import (absolute_import, division, print_function,
... | mit |
wzbozon/scikit-learn | sklearn/mixture/gmm.py | 68 | 31091 | """
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 |
DSLituiev/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 50 | 4764 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
moreati/pandashells | pandashells/bin/p_lomb_scargle.py | 7 | 2664 | #! /usr/bin/env python
# standard library imports
import argparse
import textwrap
import sys # noqa
from pandashells.lib import arg_lib, io_lib, lomb_scargle_lib
def main():
msg = textwrap.dedent(
"""
Computes a spectrogram using the lomb-scargle algorithm provided by
the gatspy module.... | bsd-2-clause |
walterreade/scikit-learn | sklearn/decomposition/tests/test_dict_learning.py | 67 | 9084 | import numpy as np
from sklearn.utils import check_array
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklea... | bsd-3-clause |
Titan-C/scikit-learn | examples/cluster/plot_dict_face_patches.py | 9 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
xwolf12/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 303 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
asnir/airflow | setup.py | 3 | 9881 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
YinongLong/scikit-learn | sklearn/decomposition/tests/test_fastica.py | 272 | 7798 | """
Test the fastica algorithm.
"""
import itertools
import warnings
import numpy as np
from scipy import stats
from nose.tools import assert_raises
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from skl... | bsd-3-clause |
thientu/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | 150 | 3651 | """
Testing for mean shift clustering methods
"""
import numpy as np
import warnings
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.utils.testing import asser... | bsd-3-clause |
antoinearnoud/openfisca-france-indirect-taxation | setup.py | 4 | 2305 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute... | agpl-3.0 |
466152112/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 |
procoder317/scikit-learn | sklearn/utils/__init__.py | 79 | 14202 | """
The :mod:`sklearn.utils` module includes various utilities.
"""
from collections import Sequence
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array,
assert_all_finite,
... | bsd-3-clause |
gfyoung/scipy | scipy/signal/_max_len_seq.py | 24 | 4929 | # Author: Eric Larson
# 2014
"""Tools for MLS generation"""
import numpy as np
from ._max_len_seq_inner import _max_len_seq_inner
__all__ = ['max_len_seq']
# These are definitions of linear shift register taps for use in max_len_seq()
_mls_taps = {2: [1], 3: [2], 4: [3], 5: [3], 6: [5], 7: [6], 8: [7, 6, 1],
... | bsd-3-clause |
niketanpansare/systemml | src/main/python/tests/test_mllearn_numpy.py | 2 | 10252 | #!/usr/bin/python
#-------------------------------------------------------------
#
# 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 f... | apache-2.0 |
Tejas-Khot/ConvAE-DeSTIN | scripts/subsampling.py | 3 | 1131 | """
"""
import sys
sys.path.append("..")
import numpy as np
import numpy as np
from scipy import linalg
from sklearn.utils import array2d, as_float_array
from sklearn.base import TransformerMixin, BaseEstimator
import scae_destin.datasets as ds
Xtr, Ytr, Xte, Yte=ds.load_CIFAR10_Processed("../data/train.npy",
... | apache-2.0 |
laosiaudi/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/tensorflow_dataframe_test.py | 24 | 13091 | # 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 |
ARudiuk/mne-python | mne/io/array/tests/test_array.py | 3 | 3552 | from __future__ import print_function
# Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import warnings
import matplotlib
from numpy.testing import assert_array_almost_equal, assert_allclose
from nose.tools import assert_equal, assert_raises, assert_true
from mne import... | bsd-3-clause |
elenanst/HPOlib | HPOlib/Plotting/plotBoxWhisker.py | 7 | 5401 | #!/usr/bin/env python
##
# wrapping: A program making it easy to use hyperparameter
# optimization software.
# Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer
#
# 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
# ... | gpl-3.0 |
cybernet14/scikit-learn | sklearn/feature_extraction/text.py | 50 | 50249 | # -*- 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 |
appapantula/scikit-learn | sklearn/feature_selection/tests/test_rfe.py | 209 | 11733 | """
Testing Recursive feature elimination
"""
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal, assert_true
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris,... | bsd-3-clause |
worldbank-climate-group/resilience-indicator-tool | preprocess/world2/res_ind_lib.py | 3 | 33460 | import logging
import numpy as np
import pandas as pd
#help with multiindex dataframe
#from pandas_helper import get_list_of_index_names, broadcast_simple, concat_categories
from scipy.interpolate import interp1d
logging.basicConfig(
filename='model.log', level=logging.DEBUG,
format='%(asctime)s: %(levelnam... | gpl-3.0 |
mjudsp/Tsallis | sklearn/tests/test_multioutput.py | 39 | 6609 | import numpy as np
import scipy.sparse as sp
from sklearn.utils import shuffle
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regex
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing impor... | bsd-3-clause |
renesugar/arrow | python/pyarrow/tests/test_extension_type.py | 1 | 11717 | # 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 |
maxhutch/packtets | demo/PackTets.py | 1 | 2674 |
# coding: utf-8
# In[ ]:
from ipywidgets import widgets
from IPython.display import display
from packtets.geometry import Cell
from packtets import *
from packtets.utils import read_packing, write_packing
def wrapper(foo):
global res, box
vx = [v1[x].value for x in range(3)]
vy = [v2[x].value for x in r... | mit |
ashhher3/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
RomainBrault/scikit-learn | sklearn/metrics/tests/test_regression.py | 49 | 8058 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises, assert_raises_regex
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equa... | bsd-3-clause |
entrepidea/projects | python/prod/account/archived_code/2019/Main.py | 1 | 7914 | from sys import argv
import os
import re
from datetime import datetime
import pandas as pd
"""
Utilities methods.
"""
def num(s):
s = re.sub('[!"]','', s)
pat = re.compile(r'^[0-9]*[.,]?[0-9]*$')
if pat.match(s):
if ',' in s:
s = s.replace(',','')
try:
return int(s)
... | gpl-3.0 |
openstack-hyper-v-python/numpy | doc/sphinxext/numpydoc/tests/test_docscrape.py | 39 | 18326 | # -*- encoding:utf-8 -*-
from __future__ import division, absolute_import, print_function
import sys, textwrap
from numpydoc.docscrape import NumpyDocString, FunctionDoc, ClassDoc
from numpydoc.docscrape_sphinx import SphinxDocString, SphinxClassDoc
from nose.tools import *
if sys.version_info[0] >= 3:
sixu = la... | bsd-3-clause |
scotgl/sonify | ver_dev/dep/scripts/pan.py | 4 | 1672 | from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
from IPython.display import display
from gtts import gTTS
import os
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import pandas as pd
import ctcsound
pan = 0
index = 10
cs... | gpl-3.0 |
jenfly/atmos-read | scripts/fram/run4.py | 1 | 9484 | """
3-D variables:
--------------
Instantaneous:
['U', 'V', 'OMEGA', 'T', 'QV', 'H']
Time-average:
['DUDTANA']
2-D variables:
--------------
Time-average surface fluxes:
['PRECTOT', 'EVAP', 'EFLUX', 'HFLUX', 'QLML', 'TLML']
Time-average vertically integrated fluxes:
['UFLXQV', 'VFLXQV', 'VFLXCPT', 'VFLXPHI']
Instan... | mit |
vortex-ape/scikit-learn | sklearn/svm/tests/test_sparse.py | 5 | 13966 | import pytest
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from scipy import sparse
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classification, load_digits, make_blobs
from sklearn.svm.... | bsd-3-clause |
Titan-C/scikit-learn | examples/linear_model/plot_ard.py | 33 | 3912 | """
==================================================
Automatic Relevance Determination Regression (ARD)
==================================================
Fit regression model with Bayesian Ridge Regression.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary l... | bsd-3-clause |
enriquesanchezb/practica_utad_2016 | venv/lib/python2.7/site-packages/nltk/probability.py | 3 | 89919 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Probability and Statistics
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com> (additions)
# Trevor Cohn <tacohn@cs.mu.oz.au> (additions)
# Peter Ljunglöf <peter.ljung... | apache-2.0 |
enigmampc/catalyst | tests/test_restrictions.py | 1 | 17007 | import pandas as pd
from pandas.util.testing import assert_series_equal
from six import iteritems
from functools import partial
from toolz import groupby
from catalyst.finance.asset_restrictions import (
RESTRICTION_STATES,
Restriction,
HistoricalRestrictions,
StaticRestrictions,
SecurityListRestr... | apache-2.0 |
nmartensen/pandas | pandas/core/indexes/datetimelike.py | 2 | 28004 | """
Base and utility classes for tseries type pandas objects.
"""
import warnings
from datetime import datetime, timedelta
from pandas import compat
from pandas.compat.numpy import function as nv
import numpy as np
from pandas.core.dtypes.common import (
is_integer, is_float,
is_bool_dtype, _ensure_int64,
... | bsd-3-clause |
roxyboy/scikit-learn | sklearn/linear_model/tests/test_logistic.py | 105 | 26588 | 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 |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/mpl_toolkits/axes_grid1/anchored_artists.py | 8 | 5410 |
from matplotlib.patches import Rectangle, Ellipse
import numpy as np
from matplotlib.offsetbox import AnchoredOffsetbox, AuxTransformBox, VPacker,\
TextArea, AnchoredText, DrawingArea, AnnotationBbox
class AnchoredDrawingArea(AnchoredOffsetbox):
"""
AnchoredOffsetbox with DrawingArea
"""
def ... | mit |
waditu/tushare | tushare/util/upass.py | 2 | 1453 | # -*- coding:utf-8 -*-
"""
Created on 2015/08/24
@author: Jimmy Liu
@group : waditu
@contact: jimmysoa@sina.cn
"""
import pandas as pd
import os
from tushare.stock import cons as ct
BK = 'bk'
def set_token(token):
df = pd.DataFrame([token], columns=['token'])
user_home = os.path.expanduser('~')
fp = os... | bsd-3-clause |
hdmetor/scikit-learn | examples/applications/face_recognition.py | 15 | 5394 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... | bsd-3-clause |
KathleenLabrie/KLpyastro | klpyastro/redux/spec1d.py | 1 | 5364 | from __future__ import print_function
from math import pi
from astropy.io import fits
import numpy as np
import matplotlib.pyplot as plt
import stsci.convolve._lineshape as ls
from klpysci.fit import fittools as ft
# Utility function to open and plot original spectrum
def openNplot1d (filename, extname=('SCI',1)):
... | isc |
open-mmlab/mmdetection | tests/test_utils/test_visualization.py | 1 | 4431 | # Copyright (c) Open-MMLab. All rights reserved.
import os
import os.path as osp
import tempfile
import mmcv
import numpy as np
import pytest
import torch
from mmdet.core import visualization as vis
def test_color():
assert vis.color_val_matplotlib(mmcv.Color.blue) == (0., 0., 1.)
assert vis.color_val_matpl... | apache-2.0 |
cloud-fan/spark | python/pyspark/ml/feature.py | 15 | 212774 | #
# 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 |
droundy/deft | papers/thesis-scheirer/final/RG_fn.py | 2 | 14458 | from __future__ import division
import scipy as sp
from scipy.optimize import fsolve
from scipy.interpolate import interp1d
import pylab as plt
import matplotlib
import RG
import SW
import numpy as np
import time
import integrate
import os
import sys
##################################################################... | gpl-2.0 |
aswolf/xmeos | xmeos/build.py | 1 | 6157 | import numpy as np
import scipy as sp
import eoslib
import matplotlib.pyplot as plt
#====================================================================
# EOSMod: Equation of State Model
# build- interface for building complete eos models
#====================================================================
... | mit |
moutai/scikit-learn | examples/neighbors/plot_species_kde.py | 16 | 4037 | """
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... | bsd-3-clause |
akrherz/idep | scripts/hud/deliver_reports.py | 2 | 4112 | """Generate and upload DEP reports."""
from pandas.io.sql import read_sql
import pandas as pd
import geopandas as gpd
import requests
from pyiem.util import get_dbconn
from pyiem.box_utils import sendfiles2box
LOOKUP = {
"10240003": "East Nishnabotna River",
"07080205": "Middle Cedar River",
"07100006": "... | mit |
vinodkc/spark | python/pyspark/sql/dataframe.py | 4 | 100392 | #
# 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 |
cmap/cmapPy | cmapPy/pandasGEXpress/tests/python3_tests/test_parse_gct.py | 1 | 14197 | import unittest
import logging
import os
import pandas as pd
import numpy as np
import cmapPy.pandasGEXpress.setup_GCToo_logger as setup_logger
import cmapPy.pandasGEXpress.parse_gct as pg
import cmapPy.pandasGEXpress.GCToo as GCToo
FUNCTIONAL_TESTS_PATH = "cmapPy/pandasGEXpress/tests/functional_tests/"
logger = log... | bsd-3-clause |
dancingdan/tensorflow | tensorflow/contrib/gan/python/estimator/python/stargan_estimator_test.py | 13 | 12094 | # 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 |
jreback/pandas | pandas/tests/extension/test_integer.py | 1 | 7214 | """
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... | bsd-3-clause |
KevinFasusi/supplychainpy | supplychainpy/model_inventory.py | 1 | 37817 | # Copyright (c) 2015-2016, The Authors and Contributors
# <see AUTHORS file>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.