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 |
|---|---|---|---|---|---|
gfyoung/scipy | scipy/signal/filter_design.py | 1 | 150871 | """Filter design.
"""
from __future__ import division, print_function, absolute_import
import math
import operator
import warnings
import numpy
import numpy as np
from numpy import (atleast_1d, poly, polyval, roots, real, asarray,
resize, pi, absolute, logspace, r_, sqrt, tan, log10,
... | bsd-3-clause |
iamkingmaker/zipline | zipline/utils/security_list.py | 18 | 4472 | from datetime import datetime
from os import listdir
import os.path
import pandas as pd
import pytz
import zipline
from zipline.finance.trading import with_environment
DATE_FORMAT = "%Y%m%d"
zipline_dir = os.path.dirname(zipline.__file__)
SECURITY_LISTS_DIR = os.path.join(zipline_dir, 'resources', 'security_lists')
... | apache-2.0 |
maciekszul/maciekszul.github.io | markdown_generator/talks.py | 199 | 4000 |
# coding: utf-8
# # Talks markdown generator for academicpages
#
# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i... | mit |
otmaneJai/Zipline | zipline/assets/asset_writer.py | 1 | 20144 | from abc import (
ABCMeta,
abstractmethod,
)
from collections import namedtuple
import re
import pandas as pd
import numpy as np
from six import with_metaclass
import sqlalchemy as sa
from zipline.errors import SidAssignmentError
from zipline.assets._assets import Asset
SQLITE_MAX_VARIABLE_NUMBER = 999
# De... | apache-2.0 |
numenta/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/projections/geo.py | 69 | 19738 | import math
import numpy as np
import numpy.ma as ma
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.artist import kwdocd
from matplotlib.axes import Axes
from matplotlib import cbook
from matplotlib.patches import Circle
from matplotlib.path import Path
from matplotlib.ticker import Formatter, Locat... | agpl-3.0 |
icexelloss/spark | python/pyspark/sql/group.py | 24 | 12490 | #
# 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 |
ChenglongChen/Kaggle_HomeDepot | Code/Igor&Kostia/generate_ensemble_output_from_models.py | 1 | 8679 | # -*- coding: utf-8 -*-
"""
Generating ensemble output from models: Igor's part.
Competition: HomeDepot Search Relevance
Author: Igor Buinyi
Team: Turing test
"""
from config_IgorKostia import *
import numpy as np
import pandas as pd
from sklearn.svm import SVR
from time import time
import re
import os
from scipy.st... | mit |
afisher1/volttron-applications | pnnl/TCMAgent/tcm/agent.py | 5 | 12924 | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright (c) 2015, Battelle Memorial Institute
# 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. Redistrib... | bsd-3-clause |
wazeerzulfikar/scikit-learn | sklearn/decomposition/tests/test_kernel_pca.py | 33 | 8564 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... | bsd-3-clause |
juanka1331/VAN-applied-to-Nifti-images | final_scripts/results_reader/reader_helper.py | 1 | 1817 | from matplotlib import pyplot as plt
import os
import numpy as np
from matplotlib import cm
from numpy import linspace
mapa_etiquetas = {
"kernel": "Kernel",
"latent_layer": "Neuronas de la capa latente"
}
string_ref = "{0}. Variación {1}. Método {2}"
def generate_color_palette():
start = 0.0
stop =... | gpl-2.0 |
chilleo/ALPHA | module/statisticCalculations.py | 1 | 21385 | import subprocess
import os
from natsort import natsorted
import re
import dendropy
from dendropy import Tree
import math
from dendropy.calculate import treecompare
import matplotlib.pyplot as plt
import numpy as np
from PyQt4 import QtCore
from sys import platform
"""
Functions:
__init__(self, output_directory='R... | mit |
opencobra/cobrapy | src/cobra/test/test_core/test_model.py | 1 | 37178 | # -*- coding: utf-8 -*-
"""Test functions of model.py"""
from __future__ import absolute_import
import os
import warnings
from copy import copy, deepcopy
from math import isnan
import numpy as np
import pandas as pd
import pytest
from optlang.symbolics import Zero
from cobra.core import Group, Metabolite, Model, R... | gpl-2.0 |
3324fr/spinalcordtoolbox | dev/vertebral_labeling/batch_labeling.py | 1 | 56524 | #!/usr/bin/env python
# check if needed Python libraries are already installed or not
import os
import getopt
import commands
import math
import sys
import scipy
import scipy.signal
import scipy.fftpack
import pylab as pl
import sct_utils as sct
from sct_utils import fsloutput
try:
import nibabel
except ImportErr... | mit |
saiwing-yeung/scikit-learn | examples/neighbors/plot_regression.py | 349 | 1402 | """
============================
Nearest Neighbors regression
============================
Demonstrate the resolution of a regression problem
using a k-Nearest Neighbor and the interpolation of the
target using both barycenter and constant weights.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@... | bsd-3-clause |
halwai/cvxpy | examples/relax_and_round.py | 12 | 6062 | # Relax and round example for talk.
from __future__ import division
from cvxpy import *
import numpy
# def bool_vars(prob):
# return [var for var in prob.variables() if var.boolean]
def cvx_relax(prob):
new_constr = []
for var in prob.variables():
if getattr(var, 'boolean', False):
new... | gpl-3.0 |
yonglehou/scikit-learn | sklearn/tests/test_random_projection.py | 142 | 14033 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
eickenberg/scikit-learn | sklearn/covariance/__init__.py | 389 | 1157 | """
The :mod:`sklearn.covariance` module includes methods and algorithms to
robustly estimate the covariance of features given a set of points. The
precision matrix defined as the inverse of the covariance is also estimated.
Covariance estimation is closely related to the theory of Gaussian Graphical
Models.
"""
from ... | bsd-3-clause |
ligovirgo/seismon | RfPrediction/BLRMS_Prediction/fetch_seismic_peaks.py | 1 | 13305 | #!/usr/bin/env python
##########################################################################
#
# This script fetches band-limited rms of seismic data from LIGO seimometers and
# finds the corresponding peak Rayleigh wave velocity averaged across all thhree directions.
#
# Input Earthquake Event file (Ex: LLO... | gpl-3.0 |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/util/test_deprecate.py | 2 | 1630 | from textwrap import dedent
import pytest
from pandas.util._decorators import deprecate
import pandas.util.testing as tm
def new_func():
"""
This is the summary. The deprecate directive goes next.
This is the extended summary. The deprecate directive goes before this.
"""
return "new_func call... | apache-2.0 |
thilbern/scikit-learn | sklearn/linear_model/tests/test_omp.py | 15 | 7882 | # 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 |
bsipocz/scikit-image | doc/examples/applications/plot_geometric.py | 28 | 3253 | """
===============================
Using geometric transformations
===============================
In this example, we will see how to use geometric transformations in the context
of image processing.
"""
from __future__ import print_function
import math
import numpy as np
import matplotlib.pyplot as plt
from skim... | bsd-3-clause |
zihua/scikit-learn | examples/classification/plot_digits_classification.py | 34 | 2409 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | bsd-3-clause |
wlamond/scikit-learn | doc/sphinxext/sphinx_gallery/notebook.py | 25 | 6032 | # -*- coding: utf-8 -*-
r"""
============================
Parser for Jupyter notebooks
============================
Class that holds the Jupyter notebook information
"""
# Author: Óscar Nájera
# License: 3-clause BSD
from __future__ import division, absolute_import, print_function
from functools import partial
impor... | bsd-3-clause |
Lawrence-Liu/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
AlexanderFabisch/scikit-learn | sklearn/neural_network/tests/test_rbm.py | 225 | 6278 | import sys
import re
import numpy as np
from scipy.sparse import csc_matrix, csr_matrix, lil_matrix
from sklearn.utils.testing import (assert_almost_equal, assert_array_equal,
assert_true)
from sklearn.datasets import load_digits
from sklearn.externals.six.moves import cStringIO as ... | bsd-3-clause |
jayflo/scikit-learn | sklearn/metrics/tests/test_ranking.py | 75 | 40883 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projec... | bsd-3-clause |
Kebniss/TalkingData-Mobile-User-Demographics | src/features/make_dense_brand_model_price.py | 1 | 3614 | """ This script loads the raw phone_brand_device_model phone set, creates the
features and deals with NaN values."""
import os
from os import path
import pandas as pd
import pickle as pkl
from dotenv import load_dotenv, find_dotenv
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import St... | mit |
MrNuggelz/sklearn-glvq | sklearn_lvq/gmlvq.py | 1 | 12014 | # -*- coding: utf-8 -*-
# Author: Joris Jensen <jjensen@techfak.uni-bielefeld.de>
#
# License: BSD 3 clause
from __future__ import division
import math
from math import log
import numpy as np
from scipy.optimize import minimize
from .glvq import GlvqModel
from sklearn.utils import validation
class GmlvqModel(Glv... | bsd-3-clause |
kjung/scikit-learn | examples/neighbors/plot_classification.py | 287 | 1790 | """
================================
Nearest Neighbors Classification
================================
Sample usage of Nearest Neighbors 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 ListedColorm... | bsd-3-clause |
drammock/expyfun | expyfun/stimuli/_tracker.py | 2 | 50985 | """Adaptive tracks for psychophysics (individual, or multiple randomly dealt)
"""
# Author: Ross Maddox <ross.maddox@rochester.edu>
#
# License: BSD (3-clause)
import numpy as np
import time
from scipy.stats import binom
import json
import warnings
from .. import ExperimentController
# =============================... | bsd-3-clause |
diogo149/CauseEffectPairsPaper | configs/trial1.py | 1 | 7441 | import numpy as np
from scipy.stats import skew, kurtosis, shapiro, pearsonr, ansari, mood, levene, fligner, bartlett, mannwhitneyu
from scipy.spatial.distance import braycurtis, canberra, chebyshev, cityblock, correlation, cosine, euclidean, hamming, jaccard, kulsinski, matching, russellrao, sqeuclidean
from sklearn.p... | mit |
jldbc/pybaseball | tests/pybaseball/cache/test_cache.py | 1 | 8579 | from datetime import datetime, timedelta
from typing import Callable
from unittest.mock import MagicMock, patch
import pandas as pd
import pytest
from _pytest.monkeypatch import MonkeyPatch
from pybaseball import cache
@pytest.fixture(name="mock_data_1")
def _mock_data_1() -> pd.DataFrame:
return pd.DataFrame([1... | mit |
mehdidc/scikit-learn | sklearn/metrics/cluster/tests/test_unsupervised.py | 19 | 2844 | 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 |
SU-ECE-17-7/ibeis | _broken/notebook/scratch_old.py | 1 | 11349 | import ibeis
import six
import vtool
import utool
import numpy as np
import numpy.linalg as npl # NOQA
import pandas as pd
from vtool import clustering2 as clustertool
from vtool import nearest_neighbors as nntool
from plottool import draw_func2 as df2
np.set_printoptions(precision=2)
pd.set_option('display.max_rows',... | apache-2.0 |
poryfly/scikit-learn | sklearn/preprocessing/tests/test_function_transformer.py | 176 | 2169 | from nose.tools import assert_equal
import numpy as np
from sklearn.preprocessing import FunctionTransformer
def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X):
def _func(X, *args, **kwargs):
args_store.append(X)
args_store.extend(args)
kwargs_store.update(kwargs)
... | bsd-3-clause |
jseabold/scikit-learn | benchmarks/bench_plot_approximate_neighbors.py | 244 | 6011 | """
Benchmark for approximate nearest neighbor search using
locality sensitive hashing forest.
There are two types of benchmarks.
First, accuracy of LSHForest queries are measured for various
hyper-parameters and index sizes.
Second, speed up of LSHForest queries compared to brute force
method in exact nearest neigh... | bsd-3-clause |
fatiando/fatiando | fatiando/vis/mpl.py | 6 | 35570 | """
Wrappers for :mod:`matplotlib` functions to facilitate plotting grids,
2D objects, etc.
This module loads all functions from :mod:`matplotlib.pyplot`, adds new
functions and overwrites some others (like :func:`~fatiando.vis.mpl.contour`,
:func:`~fatiando.vis.mpl.pcolor`, etc).
.. warning::
This module will b... | bsd-3-clause |
waltervh/BornAgain-tutorial | talks/day_2/reflectometry_D/python_tutorial/task_script_key.py | 2 | 2656 | import numpy as np
from matplotlib import pyplot as plt
import bornagain as ba
from bornagain import deg, angstrom, nm
from plotter import PlotterSpecular
data_1 = np.loadtxt("python_exp_data_1.txt") # [deg, intensity], angle range [0, 3] deg
data_2 = np.loadtxt("python_exp_data_2.txt") # [deg, intensity], angle ran... | gpl-3.0 |
isb-cgc/User-Data-Processor | isb_cgc_user_data/utils/get_hgnc_approved_symbols.py | 2 | 1487 | #!/usr/bin/env python
# Copyright 2015, Institute for Systems Biology.
# 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 app... | apache-2.0 |
0asa/scikit-learn | sklearn/metrics/cluster/tests/test_bicluster.py | 17 | 1155 | """Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.metrics.cluster.bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([True, True, True, True... | bsd-3-clause |
Fireblend/scikit-learn | examples/text/hashing_vs_dict_vectorizer.py | 284 | 3265 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
rajeevsingh717/ThinkStats2 | code/hypothesis.py | 75 | 10162 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import nsfg
import nsfg2
import first
import thinkstats2
import thinkplot
... | gpl-3.0 |
datacommonsorg/data | scripts/eurostat/regional_statistics_by_nuts/birth_death_migration/import_data.py | 1 | 7275 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
hsiaoyi0504/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
averagehat/scikit-bio | skbio/stats/tests/test_power.py | 12 | 22512 | # ----------------------------------------------------------------------------
# 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 |
yavalvas/yav_com | build/matplotlib/doc/users/plotting/examples/simple_annotate01.py | 5 | 3309 |
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
x1, y1 = 0.3, 0.3
x2, y2 = 0.7, 0.7
fig = plt.figure(1)
fig.clf()
from mpl_toolkits.axes_grid.axes_grid import Grid
from mpl_toolkits.axes_grid.anchored_artists import AnchoredText
from matplotlib.font_manager import FontProperties
def add_at(ax... | mit |
shaneknapp/spark | python/pyspark/sql/group.py | 23 | 10681 | #
# 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 |
mkoledoye/mds_experiments | samples/classical_mds.py | 2 | 2193 | from __future__ import print_function
import operator
import numpy as np
from sklearn.metrics import euclidean_distances
from sklearn import manifold
import matplotlib.pyplot as plt
#==========================================================================================================
# classical multidimensiona... | mit |
UNR-AERIAL/scikit-learn | sklearn/utils/__init__.py | 132 | 14185 | """
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 |
Functional-Genomics/pancancer | scripts/volcanoplot.py | 1 | 3529 | #!/usr/bin/env python
import numpy as np
import pandas as pd
import matplotlib as mpl
mpl.use('Agg')
from matplotlib import pyplot as plt
import matplotlib.patches as mpatches
import sys
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = ax1.twinx()
#if len(sys.argv[1:]) < 4:
# sys.stderr.write('Error: missing argume... | lgpl-3.0 |
dsquareindia/scikit-learn | examples/svm/plot_separating_hyperplane.py | 294 | 1273 | """
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machine classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impor... | bsd-3-clause |
cngo-github/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/image.py | 69 | 28764 | """
The image module supports basic image loading, rescaling and display
operations.
"""
from __future__ import division
import os, warnings
import numpy as np
from numpy import ma
from matplotlib import rcParams
from matplotlib import artist as martist
from matplotlib import colors as mcolors
from matplotlib import... | agpl-3.0 |
f3r/scikit-learn | sklearn/preprocessing/tests/test_imputation.py | 47 | 12381 |
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.preprocessing.imput... | bsd-3-clause |
leftees/BDA_py_demos | demos_ch2/demo2_4.py | 19 | 2780 | """Bayesian Data Analysis, 3rd ed
Chapter 2, demo 4
Calculate the posterior distribution on a discrete grid of points by
multiplying the likelihood and a non-conjugate prior at each point, and
normalizing over the points. Simulate samples from the resulting non-standard
posterior distribution using inverse cdf usin... | gpl-3.0 |
apark263/tensorflow | tensorflow/examples/get_started/regression/imports85.py | 41 | 6589 | # 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 |
ycaihua/scikit-learn | sklearn/metrics/cluster/tests/test_bicluster.py | 394 | 1770 | """Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils.testing import assert_equal, assert_almost_equal
from sklearn.metrics.cluster.bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([T... | bsd-3-clause |
chappers/sklearn-recipes | saliency/SPEC.py | 3 | 5467 | import numpy.matlib
import numpy as np
from scipy.sparse import *
from sklearn.metrics.pairwise import rbf_kernel
from numpy import linalg as LA
import pandas as pd
import scipy
def similarity_classification(X, y):
"""
Calculates similarity based on labels using X (data) y (labels)
note that it only ... | mit |
iABC2XYZ/abc | Scripts/Linac_Cost/python/Cost.py | 2 | 12206 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 22 09:28:26 2017
@author: A
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
plt.close('all')
def TTFC(nCell,betaC,betaG):
if (np.abs(betaC-betaG)<1.0e-6):
return np.pi/4.
else:
ret... | gpl-3.0 |
francisco-dlp/hyperspy | hyperspy/tests/drawing/test_mpl_testing_setup.py | 3 | 2383 | # Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 ... | gpl-3.0 |
QudevETH/PycQED_py3 | pycqed/instrument_drivers/meta_instrument/qubit_objects/QuDev_transmon.py | 1 | 190735 | import logging
log = logging.getLogger(__name__)
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
from qcodes.instrument.parameter import (
ManualParameter, InstrumentRefParameter)
from qcodes.utils import validators as vals
from pycqed.analysis_v2.readout_analysis import Singleshot_Re... | mit |
Rachine/AuditoryCoding | encoding.py | 1 | 3769 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: Rachid and Kimia
"""
from gammatone_utils import *
from scikits.talkbox import segment_axis
from scikits.audiolab import Sndfile, play
import matplotlib.pyplot as plt
plt.style.use('ggplot')
def matching_pursuit(signal, dict_kernels, threshold=0.1, max_ite... | mit |
ankurankan/scikit-learn | sklearn/metrics/cluster/__init__.py | 312 | 1322 | """
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 |
lancezlin/ml_template_py | lib/python2.7/site-packages/pandas/tests/frame/test_dtypes.py | 7 | 24682 | # -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import timedelta
import numpy as np
from pandas import (DataFrame, Series, date_range, Timedelta, Timestamp,
compat, concat, option_context)
from pandas.compat import u
from pandas.types.dtypes import DatetimeTZDtype
from ... | mit |
jayflo/scikit-learn | sklearn/qda.py | 140 | 7682 | """
Quadratic Discriminant Analysis
"""
# Author: Matthieu Perrot <matthieu.perrot@gmail.com>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import BaseEstimator, ClassifierMixin
from .externals.six.moves import xrange
from .utils import check_array, check_X_y
from .utils.validation import ... | bsd-3-clause |
gclenaghan/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 278 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
DSLituiev/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 299 | 1770 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
hrjn/scikit-learn | benchmarks/bench_lasso.py | 111 | 3364 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
prudhvid/github-recommendations | github/code/forked.py | 1 | 1151 | __author__ = 'prudhvi'
import MySQLdb as mdb
import networkx as nx
#import matplotlib.pyplot as plt
#db = mdb.connect('10.5.18.68', '12CS10037', 'btech12', '12CS10037');
db = mdb.connect('localhost', '12CS10037', 'btech12', '12CS10037');
cursor = db.cursor()
cursor.execute("Select * from projects where forked_fro... | gpl-2.0 |
radinformatics/whatisit | scripts/upload_demo.py | 1 | 5956 | #!/bin/python
# This script will upload the data from @mlungren's project, including basic reports and labels
# (see README.md for full instructions). In the long run we want a standard data format for importing.
# AllowedAnnotation objects store a label name and allowed value, and an Annotation combines one of these ... | mit |
WhitakerLab/BrainsForPublication | NotYetCurated/DrawingVolumes/MakePngs_StatsBg_StandardSpace.py | 3 | 18350 | #!/usr/bin/env python
'''
This code allows you to make png images of a stats image on top of a background
image for all the slices in a 3D volume (sagittal, axial and coronal).
positional arguments:
bg_fname File name for background .nii.gz image
stats_fname File name for stats .nii.gz imag... | mit |
Petr-Kovalev/nupic-win32 | examples/opf/tools/MirrorImageViz/mirrorImageViz.py | 1 | 7336 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/dateutil/parser/_parser.py | 8 | 57607 | # -*- coding: utf-8 -*-
"""
This module offers a generic date/time string parser which is able to parse
most known formats to represent a date and/or time.
This module attempts to be forgiving with regards to unlikely input formats,
returning a datetime object even for dates which are ambiguous. If an element
of a dat... | mit |
procoder317/scikit-learn | examples/svm/plot_rbf_parameters.py | 132 | 8096 | '''
==================
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... | bsd-3-clause |
kevin-intel/scikit-learn | sklearn/cluster/tests/test_hierarchical.py | 3 | 32690 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
import itertools
from tempfile import mkdtemp
import shutil
import pytest
from functools import partial
import numpy as n... | bsd-3-clause |
WeichenXu123/spark | python/pyspark/sql/tests/test_arrow.py | 2 | 20287 | #
# 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 |
bhargav/scikit-learn | setup.py | 25 | 11732 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
import subprocess
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distut... | bsd-3-clause |
neuropoly/spinalcordtoolbox | spinalcordtoolbox/scripts/sct_check_dependencies.py | 1 | 11338 | #!/usr/bin/env python
#########################################################################################
#
# Check the installation and environment variables of the toolbox and its dependencies.
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2013 Polyt... | mit |
hsiaoyi0504/scikit-learn | examples/applications/topics_extraction_with_nmf_lda.py | 133 | 3517 | """
========================================================================================
Topics extraction with Non-Negative Matrix Factorization And Latent Dirichlet Allocation
========================================================================================
This is an example of applying Non Negative Matr... | bsd-3-clause |
rhyolight/nupic.research | projects/sequence_prediction/mackey_glass/generate_sine.py | 13 | 2188 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
scharch/zap | tests/run_tests.py | 1 | 3419 | #!/usr/bin/env python3
#clean up function
def cleanup():
shutil.rmtree( "output", ignore_errors=True )
shutil.rmtree( "work", ignore_errors=True)
try:
os.remove("f0_merged.fq")
os.remove("derepAllRawSeqs.uc")
os.remove("lineage.fa")
except:
pass
#test imports (it's a bit silly to include builtins in this... | gpl-3.0 |
dominicelse/scipy | scipy/stats/_distn_infrastructure.py | 7 | 119504 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy._lib.six import string_types, exec_, PY3
from scipy._lib._util import getargspec_no_self as _getargspec
import sys
import keyword
import r... | bsd-3-clause |
OthmanEmpire/project_monies | test/unit/test_unit_santander.py | 1 | 1512 | import unittest
import datetime
import pandas as pd
from pandas.util.testing import assert_frame_equal
import monies.monies.santander as san
class SantanderUnit(unittest.TestCase):
def setUp(self):
self.rawData = \
[
"From: 31/12/2011 to 31/12/2012\n",
"\n",
... | mit |
SGenheden/Scripts | Membrane/calc_permeation.py | 1 | 1362 | import argparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pylab as plt
import numpy as np
import scipy.stats as stats
import numpy.random as random
import wham
if __name__ == '__main__' :
# Command-line input
parser = argparse.ArgumentParser(description="Calculationg permeation from PMF and dif... | mit |
PythonCharmers/bokeh | examples/plotting/server/elements.py | 42 | 1532 | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
import pandas as pd
from bokeh.plotting import figure, show, output_server
from bokeh.sampledata import periodic_table
elements = periodic_table.elements
elements = elements[elements["atomic number"] <= 82]
elements = elements[~p... | bsd-3-clause |
h2educ/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/pandas/core/indexes/numeric.py | 4 | 14410 | import numpy as np
from pandas._libs import (index as libindex,
join as libjoin)
from pandas.core.dtypes.common import (
is_dtype_equal,
pandas_dtype,
needs_i8_conversion,
is_integer_dtype,
is_bool,
is_bool_dtype,
is_scalar)
from pandas import compat
from pandas.co... | mit |
djbard/ccogs | angular_correlation/utility_scripts/plot_angular_correlation_function.py | 1 | 6758 | import sys
import numpy as np
import matplotlib.pyplot as plt
################################################################################
# main
################################################################################
def main():
#######################################################################... | mit |
schreiberx/sweet | benchmarks_sphere/paper_jrn_sl_exp/test_compare_wt_dt_vs_accuracy_galewsky_M512_6hours_l_n_uv/postprocessing_consolidate_prog_div.py | 8 | 6177 | #! /usr/bin/env python3
import sys
import math
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
mule_plotting_usetex(False)
groups = ['runtime.timestepping_method'... | mit |
JasonKessler/scattertext | scattertext/Common.py | 1 | 3552 | from sklearn.feature_extraction.text import ENGLISH_STOP_WORDS
# Constants for scaled f-score
DEFAULT_BETA = 2
DEFAULT_SCALER_ALGO = 'normcdf'
DEFAULT_D3_AXIS_VALUE_FORMAT = '.3f'
DEFAULT_PMI_THRESHOLD_COEFFICIENT = 8
DEFAULT_MINIMUM_TERM_FREQUENCY = 3
DEFAULT_DIV_ID = 'd3-div-1'
DEFAULT_HTML_VIZ_FILE_NAME = 'sca... | apache-2.0 |
benfrandsen/mPDFmodules_noDiffpy | example_MnO-cubic.py | 1 | 1326 | import numpy as np
import matplotlib.pyplot as plt
from mcalculator import *
# Create the unit cell and atomic basis
a=4.446
MnOunitCell=np.array([[a,0,0],[0,a,0],[0,0,a]])
atomBasis=np.array([[0,0,0],[0,0.5,0.5],[0.5,0,0.5],[0.5,0.5,0]])
rmax=30.0
aXYZ=generateAtomsXYZ(MnOunitCell,atomBasis,rmax)
svec=2.5*np.array(... | gpl-3.0 |
librosa/librosa | docs/examples/plot_display.py | 2 | 14733 | # coding: utf-8
"""
======================
Using display.specshow
======================
This notebook gives a more in-depth demonstration of all things that `specshow`
can do to help generate beautiful visualizations of spectro-temporal data.
"""
# Code source: Brian McFee
# License: ISC
# sphinx_gallery_thumbnail_... | isc |
David-OConnor/tune-time | tune_time/tuner.py | 1 | 14518 | # Tune Time - Chromatic instrument tuner and metronome
# Copyright (C) <2013> <David O'Connor>
# 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 yo... | gpl-3.0 |
alheinecke/tensorflow-xsmm | tensorflow/examples/learn/boston.py | 11 | 1978 | # 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 |
AlexCatarino/Lean | PythonToolbox/setup.py | 4 | 1322 | # -*- coding: utf-8 -*-
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 ob... | apache-2.0 |
smsaladi/murraylab_tools | murraylab_tools/biotek/biotek.py | 1 | 19405 | # TODO:
# -- Move calibration data out of source code
# -- Add temperature records?
import csv
import sys
import collections
import pandas as pd
import numpy as np
import warnings
import scipy.interpolate
####################
# Plate Reader IDs #
####################
plate_reader_ids = {"268449":'b1',
... | mit |
ldbc/ldbc_driver | plotting/make_charts_select_queries_all_metrics.py | 1 | 3805 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker
from matplotlib.font_manager import FontProperties
import json
import sys
arg_count = len(sys.argv)-1
if arg_count != 4:
print "4 parameter expected (results_file, start_query, end_query, legend_location left/center/right/none) - %s given"%ar... | gpl-3.0 |
airanmehr/bio | Scripts/TimeSeriesPaper/Plot/likelihoodCurves.py | 1 | 1517 | '''
Copyleft Feb 03, 2017 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 |
TomAugspurger/pandas | pandas/io/sas/sas_xport.py | 1 | 14447 | """
Read a SAS XPort format file into a Pandas DataFrame.
Based on code from Jack Cushman (github.com/jcushman/xport).
The file format is defined here:
https://support.sas.com/techsup/technote/ts140.pdf
"""
from collections import abc
from datetime import datetime
import struct
import warnings
import numpy as np
f... | bsd-3-clause |
nicococo/scRNA | scripts/experiments/main_wrapper_tasic_NMF_labels.py | 1 | 10987 | ###################################################
### ###
### Complete Experiment on Tasic data ###
### using NMF labels for source data ###
### written by Bettina Mieth, Nico Görnitz, ###
### Marina Vidovic and Alex Gutteridge ###
### ... | mit |
TomAugspurger/pandas | asv_bench/benchmarks/index_object.py | 1 | 6037 | import gc
import numpy as np
from pandas import (
DatetimeIndex,
Float64Index,
Index,
IntervalIndex,
MultiIndex,
RangeIndex,
Series,
date_range,
)
from .pandas_vb_common import tm
class SetOperations:
params = (
["datetime", "date_string", "int", "strings"],
["i... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.