repo_name
stringlengths
7
90
path
stringlengths
5
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
976
581k
license
stringclasses
15 values
dynamiq-md/spectral_density_discretization
spectral_density_discretization/spectral_density.py
1
3594
#!/usr/bin/env python import math import pandas as pd def print5(one, two, three, four, five): fivestr = "%.10f %.10f %.10f %.10f %.10f" % (one, two, three, four, five) return fivestr def print_column(v, N_max): out_str = "" if (N_max == 0): out_str += "0.0" for i in range(N_max / 5): ...
mit
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/manifold/tests/test_spectral_embedding.py
1
11146
import numpy as np from nose.plugins.skip import SkipTest from nose.tools import assert_equal from nose.tools import assert_raises from nose.tools import assert_true from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from scipy.linalg import eigh from scipy.sparse import co...
mit
JackKelly/neuralnilm_prototype
scripts/e234.py
2
4812
from __future__ import print_function, division import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid, rectify from lasagne.objectives import crossentropy, mse...
mit
samuel1208/scikit-learn
sklearn/feature_selection/rfe.py
137
17066
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import warnings import numpy as np from ..utils import check_X_y, safe_sqr fro...
bsd-3-clause
IssamLaradji/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# 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 nose.tools import assert_equa...
bsd-3-clause
louispotok/pandas
pandas/io/formats/latex.py
3
9390
# -*- coding: utf-8 -*- """ Module for formatting output data in Latex. """ from __future__ import print_function from pandas.core.index import MultiIndex from pandas import compat from pandas.compat import range, map, zip, u from pandas.io.formats.format import TableFormatter import numpy as np class LatexFormatte...
bsd-3-clause
orzinal/test
nab/scorer.py
3
15103
# ---------------------------------------------------------------------- # Copyright (C) 2014-2015, 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/...
agpl-3.0
agartland/utils
corrplots.py
1
31054
import matplotlib import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from scipy import polyfit, polyval, stats import pandas as pd from mytext import textTL, textTR import statsmodels.api as sm from patsy import dmatrices, ModelDesc, Term, LookupFactor from copy import ...
mit
trachelr/mne-python
examples/realtime/plot_compute_rt_average.py
18
1790
""" ======================================================== Compute real-time evoked responses using moving averages ======================================================== This example demonstrates how to connect to an MNE Real-time server using the RtClient and use it together with RtEpochs to compute evoked respo...
bsd-3-clause
dsquareindia/scikit-learn
sklearn/datasets/base.py
13
29166
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import sys import shutil from os import environ...
bsd-3-clause
BSchilperoort/BR-DTS-Processing
data_processing/dts_plot_example.py
1
3395
##Imports from datetime import datetime from datetime import timedelta from glob import glob from time import time import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.image as mpimg import numpy as np import os import sys ##!>Set working directory to correct folder (BR-DTS-Processing) w...
mit
zhenv5/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
lancezlin/ml_template_py
lib/python2.7/site-packages/pandas/util/testing.py
7
92097
from __future__ import division # pylint: disable-msg=W0402 import re import string import sys import tempfile import warnings import inspect import os import subprocess import locale import unittest import traceback from datetime import datetime from functools import wraps, partial from contextlib import contextmana...
mit
jccaicedo/localization-agent
utils/libDetection.py
1
8598
import os,sys import numpy as np from abc import ABCMeta, abstractmethod intersect = lambda x,y: [max(x[0],y[0]),max(x[1],y[1]),min(x[2],y[2]),min(x[3],y[3])] area = lambda x: (x[2]-x[0]+1)*(x[3]-x[1]+1) # Symmetric Jaccard coefficient def IoU(b1,b2): bi = intersect(b1,b2) iw = bi[2] - bi[0] + 1 ih = bi[3] - b...
mit
AdrieleD/gr-mac1
python/qa_css_sync.py
2
16786
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2015 Felix Wunsch, Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT) <wunsch.felix@googlemail.com>. # # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
gpl-3.0
jramcast/ml_weather
example2/example2.py
1
6718
""" Test 1 Calculate Error on training and validation sets manually. Quick and dirty test to classify tweets talking about weather. """ import csv import numpy as np from random import shuffle from sklearn.datasets import make_blobs from sklearn.linear_model import LogisticRegression from sklearn.model_selection imp...
apache-2.0
dingocuster/scikit-learn
examples/cluster/plot_digits_linkage.py
369
2959
""" ============================================================================= Various Agglomerative Clustering on a 2D embedding of digits ============================================================================= An illustration of various linkage option for agglomerative clustering on a 2D embedding of the di...
bsd-3-clause
StefReck/Km3-Autoencoder
scripts/plotting/autoencoder_3d_hist_multiple_epochs.py
1
5019
# -*- coding: utf-8 -*- """ Make 3d plots of some events and the autoencoder predictions for one autoencoder model and multiple epochs. """ import matplotlib matplotlib.use('Agg') #dont open plotting windows from keras.models import load_model import h5py import numpy as np import matplotlib.pyplot as plt from matplot...
mit
vitaly-krugl/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/axes.py
69
259904
from __future__ import division, generators import math, sys, warnings, datetime, new import numpy as np from numpy import ma import matplotlib rcParams = matplotlib.rcParams import matplotlib.artist as martist import matplotlib.axis as maxis import matplotlib.cbook as cbook import matplotlib.collections as mcoll im...
agpl-3.0
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/tight_bbox.py
22
2601
""" This module is to support *bbox_inches* option in savefig command. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import warnings from matplotlib.transforms import Bbox, TransformedBbox, Affine2D def adjust_bbox(fig, bbox_inches, fixe...
mit
google-research/google-research
concept_explanations/awa_helper.py
1
10860
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
MohammedWasim/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
jlegendary/scikit-learn
examples/ensemble/plot_bias_variance.py
357
7324
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
bsd-3-clause
napjon/krisk
krisk/tests/test_tooltip.py
1
1145
import pytest import json import pandas as pd import krisk.plot as kk DATA_DIR = 'krisk/tests/data' def test_tooltip(gap_chart): formatter = gap_chart.option['tooltip']['formatter'] true_formatter = json.load(open(DATA_DIR + '/tooltip.json', 'r'))['formatter'] assert formatter == true_formatter def test...
bsd-3-clause
huobaowangxi/scikit-learn
sklearn/neighbors/regression.py
106
10572
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output support by Arna...
bsd-3-clause
ghorn/casadi
docs/examples/python/chain_qp.py
3
3488
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
lgpl-3.0
lilleswing/deepchem
deepchem/trans/tests/test_log_transform.py
3
6317
import os import deepchem as dc import pandas as pd import numpy as np def load_feat_multitask_data(): """Load example with numerical features, tasks.""" current_dir = os.path.dirname(os.path.abspath(__file__)) features = ["feat0", "feat1", "feat2", "feat3", "feat4", "feat5"] featurizer = dc.feat.UserDefinedF...
mit
potash/scikit-learn
sklearn/metrics/cluster/tests/test_unsupervised.py
66
5806
import numpy as np import scipy.sparse as sp from scipy.sparse import csr_matrix from sklearn import datasets from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from skl...
bsd-3-clause
hodger/cyclus
tests/test_memback.py
6
11123
"""Tests Python memory backend.""" from __future__ import print_function, unicode_literals import nose from nose.tools import assert_equal, assert_true, assert_is_instance, \ assert_in, assert_false, assert_not_in, assert_is, assert_is_not from cyclus import memback from cyclus import lib from cyclus import types...
bsd-3-clause
andersbll/texture_benchmarks
code/data/diku_scale_seq.py
1
1851
import os import numpy as np from scipy.misc import imread from sklearn.cross_validation import StratifiedShuffleSplit from .base import BaseDataset _CLASS_NAMES = [ 'kockums', 'dobelnsgatan', 'dobelnsgatan_small_house', 'shrub_rosjoparken', 'birch_tree_1_university_park', 'birch_tree_trunk_1', ] _IMG_PREFIX_NOS...
mit
bueler/p4pdes
c/ch5/plotTS.py
1
4130
#!/usr/bin/env python3 help =\ ''' Plot trajectory, or frames if solution has two spatial dimensions, generated by running a PETSc TS program. Reads output from -ts_monitor binary:TDATA -ts_monitor_solution binary:UDATA Requires copies or sym-links to $PETSC_DIR/lib/petsc/bin/PetscBinaryIO.py and $PETSC_DIR/lib/pe...
mit
wzbozon/statsmodels
statsmodels/graphics/regressionplots.py
20
39579
'''Partial Regression plot and residual plots to find misspecification Author: Josef Perktold License: BSD-3 Created: 2011-01-23 update 2011-06-05 : start to convert example to usable functions 2011-10-27 : docstrings ''' from statsmodels.compat.python import lrange, string_types, lzip, range import numpy as np imp...
bsd-3-clause
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/site-packages/dask/tests/test_distributed.py
4
5764
import pytest distributed = pytest.importorskip('distributed') from functools import partial import inspect from operator import add from tornado import gen import dask from dask import persist, delayed, compute from dask.delayed import Delayed from dask.utils import tmpdir from distributed.client import wait, Client...
gpl-3.0
cycleuser/GeoPython
Experimental/PreTreat.py
2
6940
# coding:utf-8 import math import sys import os import csv import random from bs4 import BeautifulSoup import pandas as pd import numpy as np from mpl_toolkits.mplot3d import Axes3D from sklearn import datasets from sklearn.decomposition import PCA from sklearn.neighbors import NearestNeighbors import matplotlib impo...
gpl-3.0
chenliu0831/QuantModeling
BackTester/portfolio.py
1
8715
#!/usr/bin/python # -*- coding: utf-8 -*- # portfolio.py import datetime import numpy as np import pandas as pd import Queue from math import floor from event import FillEvent, OrderEvent from performance import create_sharpe_ratio, create_drawdowns class Portfolio(object): """ The Portfolio class handles...
mit
musically-ut/statsmodels
statsmodels/tsa/statespace/tools.py
19
12762
""" Statespace Tools Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np from statsmodels.tools.data import _is_using_pandas from . import _statespace try: from scipy.linalg.blas import find_best_blas_type except ImportError: # prag...
bsd-3-clause
dgasmith/SICM2-Software-Summer-School-2014
Useful_Resources/Python_Scripts/extract_molpro_rks.py
1
1073
# This is in the public domain. # Created by Daniel Smith 7/10/14 import glob import pandas as pd infiles = glob.glob('Data/*.out') def read(infile): """Read 'infile' into a list where each element is a line of the file""" return open(infile, 'r').readlines() def find(data, string, position=False, dtype...
mit
procoder317/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
hgrif/incubator-airflow
airflow/www/views.py
2
97479
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
ahad-s/getting-rich-with-rnn-nlp-stocks
skynetNLP.py
1
16746
import numpy as np import pandas as pd import random from string import translate, punctuation from nltk.data import load from nltk.corpus import stopwords from nltk import word_tokenize from sklearn.ensemble import RandomForestClassifier from sklearn.cross_validation import train_test_split from mindController impor...
gpl-3.0
BovineJoni/StylometricClustering
cluster_util.py
1
16503
# -*- coding: utf-8 -*- # StylometricClustering, Copyright 2014 Daniel Schneider. # schneider.dnl(at)gmail.com # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
gpl-3.0
gclenaghan/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
mikolajsacha/tweetsclassification
src/features/sentence_embeddings/isentence_embedding.py
1
2193
""" Contains basic interface (abstract base class) for sentence embeddings. """ from abc import ABCMeta, abstractmethod from sklearn.decomposition import PCA class ISentenceEmbedding(object): """ Abstract base class for sentece embeddings. Sentence embedding creates vectors representing sentences (word li...
mit
q1ang/scikit-learn
sklearn/tests/test_kernel_approximation.py
244
7588
import numpy as np from scipy.sparse import csr_matrix from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true from sklearn.utils.testing import assert_not_equal from sklearn.utils.testing import assert_array_almost_equal, assert_raises from sklearn.utils.testing import assert_less_equal from ...
bsd-3-clause
VU-Cog-Sci/PRF_experiment
plot_staircases.py
1
8541
from matplotlib import pyplot as pl import numpy as np import pickle import glob import seaborn as sn from IPython import embed as shell def plot_staircases(initials,run_nr): for eccen_bin in np.arange(3): exec("color_staircase_%d=[]"%eccen_bin); exec("speed_staircase_%d = []"%eccen_bin); exec("fix_staircase_...
mit
jatraug/Dataclass
Module6/assignment6.py
8
2431
import pandas as pd import time # Grab the DLA HAR dataset from: # http://groupware.les.inf.puc-rio.br/har # http://groupware.les.inf.puc-rio.br/static/har/dataset-har-PUC-Rio-ugulino.zip # # TODO: Load up the dataset into dataframe 'X' # # .. your code here .. # # TODO: Encode the gender column, 0 as male, 1 as ...
mit
johnhw/summerschool2016
unsupervised_image_learning/som.py
1
7256
#!/usr/bin/env python # ----------------------------------------------------------------------------- # Self-organizing map # Copyright (C) 2011 Nicolas P. Rougier # # Distributed under the terms of the BSD License. # ----------------------------------------------------------------------------- import numpy as np impo...
mit
BitTiger-MP/DS502-AI-Engineer
DS502-1702/Jason_course/Week4_Codelab2/class1_logistic_regression.py
1
4772
# coding=utf-8 import numpy as np import matplotlib.pyplot as plt from sklearn import datasets, linear_model # 绘图函数 def plot_line(x, y, theta=None, regressor=None): # Plot outputs x_min, x_max = x[:, 0].min() - .5, x[:, 0].max() + .5 y_min, y_max = x[:, 1].min() - .5, x[:, 1].max() + .5 xx, yy = np.me...
apache-2.0
dgary50/eovsa
flare_monitor.py
1
21039
''' Module for plotting the median of the front-end RF detector voltages from the stateframe SQL database, as a crude flare monitor''' # # History: # 2014-Dec-20 DG # First written. # 2014-Dec-21 DG # Added annotation and information about source. # 2014-Dec-22 DG # Cleaned up er...
gpl-2.0
zqhuang/COOP
mapio/pyscripts/sharex.py
2
2072
import numpy as np from matplotlib import use use('pdf') import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.colors import LogNorm import pylab as m cdict = { 'red' : ((0., 1., 1.), (0.02, 0.56, 0.56), (0.25, 0., 0.), (0.45, 0.1, 0.1), (0.5, 0., 0.) , (0.6, 0.7, 0.7), (0.7, 1., 1.), (0.8, 1., 1....
gpl-3.0
bundgus/python-playground
matplotlib-playground/examples/event_handling/resample.py
1
1565
import numpy as np import matplotlib.pyplot as plt from scikits.audiolab import wavread # A class that will downsample the data and recompute when zoomed. class DataDisplayDownsampler(object): def __init__(self, xdata, ydata): self.origYData = ydata self.origXData = xdata self.numpts = 300...
mit
PatrickOReilly/scikit-learn
sklearn/neighbors/graph.py
22
6646
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def _check_params(X, metric, p, metric_params): """C...
bsd-3-clause
apache/spark
python/pyspark/pandas/typedef/typehints.py
11
18793
# # 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
alliemacleay/MachineLearning_CS6140
utils/Perceptron.py
1
4177
__author__ = 'Allison MacLeay' import numpy as np import CS6140_A_MacLeay.utils.Stats as mystats from CS6140_A_MacLeay.utils import check_binary from CS6140_A_MacLeay.utils.Stats import get_error import pandas as pd class Perceptron: def __init__(self, data, predict_col, learning_rate, max_iterations=1000): ...
mit
ChristosChristofidis/bokeh
bokeh/crossfilter/models.py
40
30635
from __future__ import absolute_import import logging import six import pandas as pd import numpy as np from ..plotting import curdoc from ..models import ColumnDataSource, GridPlot, Panel, Tabs, Range from ..models.widgets import Select, MultiSelect, InputWidget # crossfilter plotting utilities from .plotting impo...
bsd-3-clause
jlurie/decatur
decatur/utils.py
1
6433
#!/usr/bin/env python # encoding: utf-8 from __future__ import print_function, division, absolute_import import os import warnings import h5py import numpy as np import pandas as pd from .config import data_dir, repo_data_dir def load_catalog(catalog_file='kebc.csv'): """ Load the Kepler Eclipsing Binary ...
mit
kazemakase/scikit-learn
examples/plot_multilabel.py
87
4279
# 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
Naereen/notebooks
Oraux_CentraleSupelec_PSI__Juin_2018.py
1
28554
# coding: utf-8 # # Table of Contents # <p><div class="lev1 toc-item"><a href="#Oraux-CentraleSupélec-PSI---Juin-2018" data-toc-modified-id="Oraux-CentraleSupélec-PSI---Juin-2018-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Oraux CentraleSupélec PSI - Juin 2018</a></div><div class="lev2 toc-item"><a href="#Rema...
mit
mwv/scikit-learn
examples/linear_model/plot_omp.py
385
2263
""" =========================== Orthogonal Matching Pursuit =========================== Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encoded with a dictionary """ print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import OrthogonalM...
bsd-3-clause
RayMick/scikit-learn
sklearn/grid_search.py
61
37197
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
bsd-3-clause
tdopires/forest-cover-group6
analysis/visualize.py
1
5749
# Some code for visualization of the raw data. import pandas as pd from sklearn import ensemble import pylab import math def plot_scatter_all(df_train, columns): """ Makes scatter plots of all combinations of quantative features. """ # Get a feature for the x-axis for i in xrange(1,11): co...
apache-2.0
glouppe/scikit-learn
examples/decomposition/plot_image_denoising.py
181
5819
""" ========================================= Image denoising using dictionary learning ========================================= An example comparing the effect of reconstructing noisy fragments of the Lena image using firstly online :ref:`DictionaryLearning` and various transform methods. The dictionary is fitted o...
bsd-3-clause
NINAnor/sentinel4nature
Tree canopy cover/regression/GBRT_Dovre2_LiDAR_bands.py
1
8988
# GBRT for Dovre2 case study site # Training data: LiDAR-derived tree canopy cover # Predictors: Sentinel-1 and Sentinel-2 bands # Authors: Stefan Blumentrath import numpy as np import matplotlib matplotlib.use('Cairo') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt from sklear...
gpl-2.0
bartosh/zipline
zipline/testing/fixtures.py
1
56869
import os import sqlite3 from unittest import TestCase from contextlib2 import ExitStack from logbook import NullHandler, Logger from six import with_metaclass, iteritems from toolz import flip import pandas as pd import responses from .core import ( create_daily_bar_data, create_minute_bar_data, make_sim...
apache-2.0
sharag/py_analis
razlad/for_stat.py
1
7047
import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D from matplotlib.ticker import LinearLocator, FormatStrFormatter from razlad.functions import f_probability, max_probabil import pickle # Формирвоание скачков # Характеристики скачков graph_len...
gpl-3.0
mxjl620/scikit-learn
sklearn/metrics/tests/test_regression.py
272
6066
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
bsd-3-clause
daisuke-motoki/single_shot_multibox_detector
scripts/video_example.py
1
5061
import os import pickle import numpy as np from scipy.misc import imread, imresize from ssd.ssd import SingleShotMultiBoxDetector import imageio from PIL import Image, ImageDraw, ImageFont import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt class Video(object): """ """ def __init__(sel...
mit
duguyue100/kmeans
kmeans.py
1
1294
""" This file contains my implementation of the paper: Learning Feature Representation with K-means Author: Yuhuang Hu Email: duguyue100@gmail.com """ import numpy as np; import matplotlib; matplotlib.use('tkagg'); import matplotlib.pyplot as plt; import util; # Read image ## MNIST # train_set, valid_set, test_set...
mit
RomainBrault/scikit-learn
sklearn/decomposition/tests/test_pca.py
12
21107
import numpy as np import scipy as sp from itertools import product from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_gre...
bsd-3-clause
JVillella/tensorflow
tensorflow/examples/learn/text_classification_character_rnn.py
29
4506
# 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
heprom/pymicro
examples/plotting/field_pole_figure.py
1
1665
from pymicro.crystal.microstructure import * from pymicro.crystal.texture import * from matplotlib import pyplot as plt, colors, colorbar, cm if __name__ == '__main__': '''This example demonstrate how a field can be used to color each symbol on the pole figure with the :py:meth:~`pymicro.crystal.texture.set_ma...
mit
mattjj/dirichlet-truncated-multinomial
figures.py
1
11125
from __future__ import division from matplotlib import pyplot as plt import numpy as np na = np.newaxis from scipy.interpolate import griddata import simplex, dirichlet, sampling, tests, density, timing allfigfuncs = [] SAVING = True # plt.interactive(False) ################################# # Figure-Generating Fun...
mit
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/lines_bars_and_markers/scatter_with_legend.py
1
1323
""" =========================== Scatter plots with a legend =========================== Also demonstrates how transparency of the markers can be adjusted by giving ``alpha`` a value between 0 and 1. """ import matplotlib.pyplot as plt from numpy.random import rand # nodebox section if __name__ == '__builtin__': ...
mit
jcsaezal/pmctrack
src/gui/frontend/monitoring_frame.py
1
19577
# -*- coding: utf-8 -*- # # monitoring_frame.py # ############################################################################## # # Copyright (c) 2015 Jorge Casas <jorcasas@ucm.es> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
gpl-2.0
IBT-FMI/SAMRI
samri/pipelines/diagnostics.py
1
9355
from os import path, listdir, getcwd, remove import inspect import json import re import shutil from copy import deepcopy from itertools import product import argh import nipype.interfaces.ants as ants import nipype.interfaces.io as nio import nipype.interfaces.utility as util import nipype.pipeline.engine as pe impo...
gpl-3.0
NixaSoftware/CVis
venv/lib/python2.7/site-packages/pandas/tests/groupby/test_aggregate.py
2
34088
# -*- coding: utf-8 -*- """ we test .agg behavior / note that .apply is tested generally in test_groupby.py """ from __future__ import print_function import pytest from datetime import datetime, timedelta from functools import partial import numpy as np from numpy import nan import pandas as pd from pandas import...
apache-2.0
DPRL/MathSymbolRecognizer
src/get_enhanced_clustered_set.py
1
14814
""" DPRL Math Symbol Recognizers Copyright (c) 2012-2014 Kenny Davila, Richard Zanibbi This file is part of DPRL Math Symbol Recognizers. DPRL Math Symbol Recognizers is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by t...
gpl-3.0
mdenil/parameter_prediction
examples/multijob/mnist_0001/generate_report.py
1
3199
from __future__ import division import numpy as np import pandas as pd import os import yaml import re import glob import cPickle as pickle import itertools from StringIO import StringIO def job_results_available(job_dir): model_file_name = os.path.join(job_dir, "models", "finetune_all.pkl") return os.path.ex...
mit
wlamond/scikit-learn
sklearn/decomposition/truncated_svd.py
1
8451
"""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
rrohan/scikit-learn
setup.py
76
9370
#! /usr/bin/env python # # Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # License: 3-clause BSD descr = """A set of python modules for machine learning and data mining""" import sys import os import shutil from distutils.command.clean ...
bsd-3-clause
gdiminin/HaSAPPy
HaSAPPy/Outlier_fold.py
1
3131
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Apr 4 08:49:20 2017 @author: gdiminin """ import pandas as pd import numpy as np import HaSAPPy.LOF as LOF def main (GroupAnalysis,DATA): #### def outlier_InputData (GroupAnalysis,DATA,group): #### def prepare...
mit
dolphyin/cs194-16-data_manatees
classificationSpecific/train.py
4
3624
import numpy as np import pandas as pd from pandas import Timestamp import time import math, json, pdb from sklearn import cross_validation from sklearn import datasets from sklearn import grid_search from sklearn import svm from sklearn import linear_model from sklearn import cluster # TODO: create training data # ...
apache-2.0
humdings/zipline
tests/data/test_us_equity_pricing.py
5
14225
# # Copyright 2015 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
takaakiaoki/PyFoam
PyFoam/Basics/MatplotlibTimelines.py
2
6466
# ICE Revision: $Id$ """Plots a collection of timelines""" from PyFoam.Error import warning,error from PyFoam.Basics.CustomPlotInfo import readCustomPlotInfo,CustomPlotInfo from .GeneralPlotTimelines import GeneralPlotTimelines from platform import uname firstTimeImport=True class MatplotlibTimelines(GeneralPlot...
gpl-2.0
michellemorales/OpenMM
scripts/Experiments.py
1
19954
import Fusions import pandas import os def get_earlyfusion(): print('\nRunning fusion experiments...\n') # Get training labels train_csv = '/Users/michellemorales/Desktop/MoralesDocs/DAIC_WOZ/Labels/training_split.csv' train_df = pandas.read_csv(train_csv) train_labels = {} for row in train_df...
gpl-2.0
yask123/scikit-learn
sklearn/decomposition/tests/test_online_lda.py
49
13124
import numpy as np from scipy.linalg import block_diag from scipy.sparse import csr_matrix from scipy.special import psi from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d, _dirichlet_expect...
bsd-3-clause
markovg/nest-simulator
testsuite/manualtests/stdp_check.py
4
4619
# -*- coding: utf-8 -*- # # stdp_check.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 2 of the License, or ...
gpl-2.0
Prometheus-ETSIIT/locaviewer
Localizacion/Estudio potencia/estudio_potencia.py
1
5570
# -*- coding: utf-8 -*- # ############################################### # Script para realizar un estudio de potencia # # de un dispositivo Bluetooth. # # # # V 1.0: Benito Palacios Sánchez # # - Recorre rango de distancia y ángulo y # # ...
mit
kapteyn-astro/kapteyn
doc/source/EXAMPLES/kmpfit_hubblefit.py
1
8592
#!/usr/bin/env python # Demonstrate regression through origin # 02-03-2012 import numpy from matplotlib.pyplot import figure, show, rc from numpy.random import normal from scipy.special import erfc from kapteyn import kmpfit def model(b, x): return b*x def residuals(p, data): # Needed for kmpfit x, y, er...
bsd-3-clause
cmorgan/trading-with-python
lib/classes.py
1
8162
""" worker classes @author: Jev Kuznetsov Licence: GPL v2 """ __docformat__ = 'restructuredtext' import os import logger as logger from yahooFinance import getHistoricData from functions import estimateBeta, returns, rank from datetime import date from pandas import DataFrame, Series import numpy as n...
bsd-3-clause
JohnCEarls/MasterDirac
masterdirac/models/run.py
1
12943
from pynamodb.models import Model from pynamodb.attributes import (UnicodeAttribute, UTCDateTimeAttribute, NumberAttribute, UnicodeSetAttribute, JSONAttribute, BooleanAttribute) from datetime import datetime import json import collections import os.path #STATUS_CODES CONFIG = -10 INIT = 0 PREP = 5 ACTIVE = 10...
agpl-3.0
Barmaley-exe/scikit-learn
examples/ensemble/plot_forest_iris.py
335
6271
""" ==================================================================== Plot the decision surfaces of ensembles of trees on the iris dataset ==================================================================== Plot the decision surfaces of forests of randomized trees trained on pairs of features of the iris dataset. ...
bsd-3-clause
afgaron/rgz-analysis
python/betatest.py
2
14268
#!/usr/bin/env python ''' First script to reduce the data from the beta release of Radio Galaxy Zoo (Oct 2013) Written by Julie Banfield, CSIRO ''' # import necessary python packages import numpy as np import matplotlib # plotting package import pylab as plt # part of plotting package i...
mit
oxtopus/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/blocking_input.py
69
12119
""" This provides several classes used for blocking interaction with figure windows: :class:`BlockingInput` creates a callable object to retrieve events in a blocking way for interactive sessions :class:`BlockingKeyMouseInput` creates a callable object to retrieve key or mouse clicks in a blocking way for int...
gpl-3.0
felipeband/aterramento
impedanciaImpulsiva.py
1
3208
#!/usr/bin/env python # -*- coding: utf-8 -*- # Felipe Bandeira da Silva # Fortaleza-CE, 29/06/2013 # felipeband18@gmail.com import os import csv import matplotlib.pyplot as plt from scipy.signal import butter, lfilter from numpy import copy, mean def zpDir(dir, nivelRecursao=50, ddir=None, debug=0): """ Calcul...
gpl-2.0
kcompher/scipy2015-blaze-bokeh
viz.py
6
3985
# -*- coding: utf-8 -*- import math from collections import OrderedDict import pandas as pd import netCDF4 from bokeh.plotting import figure, show, output_notebook from bokeh.models import DatetimeTickFormatter, ColumnDataSource, HoverTool, Plot, Range1d from bokeh.palettes import RdBu11 from bokeh.models.glyphs impo...
mit
BrianGasberg/filterpy
filterpy/kalman/tests/test_ukf.py
2
20947
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for mo...
mit
hugobowne/scikit-learn
sklearn/gaussian_process/tests/test_gaussian_process.py
267
6813
""" Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # Licence: BSD 3 clause from nose.tools import raises from nose.tools import assert_true import numpy as np from sklearn.gaussian_process import GaussianProcess from sklearn.gaussian_process ...
bsd-3-clause
hazelnusse/robot.bicycle
gui/rbg_plot_page.py
1
4805
""" Setup for Robot Bicycle GUI Plot Page. Oliver Lee (oliverzlee@gmail.com) 18 Feb 2013 """ import os import sys sys.path.append(os.path.join(os.getcwd(), "..", "common")) import math import sip from PyQt4 import QtCore, QtGui from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import Figur...
bsd-2-clause
dsquareindia/scikit-learn
sklearn/base.py
13
19725
"""Base classes for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import copy import warnings import numpy as np from scipy import sparse from .externals import six from .utils.fixes import signature from . import __version__ ###################################...
bsd-3-clause