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 |
|---|---|---|---|---|---|
cg31/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/io_test.py | 20 | 5003 | # 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 |
mayblue9/scikit-learn | sklearn/svm/tests/test_svm.py | 70 | 31674 | """
Testing for Support Vector Machine module (sklearn.svm)
TODO: remove hard coded numerical results when possible
"""
import numpy as np
import itertools
from numpy.testing import assert_array_equal, assert_array_almost_equal
from numpy.testing import assert_almost_equal
from scipy import sparse
from nose.tools im... | bsd-3-clause |
hadrianmontes/Plotter2 | template_gepmetry.py | 1 | 2793 | from ui.template_dialog import Ui_Dialog
from PyQt4 import QtGui
import matplotlib.pyplot as plt
from axes_template import axes_template
from time import sleep
class TemplateDialog(Ui_Dialog):
def __init__(self,*args,**kwargs):
self.selectedIndex=False
super(TemplateDialog,self).__init__(*args,**kw... | mit |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/matplotlib/backends/backend_wxagg.py | 10 | 5840 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import matplotlib
from matplotlib.figure import Figure
from .backend_agg import FigureCanvasAgg
from . import wx_compat as wxc
from . import backend_wx
from .backend_wx import (FigureManagerWx, Fi... | apache-2.0 |
aashish24/seaborn | seaborn/linearmodels.py | 1 | 67085 | """Plotting functions for linear models (broadly construed)."""
from __future__ import division
import copy
import itertools
import numpy as np
import pandas as pd
from scipy.spatial import distance
import matplotlib as mpl
import matplotlib.pyplot as plt
try:
import statsmodels
assert statsmodels
_has_sta... | bsd-3-clause |
vsanca/TSDC | TensorDetector/code/to_json.py | 1 | 3315 | # -*- coding: utf-8 -*-
"""
Tool for converting existing GTSDB annotations to JSON accepted by TensorBox,
in accordance to brainwash dataset example JSON file.
[
{
"image_path": $path (string),
"rects": [
{
"x1":$x1 (float),
"x2":$x2 (float),
... | gpl-3.0 |
decvalts/cartopy | lib/cartopy/tests/mpl/test_gridliner.py | 1 | 6239 | # (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | gpl-3.0 |
arjoly/scikit-learn | sklearn/metrics/__init__.py | 214 | 3440 | """
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 |
stylianos-kampakis/scikit-learn | examples/applications/wikipedia_principal_eigenvector.py | 233 | 7819 | """
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | bsd-3-clause |
hainm/scikit-learn | examples/neighbors/plot_digits_kde_sampling.py | 251 | 2022 | """
=========================
Kernel Density Estimation
=========================
This example shows how kernel density estimation (KDE), a powerful
non-parametric density estimation technique, can be used to learn
a generative model for a dataset. With this generative model in place,
new samples can be drawn. These... | bsd-3-clause |
aabadie/scikit-learn | examples/decomposition/plot_pca_iris.py | 65 | 1485 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
PCA example with Iris Data-set
=========================================================
Principal Component Analysis applied to the Iris dataset.
See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f... | bsd-3-clause |
pnedunuri/scikit-learn | sklearn/utils/testing.py | 71 | 26178 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
import sys
import re
import platf... | bsd-3-clause |
kcompher/pyLDAvis | pyLDAvis/graphlab.py | 6 | 2460 | """
pyLDAvis GraphLab
===============
Helper functions to visualize GraphLab Create's TopicModel (an implementation of LDA)
"""
from __future__ import absolute_import
import funcy as fp
import numpy as np
import pandas as pd
import graphlab as gl
import pyLDAvis
def _topics_as_df(topic_model):
tdf = topic_model[... | bsd-3-clause |
nhuntwalker/astroML | book_figures/chapter8/fig_cross_val_A.py | 3 | 2169 | """
Cross Validation Examples: Part 1
---------------------------------
Figure 8.12
Our toy data set described by eq. 8.75. Shown is the line of best fit, which
quite clearly underfits the data. In other words, a linear model in this case
has high bias.
"""
# Author: Jake VanderPlas
# License: BSD
# The figure produ... | bsd-2-clause |
kentwait/bioseq | bioseq/arrays.py | 1 | 50873 | from .basetypes import *
import os
import numpy as np
import re
from collections.abc import MutableMapping
from collections import OrderedDict, Counter
import collections
from copy import deepcopy
from scipy.sparse import lil_matrix
import pandas as pd
__all__ = ['SEQTYPES', 'validate_sequence_chars',
'Sequ... | apache-2.0 |
uzgit/ardupilot | Tools/mavproxy_modules/lib/magcal_graph_ui.py | 108 | 8248 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 fi... | gpl-3.0 |
ssamot/ce888 | labs/lab2/permutations.py | 1 | 2483 | import matplotlib
matplotlib.use('Agg')
import pandas as pd
import random
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import numpy.random as npr
def permutation_resampling(num_samples, case, control):
"""Returns p-value that statistic for case is different
from statistc for con... | gpl-3.0 |
nelson-liu/paraphrase-id-tensorflow | scripts/run_model/run_siamese.py | 1 | 13787 | import argparse
import sys
import logging
import math
import numpy as np
import os
import pandas as pd
import pickle
import json
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
from duplicate_questions.data.data_manager import DataManager
from duplicate_questions.data.embedding_manager import Embedd... | mit |
hrjn/scikit-learn | sklearn/utils/tests/test_murmurhash.py | 79 | 2849 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from sklearn.utils.testing import ... | bsd-3-clause |
louispotok/pandas | pandas/io/sas/sas_xport.py | 2 | 14809 | """
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 datetime import datetime
import pandas as pd
from pandas.io.common import get_filepath_or_buffer, BaseIt... | bsd-3-clause |
Ziqi-Li/bknqgis | pandas/pandas/tests/indexing/test_iloc.py | 2 | 22256 | """ test positional based indexing with iloc """
import pytest
from warnings import catch_warnings
import numpy as np
import pandas as pd
from pandas.compat import lrange, lmap
from pandas import Series, DataFrame, date_range, concat, isna
from pandas.util import testing as tm
from pandas.tests.indexing.common impor... | gpl-2.0 |
mblondel/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
ScottFreeLLC/AlphaPy | alphapy/sport_flow.py | 1 | 29317 | ################################################################################
#
# Package : AlphaPy
# Module : sport_flow
# Created : July 11, 2013
#
# Copyright 2017 ScottFree Analytics LLC
# Mark Conway & Robert D. Scott II
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not us... | apache-2.0 |
pkruskal/scikit-learn | examples/plot_digits_pipe.py | 250 | 1809 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... | bsd-3-clause |
brix4dayz/TRiCAM2.0 | frame_grabber.py | 1 | 2011 | """
frame_grabber.py
>>> python frame_grabber.py [from dir] [to dir] [frame capture rate]
"""
import hpidol as hp
import cv2, sys, shutil
import numpy as np
import scipy.misc, os
import pandas as pd
from collections import Counter
from PIL import Image
def post_img(image):
return hp.recognize_logos(image)
def get... | mit |
sanketloke/scikit-learn | examples/cluster/plot_cluster_iris.py | 350 | 2593 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
Brett777/Predict-Churn | DeployChurnEnsembleModel.py | 1 | 2262 | import os
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import h2o
import numpy as np
import pandas as pd
from tabulate import tabulate
# initialize the model scoring server
h2o.init(nthreads=1,max_mem_size=1, start_h2o=True, strict_version_check = False)
def churn_predict(State,AccountLength... | mit |
WuShichao/computational-physics | 3/3_9/3_9.py | 1 | 2377 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 26 13:45:32 2016
Study the effects of damping by starting the pendulum with some initial
angular displacement. Using Euler-Cromer method.
@author: nightwing
"""
from math import sin,pi
import matplotlib.pyplot as plt
g = 9.8 #gravity acceleration (m/s2)
len... | gpl-3.0 |
dlmacedo/SVM-CNN | random_layer.py | 1 | 18874 | #-*- coding: utf8
# Author: David C. Lambert [dcl -at- panix -dot- com]
# Copyright(c) 2013
# License: Simple BSD
"""The :mod:`random_layer` module
implements Random Layer transformers.
Random layers are arrays of hidden unit activations that are
random functions of input activation values (dot products for simple
ac... | apache-2.0 |
henrykironde/scikit-learn | examples/manifold/plot_mds.py | 261 | 2616 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... | bsd-3-clause |
kobejean/tensorflow | tensorflow/contrib/timeseries/examples/multivariate.py | 10 | 5155 | # 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 |
arabenjamin/scikit-learn | benchmarks/bench_glmnet.py | 297 | 3848 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
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... | bsd-3-clause |
kdebrab/pandas | pandas/tests/frame/test_duplicates.py | 1 | 13948 | # -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
import numpy as np
from pandas.compat import lrange, string_types
from pandas import DataFrame, Series
import pandas.util.testing as tm
@pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']])
def test_duplicated_with_misspelled_colu... | bsd-3-clause |
ArdenB/TSSRESTREND | NCdemo/S03_MappingResults.py | 1 | 16577 | # ==============================================================================
__title__ = "csv to netcdf and maps"
__author__ = "Arden Burrell"
__version__ = "v1.0(23.06.2020)"
__email__ = "aburrell@whrc.org"
# ==============================================================================
import os
i... | mit |
lancezlin/ml_template_py | lib/python2.7/site-packages/ipykernel/inprocess/ipkernel.py | 5 | 6838 | """An in-process kernel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from contextlib import contextmanager
import logging
import sys
from IPython.core.interactiveshell import InteractiveShellABC
from ipykernel.jsonutil import json_clean
from traitlets import... | mit |
kazemakase/scikit-learn | sklearn/semi_supervised/tests/test_label_propagation.py | 307 | 1974 | """ test the label propagation module """
import nose
import numpy as np
from sklearn.semi_supervised import label_propagation
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
ESTIMATORS = [
(label_propagation.LabelPropagation, {'kernel': 'rbf'}),
(label_propa... | bsd-3-clause |
shahankhatch/scikit-learn | examples/applications/plot_out_of_core_classification.py | 255 | 13919 | """
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | bsd-3-clause |
nikitasingh981/scikit-learn | sklearn/covariance/robust_covariance.py | 6 | 30178 | """
Robust location and covariance estimators.
Here are implemented estimators that are resistant to outliers.
"""
# Author: Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
from scipy import linalg
from scipy.stats import chi2
from . import empir... | bsd-3-clause |
michaellaier/pymor | src/pymortests/gui.py | 1 | 1974 | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
import multiprocessing
from pymor.grids.oned impo... | bsd-2-clause |
Moriadry/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/ops.py | 77 | 46403 | # 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 |
DougBurke/astropy | astropy/visualization/hist.py | 2 | 1834 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from inspect import signature
from ..stats import histogram
__all__ = ['hist']
def hist(x, bins=10, ax=None, **kwargs):
"""Enhanced histogram function
This is a histogram function that enables the use of more sophisticated
... | bsd-3-clause |
ryfeus/lambda-packs | LightGBM_sklearn_scipy_numpy/source/sklearn/linear_model/tests/test_passive_aggressive.py | 31 | 9812 | from sklearn.utils.testing import assert_true
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... | mit |
laranea/trading-with-python | cookbook/workingWithDatesAndTime.py | 77 | 1551 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 16 17:45:02 2011
@author: jev
"""
import time
import datetime as dt
from pandas import *
from pandas.core import datetools
# basic functions
print 'Epoch start: %s' % time.asctime(time.gmtime(0))
print 'Seconds from epoch: %.2f' % time.time()
t... | bsd-3-clause |
hstau/manifold-cryo | manifold/gui/gui.py | 1 | 14009 | ''' Graphical user interface for manifold technique
.. Created 2015
.. codeauthor:: Hstau Y Liao <hstau.y.liao@gmail.com>
First input window:
Project name (Proj_name)
Stack file (Stack_file),
Snapshots info (snapshot_info_file),
Resolution (in Angstroms),
Bin size (in multiples of Shannon angle),
N... | gpl-2.0 |
rajat1994/scikit-learn | examples/classification/plot_digits_classification.py | 289 | 2397 | """
================================
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 |
keflavich/scikit-image | doc/examples/plot_shapes.py | 22 | 1913 | """
======
Shapes
======
This example shows how to draw several different shapes:
- line
- Bezier curve
- polygon
- circle
- ellipse
Anti-aliased drawing for:
- line
- circle
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from skimage.draw import (line, polygon, circle,
... | bsd-3-clause |
adamgreenhall/scikit-learn | sklearn/ensemble/partial_dependence.py | 251 | 15097 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | bsd-3-clause |
jjhelmus/wradlib | doc/source/conf.py | 1 | 10250 | # -*- coding: utf-8 -*-
#
# wradlib documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 26 13:48:08 2011.
# adapted with code from https://github.com/ARM-DOE/pyart/blob/master/doc/source/conf.py
#
# This file is execfile()d with the current directory set to its containing dir.
#
# ... | mit |
magnusax/ml-meta-wrapper | gazer/classifiers/sgdescent.py | 1 | 2644 | from scipy.stats import uniform
from sklearn.linear_model import SGDClassifier
from ..sampling import Loguniform
from ..base import BaseClassifier
class MetaSGDClassifier(BaseClassifier):
def __init__(self, loss='hinge', penalty='l2', alpha=0.0001, l1_ratio=0.15,
fit_intercept=True, max_iter=5,... | mit |
kevinjos/planet-kaggle | code/planetutils.py | 1 | 3161 | import pandas as pd
import numpy as np
import cv2
import os
import random
def mkdir(d):
if not os.path.exists(d):
os.mkdir(d)
class FileHandler(object):
def __init__(self, input_basepath="/Users/kjs/repos/planet"):
# Directories
self.basepath = input_basepath
self.path = self... | agpl-3.0 |
yashpungaliya/MailingListParser | lib/input/mbox/keyword_clustering.py | 1 | 7192 | import json
import mailbox
import numpy as np
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from sklearn.cluster import KMeans
from sklearn.feature_extraction.text import TfidfVectorizer
from analysis.author import generate_author_ranking
from util import custom_stopwords
from util.read_ut... | gpl-3.0 |
plotly/plotly.py | packages/python/plotly/plotly/figure_factory/_dendrogram.py | 1 | 13956 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from collections import OrderedDict
from plotly import exceptions, optional_imports
from plotly.graph_objs import graph_objs
# Optional imports, may be None for users that only use our core functionality.
np = optional_imports.get_module("numpy")
scp = ... | mit |
IQuOD/AutoQC | catchall.py | 1 | 6808 | # algorithm:
# 0. remove from consideration any QC test that fails to produce TPR / FPR >= some tunable threshold
# 1. remove from consideration any bad profile not flagged by any test; put these aside for new qc test design
# 2. accept all individual qc tests with 0% fpr; remove these from consideration, along with al... | mit |
dkillick/iris | docs/iris/src/conf.py | 1 | 11165 | # (C) British Crown Copyright 2010 - 2018, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
mjudsp/Tsallis | sklearn/tests/test_kernel_ridge.py | 342 | 3027 | import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | bsd-3-clause |
robin-lai/scikit-learn | sklearn/tests/test_base.py | 216 | 7045 | # Author: Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing impo... | bsd-3-clause |
rymurr/q | q/unparser.py | 1 | 6684 | from bitstring import pack, ConstBitStream
import pandas
import numpy as np
import datetime
from protocol import types, inv_types, header_format, MILLIS, Y2KDAYS, NULL, BYTE, INT
from utils import str_convert, format, format_list, get_header, get_date_from_q, get_hour, format_raw_list
from collections import OrderedDi... | mit |
arahuja/scikit-learn | examples/svm/plot_weighted_samples.py | 69 | 1942 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
gfyoung/scipy | scipy/stats/stats.py | 1 | 202270 | # Copyright 2002 Gary Strangman. All rights reserved
# Copyright 2002-2016 The SciPy Developers
#
# The original code from Gary Strangman was heavily adapted for
# use in SciPy by Travis Oliphant. The original code came with the
# following disclaimer:
#
# This software is provided "as-is". There are no expressed or... | bsd-3-clause |
dmsul/econtools | econtools/metrics/tests/data/src_areg.py | 1 | 2317 | import pandas as pd
import numpy as np
class regout(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
stat_names=['coeff', 'se', 't', 'p>t', 'CI_low', 'CI_high']
var_names=['mpg', 'length', ]
areg_std = regout(
summary=pd.DataFrame(np.array([
[-221.7118772462534,
92.449820557117... | bsd-3-clause |
bjsmith/motivation-simulation | SetupBaseStudentModel.py | 1 | 4249 | __author__ = 'benjaminsmith'
import numpy as np
import time
import os
import matplotlib.pyplot as plt #we might do some other tool later.
from ActionModel import ActionModel
import sys
from BisbasModel import BisbasModel
from UnitModel import *
i_food = 0
i_friends = 1
i_partner = 2
i_study = 3
i_fear_threat = 4
def... | gpl-3.0 |
haochenuw/eigen-mpc | plots/phase1_time.py | 2 | 2313 | from matplotlib import rc, pyplot as plt
import numpy as np
import os
import sys
import json
ns = [i * 10**j for j in [3,4,5] for i in [1,2,5]] + [1000000]
ds = [10, 20, 50, 100, 200, 500]
num_samples = 4
ps = [2,3,5]#[1, 2, 5, 10, 20]
# n x d x num_parties x sample x party -> (cputime, waittime, realtime, bytes sent... | gpl-3.0 |
CnrLwlss/Colonyzer | scripts/parseAndRun2.py | 1 | 17440 | import colonyzer2 as c2
import json
import argparse
import shutil
import string
import os
import time
import numpy as np
import itertools
import cv2
from matplotlib.backends.backend_pdf import PdfPages, FigureCanvasPdf
from matplotlib import figure
from PIL import Image,ImageDraw
from scipy import ndimage
from pkg_reso... | gpl-3.0 |
BhallaLab/moose-full | moose-examples/snippets/ionchannel.py | 2 | 8640 | # ionchannel.py ---
#
# Filename: ionchannel.py
# Description:
# Author: Subhasis Ray
# Maintainer:
# Created: Wed Sep 17 10:33:20 2014 (+0530)
# Version:
# Last-Updated:
# By:
# Update #: 0
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
#
# Change log:
#
#
#
#
# This p... | gpl-2.0 |
xinfang/face-recognize | demos/classifier_webcam.py | 4 | 7059 | #!/usr/bin/env python2
#
# Example to run classifier on webcam stream.
# Brandon Amos & Vijayenthiran
# 2016/06/21
#
# Copyright 2015-2016 Carnegie Mellon University
#
# 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 ... | apache-2.0 |
mitkin/pyresample | pyresample/plot.py | 1 | 9821 | # pyresample, Resampling of remote sensing image data in python
#
# Copyright (C) 2010-2015
#
# Authors:
# Esben S. Nielsen
# Thomas Lavergne
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software F... | lgpl-3.0 |
jlegendary/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 222 | 3055 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Licence: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
nikitasingh981/scikit-learn | examples/plot_multilabel.py | 236 | 4157 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
GuessWhoSamFoo/pandas | pandas/tests/tseries/offsets/test_offsets.py | 1 | 130620 | from datetime import date, datetime, timedelta
from distutils.version import LooseVersion
import numpy as np
import pytest
from pandas._libs.tslibs import (
NaT, OutOfBoundsDatetime, Timestamp, conversion, timezones)
from pandas._libs.tslibs.frequencies import (
INVALID_FREQ_ERR_MSG, get_freq_code, get_freq_s... | bsd-3-clause |
adykstra/mne-python | mne/preprocessing/maxwell.py | 1 | 84078 | # -*- coding: utf-8 -*-
# Authors: Mark Wronkiewicz <wronk.mark@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Jussi Nurminen <jnu@iki.fi>
# License: BSD (3-clause)
from functools import partial
from math import factorial
from os import path as op
import numpy as np
from scipy import linalg
... | bsd-3-clause |
michaelchu/kaleidoscope | kaleidoscope/datafeeds/sqlite_data.py | 1 | 3289 | from .base import BaseDataFeed
import kaleidoscope.globals as gb
import os
import sqlite3
import pandas as pd
class SQLiteDataFeed(BaseDataFeed):
def __init__(self, path=None):
self.path = path
self.opt_params = (
('symbol', 0),
('underlying_symbol', 1),
('quot... | mit |
joshloyal/scikit-learn | sklearn/neural_network/rbm.py | 46 | 12291 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
manashmndl/scikit-learn | examples/decomposition/plot_pca_vs_fa_model_selection.py | 78 | 4510 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
===============================================================
Model selection with Probabilistic PCA and Factor Analysis (FA)
===============================================================
Probabilistic PCA and Factor Analysis are probabilistic models.
The consequence ... | bsd-3-clause |
em-er-es/rollo | rollo/src/rollo_visualization.py | 1 | 15564 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
## @file rollo_visualization.py
# @author Rabbia Asghar
# @author Ernest Skrzypczyk
#
# @date 25/2/16
#
# @brief Visualize motion capture data and EKF estimates
#
# Command prototype: <b>rosrun rollo rollo_visualization _rate:=25 _plotrefreshperiod:=100</b>
# \param rate R... | gpl-2.0 |
r-rathi/error-control-coding | perf/error_probs.py | 1 | 2278 | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from scipy.misc import comb as C
# Error probability calculations, based on:
# "On the Performance of Concatenated Reed-Solomon, Convolutional and Parity
# Check Codes for BWA Applications"
# www.ieee802.org/16/tg1/phy/contrib/802161pc-00_3... | mit |
shenzebang/scikit-learn | sklearn/metrics/regression.py | 175 | 16953 | """Metrics to assess performance on regression task
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.fr>
# Ma... | bsd-3-clause |
raghavrv/scikit-learn | sklearn/linear_model/tests/test_omp.py | 76 | 7752 | # Author: Vlad Niculae
# License: 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 |
deisi/SFG2D | sfg2d/plot.py | 1 | 11656 | #!/usr/bin.env python
# coding: utf-8
"""Module for plot functions."""
import matplotlib.pyplot as plt
import sfg2d
from numpy import transpose, where, linspace, all, array
def fit_model(
x,
y,
yerr,
name,
kwargs_model={},
fit=True,
print_matrix=True,
k... | mit |
biokit/biokit | biokit/viz/volcano.py | 1 | 3251 | """Volcano plot"""
import numpy as np
import pylab
import pandas as pd
__all__ = ['Volcano']
class Volcano(object):
"""Volcano plot
In essence, just a scatter plot with annotations.
.. plot::
:width: 80%
:include-source:
import numpy as np
fc = np.random.randn(1000)
... | bsd-2-clause |
dsbrown/FreeCAD | src/Mod/Plot/InitGui.py | 18 | 2920 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
chrysante87/pyterpol | synthetic/auxiliary.py | 1 | 10363 | import numpy as np
import matplotlib.pyplot as plt
from astropy.constants import c
from scipy.interpolate import splrep
from scipy.interpolate import splev
from scipy.interpolate import bisplrep
from scipy.interpolate import bisplev
from scipy.interpolate import RectBivariateSpline
from scipy.interpolate import Interpo... | gpl-2.0 |
sbnlp/mTOR-evaluation | networkx_analysis.py | 1 | 125507 | import collections
import csv
import datetime
import fuzzywuzzy.fuzz
import fuzzywuzzy.process
import itertools
import joblib
import libsbml
import lxml
import lxml.etree
import networkx
import numpy
import os
import operator
import pickle
import re
import simstring
import sys
#########################################... | apache-2.0 |
bendudson/BOUT | tools/pylib/post_bout/pb_nonlinear.py | 2 | 3020 | #some function to plot nonlinear stuff
from pb_corral import LinRes
from ListDict import ListDictKey, ListDictFilt
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib.artist as artist
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
import matplotlib.patche... | gpl-3.0 |
joshloyal/scikit-learn | sklearn/__check_build/__init__.py | 345 | 1671 | """ Module to give helpful messages to the user that did not
compile the scikit properly.
"""
import os
INPLACE_MSG = """
It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.""... | bsd-3-clause |
nikitasingh981/scikit-learn | sklearn/externals/joblib/__init__.py | 54 | 5087 | """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** and **r... | bsd-3-clause |
pfnet/chainercv | chainercv/extensions/vis_report/detection_vis_report.py | 3 | 5090 | import copy
import os
import warnings
import chainer
from chainercv.visualizations.vis_bbox import vis_bbox
try:
import matplotlib # NOQA
_available = True
except (ImportError, TypeError):
_available = False
def _check_available():
if not _available:
warnings.warn('matplotlib is not insta... | mit |
apache/airflow | tests/providers/vertica/hooks/test_vertica.py | 3 | 3800 | #
# 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... | apache-2.0 |
Huyuwei/tvm | tutorials/frontend/from_mxnet.py | 2 | 5372 | # 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 |
markfuge/creativitymetrics | paper_experiments.py | 1 | 9107 | """
paper_experiments.py
Uses other modules to re-produce the results and paper graphs contained
in the paper. Authors wanting to reproduce or compare to our algorithm can
run the experiments by executing:
python paper_experiments.py
from the command line
Paper:
Mark Fuge, Josh Stroud, Alice Agogino. "Automatically ... | apache-2.0 |
mhogg/scipy | scipy/signal/ltisys.py | 38 | 76123 | """
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
from __future__ import division, print_function, absolute_import
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
# Aug 2013: Juan Luis Cano
# Rewrote abcd_normaliz... | bsd-3-clause |
mingwpy/scipy | scipy/stats/stats.py | 18 | 169352 | # Copyright (c) Gary Strangman. All rights reserved
#
# Disclaimer
#
# This software is provided "as-is". There are no expressed or implied
# warranties of any kind, including, but not limited to, the warranties
# of merchantability and fitness for a given application. In no event
# shall Gary Strangman be liable fo... | bsd-3-clause |
ndingwall/scikit-learn | sklearn/cross_decomposition/tests/test_pls.py | 1 | 20589 | import pytest
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition._pls import (
_center_scale_xy,
_get_first_singular_vectors_power_method,
_get_f... | bsd-3-clause |
jburos/survivalstan | test/test_pem_survival_model_sim.py | 1 | 2040 |
import matplotlib as mpl
mpl.use('Agg')
import survivalstan
from stancache import stancache
import numpy as np
from nose.tools import ok_
from functools import partial
num_iter = 500
from .test_datasets import load_test_dataset_long, sim_test_dataset_long
model_code = survivalstan.models.pem_survival_model
make_inits... | apache-2.0 |
myuuuuun/RepeatedMatrixGame | PrisonersDilemma/experiment3/contest1/contest1.py | 2 | 1238 | #-*- encoding: utf-8 -*-
'''
Simulate finite repeated symmetric matrix game.
Copyright (c) 2015 @myuuuuun
Contest - perfect monitoring
'''
import sys
sys.path.append('../')
sys.path.append('../user_strategies')
import numpy as np
import pandas as pd
import play as pl
from Iida_perfect_monitoring import Iida_pm
from k... | mit |
Statoil/SegyIO | python/segyio/trace.py | 1 | 28059 | import collections
import contextlib
import itertools
import warnings
import sys
try: from future_builtins import zip
except ImportError: pass
import numpy as np
from .line import HeaderLine
from .field import Field
from .utils import castarray
class Sequence(collections.Sequence):
# unify the common optimisati... | lgpl-3.0 |
yudingding6197/fin_script | kzz/kzz.py | 1 | 11334 | #!/usr/bin/env python
# -*- coding:gbk -*-
#¿Éתծ
import sys
import re
import urllib2
import time
import datetime
import zlib
import json
import getopt
import pandas as pd
sys.path.append('.')
from internal.dfcf_inf import *
'''
urlall = "http://data.eastmoney.com/kzz/default.html"
==========
[STARTDATE]='2017-12-04... | gpl-2.0 |
alexeyum/scikit-learn | sklearn/ensemble/tests/test_base.py | 284 | 1328 | """
Testing for the base module (sklearn.ensemble.base).
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
from numpy.testing import assert_equal
from nose.tools import assert_true
from sklearn.utils.testing import assert_raise_message
from sklearn.datasets import load_iris
from sklearn.ensemble import BaggingCla... | bsd-3-clause |
Oscarlight/PiNN_Caffe2 | ac_qv_api.py | 1 | 11919 | import caffe2_paths
import os
import pickle
from caffe2.python import (
workspace, layer_model_helper, schema, optimizer, net_drawer
)
import caffe2.python.layer_model_instantiator as instantiator
import numpy as np
from pinn.adjoint_mlp_lib import build_adjoint_mlp, init_model_with_schemas
import pinn.data_r... | mit |
miltondp/ukbrest | tests/test_rest_api_phenotype.py | 1 | 148176 | import io
import json
import unittest
import tempfile
from base64 import b64encode
from ukbrest import app
import pandas as pd
from tests.settings import POSTGRESQL_ENGINE
from tests.utils import get_repository_path, DBTest
from ukbrest.common.pheno2sql import Pheno2SQL
from ukbrest.common.utils.auth import PasswordH... | gpl-3.0 |
tomsilver/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/legend.py | 69 | 30705 | """
Place a legend on the axes at location loc. Labels are a
sequence of strings and loc can be a string or an integer
specifying the legend location
The location codes are
'best' : 0, (only implemented for axis legends)
'upper right' : 1,
'upper left' : 2,
'lower left' : 3,
'lower right' : 4... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.