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
Minhua722/NMF
egs/ar/local/ar_extract_nmf_feats.py
1
3850
#!/usr/bin/env python import cv2 import numpy as np import argparse import math import pickle from sklearn.decomposition import PCA from nmf_support import * import sys, os if __name__ == '__main__': #------------------------------------------------------ # Args parser #--------------------------------------...
apache-2.0
qPCR4vir/orange
Orange/projection/mds.py
6
14713
""" .. index:: multidimensional scaling (mds) .. index:: single: projection; multidimensional scaling (mds) ********************************** Multidimensional scaling (``mds``) ********************************** The functionality to perform multidimensional scaling (http://en.wikipedia.org/wiki/Multidimensional_...
gpl-3.0
maryklayne/Funcao
examples/intermediate/mplot3d.py
14
1261
#!/usr/bin/env python """Matplotlib 3D plotting example Demonstrates plotting with matplotlib. """ import sys from sample import sample from sympy import sin, Symbol from sympy.external import import_module def mplot3d(f, var1, var2, show=True): """ Plot a 3d function using matplotlib/Tk. """ im...
bsd-3-clause
rkmaddox/mne-python
examples/visualization/topo_compare_conditions.py
20
1828
""" ================================================= Compare evoked responses for different conditions ================================================= In this example, an Epochs object for visual and auditory responses is created. Both conditions are then accessed by their respective names to create a sensor layout...
bsd-3-clause
esatel/ADCPy
doc/source/conf.py
1
8929
# -*- coding: utf-8 -*- # # ADCpy documentation build configuration file, created by # sphinx-quickstart on Tue Oct 07 11:54:34 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 # autogenerated file. # # All...
mit
vdt/SimpleCV
SimpleCV/examples/util/ColorCube.py
13
1901
from SimpleCV import Image, Camera, Display, Color import pygame as pg import numpy as np from pylab import * from mpl_toolkits.mplot3d import axes3d from matplotlib.backends.backend_agg import FigureCanvasAgg import cv2 bins = 8 #precompute idxs = [] colors = [] offset = bins/2 skip = 255/bins for x in range(0,bins):...
bsd-3-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/mpl_toolkits/mplot3d/axis3d.py
7
17489
#!/usr/bin/python # axis3d.py, original mplot3d version by John Porter # Created: 23 Sep 2005 # Parts rewritten by Reinier Heeres <reinier@heeres.eu> from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import math import co...
mit
scottpurdy/NAB
tests/integration/corpus_test.py
10
4895
# ---------------------------------------------------------------------- # 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
NSLS-II-SRX/ipython_ophyd
profile_xf05id1-noX11/startup/85-bs_callbacks.py
1
3670
# -*- coding: utf-8 -*- """ Created on Wed Feb 24 12:30:06 2016 @author: xf05id1 """ from bluesky.callbacks import CallbackBase,LivePlot #import os #import time as ttime #from databroker import DataBroker as db, get_events #from databroker.databroker import fill_event import filestore.api as fsapi #from metadatasto...
bsd-2-clause
leon-adams/datascience
algorithms/hobfield.py
1
5247
# # Leon Adams # # Python Module for running a hopfield network to relocate the memory from a perturbed image. # The raw data set is represented in png image format. This code takes the three color channels (rgb) # Converts to a single channel gray scaled image and then transforms the output to a [-1,1] vector # for u...
mpl-2.0
lxsmnv/spark
examples/src/main/python/sql/arrow.py
13
3997
# # 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
dancingdan/tensorflow
tensorflow/examples/tutorials/input_fn/boston.py
76
2920
# 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
karvenka/sp17-i524
project/S17-IR-P014/code/delay.py
15
5276
import sys import csv import sip #import org.apache.log4j.{Level, Logger} import matplotlib #matplotlib.user('agg') import matplotlib.pyplot as plt plt.switch_backend('agg') from matplotlib import rcParams rcParams.update({'figure.autolayout': True}) from pyspark import SparkContext, SparkConf from datetime import date...
apache-2.0
Carnon/nlp
TextClassify/textclassify/textdata.py
1
2565
import os import codecs import re import jieba import numpy as np from tqdm import tqdm from tensorflow.contrib import learn from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import LabelEncoder class TextData(object): def __init__(self,args): self.args = args corpus_dir =...
apache-2.0
yarikoptic/NiPy-OLD
examples/neurospin/demo_dmtx.py
1
2005
""" test code to make a design matrix """ import numpy as np from nipy.neurospin.utils.design_matrix import dmtx_light tr = 1.0 frametimes = np.linspace(0,127*tr,128) conditions = [0,0,0,1,1,1,3,3,3] onsets=[30,70,100,10,30,90,30,40,60] hrf_model = 'Canonical' motion = np.cumsum(np.random.randn(128,6),0) add_reg_name...
bsd-3-clause
sarathid/Learning
Intro_to_ML/pca/eigenfaces.py
9
4989
""" =================================================== Faces recognition example using eigenfaces and SVMs =================================================== The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", aka LFW_: http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2...
gpl-3.0
lancezlin/ml_template_py
lib/python2.7/site-packages/pandas/tools/tests/test_util.py
7
16721
import os import locale import codecs import nose import numpy as np from numpy import iinfo import pandas as pd from pandas import (date_range, Index, _np_version_under1p9) import pandas.util.testing as tm from pandas.tools.util import cartesian_product, to_numeric CURRENT_LOCALE = locale.getlocale() LOCALE_OVERRID...
mit
rboyes/KerasScripts
CSVTrainer.py
1
5321
import os import datetime import sys import time import string import random import pandas as pd import numpy as np import gc if(len(sys.argv) < 2): print('Usage: CSVTrainer.py train.csv validation.csv model.h5 log.txt') sys.exit(1) trainingName = sys.argv[1] validationName = sys.argv[2] modelName = sys....
apache-2.0
DonBeo/statsmodels
statsmodels/graphics/tests/test_gofplots.py
27
6814
import numpy as np from numpy.testing import dec import statsmodels.api as sm from statsmodels.graphics.gofplots import qqplot, qqline, ProbPlot from scipy import stats try: import matplotlib.pyplot as plt import matplotlib have_matplotlib = True except ImportError: have_matplotlib = False class Ba...
bsd-3-clause
jolove/monmale
machineLearningLibrary.py
1
14267
#!/usr/bin/env python # -*- coding: utf-8 -*- from sklearn.cross_validation import train_test_split from sklearn import linear_model from sklearn import mixture from sklearn import metrics import logging import sys, traceback, os import uuid import psutil import getpass import usefulLibraryFiles # Libreria pr...
apache-2.0
jimsrc/seatos
mixed/figs/sheaths.paper/src/together4.py
1
11024
#!/usr/bin/env ipython from pylab import * import numpy as np import console_colors as ccl from scipy.io.netcdf import netcdf_file import os, sys import matplotlib.patches as patches import matplotlib.transforms as transforms from numpy import array from matplotlib.gridspec import GridSpec import matplotlib.pyplot as p...
mit
CleverChuk/ices
Python/multijob_module.py
1
3479
""" Author: Chukwubuikem Ume-Ugwa Email: chubiyke@gmail.com MIT License Copyright (c) 2017 CleverChuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limit...
mit
ZenDevelopmentSystems/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
TheGhostHuCodes/spy_dir
spy_dir.py
1
2182
#!/usr/bin/env python import os import os.path as pt import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import argparse #TODO: take decimal places as parameter for printing. def sizeof_pp(num): for unit in ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB']: if abs(num) < 1024....
apache-2.0
deepesch/scikit-learn
sklearn/datasets/lfw.py
141
19372
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
HolgerPeters/scikit-learn
sklearn/ensemble/gradient_boosting.py
5
73159
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
bsd-3-clause
0x0all/scikit-learn
examples/covariance/plot_covariance_estimation.py
250
5070
""" ======================================================================= Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood ======================================================================= When working with covariance estimation, the usual approach is to use a maximum likelihood estimator,...
bsd-3-clause
abimannans/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
dcastro9/patternrec_ps2
code/alcohol_script.py
1
5623
from Dataset import Dataset from WTA_Hasher import WTAHasher from kNN_Classifier import kNNClassifier import numpy as np import matplotlib.pyplot as plt import copy ds_train_dir = "../datasets/alcohol/alcoholism_training.csv" ds_test_dir = "../datasets/alcohol/alcoholism_test.csv" results_dir = "../final_results/alcoh...
mit
dhruv13J/scikit-learn
sklearn/tests/test_naive_bayes.py
142
17496
import pickle from io import BytesIO import numpy as np import scipy.sparse from sklearn.datasets import load_digits, load_iris from sklearn.cross_validation import cross_val_score, train_test_split from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_almost_equal from sklearn.utils.te...
bsd-3-clause
hagabbar/pycbc_copy
examples/distributions/spin_spatial_distr_example.py
14
1973
import numpy import matplotlib.pyplot as plt import pycbc.coordinates as co from mpl_toolkits.mplot3d import Axes3D from pycbc import distributions # We can choose any bounds between 0 and pi for this distribution but in units # of pi so we use between 0 and 1. theta_low = 0. theta_high = 1. # Units of pi for the bou...
gpl-3.0
zaxliu/deepnap
experiments/kdd-exps/experiment_DynaQNN_130_Feb10_2317.py
1
5180
# System built-in modules import time from datetime import datetime import sys import os from multiprocessing import Pool # Project dependency modules import pandas as pd pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment import lasagne # Project modules sys.path.append('...
bsd-3-clause
kedz/sumpy
sumpy/io.py
1
4037
import os import re import pandas as pd def load_duc_docset(input_source): docs = DucSgmlReader().read(input_source) return docs def load_duc_abstractive_summaries(input_source): models = DucAbstractSgmlReader().read(input_source) return models class FileInput(object): def gather_paths(self, sou...
apache-2.0
zzcclp/spark
python/pyspark/pandas/tests/test_groupby.py
14
118068
# # 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
AndrewBMartin/pygurobi
pygurobi/pygurobi.py
1
31972
""" Functions to support rapid interactive modification of Gurobi models. For reference on Gurobi objects such as Models, Variables, and Constraints, see http://www.gurobi.com/documentation/7.0/refman/py_python_api_overview.html. """ import csv import json try: import gurobipy as gp except ImportError: raise ...
mit
gtoonstra/airflow
airflow/hooks/base_hook.py
14
3184
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
bootphon/crossitlearn
simple_dnn.py
1
32993
""" A deep neural network with or w/o dropout in one file. """ import numpy import theano import sys import math from theano import tensor as T from theano import shared from theano.tensor.shared_randomstreams import RandomStreams from collections import OrderedDict BATCH_SIZE = 100 STACKSIZE = 69 def relu_f(vec): ...
mit
parthea/pydatalab
datalab/data/_csv.py
6
7063
# Copyright 2016 Google Inc. 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 applicable law or agreed ...
apache-2.0
vene/marseille
experiments/exp_rnn.py
1
5162
import os import dill import numpy as np from sklearn.model_selection import KFold from marseille.custom_logging import logging from marseille.datasets import get_dataset_loader, load_embeds from marseille.io import cache_fname from marseille.argrnn import ArgumentLSTM def argrnn_cv_score(dataset, dynet_weight_deca...
bsd-3-clause
soft-matter/mr
mr/tests/test_feature_saving.py
1
1721
import unittest import nose from numpy.testing import assert_almost_equal, assert_allclose from numpy.testing.decorators import slow from pandas.util.testing import (assert_series_equal, assert_frame_equal) import os from tempfile import NamedTemporaryFile import pandas as pd from pandas import DataFrame, Series imp...
gpl-3.0
eyadsibai/rep
tests/test_pybrain.py
3
3872
# Copyright 2014-2015 Yandex LLC and contributors <https://yandex.com/> # # 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...
apache-2.0
ybalgir/Quantop
Lec7.py
1
1822
import numpy as np import pandas as pd from statsmodels import regression import statsmodels.api as sm import matplotlib.pyplot as plt import math import pandas_datareader.data as web from datetime import datetime def Starter_Lec7(): start = datetime(2014, 1, 1) end = datetime(2015, 1, 1) asset = web.Da...
gpl-3.0
studywolf/pydmps
pydmps/dmp_rhythmic.py
1
5004
""" Copyright (C) 2013 Travis DeWolf This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope t...
gpl-3.0
fracturica/shardlib
shardlib/comp_analysis/SIMCompAnalysis.py
1
23592
import dataProcessing as dp import plotFuncs as pf import numpy as np from matplotlib.ticker import MultipleLocator, FormatStrFormatter from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA from matplotlib.path import Path from mpl_toolkits.mplot3d import Axes3D import matplotlib as mp...
mit
slarosa/QGIS
python/plugins/sextante/algs/MeanAndStdDevPlot.py
3
3304
# -*- coding: utf-8 -*- """ *************************************************************************** MeanAndStdDevPlot.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com ********************...
gpl-2.0
mne-tools/mne-tools.github.io
0.14/_downloads/plot_topo_compare_conditions.py
3
2175
""" ================================================= Compare evoked responses for different conditions ================================================= In this example, an Epochs object for visual and auditory responses is created. Both conditions are then accessed by their respective names to create a sensor layout...
bsd-3-clause
rupakc/Kaggle-Compendium
Santas Stolen Sleigh/SantaUtil.py
1
6924
# -*- coding: utf-8 -*- """ Created on Wed Jan 13 23:21:29 2016 Defines a set of utility functions to be used for prediction @author: Rupak Chakraborty """ import math from trip import Trip from gift import Gift import random import time import pandas as pd import operator RADIUS_EARTH = 6773 NORTH_POLE_LAT = 90 NOR...
mit
nesterione/scikit-learn
examples/cluster/plot_agglomerative_clustering.py
343
2931
""" Agglomerative clustering with and without structure =================================================== This example shows the effect of imposing a connectivity graph to capture local structure in the data. The graph is simply the graph of 20 nearest neighbors. Two consequences of imposing a connectivity can be s...
bsd-3-clause
shuangshuangwang/spark
python/pyspark/sql/tests/test_pandas_udf.py
1
10216
# # 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
kkouer/PcGcs
Lib/site-packages/numpy/core/code_generators/ufunc_docstrings.py
57
85797
# Docstrings for generated ufuncs docdict = {} def get(name): return docdict.get(name) def add_newdoc(place, name, doc): docdict['.'.join((place, name))] = doc add_newdoc('numpy.core.umath', 'absolute', """ Calculate the absolute value element-wise. Parameters ---------- x : array_like...
gpl-3.0
bdestombe/flopy-1
flopy/utils/mflistfile.py
1
25207
""" This is a set of classes for reading budget information out of MODFLOW-style listing files. Cumulative and incremental budgets are returned as numpy recarrays, which can then be easily plotted. """ import collections import os import re import sys from datetime import timedelta import numpy as np from ..utils.u...
bsd-3-clause
vermouthmjl/scikit-learn
examples/gaussian_process/plot_gpr_co2.py
131
5705
""" ======================================================== Gaussian process regression (GPR) on Mauna Loa CO2 data. ======================================================== This example is based on Section 5.4.3 of "Gaussian Processes for Machine Learning" [RW2006]. It illustrates an example of complex kernel engine...
bsd-3-clause
preprocessed-connectomes-project/quality-assessment-protocol
scripts/qap_check_output_csv.py
1
1302
#!/usr/bin/env python def main(): import os import argparse from qap.script_utils import check_csv_missing_subs, csv_to_pandas_df, \ write_inputs_dict_to_yaml_file, read_yml_file from qap.qap_utils import raise_smart_exception parser = argparse.ArgumentParser() parser.add_argument("o...
bsd-3-clause
Ttl/scikit-rf
skrf/io/general.py
3
22567
''' .. module:: skrf.io.general ======================================== general (:mod:`skrf.io.general`) ======================================== General io functions for reading and writing skrf objects .. autosummary:: :toctree: generated/ read read_all read_all_networks write write_all ...
bsd-3-clause
a113n/bcbio-nextgen
bcbio/rnaseq/sailfish.py
4
8177
import os from collections import namedtuple import pandas as pd from bcbio import utils import bcbio.pipeline.datadict as dd import bcbio.rnaseq.gtf as gtf from bcbio.distributed.transaction import file_transaction from bcbio.provenance import do from bcbio.utils import (file_exists, safe_makedir, is_gzipped, ...
mit
daleloogn/all-in-one
evaluation.py
2
2290
import argparse import numpy as np from sklearn.metrics import precision_score, recall_score, f1_score _ALL_ = ["random", "decision_trees", "linear_svm", "gaussian_naive_bayes"] def precision_recall_f1score(GT, Y_pred): precisions, recalls, f1scores = [], [], [] for i in range(GT.shape[0]): precisions.append(prec...
gpl-2.0
arahuja/scikit-learn
examples/calibration/plot_calibration_multiclass.py
272
6972
""" ================================================== Probability Calibration for 3-class classification ================================================== This example illustrates how sigmoid calibration changes predicted probabilities for a 3-class classification problem. Illustrated is the standard 2-simplex, wher...
bsd-3-clause
vshtanko/scikit-learn
examples/hetero_feature_union.py
288
6236
""" ============================================= Feature Union with Heterogeneous Data Sources ============================================= Datasets can often contain components of that require different feature extraction and processing pipelines. This scenario might occur when: 1. Your dataset consists of hetero...
bsd-3-clause
xzh86/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
google-research/google-research
learn_to_infer/run_ring.py
1
10211
# 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
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/numpy/lib/twodim_base.py
83
26903
""" Basic functions for manipulating 2d arrays """ from __future__ import division, absolute_import, print_function from numpy.core.numeric import ( asanyarray, arange, zeros, greater_equal, multiply, ones, asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal, ) from numpy.core import...
artistic-2.0
edonyM/emthesis
code/3point2plane.py
1
3545
#!/usr/bin/env python3 # -*- coding: utf-8 -*- r""" # .---. .----------- # / \ __ / ------ # / / \( )/ ----- (`-') _ _(`-') <-. (`-')_ # ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .-> # //// / // : : --- (,------...
mit
lgeiger/ide-python
lib/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydev_ipython/matplotlibtools.py
8
5428
import sys backends = {'tk': 'TkAgg', 'gtk': 'GTKAgg', 'wx': 'WXAgg', 'qt': 'Qt4Agg', # qt3 not supported 'qt4': 'Qt4Agg', 'qt5': 'Qt5Agg', 'osx': 'MacOSX'} # We also need a reverse backends2guis mapping that will properly choose which # GUI sup...
mit
zorojean/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py
221
5517
""" Testing for the gradient boosting loss functions and initial estimators. """ import numpy as np from numpy.testing import assert_array_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.utils import check_random_state from ...
bsd-3-clause
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py
18
26105
""" An experimental support for curvilinear grid. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import zip from itertools import chain from .grid_finder import GridFinder from .axislines import AxisArtistHelper, GridHelperB...
gpl-2.0
michaelhuang/QuantSoftwareToolkit
Examples/Basic/tutorial3.py
4
3612
''' (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 January, 24, 2013 @author: Sourabh Bajaj @contact: sourabhbajaj@gatech.edu @summary: Example tut...
bsd-3-clause
maxlikely/scikit-learn
sklearn/manifold/tests/test_spectral_embedding.py
6
8149
import warnings from nose.tools import assert_true from nose.tools import assert_equal from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_raises from nose.plugins.skip import SkipTest from sklea...
bsd-3-clause
LeSam/avoplot
src/avoplot/gui/analysis_tools.py
3
4491
#Copyright (C) Nial Peters 2013 # #This file is part of AvoPlot. # #AvoPlot is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at your option) any later version. # #AvoPlot is ...
gpl-3.0
stylianos-kampakis/scikit-learn
sklearn/mixture/gmm.py
68
31091
""" Gaussian Mixture Models. This implementation corresponds to frequentist (non-Bayesian) formulation of Gaussian Mixture Models. """ # Author: Ron Weiss <ronweiss@gmail.com> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Bertrand Thirion <bertrand.thirion@inria.fr> import warnings import numpy as...
bsd-3-clause
davidgbe/scikit-learn
sklearn/ensemble/voting_classifier.py
178
8006
""" Soft Voting/Majority Rule classifier. This module contains a Soft Voting/Majority Rule classifier for classification estimators. """ # Authors: Sebastian Raschka <se.raschka@gmail.com>, # Gilles Louppe <g.louppe@gmail.com> # # Licence: BSD 3 clause import numpy as np from ..base import BaseEstimator f...
bsd-3-clause
OTAkeys/RIOT
tests/pkg_utensor/generate_digit.py
19
1149
#!/usr/bin/env python3 """Generate a binary file from a sample image of the MNIST dataset. Pixel of the sample are stored as float32, images have size 28x28. """ import os import argparse import numpy as np import matplotlib.pyplot as plt import tensorflow as tf SCRIPT_DIR = os.path.dirname(os.path.realpath(__fil...
lgpl-2.1
abyssxsy/gnuradio
gr-utils/python/utils/plot_fft_base.py
53
10449
#!/usr/bin/env python # # Copyright 2007,2008,2011 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 ...
gpl-3.0
rfriesen/DR1_analysis
property_histograms.py
2
7527
from astropy.io import fits import aplpy import matplotlib.pyplot as plt import matplotlib.ticker as ticker import astropy.units as u import astropy.constants as c import warnings import numpy as np from astropy.visualization import hist from config import plottingDictionary """ Make histogram plots of NH3-derived prop...
mit
bsipocz/statsmodels
statsmodels/graphics/plot_grids.py
33
5711
'''create scatterplot with confidence ellipsis Author: Josef Perktold License: BSD-3 TODO: update script to use sharex, sharey, and visible=False see http://www.scipy.org/Cookbook/Matplotlib/Multiple_Subplots_with_One_Axis_Label for sharex I need to have the ax of the last_row when editing the earlier row...
bsd-3-clause
jereze/scikit-learn
benchmarks/bench_rcv1_logreg_convergence.py
149
7173
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import matplotlib.pyplot as plt import numpy as np import gc import time from sklearn.externals.joblib import Memory from sklearn.linear_model import (LogisticRegression, SGDClassifi...
bsd-3-clause
nhmc/LAE
cloudy/find_par.py
1
13374
from __future__ import division from math import log, sqrt, pi from barak.utilities import adict from barak.absorb import split_trans_name from barak.io import parse_config, loadobj from barak.interp import AkimaSpline, MapCoord_Interpolator from cloudy.utils import read_observed import numpy as np import os from glob...
mit
cloudera/ibis
ibis/backends/pandas/tests/conftest.py
1
1158
from pathlib import Path import pandas as pd import ibis import ibis.expr.operations as ops from ibis.backends.tests.base import BackendTest, RoundHalfToEven class TestConf(BackendTest, RoundHalfToEven): check_names = False additional_skipped_operations = frozenset({ops.StringSQLLike}) supported_to_time...
apache-2.0
seckcoder/lang-learn
python/sklearn/examples/covariance/plot_lw_vs_oas.py
4
2864
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotical optimal shrinkage parameter (minimizing a MSE criterion), yielding the ...
unlicense
jswanljung/iris
docs/iris/example_code/General/inset_plot.py
7
2357
""" Test Data Showing Inset Plots ============================= This example demonstrates the use of a single 3D data cube with time, latitude and longitude dimensions to plot a temperature series for a single latitude coordinate, with an inset plot of the data region. """ import matplotlib.pyplot as plt import nump...
lgpl-3.0
gviejo/ThalamusPhysio
python/main_make_MAPinfo.py
1
14284
#!/usr/bin/env python ''' File name: main_make_movie.py Author: Guillaume Viejo Date created: 09/10/2017 Python Version: 3.5.2 To make shank mapping ''' import numpy as np import pandas as pd # from matplotlib.pyplot import plot,show,draw import scipy.io from functions import * from pylab import * from skle...
gpl-3.0
piyush0609/scipy
scipy/spatial/tests/test__plotutils.py
71
1463
from __future__ import division, print_function, absolute_import from numpy.testing import dec, assert_, assert_array_equal try: import matplotlib matplotlib.rcParams['backend'] = 'Agg' import matplotlib.pyplot as plt has_matplotlib = True except: has_matplotlib = False from scipy.spatial import ...
bsd-3-clause
sgenoud/scikit-learn
sklearn/tests/test_base.py
4
3825
# Author: Gael Varoquaux # License: BSD import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from nose.tools import assert_true from nose.tools import assert_false from nose.tools import assert_equal from nose.tools import assert_raises from sklearn.base import BaseEstimator, clo...
bsd-3-clause
PatrickOReilly/scikit-learn
sklearn/tests/test_metaestimators.py
57
4958
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.pipeline import Pipeline...
bsd-3-clause
AlexanderFabisch/scikit-learn
examples/missing_values.py
71
3055
""" ====================================================== Imputing missing values before building an estimator ====================================================== This example shows that imputing the missing values can give better results than discarding the samples containing any missing value. Imputing does not ...
bsd-3-clause
russel1237/scikit-learn
sklearn/utils/tests/test_sparsefuncs.py
157
13799
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.datasets import make_classification from sklearn.utils.sparsefuncs import (mean_variance_axis, inplace_column_scale, ...
bsd-3-clause
yongfuyang/vnpy
vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/strategyBreakOut.py
22
11811
# encoding: UTF-8 """ This file tweaks ctaTemplate Module to suit multi-TimeFrame strategies. """ from ctaBase import * from ctaTemplate import CtaTemplate import numpy as np ######################################################################## class BreakOut(CtaTemplate): """ "infoArray" 字典是用来储存辅助品种信息的, ...
mit
hchim/stockanalyzer
simulator/TradeSimulator.py
1
4978
import pandas as pd import numpy as np from utils.webdata import get_close_of_symbols class TradeSimulator(object): def __init__(self, start_val=1000000, leverage=2.0, allow_short=True): """ Parameters ---------- start_val: float start value of the portfolio l...
mit
aflaxman/scikit-learn
sklearn/tests/test_learning_curve.py
33
12840
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_raises from sklearn.utils.testing import ...
bsd-3-clause
WillBrennan/DigitClassifier
DeepConv.py
1
8479
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Will Brennan' # Built-in Module import os import time import logging import warnings import cPickle as pickle from datetime import datetime # Standard Modules import numpy import sklearn import theano import theano.tensor as T # Custom Modules import Scripts...
bsd-2-clause
breeezzz/local-bitcoins-api
LocalBitcoins/market_depth.py
1
6253
''' Created on 7 Jun 2013 @author: Jamie ''' import urllib2 import math import re import itertools import argparse from bs4 import BeautifulSoup import matplotlib.pyplot as plt markets = {'UK': {'url': 'gb/united%20kingdom/', 'curr': 'GBP'}, 'USA': {'url': 'us/united%20states/', 'curr': 'USD'}, ...
mit
planetarymike/IDL-Colorbars
IDL_py_test/027_Eos_B.py
1
5942
from matplotlib.colors import LinearSegmentedColormap from numpy import nan, inf cm_data = [[1., 1., 1.], [1., 1., 1.], [0.498039, 0.498039, 0.498039], [0., 0., 0.513725], [0., 0., 0.533333], [0., 0., 0.54902], [0., 0., 0.564706], [0., 0., 0.580392], [0., 0., 0.6], [0., 0., 0.615686], [0., 0., 0.568627], [0., 0., 0.584...
gpl-2.0
williamleif/histwords
statutils/plothelper.py
2
5401
import matplotlib.pyplot as plt import numpy as np import scipy as sp def trendline(xd, yd, order=1, c='r', alpha=1, plot_r=False, text_pos=None): """Make a line of best fit""" #Calculate trendline coeffs = np.polyfit(xd, yd, order) intercept = coeffs[-1] slope = coeffs[-2] if order == 2: pow...
apache-2.0
c-PRIMED/puq
test/UniformPDF_test.py
1
4485
#! /usr/bin/env python ''' Testsuite for the UniformPDF class ''' from __future__ import absolute_import, division, print_function import numpy as np from puq import * import scipy.stats as stats def _hisplot(y, nbins): n, bins = np.histogram(y, nbins, normed=True) mids = bins[:-1] + np.diff(bins) / 2.0 ...
mit
aolindahl/streaking
process_hdf5.py
1
46151
# -*- coding: utf-8 -*- """ Created on Mon Jun 8 15:37:51 2015 @author: Anton O Lindahl """ import h5py import argparse import matplotlib.pyplot as plt import numpy as np import time import os import sys import lmfit import warnings from aolPyModules import wiener, wavelet_filter import time_to_energy_conversion as ...
gpl-2.0
TiKunze/CanMics
src/python/01_SingleChannel/3pop/EIN/HeHiVariation/RUM_Detektor_HeHi_2ndversion_cluster.py
1
5917
# -*- coding: utf-8 -*- """ Created on Mon Jun 22 17:15:03 2015 @author: Tim Kunze Copyright (C) 2015, Tim Kunze. All rights reserved. This script is a modified version of the RUM Detector: instead of sweeping over He and Hi in every diagram, we sweep over lenge and intensity of the impulse (as in the actiation p...
gpl-3.0
GitYiheng/reinforcement_learning_test
test00_previous_files/mountaincar_q_learning.py
1
4304
import gym import os import sys import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from gym import wrappers from datetime import datetime from sklearn.pipeline import FeatureUnion from sklearn.preprocessing import StandardScaler from sklearn.kernel_approximation...
mit
aemerick/galaxy_analysis
particle_analysis/sn_rate.py
1
9054
#import yt.mods as yt import yt import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np import glob __all__ = ['future_snr', 'snr'] _core_collapse_labels = ["SNII", "II", "2", "SN_II", "TypeII", "Type 2", "Type II", "type II", "typeII", 'core collapse'] _...
mit
CallaJun/hackprince
indico/matplotlib/tests/test_style.py
10
1977
from __future__ import (absolute_import, division, print_function, unicode_literals) import os import shutil import tempfile from contextlib import contextmanager import matplotlib as mpl from matplotlib import style from matplotlib.style.core import USER_LIBRARY_PATHS, STYLE_EXTENSION import...
lgpl-3.0
rhattersley/cartopy
lib/cartopy/tests/mpl/test_ticker.py
3
8574
# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
lgpl-3.0
gibiansky/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py
30
2249
# encoding: utf-8 # 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 r...
apache-2.0