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 |
|---|---|---|---|---|---|
jesselegg/panda_client_python | panda/__init__.py | 1 | 2098 | from .request import PandaRequest
from .models import Video, Cloud, Encoding, Profile, Notifications, PandaDict
from .models import GroupRetriever, SingleRetriever
from .models import PandaError
from .upload_session import UploadSession
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
clas... | mit |
alphaBenj/zipline | zipline/finance/slippage.py | 5 | 16230 | #
# Copyright 2017 Quantopian, Inc.
#
# 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 wr... | apache-2.0 |
philscher/gkc | doc/scripts/grid_BoundaryDomain.py | 1 | 3530 | from pylab import *
import random
import matplotlib.lines as lines
import matplotlib.patches as patches
#import matplotlib.text as text
import matplotlib.collections as collections
import matplotlib.units as units
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.collections import Pa... | gpl-3.0 |
abouquin/django-megaraetc | etc/views.py | 1 | 78417 | from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render, render_to_response
from django.core.urlresolvers import reverse
from .forms import AtmosphericConditionsForm, ObservationalSetupForm
from .forms import TargetForm, InstrumentForm
from .forms import Ou... | gpl-3.0 |
alberlab/alabtools | alabtools/utils.py | 1 | 53227 | # Copyright (C) 2017 University of Southern California and
# Nan Hua
#
# Authors: Nan Hua, Guido Polles
#
# 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 ... | gpl-3.0 |
vermouthmjl/scikit-learn | examples/applications/plot_out_of_core_classification.py | 32 | 13829 | """
======================================================
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 |
chrsrds/scikit-learn | benchmarks/bench_plot_svd.py | 11 | 2895 | """Benchmarks of Singular Value Decomposition (Exact and Approximate)
The data is mostly low rank but is a fat infinite tail.
"""
import gc
from time import time
import numpy as np
from collections import defaultdict
from scipy.linalg import svd
from sklearn.utils.extmath import randomized_svd
from sklearn.datasets.s... | bsd-3-clause |
doct-rubens/predator-prey-beetle-wasp | simul/world.py | 1 | 11507 | # -*- coding: utf-8 -*-
#
# World class file. A world is composed of:
# - an initial number of flies and moths
# - a set of laws that control the relation between its creatures
# - how its creatures interact with each other for each time step (day)
# - a support structure that allows the data of each time s... | bsd-2-clause |
winklerand/pandas | pandas/core/sparse/frame.py | 1 | 35030 | """
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
from __future__ import division
# pylint: disable=E1101,E1103,W0231,E0202
import warnings
from pandas.compat import lmap
from pandas import compat
import numpy as np
from pandas.core.dtypes.missing import isna, notna... | bsd-3-clause |
nikitasingh981/scikit-learn | examples/svm/plot_svm_nonlinear.py | 62 | 1119 | """
==============
Non-linear SVM
==============
Perform binary classification using non-linear SVC
with RBF kernel. The target to predict is a XOR of the
inputs.
The color map illustrates the decision function learned by the SVC.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn imp... | bsd-3-clause |
vigilv/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 |
hyrise/hyrise | scripts/plot_performance_over_commit_range.py | 1 | 2039 | #!/usr/bin/python3
# Given a range of benchmark jsons created by run_benchmarks_over_commit_range.sh, plots a graph showing the
# performance development over time
import matplotlib.pyplot as plt
import os
import pandas as pd
from pydriller import RepositoryMining
import re
import sys
if len(sys.argv) != 4:
exit... | mit |
swathimatsa123/wifimonitor | Network.py | 1 | 2832 | import Device
from scapy.all import *
import threading
from pylab import *
import matplotlib.pyplot as plt
import time
import os
class Network:
num_devices = 0
device_list = {}
bwUsageHistory = {}
def Join_device(self, mac_addr, ip_addr=None):
dev = Device.device(mac_addr, ip_addr)
sel... | apache-2.0 |
ruohoruotsi/Wavelet-Tree-Synth | nnet/VRNN_nips2015/datasets/iamondb.py | 1 | 3778 | import ipdb
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal
import theano.tensor as T
from cle.cle.data import TemporalSeries
from cle.cle.data.prep import SequentialPrepMixin
from cle.cle.utils import segment_axis, tolist, totuple
from iamondb_utils impo... | gpl-2.0 |
akaraspt/deepsleepnet | tensorlayer/utils.py | 1 | 21547 | #! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import tensorlayer as tl
from . import iterate
import numpy as np
import time
import math
import random
def fit(sess, network, train_op, cost, X_train, y_train, x, y_, acc=None, batch_size=100,
n_epoch=100, print_freq=5, X_val=None, y_val=None,... | apache-2.0 |
dsm054/pandas | pandas/tests/arrays/test_integer.py | 1 | 21799 | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from pandas.core.dtypes.generic import ABCIndexClass
import pandas as pd
from pandas.api.types import is_float, is_float_dtype, is_integer, is_scalar
from pandas.core.arrays import IntegerArray, integer_array
from pandas.core.arrays.integer import (
Int8Dty... | bsd-3-clause |
jjx02230808/project0223 | 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 |
magicDGS/gatk | src/main/python/org/broadinstitute/hellbender/gcnvkernel/io/io_metadata.py | 3 | 8160 | import csv
import logging
import numpy as np
import os
import pandas as pd
from typing import List
from . import io_commons
from . import io_consts
from .. import types
from ..structs.metadata import SampleReadDepthMetadata, SamplePloidyMetadata, SampleCoverageMetadata, \
SampleMetadataCollection
_logger = loggin... | bsd-3-clause |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/matplotlib/tests/test_contour.py | 6 | 8038 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import datetime
import numpy as np
from matplotlib import mlab
from matplotlib.testing.decorators import cleanup, image_comparison
from matplotlib import pyplot as plt
fro... | apache-2.0 |
manns/pyspread | pyspread/share/templates/matplotlib/chart_bar_1_3.py | 1 | 1883 | fig = Figure()
ax = fig.add_axes([.2,.05, .7, .7])
category_names = ['Strongly disagree', 'Disagree',
'Neither agree nor disagree', 'Agree', 'Strongly agree']
results = {
'Question 1': [10, 15, 17, 32, 26],
'Question 2': [26, 22, 29, 10, 13],
'Question 3': [35, 37, 7, 2, 19],
'Questio... | gpl-3.0 |
seaotterman/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py | 62 | 5053 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
pratapvardhan/pandas | pandas/tests/io/parser/parse_dates.py | 3 | 27633 | # -*- coding: utf-8 -*-
"""
Tests date parsing functionality for all of the
parsers defined in parsers.py
"""
from distutils.version import LooseVersion
from datetime import datetime, date
import pytest
import numpy as np
from pandas._libs.tslibs import parsing
from pandas._libs.tslib import Timestamp
import pandas... | bsd-3-clause |
gdl-civestav-localization/cinvestav_location_fingerprinting | datasets/__init__.py | 1 | 4814 | import os
import pandas as pd
import numpy as np
from geopy.distance import vincenty
__author__ = 'Gibran Felix'
def save_mac_list(log_folder='anyplace_labeled'):
macs = set()
for file_name in os.listdir(log_folder):
with open(os.path.join(log_folder, file_name), 'rb') as f:
# Read docu... | gpl-3.0 |
CalebBell/thermo | tests/test_fitting.py | 1 | 7452 | # -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2019, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | mit |
mkuai/underwater | src/core/examples/sample-rng-plot.py | 188 | 1246 | # -*- Mode:Python; -*-
# /*
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRA... | gpl-2.0 |
wackymaster/QTClock | Libraries/matplotlib/backends/backend_qt4agg.py | 8 | 2205 | """
Render to qt from agg
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import os # not used
import sys
import ctypes
import warnings
import matplotlib
from matplotlib.figure import Figure
from .backend_qt5agg ... | mit |
hugobowne/scikit-learn | examples/neural_networks/plot_mlp_training_curves.py | 56 | 3596 | """
========================================================
Compare Stochastic learning strategies for MLPClassifier
========================================================
This example visualizes some training loss curves for different stochastic
learning strategies, including SGD and Adam. Because of time-constrai... | bsd-3-clause |
aestrivex/mne-python | examples/stats/plot_spatio_temporal_cluster_stats_sensor.py | 6 | 5408 | """
=====================================================
Spatiotemporal permutation F-test on full sensor data
=====================================================
Tests for differential evoked responses in at least
one condition using a permutation clustering test.
The FieldTrip neighbor templates will be used to d... | bsd-3-clause |
cbertinato/pandas | pandas/tests/indexes/multi/test_constructor.py | 1 | 22051 | from collections import OrderedDict
import numpy as np
import pytest
from pandas._libs.tslib import Timestamp
from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
import pandas as pd
from pandas import Index, MultiIndex, date_range
import pandas.util.testing as tm
def test_constructor_singl... | bsd-3-clause |
shahankhatch/scikit-learn | examples/applications/plot_stock_market.py | 227 | 8284 | """
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | bsd-3-clause |
beepee14/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 204 | 5442 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
idlead/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 |
wesm/arrow | python/pyarrow/tests/test_ipc.py | 4 | 29983 | # 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 |
themrmax/scikit-learn | sklearn/decomposition/truncated_svd.py | 13 | 8301 | """Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).
"""
# Author: Lars Buitinck
# Olivier Grisel <olivier.grisel@ensta.org>
# Michael Becker <mike@beckerfuffle.com>
# License: 3-clause BSD.
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import svds
from ..... | bsd-3-clause |
DamCB/tyssue | tyssue/particles/point_cloud.py | 2 | 10119 | """Utilities to generate point clouds
The positions of the points are generated along the architecture
of the epithelium.
"""
from collections import abc
import numpy as np
import pandas as pd
from ..config.subdiv import bulk_spec
class EdgeSubdiv:
"""
Container class to ease discretisation along the edges
... | gpl-3.0 |
GPflow/GPflow | doc/source/notebooks/advanced/gps_for_big_data.pct.py | 1 | 8027 | # ---
# jupyter:
# jupytext:
# formats: ipynb,.pct.py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
... | apache-2.0 |
trangel/Data-Science | tracking-purchases/src/anomaly_detection.py | 1 | 5283 | """
Program that solves the anomaly detection insight problem.
"""
def main(argv):
"""
Main routine that runs the anomaly detection algorithm.
The procedure followed is:
1) Get command line arguments (if any).
2) Initialize a graph structure for the user network.
3) Initialize a database to ... | gpl-3.0 |
FDPS/FDPS | sample/c++/nbody+sph/magi_data/py/tipsy.py | 3 | 6144 | # $ python py/tipsy.py filename [pmax]
import sys
import numpy as np
import matplotlib
matplotlib.use("agg")
import matplotlib.pyplot as plt
# import re
import struct
def read_position_tipsy(filename):
# open the file
fin = open(filename, "rb")
size = len(fin.read())
fin.seek(0)
# read header (28... | mit |
walterreade/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 387 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause |
hvanhovell/spark | python/pyspark/sql/dataframe.py | 3 | 94909 | #
# 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 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/numpy/linalg/linalg.py | 24 | 77839 | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | mit |
ray-project/ray | python/ray/tune/utils/visual_utils.py | 4 | 2077 | import pandas as pd
from pandas.api.types import is_string_dtype, is_numeric_dtype
import logging
import os
import os.path as osp
import numpy as np
import json
from ray.tune.utils import flatten_dict
logger = logging.getLogger(__name__)
logger.warning("This module will be deprecated in a future version of Tune.")
... | apache-2.0 |
namiszh/fba | WebApp/app/compute.py | 1 | 12890 | #!/usr/bin/env python
import pandas as pd
from pandas import DataFrame
from scipy.stats import rankdata
import re
import matplotlib.pyplot as plt
import os
import numpy as np
from io import BytesIO
import base64
# web application directory
WEB_APP_ROOT = os.path.abspath(os.path.dirname( __file__ ))
# print(WEB_APP_RO... | mit |
numenta/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/colors.py | 69 | 31676 | """
A module for converting numbers or color arguments to *RGB* or *RGBA*
*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the
range 0-1.
This module includes functions and classes for color specification
conversions, and for mapping numbers to colors in a 1-D array of
colors called a colormap. Color... | agpl-3.0 |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/api/line_with_text.py | 1 | 2601 | """
=======================
Artist within an artist
=======================
Show how to override basic methods so an artist can contain another
artist. In this case, the line contains a Text instance to label it.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
import matplotlib... | mit |
manpen/hypergen | libs/NetworKit/networkit/profiling/stat.py | 2 | 16463 | #
# file: stat.py
# author: Mark Erb
#
from . import job
import math
import matplotlib.pyplot as plt
from _NetworKit import sort2
from _NetworKit import ranked
def sorted(sample):
""" returns a sorted list of given numbers """
return sort2(sample)
class Stat(job.Job):
""" statistical computa... | gpl-3.0 |
tomolaf/trading-with-python | sandbox/spreadCalculations.py | 78 | 1496 | '''
Created on 28 okt 2011
@author: jev
'''
from tradingWithPython import estimateBeta, Spread, returns, Portfolio, readBiggerScreener
from tradingWithPython.lib import yahooFinance
from pandas import DataFrame, Series
import numpy as np
import matplotlib.pyplot as plt
import os
symbols = ['SPY','... | bsd-3-clause |
perslab/DEPICT | src/python/depict.py | 1 | 9172 | #!/usr/bin/env python2.7
import warnings
warnings.filterwarnings("ignore")
import os,sys,pdb,logging,subprocess,ConfigParser,argparse
from glob import glob
import pandas as pd
# Read path to config file
parser = argparse.ArgumentParser(description='DEPICT')
parser.add_argument('cfg_file', metavar='DEPICT configuratio... | gpl-3.0 |
gclenaghan/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 261 | 4490 | import unittest
import sys
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less, assert_equal
from sklearn.mixture.tests.test_gmm import GMMTester
from sklearn.externals.s... | bsd-3-clause |
musically-ut/statsmodels | statsmodels/stats/outliers_influence.py | 27 | 25639 | # -*- coding: utf-8 -*-
"""Influence and Outlier Measures
Created on Sun Jan 29 11:16:09 2012
Author: Josef Perktold
License: BSD-3
"""
from statsmodels.compat.python import lzip
from collections import defaultdict
import numpy as np
from statsmodels.regression.linear_model import OLS
from statsmodels.tools.decorato... | bsd-3-clause |
jreback/pandas | pandas/tests/test_optional_dependency.py | 3 | 1518 | import sys
import types
import pytest
from pandas.compat._optional import VERSIONS, import_optional_dependency
import pandas._testing as tm
def test_import_optional():
match = "Missing .*notapackage.* pip .* conda .* notapackage"
with pytest.raises(ImportError, match=match):
import_optional_depende... | bsd-3-clause |
saketkc/statsmodels | statsmodels/sandbox/examples/ex_mixed_lls_re.py | 34 | 5393 | # -*- coding: utf-8 -*-
"""Example using OneWayMixed
Created on Sat Dec 03 10:15:55 2011
Author: Josef Perktold
This example constructs a linear model with individual specific random
effects, and uses OneWayMixed to estimate it.
This is a variation on ex_mixed_lls_0.py. Here we only have a single
individual specif... | bsd-3-clause |
JsNoNo/scikit-learn | sklearn/neighbors/nearest_centroid.py | 199 | 7249 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
ryfeus/lambda-packs | pytorch/source/numpy/lib/npyio.py | 3 | 84661 | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import functools
import itertools
import warnings
import weakref
from operator import itemgetter, index as opindex
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core import override... | mit |
jseabold/scikit-learn | sklearn/utils/setup.py | 296 | 2884 | import os
from os.path import join
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('utils', parent_package, top_path)
config.add_subpackage('sparsetools')
... | bsd-3-clause |
studio666/gnuradio | gr-filter/examples/fir_filter_ccc.py | 47 | 4019 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/numpy/lib/function_base.py | 15 | 150516 | from __future__ import division, absolute_import, print_function
import warnings
import sys
import collections
import operator
import numpy as np
import numpy.core.numeric as _nx
from numpy.core import linspace, atleast_1d, atleast_2d
from numpy.core.numeric import (
ones, zeros, arange, concatenate, array, asarr... | mit |
mrcslws/htmresearch | projects/combined_sequences/object_convergence.py | 3 | 27757 | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | agpl-3.0 |
avistous/QSTK | Tools/Visualizer/GenerateData.py | 3 | 2880 | '''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on April, 20, 2012
@author: Sourabh Bajaj
@contact: sourabhbajaj90@gmail.com
@summary: Visualizer - Generatin... | bsd-3-clause |
plissonf/scikit-learn | examples/decomposition/plot_ica_vs_pca.py | 306 | 3329 | """
==========================
FastICA on 2D point clouds
==========================
This example illustrates visually in the feature space a comparison by
results using two different component analysis techniques.
:ref:`ICA` vs :ref:`PCA`.
Representing ICA in the feature space gives the view of 'geometric ICA':
ICA... | bsd-3-clause |
cactusbin/nyt | matplotlib/lib/matplotlib/mathtext.py | 1 | 110722 | r"""
:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
TeX math syntax and drawing them to a matplotlib backend.
For a tutorial of its usage see :ref:`mathtext-tutorial`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _p... | unlicense |
ngoix/OCRF | examples/svm/plot_oneclass.py | 80 | 2338 | """
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
An example using a one-class SVM for novelty detection.
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
... | bsd-3-clause |
Jimmy-Morzaria/scikit-learn | sklearn/ensemble/partial_dependence.py | 36 | 14909 | """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 |
gautam1858/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 |
endlessm/chromium-browser | third_party/catapult/trace_processor/experimental/visualize_traces/visualize_traces.py | 7 | 3307 | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import json
import os
import sys
from ggplot import *
import pandas
def _ConvertToSimplifiedFormat(values_list):
data = {}
for trace_na... | bsd-3-clause |
alexandreday/fast_density_clustering | example/example2.py | 1 | 2896 | '''
Created on Feb 4, 2017
@author: Alexandre Day
Perform density clustering on some datasets found in the sklearn
documentation on clustering (http://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html)
'''
import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn ... | bsd-3-clause |
ice3/VAST_2015 | Challenge1/analysis/test_pandas.py | 1 | 1309 | import sqlite3
import pandas
from matplotlib import pylab as plt
def get_data(fname, table, nb_lines):
conn = sqlite3.connect(fname)
sql_request = "SELECT * FROM {} LIMIT {}".format(table, nb_lines)
df = pandas.read_sql(sql_request, conn, parse_dates="time", index_col='time')
return df #.set_index('tim... | gpl-2.0 |
MikeOuimet/AI-fun | RLbasics/dieN.py | 1 | 2257 | import numpy as np
import matplotlib.pyplot as plt
'''Basic TD(0) implementation illustrated on a die rolling problem where you get reward equal
to die roll unless roll a bad number, which makes you lose everything collected. Actions are to
0 - keep rolling, 1- keep the money you've collected and stop playing
'''
# ... | mit |
nabilbendafi/script.module.pydevd | lib/pydev_ipython/inputhook.py | 52 | 18411 | # coding: utf-8
"""
Inputhook management for GUI event loop integration.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distribu... | epl-1.0 |
larsmans/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
from .docscrape import NumpyDocString
from .docscrape import FunctionDoc
from .docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots... | bsd-3-clause |
mraspaud/dask | dask/dataframe/utils.py | 1 | 21094 | from __future__ import absolute_import, division, print_function
import re
import textwrap
from distutils.version import LooseVersion
from collections import Iterator
import sys
import traceback
from contextlib import contextmanager
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas.... | bsd-3-clause |
biocore/qiime | scripts/categorized_dist_scatterplot.py | 15 | 6299 | #!/usr/bin/env python
# File created on 19 Jan 2011
from __future__ import division
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczynski"
__email__ = "justinak@gmail.com"
... | gpl-2.0 |
AIML/scikit-learn | sklearn/neighbors/tests/test_nearest_centroid.py | 305 | 4121 | """
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.metrics.pairwise import pairwise_distances
# t... | bsd-3-clause |
wzbozon/statsmodels | statsmodels/regression/tests/test_robustcov.py | 25 | 31412 | # -*- coding: utf-8 -*-
"""Testing OLS robust covariance matrices against STATA
Created on Mon Oct 28 15:25:14 2013
Author: Josef Perktold
"""
import numpy as np
from scipy import stats
from numpy.testing import (assert_allclose, assert_equal, assert_warns,
assert_raises)
from statsmode... | bsd-3-clause |
nolanliou/tensorflow | tensorflow/examples/learn/multiple_gpu.py | 39 | 3957 | # 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 |
piiswrong/mxnet | python/mxnet/model.py | 13 | 41314 | # 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 |
carthach/essentia | src/examples/python/musicbricks-tutorials/1-stft_analsynth.py | 2 | 1197 |
import essentia
import essentia.streaming as es
# import matplotlib for plotting
import matplotlib.pyplot as plt
import numpy as np
import sys
# algorithm parameters
framesize = 1024
hopsize = 256
# loop over all frames
audioout = np.array(0)
counter = 0
import matplotlib.pylab as plt
# input and output files
imp... | agpl-3.0 |
capitancambio/scikit-neuralnetwork | docs/conf.py | 1 | 1948 | # -*- coding: utf-8 -*-
#
# scikit-neuralnetwork documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 31 20:28:10 2015.
import sys
import os
project = u'scikit-neuralnetwork'
copyright = u'2015, scikit-neuralnetwork developers (BSD License)'
# -- Overrides for modules -----------------... | bsd-3-clause |
jmargeta/scikit-learn | doc/sphinxext/gen_rst.py | 4 | 30674 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from time import time
import os
import shutil
import traceback
import glob
import sys
from StringIO import StringIO
import cPickle
im... | bsd-3-clause |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/sparse/frame.py | 7 | 30372 | """
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
from __future__ import division
# pylint: disable=E1101,E1103,W0231,E0202
from numpy import nan
from pandas.compat import lmap
from pandas import compat
import numpy as np
from pandas.types.missing import isnull, not... | mit |
dingliumath/quant-econ | examples/illustrates_lln.py | 7 | 1802 | """
Filename: illustrates_lln.py
Authors: John Stachurski and Thomas J. Sargent
Visual illustration of the law of large numbers.
"""
import random
import numpy as np
from scipy.stats import t, beta, lognorm, expon, gamma, poisson
import matplotlib.pyplot as plt
n = 100
# == Arbitrary collection of distributions == ... | bsd-3-clause |
rcrowder/nupic | src/nupic/algorithms/monitor_mixin/monitor_mixin_base.py | 10 | 7351 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
jjo31/ATHAM-Fluidity | examples/backward_facing_step_2d/postprocessor_2d.py | 4 | 12563 | #!/usr/bin/env python
import glob
import sys
import os
import vtktools
import numpy
import pylab
import re
from matplotlib import rc
def get_filelist(sample, start):
def key(s):
return int(s.split('_')[-1].split('.')[0])
list = glob.glob("*vtu")
list = [l for l in list if 'check' not in l]
... | lgpl-2.1 |
jenfly/monsoon-onset | scripts/save-dailyrel-regression.py | 1 | 4364 | import sys
sys.path.append('/home/jwalker/dynamics/python/atmos-tools')
sys.path.append('/home/jwalker/dynamics/python/atmos-read')
import xarray as xray
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import collections
import pandas as pd
import atmos as atm
import utils
mpl.rcParams['f... | mit |
liangz0707/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 127 | 7477 | r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected i... | bsd-3-clause |
JQIamo/artiq | doc/manual/conf.py | 1 | 9407 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ARTIQ documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 18 16:51:53 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | lgpl-3.0 |
rohanp/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 42 | 2944 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from itert... | bsd-3-clause |
jm-begon/scikit-learn | examples/applications/plot_prediction_latency.py | 234 | 11277 | """
==================
Prediction Latency
==================
This is an example showing the prediction latency of various scikit-learn
estimators.
The goal is to measure the latency one can expect when doing predictions
either in bulk or atomic (i.e. one by one) mode.
The plots represent the distribution of the pred... | bsd-3-clause |
ndingwall/scikit-learn | sklearn/model_selection/tests/test_split.py | 6 | 63286 | """Test the split module"""
import warnings
import pytest
import numpy as np
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from scipy import stats
from scipy.special import comb
from itertools import combinations
from itertools import combinations_with_replacement
from itertools import permutations
from ... | bsd-3-clause |
yuval-harpaz/MNE4D | pyScripts/Noam_mneTest.py | 1 | 15944 | __author__ = 'noam'
import mne
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
from mne.viz import plot_topo
from mne.minimum_norm import (make_inverse_operator, apply_inverse,
write_inverse_operator, read_inverse_operator)
from mne.source_estimate import read_source_estimate
from mne.comm... | gpl-2.0 |
zblasingame/EE416 | line_scan/machine_learning/model.py | 1 | 2031 | """Implementation of Linear Regression in Numpy
Author: Zander Blasingame
Institution: Clarkson University
Lab: CAMEL
"""
import numpy as np
from sklearn.metrics import confusion_matrix
import datasets as ds
class LR:
"""Linear Regression for Anomaly Detection
Args:
num_featur... | gpl-3.0 |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/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... | apache-2.0 |
PanDAWMS/panda-server | pandaserver/taskbuffer/WrappedPickle.py | 1 | 2703 | import sys
from io import BytesIO
try:
# python 2
import cPickle as pickle
from copy_reg import _reconstructor as map__reconstructor
except ImportError:
# python 3
import pickle
from copyreg import _reconstructor as map__reconstructor
# define Unpickler
if pickle.__name__ == 'cPickle':
# py... | apache-2.0 |
akionakamura/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
YzPaul3/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_weights_var_impGBM.py | 8 | 6378 | from __future__ import print_function
from builtins import zip
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
import random
def weights_var_imp():
def check_same(data1, data2, min_rows_scale):... | apache-2.0 |
fcollonval/matplotlib_qtquick_playground | backend/backend_qtquick5/backend_qquick5agg.py | 1 | 34813 | import ctypes
import os
import sys
import traceback
import matplotlib
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.backend_bases import cursors
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5 import TimerQT
from matplotlib.externals import six
from PyQt5 ... | mit |
Abhiquant/trading-with-python | lib/functions.py | 76 | 11627 | # -*- coding: utf-8 -*-
"""
twp support functions
@author: Jev Kuznetsov
Licence: GPL v2
"""
from scipy import polyfit, polyval
import datetime as dt
#from datetime import datetime, date
from pandas import DataFrame, Index, Series
import csv
import matplotlib.pyplot as plt
import numpy as np
import p... | bsd-3-clause |
TEAM-Gummy/platform_external_chromium_org | ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py | 154 | 8545 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
import tempfile
import time
script_dir = os.path.dirname(__file__)
sys.path.append(os.path.join... | bsd-3-clause |
nanditav/15712-TensorFlow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 9 | 9007 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
manipopopo/tensorflow | tensorflow/contrib/gan/python/estimator/python/gan_estimator_test.py | 5 | 12089 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.