repo_name
stringlengths
7
92
path
stringlengths
5
149
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
911
693k
license
stringclasses
15 values
sauliusl/seaborn
seaborn/tests/test_palettes.py
3
11509
import colorsys import numpy as np import matplotlib as mpl import pytest import nose.tools as nt import numpy.testing as npt import matplotlib.pyplot as plt from .. import palettes, utils, rcmod from ..external import husl from ..colors import xkcd_rgb, crayons from distutils.version import LooseVersion mpl_ge_150 ...
bsd-3-clause
Karel-van-de-Plassche/bokeh
bokeh/util/sampledata.py
2
6899
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
bsd-3-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/tests/test_common.py
9
44081
# -*- coding: utf-8 -*- import collections from datetime import datetime import re import nose from nose.tools import assert_equal, assert_true import numpy as np import pandas as pd from pandas.tslib import iNaT, NaT from pandas import Series, DataFrame, date_range, DatetimeIndex, Timestamp, Float64Index from pandas ...
gpl-2.0
par2/lamana
lamana/models/fixtures/fixture_model_class.py
1
10351
#------------------------------------------------------------------------------ '''Class-style Model This fixture is used to test the importing of models, handled by the `theories.handshake()` module. As of 0.4.11, models can: - be located in the `lamana.models` folder - module and classes can have any pythonic name...
bsd-3-clause
mxlei01/healthcareai-py
healthcareai/common/model_eval.py
4
13696
"""Model evaluation tools.""" import os import sklearn import itertools import numpy as np import pandas as pd import sklearn.metrics as skmetrics from matplotlib import pyplot as plt from healthcareai.common.healthcareai_error import HealthcareAIError DIAGONAL_LINE_COLOR = '#bbbbbb' DIAGONAL_LINE_STYLE = 'dotted'...
mit
tmhm/scikit-learn
sklearn/mixture/tests/test_gmm.py
200
17427
import unittest import copy import sys from nose.tools import assert_true import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_raises) from scipy import stats from sklearn import mixture from sklearn.datasets.samples_generator import make_spd_ma...
bsd-3-clause
costypetrisor/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
mne-tools/mne-tools.github.io
0.22/_downloads/52a5ebd4d6b8bcb7eccdf9bc2b0fcfcc/plot_cluster_stats_evoked.py
18
3021
""" ======================================================= Permutation F-test on sensor data with 1D cluster level ======================================================= One tests if the evoked response is significantly different between conditions. Multiple comparison problem is addressed with cluster level permuta...
bsd-3-clause
kevin-intel/scikit-learn
sklearn/cluster/tests/test_dbscan.py
14
15405
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np import warnings from scipy.spatial import distance from scipy import sparse import pytest from sklearn.utils._testing import assert_array_equal from sklearn.neighbors import NearestNeighbors from sklearn.cluster import DBSCAN from skle...
bsd-3-clause
wazeerzulfikar/scikit-learn
sklearn/svm/tests/test_bounds.py
6
2369
import numpy as np from scipy import sparse as sp from sklearn.svm.bounds import l1_min_c from sklearn.svm import LinearSVC from sklearn.linear_model.logistic import LogisticRegression from sklearn.utils.testing import assert_true, raises from sklearn.utils.testing import assert_raise_message dense_X = [[-1, 0], [0...
bsd-3-clause
ominux/scikit-learn
examples/linear_model/plot_sgd_iris.py
4
2171
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print __doc__ i...
bsd-3-clause
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/traitlets/config/loader.py
3
28215
# encoding: utf-8 """A simple configuration system.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import argparse import copy import logging import os import re import sys import json from ast import literal_eval from ipython_genutils.path import filefind fro...
artistic-2.0
Jigsaw-Code/net-analysis
netanalysis/traffic/data/api_repository.py
1
3175
#!/usr/bin/python # # Copyright 2019 Jigsaw Operations 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 applicabl...
apache-2.0
maheshakya/scikit-learn
sklearn/semi_supervised/label_propagation.py
2
15104
# coding=utf8 """ Label propagation in the context of this module refers to a set of semisupervised classification algorithms. In the high level, these algorithms work by forming a fully-connected graph between all points given and solving for the steady-state distribution of labels at each point. These algorithms per...
bsd-3-clause
LennonLab/ScalingMicroBiodiversity
ExtraTests/lognormal/Prestons_a.py
2
2188
from __future__ import division #from bigfloat import BigFloat, sqrt, exp, log, log2, erf, const_pi import numpy as np import math from numpy import log, log2, exp, sqrt,log10 from scipy.optimize import fsolve import scipy.optimize as opt import matplotlib.pyplot as plt from scipy.special import erf import sys pi = ma...
gpl-3.0
solarjoe/numpy
numpy/lib/npyio.py
3
75574
from __future__ import division, absolute_import, print_function import sys import os import re 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.multiarray import packbits, unpa...
bsd-3-clause
zfrenchee/pandas
pandas/core/api.py
1
3146
# pylint: disable=W0614,W0401,W0611 # flake8: noqa import numpy as np from pandas.core.algorithms import factorize, unique, value_counts from pandas.core.dtypes.missing import isna, isnull, notna, notnull from pandas.core.categorical import Categorical from pandas.core.groupby import Grouper from pandas.io.formats.f...
bsd-3-clause
woodscn/scipy
scipy/special/c_misc/struve_convergence.py
76
3725
""" Convergence regions of the expansions used in ``struve.c`` Note that for v >> z both functions tend rapidly to 0, and for v << -z, they tend to infinity. The floating-point functions over/underflow in the lower left and right corners of the figure. Figure legend ============= Red region Power series is clo...
bsd-3-clause
ashhher3/seaborn
seaborn/tests/test_axisgrid.py
11
41072
import warnings import numpy as np import pandas as pd from scipy import stats import matplotlib as mpl import matplotlib.pyplot as plt from distutils.version import LooseVersion import nose.tools as nt import numpy.testing as npt from numpy.testing.decorators import skipif import pandas.util.testing as tm from . im...
bsd-3-clause
rseubert/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
andyr0id/PyGFNN
examples/gfnn/example1F.py
1
1657
#!/usr/bin/env python __author__ = 'Andrew J. Lambert, andy@andyroid.co.uk' """ example1P A one layer network with fixed internal connections """ from pygfnn.tools.plotting.gfnn import * import pygfnn.tools.shortcuts as gfnn import numpy as np import timeit import matplotlib.pyplot as plt import scipy.io as sio if...
gpl-2.0
jereze/scikit-learn
examples/datasets/plot_iris_dataset.py
283
1928
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy...
bsd-3-clause
ashhher3/scikit-learn
sklearn/cluster/tests/test_affinity_propagation.py
31
2633
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
bsd-3-clause
earlbellinger/asteroseismology
grid/calibrate.py
1
3590
#### Calibrate a solar model #### Author: Earl Bellinger ( bellinger@mps.mpg.de ) #### Stellar Ages & Galactic Evolution Group #### Max-Planck-Institut fur Sonnensystemforschung #### Department of Astronomy, Yale University import numpy as np import pandas as pd from scipy import optimize from os import ...
gpl-2.0
shaneknapp/spark
python/pyspark/pandas/indexes/base.py
2
84541
# # 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
danforthcenter/plantcv
tests/tests.py
1
288502
#!/usr/bin/env python import pytest import os import shutil import json import numpy as np import cv2 import sys import pandas as pd from plotnine import ggplot from plantcv import plantcv as pcv import plantcv.learn import plantcv.parallel import plantcv.utils # Import matplotlib and use a null Template to block plot...
mit
awanke/bokeh
examples/plotting/file/boxplot.py
43
2269
import numpy as np import pandas as pd from bokeh.plotting import figure, show, output_file # Generate some synthetic time series for six different categories cats = list("abcdef") yy = np.random.randn(2000) g = np.random.choice(cats, 2000) for i, l in enumerate(cats): yy[g == l] += i // 2 df = pd.DataFrame(dict(s...
bsd-3-clause
lin-credible/scikit-learn
sklearn/svm/tests/test_sparse.py
95
12156
from nose.tools import assert_raises, assert_true, assert_false import numpy as np from scipy import sparse from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classif...
bsd-3-clause
lhirschfeld/JargonBot
custombot.py
1
3061
import pickle import praw import random from textblob import TextBlob from datetime import datetime from sklearn import linear_model class RedditBot: """A class that performs basic operations, working with Reddit's PRAW API.""" def __init__(self, botName): # Setup the bot and primary variables. ...
mit
RPGOne/scikit-learn
examples/decomposition/plot_pca_vs_fa_model_selection.py
70
4523
""" =============================================================== Model selection with Probabilistic PCA and Factor Analysis (FA) =============================================================== Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the likelihood of new data can be u...
bsd-3-clause
assad2012/ggplot
ggplot/geoms/geom_linerange.py
12
2881
from __future__ import (absolute_import, division, print_function, unicode_literals) import sys from .geom import geom from ggplot.utils import is_categorical import numpy as np class geom_linerange(geom): """Plot intervals represented by vertical lines Parameters --------- ...
bsd-2-clause
RPGOne/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
46
9267
import numpy as np from sklearn.exceptions import ConvergenceWarning 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...
bsd-3-clause
glemaitre/UnbalancedDataset
examples/over-sampling/plot_smote.py
2
2231
""" ===== SMOTE ===== An illustration of the SMOTE method and its variant. """ # Authors: Fernando Nogueira # Christos Aridas # Guillaume Lemaitre <g.lemaitre58@gmail.com> # License: MIT import matplotlib.pyplot as plt from sklearn.datasets import make_classification from sklearn.decomposition imp...
mit
rabrahm/ceres
utils/FastRotators/spfr.py
1
18831
from pylab import * import pyfits from PyAstronomy import pyasl import scipy from scipy import interpolate from scipy import ndimage from scipy import signal import pickle from matplotlib.backends.backend_pdf import PdfPages import os #from pyevolve import G1DList #from pyevolve import GSimpleGA from multiprocessing i...
mit
xiaoweih/DLV
networks/imageNet.py
1
1666
import os, struct from array import array as pyarray from cvxopt.base import matrix import numpy as np import PIL.Image # FIXME: need actual class names def LABELS(index): ls = labels() if len(ls) > 0: return ls[index] else: return range(1000)[index] def labels(): file = open('networks/ima...
gpl-3.0
CranleighAD/isams-tools
settings_example.py
1
2947
# enable or disable the whole program ENABLED = True # if we're in testing mode, output more debug and allow testers to add their own email DEBUG = True # used with above, you can check the output of emails that would have been sent SEND_EMAILS = True # iSAMS Batch API key API_KEY = "11D497FF-A7D9-4646-A6B8-D9D1B871...
gpl-3.0
aabadie/scikit-learn
examples/manifold/plot_lle_digits.py
138
8594
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
bsd-3-clause
annashcherbina/FASTQSim
src/msa_from_sam.py
2
15121
#This file does three things: #1. calculate the frequency of mutations, insertions, and deletions at each position in an #NGS read. #2. find the degree of coverage of the reference genome #3. find the fraction of each subject read that was aligned to a corresponding sequence #in the refenece genome. # @author ...
gpl-3.0
ffmmjj/desafio-dados-2016
data_preparation_pipeline/outliers_separation.py
1
1185
import luigi import pandas as pd from augment_data import AppendFeaturesAggregatedFromTeachersDatasetToSchool class SplitSchoolOutliersData(luigi.Task): input_task = AppendFeaturesAggregatedFromTeachersDatasetToSchool() def requires(self): return self.input_task def output(self): return...
apache-2.0
nakul02/systemml
src/main/python/systemml/classloader.py
4
7952
#------------------------------------------------------------- # # 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...
apache-2.0
nelango/ViralityAnalysis
model/lib/sklearn/gaussian_process/gaussian_process.py
78
34552
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause from __future__ import print_function import numpy as np from scipy import linalg, optimize from ..base import BaseEstimator, RegressorMixin from ..metrics...
mit
daodaoliang/neural-network-animation
matplotlib/tests/test_table.py
10
2083
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import matplotlib.pyplot as plt import numpy as np from matplotlib.testing.decorators import image_comparison @image_comparison(baseline_images=['table_zorder'], extensions=['png...
mit
phvu/DDF
python/tests/test_ml.py
3
1794
from __future__ import unicode_literals import unittest import pandas as pd from py4j.java_gateway import Py4JJavaError import test_base from ddf import ml class TestMl(test_base.BaseTest): """ Test ML functions """ def testKmeans(self): model = ml.kmeans(self.mtcars, 2, 5, 10) self...
apache-2.0
rbiswas4/SNsims
snsims_previous/snsims/tmp/models.py
1
2804
#!/usr/bin/env python import sncosmo.models import numpy class SEDFileSource(sncosmo.models.TimeSeriesSource): """A TimeSeriesSource stored in a 3-column ASCII file format, for PHASE, LAMBDA, and F_LAMBDA. The hash symbol # is a comment line. The spectral flux density of this model is given by .....
mit
jereze/scikit-learn
sklearn/utils/fixes.py
39
13318
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
mattilyra/scikit-learn
benchmarks/bench_isotonic.py
38
3047
""" Benchmarks of isotonic regression performance. We generate a synthetic dataset of size 10^n, for n in [min, max], and examine the time taken to run isotonic regression over the dataset. The timings are then output to stdout, or visualized on a log-log scale with matplotlib. This allows the scaling of the algorit...
bsd-3-clause
laserson/ibis
docs/sphinxext/ipython_sphinxext/ipython_directive.py
9
37645
# -*- coding: utf-8 -*- """ Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. It also allows you to input code as a pure pyth...
apache-2.0
mjsauvinen/P4UL
pyRaster/tif2NumpyTile.py
1
1956
#!/usr/bin/env python3 import sys import argparse import numpy as np from mapTools import * from utilities import filesFromList, writeLog from plotTools import addImagePlot import matplotlib.pyplot as plt ''' Author: Mikko Auvinen mikko.auvinen@helsinki.fi University of Helsinki & Finnish Meteor...
mit
jwiggins/scikit-image
skimage/future/graph/rag.py
2
14784
import networkx as nx import numpy as np from numpy.lib.stride_tricks import as_strided from scipy import ndimage as ndi import math from ... import draw, measure, segmentation, util, color try: from matplotlib import colors from matplotlib import cm except ImportError: pass def min_weight(graph, src, dst...
bsd-3-clause
cyliustack/sofa
bin/sofa_analyze.py
1
50661
import argparse import matplotlib matplotlib.use('agg') import csv import json import multiprocessing as mp import os import random import re import sys from functools import partial from operator import attrgetter, itemgetter import networkx as nx import numpy as np import pandas as pd import time from sofa_aisi impor...
apache-2.0
scls19fr/blaze
blaze/tests/test_interactive.py
8
9834
from blaze.interactive import Data, compute, concrete_head, expr_repr, to_html import datetime from odo import into, append from odo.backends.csv import CSV from blaze import discover from blaze.compute.core import compute from blaze.compute.python import compute from blaze.expr import symbol from datashape import dsh...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/datasets/twenty_newsgroups.py
72
13586
"""Caching loader for the 20 newsgroups text classification dataset The description of the dataset is available on the official website at: http://people.csail.mit.edu/jrennie/20Newsgroups/ Quoting the introduction: The 20 Newsgroups data set is a collection of approximately 20,000 newsgroup documents,...
bsd-3-clause
equialgo/scikit-learn
examples/datasets/plot_random_dataset.py
348
2254
""" ============================================== Plot randomly generated classification dataset ============================================== Plot several randomly generated 2D classification datasets. This example illustrates the :func:`datasets.make_classification` :func:`datasets.make_blobs` and :func:`datasets....
bsd-3-clause
joshbohde/scikit-learn
sklearn/svm/tests/test_sparse.py
2
6699
import numpy as np import scipy.sparse from sklearn import datasets, svm, linear_model from numpy.testing import assert_array_almost_equal, \ assert_array_equal, assert_equal from nose.tools import assert_raises from sklearn.datasets.samples_generator import make_classification from . import test_svm # test samp...
bsd-3-clause
Insight-book/data-science-from-scratch
first-edition/code/gradient_descent.py
53
5895
from __future__ import division from collections import Counter from linear_algebra import distance, vector_subtract, scalar_multiply import math, random def sum_of_squares(v): """computes the sum of squared elements in v""" return sum(v_i ** 2 for v_i in v) def difference_quotient(f, x, h): return (f(x +...
unlicense
anntzer/scikit-learn
sklearn/utils/_estimator_html_repr.py
1
9497
from contextlib import closing from contextlib import suppress from io import StringIO from string import Template import uuid import html from sklearn import config_context class _VisualBlock: """HTML Representation of Estimator Parameters ---------- kind : {'serial', 'parallel', 'single'} ...
bsd-3-clause
henry0312/LightGBM
python-package/lightgbm/basic.py
1
150238
# coding: utf-8 """Wrapper for C API of LightGBM.""" import ctypes import json import os import warnings from collections import OrderedDict from copy import deepcopy from functools import wraps from logging import Logger from tempfile import NamedTemporaryFile from typing import Any, Dict, List, Set, Union import num...
mit
Dapid/pywt
demo/dwt_signal_decomposition.py
1
1789
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import numpy as np import matplotlib.pyplot as plt import pywt ecg = np.load(os.path.join('data', 'ecg.npy')) data1 = np.concatenate((np.arange(1, 400), np.arange(398, 600), np.arange(601, 1024))) x = np.linspa...
mit
jmmease/pandas
pandas/conftest.py
7
2021
import pytest import numpy import pandas import pandas.util.testing as tm def pytest_addoption(parser): parser.addoption("--skip-slow", action="store_true", help="skip slow tests") parser.addoption("--skip-network", action="store_true", help="skip network tests") ...
bsd-3-clause
keflavich/APEX_CMZ_H2CO
plot_codes/parameter_comparisons.py
2
20997
import matplotlib import paths matplotlib.rc_file(paths.pcpath('pubfiguresrc')) import os import pylab as pl from astropy import table from paths import analysispath import numpy as np from astropy import coordinates from astropy import units as u import heating pcfittable = table.Table.read(os.path.join(analysispath,...
bsd-3-clause
ilastikdev/opengm
src/interfaces/python/examples/potts_gui.py
14
1100
import numpy import opengm import vigra import matplotlib.pyplot as plt import matplotlib.cm as cm gradScale = 0.1 energyNotEqual = 0.2 sigma=0.2 resizeFactor=2 img=vigra.impex.readImage('lena.bmp') shape=img.shape imgLab=vigra.colors.transform_RGB2Lab(img) shape=(shape[0]*resizeFactor,shape[1]*resizeFactor) ...
mit
spbguru/repo1
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py
70
9051
from __future__ import division """ backend_wxagg.py A wxPython backend for Agg. This uses the GUI widgets written by Jeremy O'Donoghue (jeremy@o-donoghue.com) and the Agg backend by John Hunter (jdhunter@ace.bsd.uchicago.edu) Copyright (C) 2003-5 Jeremy O'Donoghue, John Hunter, Illinois Institute of Technolo...
gpl-3.0
kinglogxzl/rqalpha
rqalpha/examples/simple_macd.py
2
2164
# 可以自己import我们平台支持的第三方python模块,比如pandas、numpy等。 import talib import numpy as np import math import pandas # 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。 def init(context): context.s1 = "000001.XSHE" # 使用MACD需要设置长短均线和macd平均线的参数 context.SHORTPERIOD = 12 context.LONGPERIOD = 26 context.SMOOTHPERIOD...
apache-2.0
MartinDelzant/scikit-learn
examples/classification/plot_lda.py
70
2413
""" ==================================================================== Normal and Shrinkage Linear Discriminant Analysis for classification ==================================================================== Shows how shrinkage improves classification. """ from __future__ import division import numpy as np import...
bsd-3-clause
jmetzen/scikit-learn
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
pdamodaran/yellowbrick
yellowbrick/text/dispersion.py
1
10916
# yellowbrick.text.dispersion # Implementations of lexical dispersions for text visualization. # # Author: Larry Gray # Created: 2018-06-21 10:06 # # Copyright (C) 2018 District Data Labs # For license information, see LICENSE.txt # # ID: dispersion.py [] lwgray@gmail.com $ """ Implementation of lexical dispersion ...
apache-2.0
robcarver17/systematictradingexamples
plots_for_perhaps/compareoptmethods.py
1
22426
import numpy as np import matplotlib.pyplot as plt from matplotlib.pyplot import plot, show, xticks, xlabel, ylabel, legend, yscale, title, savefig, rcParams, figure, hist, text, bar, subplots import Image def file_process(filename): fig = plt.gcf() fig.set_size_inches(18.5,10.5) fig.savefig("/home/rob/%s....
gpl-2.0
cloud-fan/spark
python/pyspark/pandas/internal.py
1
68330
# # 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
phobson/statsmodels
statsmodels/tools/tests/test_tools.py
1
20793
""" Test functions for models.tools """ from statsmodels.compat.python import lrange, range import numpy as np from numpy.random import standard_normal from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_string_equal, TestCase) from nose.tools import (asse...
bsd-3-clause
nhuntwalker/astroML
book_figures/chapter1/fig_moving_objects.py
3
1911
""" SDSS Moving Object Data ----------------------- Figure 1.8. The orbital semimajor axis vs. the orbital inclination angle diagram for the first 10,000 catalog entries from the SDSS Moving Object Catalog (after applying several quality cuts). The gaps at approximately 2.5, 2.8, and 3.3 AU are called the Kirkwood gap...
bsd-2-clause
waidyanatha/pingsam
visualize.py
1
8668
import numpy as np import datetime as dtm from dateutil import rrule import pandas as pd import csv import matplotlib.pylab as plt import sys, os #lets first create the csv file # #change this to actual csv file name pingfile="weeklylogs.csv" #paramters @plotinterval = 10 minutes plotinterval = 10 #csv file columns col...
mit
pbauman/libmesh
doc/statistics/libmesh_pagehits.py
1
10542
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num # Hits/month, pages, and gigabytes served. # To get the Google analytics data: # .) Go to analytics.google.com. # .) There should be (as o...
lgpl-2.1
mfjb/scikit-learn
benchmarks/bench_sample_without_replacement.py
397
8008
""" Benchmarks for sampling without replacement of integer. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import operator import matplotlib.pyplot as plt import numpy as np import random from sklearn.externals.six.moves i...
bsd-3-clause
crichardson17/starburst_atlas
Low_resolution_sims/Dusty_LowRes/Padova_inst/padova_inst_2/fullgrid/Rest.py
30
9192
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
andrewgiessel/folium
folium/utilities.py
1
19979
# -*- coding: utf-8 -*- """ Utilities ------- Utility module for Folium helper functions. """ from __future__ import absolute_import from __future__ import print_function from __future__ import division import time import math import zlib import struct import json import base64 from jinja2 import Environment, Packa...
mit
tomlof/scikit-learn
sklearn/decomposition/dict_learning.py
19
46220
""" Dictionary learning """ from __future__ import print_function # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause import time import sys import itertools from math import sqrt, ceil import numpy as np from scipy import linalg from numpy.lib.stride_tricks import as_strided from ..b...
bsd-3-clause
xiaoxiamii/scikit-learn
examples/applications/plot_model_complexity_influence.py
323
6372
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
costypetrisor/scikit-learn
examples/tree/plot_tree_regression_multioutput.py
43
1791
""" =================================================================== Multi-output Decision Tree Regression =================================================================== An example to illustrate multi-output regression with decision tree. The :ref:`decision trees <tree>` is used to predict simultaneously the ...
bsd-3-clause
sjperkins/tensorflow
tensorflow/examples/learn/multiple_gpu.py
49
3078
# 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
jkitchin/jasp
jasp/jasp_bandstructure.py
3
3749
'''Calculate bandstructure diagrams in jasp''' from jasp import * import os import matplotlib.pyplot as plt from ase.dft import DOS def get_bandstructure(self, kpts_path=None, kpts_nintersections=10): """Calculate band structure along :param kpts_path: :param list...
gpl-2.0
haeusser/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py
75
29377
# 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
CondensedOtters/PHYSIX_Utils
Projects/Moog_2016-2019/CO2/CO2_NN/analysis.py
1
9175
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 14 05:54:11 2020 @author: mathieumoog """ import cpmd import filexyz import numpy as np import matplotlib.pyplot as plt # MSMbuilder ( lacks CK validation ) from msmbuilder.msm import MarkovStateModel from msmbuilder.msm import BayesianMarkovStateM...
gpl-3.0
timestocome/Test-stock-prediction-algorithms
StockMarketLinearRegression/PredictGold.py
2
3318
# http://github.com/timestocome # Attempt to predict gold prices and find outliers # http://web.ipac.caltech.edu/staff/fmasci/home/astro_refs/TestForRandomness_RunsTest.pdf import numpy as np import pandas as pd import matplotlib.pyplot as plt ####################################################################...
mit
jseabold/scikit-learn
sklearn/linear_model/tests/test_omp.py
272
7752
# 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
Ziqi-Li/bknqgis
bokeh/bokeh/plotting/helpers.py
1
24268
from __future__ import absolute_import from collections import Iterable, OrderedDict, Sequence import difflib import itertools import re import textwrap import warnings import numpy as np import sys from six import string_types, reraise from ..models import ( BoxSelectTool, BoxZoomTool, CategoricalAxis, TapT...
gpl-2.0
FlorisHoogenboom/sklearn-helpers
tests/test_preprocessing.py
1
3095
import unittest import numpy as np import pandas as pd from sklearn_helpers.preprocessing import \ EnhancedLabelEncoder, MultiColumnLabelEncoder class EnhancedLabelEncoderTest(unittest.TestCase): def test_accepts_only_1d(self): """It should only accept only a 1d array""" ehe = EnhancedLabelEnc...
mit
aerrami/mtools
mtools/test/test_all_import.py
7
1549
from nose.tools import nottest, make_decorator from functools import wraps # tools without any external dependencies from mtools.mlogfilter.mlogfilter import MLogFilterTool from mtools.mlogvis.mlogvis import MLogVisTool from mtools.mloginfo.mloginfo import MLogInfoTool tools = [MLogFilterTool, MLogVisTool, MLogInfoTo...
apache-2.0
hadim/spindle_tracker
spindle_tracker/io/trackmate.py
1
5663
import itertools import xml.etree.cElementTree as et import networkx as nx import pandas as pd import numpy as np def trackmate_peak_import(trackmate_xml_path, get_tracks=False): """Import detected peaks with TrackMate Fiji plugin. Parameters ---------- trackmate_xml_path : str TrackMate XML...
bsd-3-clause
nikitasingh981/scikit-learn
examples/linear_model/plot_sparse_recovery.py
70
7486
""" ============================================================ Sparse recovery: feature selection for sparse linear models ============================================================ Given a small number of observations, we want to recover which features of X are relevant to explain y. For this :ref:`sparse linear ...
bsd-3-clause
zaxtax/scikit-learn
benchmarks/bench_lasso.py
297
3305
""" 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
gskielian/SimpleCV
scripts/install/win/OpenKinect/freenect-examples/demo_mp_async.py
15
1082
#!/usr/bin/env python import freenect import matplotlib.pyplot as mp import signal import frame_convert mp.ion() image_rgb = None image_depth = None keep_running = True def display_depth(dev, data, timestamp): global image_depth data = frame_convert.pretty_depth(data) mp.gray() mp.fig...
bsd-3-clause
YukiKita/fio
tools/hist/fiologparser_hist.py
3
15090
#!/usr/bin/env python2.7 """ Utility for converting *_clat_hist* files generated by fio into latency statistics. Example usage: $ fiologparser_hist.py *_clat_hist* end-time, samples, min, avg, median, 90%, 95%, 99%, max 1000, 15, 192, 1678.107, 1788.859, 1856.076, ...
gpl-2.0
h2educ/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
rubikloud/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
deeplook/bokeh
bokeh/charts/builder/line_builder.py
43
5360
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Line class which lets you build your Line charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------------------...
bsd-3-clause
molpopgen/pyseq
docs/conf.py
2
9974
# -*- coding: utf-8 -*- # # pylibseq documentation build configuration file, created by # sphinx-quickstart on Mon Oct 19 19:11:29 2015. # # 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 # autogenerated file. # # ...
gpl-2.0
sriki18/scipy
scipy/signal/_max_len_seq.py
41
4942
# Author: Eric Larson # 2014 """Tools for MLS generation""" import numpy as np from ._max_len_seq_inner import _max_len_seq_inner __all__ = ['max_len_seq'] # These are definitions of linear shift register taps for use in max_len_seq() _mls_taps = {2: [1], 3: [2], 4: [3], 5: [3], 6: [5], 7: [6], 8: [7, 6, 1], ...
bsd-3-clause
OpenSourcePolicyCenter/taxdata
puf_stage1/factors_finalprep.py
1
3867
""" Transform Stage_I_factors.csv (written by the stage1.py script) and benefit_growth_rates.csv into growfactors.csv (used by Tax-Calculator). """ import numpy as np import pandas as pd import os # pylint: disable=invalid-name CUR_PATH = os.path.abspath(os.path.dirname(__file__)) first_benefit_year = 2014 inben_file...
mit
aminert/scikit-learn
sklearn/cross_validation.py
96
58309
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from...
bsd-3-clause
wazeerzulfikar/scikit-learn
sklearn/linear_model/tests/test_base.py
33
17862
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from itertools import product from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils...
bsd-3-clause