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
nrhine1/scikit-learn
sklearn/datasets/twenty_newsgroups.py
126
13591
"""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
dingocuster/scikit-learn
examples/bicluster/bicluster_newsgroups.py
162
7103
""" ================================================================ Biclustering documents with the Spectral Co-clustering algorithm ================================================================ This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset. The 'comp.os.ms-windows...
bsd-3-clause
readevalprint/zipline
tests/test_utils.py
7
2173
# # Copyright 2013 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
Sandia2014/intrepid
ArrayOfDotProducts/generatePlots.py
1
18894
import math import os import sys import numpy import scipy import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.cm as cm import csv from mpl_toolkits.mplot3d import Axes3D from numpy import log10 prefix = 'data/ArrayOfDotProducts_' suffix = '_clearCache_sha...
mit
tmthydvnprt/pfcompute
pf/io.py
1
21872
""" io.py Input and Output functions. project : pf version : 0.0.0 status : development modifydate : createdate : website : https://github.com/tmthydvnprt/pf author : tmthydvnprt email : tim@tmthydvnprt.com maintainer : tmthydvnprt license : MIT copyright : Copyright 2016, tmthydvnprt credit...
mit
AnatolyPavlov/smart-battery-for-smart-energy-usage
src/price_data_London.py
1
1031
""" This script reads and transforms pricing data to pd.DataFrame as time-series""" import pandas as pd from datetime import timedelta # Custom Modules: from data_preprocessing import ExtractTimeSeries from auxiliary_functions import print_process def main(): df = pd.read_excel('../data/Tariffs.xlsx') df.loc...
gpl-3.0
ngoix/OCRF
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
jkoelker/python-tradeking
tradeking/api.py
1
11467
# -*- coding: utf-8 -*- import urllib.parse import requests_oauthlib as roauth import pandas as pd from tradeking import utils BASE_URL = 'https://api.tradeking.com/v1' _DATE_KEYS = ('date', 'datetime', 'divexdate', 'divpaydt', 'timestamp', 'pr_date', 'wk52hidate', 'wk52lodate', 'xdate') _FLOAT_KEYS ...
mit
warmspringwinds/scikit-image
skimage/io/tests/test_mpl_imshow.py
1
2822
from __future__ import division import numpy as np from skimage import io from skimage._shared._warnings import expected_warnings import matplotlib.pyplot as plt def setup(): io.reset_plugins() # test images. Note that they don't have their full range for their dtype, # but we still expect the display range to ...
bsd-3-clause
SmokinCaterpillar/pypet
pypet/tests/profiling/speed_analysis/avg_runtima_as_function_of_length.py
2
2266
__author__ = 'robert' from pypet import Environment, Trajectory from pypet.tests.testutils.ioutils import make_temp_dir, get_log_config import os import matplotlib.pyplot as plt import numpy as np import time def job(traj): traj.f_ares('$set.$', 42, comment='A result') def get_runtime(length): filename =...
bsd-3-clause
rohit21122012/DCASE2013
runs/2013/dnn_layerwise/bs1024/dnn_5layer/src/dataset.py
37
78389
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import urllib2 import socket import locale import zipfile import tarfile from sklearn.cross_validation import StratifiedShuffleSplit, KFold from ui import * from general import * from files import * class Dataset(object): """Dataset base class. The sp...
mit
chanceraine/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
AlexanderFabisch/scikit-learn
benchmarks/bench_isotonic.py
268
3046
""" 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 alows the scaling of the algorith...
bsd-3-clause
luo66/scikit-learn
examples/svm/plot_rbf_parameters.py
132
8096
''' ================== RBF SVM parameters ================== This example illustrates the effect of the parameters ``gamma`` and ``C`` of the Radial Basis Function (RBF) kernel SVM. Intuitively, the ``gamma`` parameter defines how far the influence of a single training example reaches, with low values meaning 'far' a...
bsd-3-clause
leal26/pyXFOIL
examples/2D/flight_conditions/convergence_study.py
2
4724
import pickle import numpy as np import pandas as pd import seaborn as sns from scipy import interpolate import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.metrics import pairwise_distances_argmin_min import aeropy.xfoil_module as xf from aeropy.aero_module import Reynolds from aeropy.geom...
mit
fmaguire/BayeHem
Spearmint/spearmint/tests/models/in_progress/gp.py
2
15806
# -*- coding: utf-8 -*- # Spearmint # # Academic and Non-Commercial Research Use Software License and Terms # of Use # # Spearmint is a software package to perform Bayesian optimization # according to specific algorithms (the “Software”). The Software is # designed to automatically run experiments (thus the code name ...
apache-2.0
rgommers/scipy
scipy/integrate/_ivp/ivp.py
21
27556
import inspect import numpy as np from .bdf import BDF from .radau import Radau from .rk import RK23, RK45, DOP853 from .lsoda import LSODA from scipy.optimize import OptimizeResult from .common import EPS, OdeSolution from .base import OdeSolver METHODS = {'RK23': RK23, 'RK45': RK45, 'DOP853': ...
bsd-3-clause
DailyActie/Surrogate-Model
01-codes/deap-master/examples/ga/nsga2.py
1
5078
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
mit
shikhardb/scikit-learn
sklearn/linear_model/tests/test_logistic.py
11
23587
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.util...
bsd-3-clause
Stargrazer82301/CAAPR
CAAPR/CAAPR_Main.py
1
4967
# Import smorgasbord import sys import os import gc import time import random #import warnings #warnings.filterwarnings('ignore') import matplotlib matplotlib.use('Agg') import multiprocessing as mp import CAAPR import CAAPR.CAAPR_IO import CAAPR.CAAPR_Pipeline import pdb # Define the function th...
mit
MicheleMaris/grasp_lib
grasp_lib.py
1
64897
__DESCRIPTION__=""" grasp_lib.py V 0.6 - 3 Feb 2012 - 23 Mar 2012 (0.4) - 2012 Nov 27 (0.5) - 2013 Dec 12 - M.Maris, M.Sandri, F.Villa From a set of routines created by M.Sandri e F.Villa This library allows to import a grasp file in GRASP format and to convert it in an healpix map, it also performs interpol...
gpl-2.0
elijah513/scikit-learn
examples/decomposition/plot_faces_decomposition.py
204
4452
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """...
bsd-3-clause
maminian/skewtools
scripts/animate_particles_2d_labframe_v2.py
1
1976
from numpy import * from matplotlib import pyplot import scripts.skewtools as st import sys X,Y,t,Pe = st.importDatasets(sys.argv[1],'X','Y','Time','Peclet') figscale = 5. fig,ax = pyplot.subplots(2,1,figsize=(4*figscale,1.5*figscale)) orig0 = ax[0].get_position() orig1 = ax[1].get_position() ax[0].set_position([o...
gpl-3.0
eramirem/astroML
book_figures/chapter10/fig_FFT_aliasing.py
3
5126
""" The effect of Sampling ---------------------- Figure 10.3 A visualization of aliasing in the Fourier transform. In each set of four panels, the top-left panel shows a signal and a regular sampling function, the top-right panel shows the Fourier transform of the signal and sampling function, the bottom-left panel s...
bsd-2-clause
amandalund/openmc
tests/regression_tests/mgxs_library_no_nuclides/test.py
6
2709
import hashlib import openmc import openmc.mgxs from openmc.examples import pwr_pin_cell from tests.testing_harness import PyAPITestHarness class MGXSTestHarness(PyAPITestHarness): def __init__(self, *args, **kwargs): # Generate inputs using parent class routine super().__init__(*args, **kwargs)...
mit
martin-sicho/MI_ADM
compound_db_utils/data_loaders.py
1
2695
import math import pandas from rdkit.Chem import PandasTools, Descriptors, MolFromSmiles from sqlalchemy.orm import sessionmaker import compound_db_utils.database as db from compound_db_utils import settings def _gather_columns(table, col_list): columns = [] for col in col_list: columns.append(getatt...
gpl-3.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
mit
Bismarrck/tensorflow
tensorflow/contrib/learn/python/learn/estimators/multioutput_test.py
136
1696
# 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
petercable/xray
xray/core/combine.py
1
15637
import warnings import pandas as pd from . import utils from .pycompat import iteritems, reduce, OrderedDict, basestring from .variable import Variable def concat(objs, dim=None, data_vars='all', coords='different', compat='equals', positions=None, indexers=None, mode=None, concat_over=None): ...
apache-2.0
geodynamics/burnman
examples/example_seismic_travel_times.py
2
9054
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU # GPL v2 or later. """ This example script produces an input files for travel time calculations in ObsPy, either by replacing one layer ...
gpl-2.0
huzq/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
23
2610
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== .. currentmodule:: sklearn Plot the decision boundaries of a :class:`~ensemble.VotingClassifier` for two features of the Iris dataset. Plot the class probabilit...
bsd-3-clause
beiko-lab/gengis
bin/Lib/site-packages/mpl_toolkits/axisartist/axislines.py
6
25977
""" Axislines includes modified implementation of the Axes class. The biggest difference is that the artists responsible to draw axis line, ticks, ticklabel and axis labels are separated out from the mpl's Axis class, which are much more than artists in the original mpl. Originally, this change was motivated to support...
gpl-3.0
PanDAWMS/panda-server
pandaserver/jobdispatcher/Protocol.py
1
16027
import re import json import base64 try: from urllib import urlencode except ImportError: from urllib.parse import urlencode from pandaserver.taskbuffer import EventServiceUtils from pandaserver.dataservice import DataServiceUtils # constants TimeOutToken = "TimeOut" NoJobsToken = "NoJobs" ########### status...
apache-2.0
giorgiop/scikit-learn
sklearn/datasets/tests/test_samples_generator.py
181
15664
from __future__ import division from collections import defaultdict from functools import partial import numpy as np import scipy.sparse as sp from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing imp...
bsd-3-clause
bsipocz/bokeh
bokeh/charts/builder/histogram_builder.py
43
9142
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Histogram class which lets you build your histograms just passing the arguments to the Chart class and calling the proper functions. """ #-------------------------------------------------------------...
bsd-3-clause
olologin/scikit-learn
sklearn/gaussian_process/gpc.py
42
31571
"""Gaussian processes classification.""" # Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # # License: BSD 3 clause import warnings from operator import itemgetter import numpy as np from scipy.linalg import cholesky, cho_solve, solve from scipy.optimize import fmin_l_bfgs_b from scipy.special import erf...
bsd-3-clause
apaleyes/mxnet
example/rcnn/rcnn/pycocotools/coco.py
17
18296
__author__ = 'tylin' __version__ = '2.0' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Pleas...
apache-2.0
MadsJensen/RP_scripts
skmodels_results.py
1
3022
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 14:50:08 2016 @author: mje """ import numpy as np import pandas as pd from sklearn.externals import joblib import mne import glob from my_settings import * labels = mne.read_labels_from_annot(subject="0008", parc="PALS_B12_Brodma...
bsd-3-clause
COSMOGRAIL/COSMOULINE
pipe/extrascripts/read_stat_rdbfiles.py
1
3050
import numpy as np import pickle as pkl import pycs, os import matplotlib.pyplot as plt import matplotlib as mpl mpl.rcParams['ps.fonttype'] = 42 mpl.rcParams['font.family'] = 'serif' mpl.rcParams['xtick.labelsize'] = 14 mpl.rcParams['ytick.labelsize'] = 14 rdb_list = [ "/Users/martin/Desktop/cosmograil-dr1/WFI_l...
gpl-3.0
uetke/experimentor
experimentor/drivers/hamamatsu/hamamatsu_camera.py
1
34446
# -*- coding: utf-8 -*- """ UUTrack.Controller.devices.hamamatsu.hamamatsu_camera.py ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ File taken from `ZhuangLab <https://github.com/ZhuangLab/storm-control>`_ A ctypes based interface to Hamamatsu cameras. (tested on a sCMOS Flash 4.0). ...
mit
kaichogami/sympy
sympy/plotting/plot_implicit.py
83
14400
"""Implicit plotting module for SymPy The module implements a data series called ImplicitSeries which is used by ``Plot`` class to plot implicit plots for different backends. The module, by default, implements plotting using interval arithmetic. It switches to a fall back algorithm if the expression cannot be plotted ...
bsd-3-clause
kjung/scikit-learn
examples/text/document_classification_20newsgroups.py
27
10521
""" ====================================================== Classification of text documents using sparse features ====================================================== This is an example showing how scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a scipy.spars...
bsd-3-clause
mne-tools/mne-tools.github.io
0.21/_downloads/6f20d729433c52851fc6a16e7531cf37/plot_compute_csd.py
20
3996
""" ================================================== Compute a cross-spectral density (CSD) matrix ================================================== A cross-spectral density (CSD) matrix is similar to a covariance matrix, but in the time-frequency domain. It is the first step towards computing sensor-to-sensor cohe...
bsd-3-clause
espenhgn/nest-simulator
doc/guides/spatial/user_manual_scripts/connections.py
5
20252
# -*- coding: utf-8 -*- # # connections.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
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/matplotlib/tests/test_backend_svg.py
5
5466
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np from io import BytesIO import xml.parsers.expat import matplotlib.pyplot as plt from matplotlib.testing.decorators import cleanup from matplotlib.testing.decorators import image_...
gpl-3.0
zfrenchee/pandas
pandas/core/apply.py
1
9002
import numpy as np from pandas import compat from pandas._libs import lib from pandas.core.dtypes.common import ( is_extension_type, is_sequence) from pandas.io.formats.printing import pprint_thing def frame_apply(obj, func, axis=0, broadcast=False, raw=False, reduce=None, args=(), **kwds): ...
bsd-3-clause
stack-of-tasks/sot-stabilizer
python/scripts/appli_two_hands_compensater.py
2
1608
# Launch it with py ../robotViewerLauncher.py +compensater.py +appli.py import sys import numpy as np import matplotlib.pyplot as pl import dynamic_graph as dg import dynamic_graph.signal_base as dgsb from math import sin from dynamic_graph.sot.application.stabilizer.compensater import * appli = HandCompensater(rob...
lgpl-3.0
markr622/moose
framework/scripts/memory_logger.py
20
43940
#!/usr/bin/env python from tempfile import TemporaryFile, SpooledTemporaryFile import os, sys, re, socket, time, pickle, csv, uuid, subprocess, argparse, decimal, select, platform class LLDB: def __init__(self): self.debugger = lldb.SBDebugger.Create() self.command_interpreter = self.debugger.GetCommandInter...
lgpl-2.1
phaustin/pyman
Book/chap8/sources/FitA.py
3
11175
"""Class for fitting data to y = a + bx""" import numpy as np import sys class FitLin: def __init__(self, x, y, dy=1.0): if isinstance(x, np.ndarray)==False: x = np.array(x) if isinstance(y, np.ndarray)==False: y = np.array(y) if isinstance(dy, np.ndarray)==False: ...
cc0-1.0
heli522/scikit-learn
examples/mixture/plot_gmm_selection.py
248
3223
""" ================================= Gaussian Mixture Model Selection ================================= This example shows that model selection can be performed with Gaussian Mixture Models using information-theoretic criteria (BIC). Model selection concerns both the covariance type and the number of components in th...
bsd-3-clause
mshakya/PyPiReT
piret/checks/dependencies.py
1
1596
#! /usr/bin/env python """Check design.""" from __future__ import print_function import sys from plumbum import local class CheckDependencies(): """Check if third party dependencies are in the path.""" def __init__(self, package): """Initialize.""" self.package = package # self.logge...
bsd-3-clause
PrashntS/scikit-learn
sklearn/metrics/classification.py
95
67713
"""Metrics to assess performance on classification task given classe prediction Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gram...
bsd-3-clause
robjstan/modelling-course
notebooks/python/f02.py
1
2889
# setup ipython environment from ipywidgets import interact, fixed # setup python environment import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') def plot_expm(r:(0,4,0.1)=1.1, n0=fixed(100)): nt = [r**t * n0 for t in range(10)] plt.figure(figsize=[9,4]) plt.plot(nt, lw=2) plt....
mit
ikaee/bfr-attendant
facerecognitionlibrary/jni-build/jni/include/tensorflow/examples/learn/text_classification_character_cnn.py
18
4289
# 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
rohit21122012/DCASE2013
runs/2016/baseline64/src/dataset.py
37
78389
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import urllib2 import socket import locale import zipfile import tarfile from sklearn.cross_validation import StratifiedShuffleSplit, KFold from ui import * from general import * from files import * class Dataset(object): """Dataset base class. The sp...
mit
IshankGulati/scikit-learn
examples/linear_model/plot_ransac.py
103
1797
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
shiquanwang/caffe
python/detect.py
25
5026
#!/usr/bin/env python """ detector.py is an out-of-the-box windowed detector callable from the command line. By default it configures and runs the Caffe reference ImageNet model. Note that this model was trained for image classification and not detection, and finetuning for detection can be expected to improve results...
bsd-2-clause
pratapvardhan/pandas
pandas/tests/tseries/test_frequencies.py
5
30953
from datetime import datetime, timedelta from pandas.compat import range import pytest import numpy as np from pandas import (Index, DatetimeIndex, Timestamp, Series, date_range, period_range) from pandas._libs.tslibs.frequencies import (_period_code_map, ...
bsd-3-clause
PredictiveScienceLab/GPy
GPy/examples/regression.py
8
18746
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) """ Gaussian Processes regression examples """ try: from matplotlib import pyplot as pb except: pass import numpy as np import GPy def olympic_marathon_men(optimize=True, plot=True): """Ru...
bsd-3-clause
ningchi/scikit-learn
sklearn/utils/validation.py
66
23629
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp from ..externals i...
bsd-3-clause
NDKoehler/DataScienceBowl2017_7th_place
dsb3/steps/include_nodule_distr.py
1
4656
import numpy as np import json from collections import OrderedDict from scipy.spatial import distance from numpy.linalg import eigh from matplotlib import pyplot as plt import sklearn.metrics import xgboost as xgb from .. import pipeline as pipe import numpy.random as random import sys import pandas as pd np.random.see...
mit
liyu1990/sklearn
sklearn/decomposition/tests/test_nmf.py
26
8544
import numpy as np from scipy import linalg from sklearn.decomposition import (NMF, ProjectedGradientNMF, non_negative_factorization) from sklearn.decomposition import nmf # For testing internals from scipy.sparse import csc_matrix from sklearn.utils.testing import assert_true from...
bsd-3-clause
Mendeley/mrec
mrec/tests/test_base_recommender.py
3
2137
try: import cPickle as pickle except ImportError: import pickle import tempfile import os import numpy as np from nose.tools import assert_less_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from mrec.tes...
bsd-3-clause
vortex-ape/scikit-learn
sklearn/decomposition/tests/test_fastica.py
10
9453
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats 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_less ...
bsd-3-clause
vacaciones/vacaciones
Quandl/organize_bonds_data.py
1
5194
# -*- coding: utf-8 -*- """ Created on Sat Aug 06 13:52:21 2016 @author: ialbuq01 """ #get brazillian bonds from debentures.com.br (anbima) import pandas as pd import pandas.io.data as web from string import maketrans import numpy as np from xlrd import open_workbook import pickle from re import sub from decimal im...
mit
brguez/TEIBA
src/python/sourceElement_validationSamples.py
1
13301
#!/usr/bin/env python #coding: utf-8 #### FUNCTIONS #### def header(string): """ Display header """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print '\n', timeInfo, "****", string, "****" def subHeader(string): """ Display subheader """ timeInfo = time.strftime("%Y-%m-%...
gpl-3.0
kshedstrom/pyroms
examples/Palau_HYCOM/remap.py
1
4890
import numpy as np import os try: import netCDF4 as netCDF except: import netCDF3 as netCDF import matplotlib.pyplot as plt import time from datetime import datetime from matplotlib.dates import date2num, num2date import pyroms import pyroms_toolbox import _remapping class nctime(object): pass def remap(src_...
bsd-3-clause
PeterRochford/SkillMetrics
skill_metrics/get_target_diagram_options.py
1
6350
def get_target_diagram_options(**kwargs): ''' Get optional arguments for target_diagram function. Retrieves the optional arguments supplied to the TARGET_DIAGRAM function as a variable-length keyword argument list (*KWARGS), and returns the values in an OPTION dictionary. Default values are ...
gpl-3.0
imperial-genomics-facility/data-management-python
igf_data/utils/tools/ppqt_utils.py
1
5010
import os,subprocess from shlex import quote import pandas as pd from igf_data.utils.fileutils import check_file_path, get_temp_dir,copy_local_file,remove_dir class Ppqt_tools: ''' A class for running Phantom quality control tools (PPQT) ''' def __init__(self,rscript_path,ppqt_exe,threads=1,use_ephemeral_space...
apache-2.0
simonsfoundation/CaImAn
demos/obsolete/1_1/demo_caiman_basic_1_1.py
2
6172
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Stripped demo for running the CNMF source extraction algorithm with CaImAn and evaluation the components. The analysis can be run either in the whole FOV or in patches. For a complete pipeline (including motion correction) check demo_pipeline.py Data courtesy of W. Ya...
gpl-2.0
timmie/cartopy
lib/cartopy/tests/mpl/test_gridliner.py
2
6239
# (C) British Crown Copyright 2011 - 2016, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
gpl-3.0
Clyde-fare/scikit-learn
examples/linear_model/plot_ols.py
220
1940
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
sandeepgupta2k4/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator.py
5
55283
# 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
mikebenfield/scikit-learn
examples/linear_model/plot_logistic.py
73
1568
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic function ========================================================= Shown in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or tw...
bsd-3-clause
bsipocz/ginga
examples/matplotlib/example1_mpl.py
1
5859
#! /usr/bin/env python # # example1_mpl.py -- Simple, configurable FITS viewer using a matplotlib # QtAgg backend for Ginga and embedded in a Qt program. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD li...
bsd-3-clause
laranea/trading-with-python
nautilus/nautilus.py
77
5403
''' Created on 26 dec. 2011 Copyright: Jev Kuznetsov License: BSD ''' from PyQt4.QtCore import * from PyQt4.QtGui import * from ib.ext.Contract import Contract from ib.opt import ibConnection from ib.ext.Order import Order import tradingWithPython.lib.logger as logger from tradingWithPython.lib.eve...
bsd-3-clause
blackecho/Deep-Learning-TensorFlow
yadlt/models/boltzmann/rbm.py
2
11013
"""Restricted Boltzmann Machine TensorFlow implementation.""" from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tqdm import tqdm from yadlt.core import Layers, Loss from yadlt.core import UnsupervisedModel from yadlt.utils import tf_utils, utilities...
mit
sergiohzlz/lectorcfdi
extrainfo.py
1
8345
#!/usr/bin/python #-*-coding:utf8-*- from bs4 import BeautifulSoup as Soup #import pandas as pd import glob import sys import re """ Version xml de cfdi 3.3 """ class CFDI(object): def __init__(self, f): """ Constructor que requiere en el parámetro una cadena con el nombre del cfdi. ...
apache-2.0
tlhr/plumology
plumology/io/hdf.py
1
7625
"""hdf - HDF5 wrappers and utilities""" from typing import (Any, Sequence, List, Mapping, Callable, Union, Optional) import h5py import numpy as np import pandas as pd from .rw import read_plumed_fields __all__ = ['plumed_to_h5', 'plumed_to_hdf', 'hdf_to_dataframe'] def plumed_to_hdf( ...
mit
PROSIC/prosic-evaluation
scripts/plot-concordance.py
1
4454
from itertools import product import matplotlib matplotlib.use("agg") from matplotlib import pyplot as plt import seaborn as sns import pandas as pd import common import numpy as np import math from matplotlib.lines import Line2D from matplotlib.colors import to_rgba class NotEnoughObservationsException(Exception): ...
mit
douglask3/UKESM_LandSurface_plotting
libs/plot_TS.py
1
1606
import iris import numpy as np import cartopy.crs as ccrs import iris.plot as iplt import matplotlib.pyplot as plt from pdb import set_trace as browser def grid_area(cube): if cube.coord('latitude').bounds is None: cube.coord('latitude').guess_bounds() cube.coord('longitude').guess_bounds() r...
gpl-3.0
henrykironde/scikit-learn
examples/applications/plot_species_distribution_modeling.py
254
7434
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
jia-kai/hearv
riesz/libriesz/analyze.py
1
13254
# -*- coding: utf-8 -*- # $File: analyze.py # $Date: Wed Jan 07 01:30:31 2015 +0800 # $Author: jiakai <jia.kai66@gmail.com> from .config import floatX from .utils import plot_val_with_fft, get_env_config import matplotlib.pyplot as plt import numpy as np from abc import ABCMeta, abstractmethod import logging logger ...
unlicense
reuk/wayverb
scripts/python/iterative_tetrahedral.py
2
4819
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np from numpy import sqrt import operator BASIC_CUBE = [(0, 0, 0), # 0 (0.5, 0, 0.5), # 1 (0.25, 0.25, 0.25), # 2 (0.75, 0.25, 0.75), # 3 (0, 0.5, 0.5), ...
gpl-2.0
dongjoon-hyun/spark
python/run-tests.py
15
13614
#!/usr/bin/env python3 # # 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 "L...
apache-2.0
dimkarakostas/rupture
etc/theory/experiments/rupture_performance/plot.py
4
2506
import matplotlib.pyplot as plt from collections import OrderedDict ''' # Divide&conquer adaptive (keeping only the last 2 known chars) on ruptureit, try 1 seconds = OrderedDict([ ('aes128cbc', [0, 11, 8, 5, 6, 6, 11]), # 47 ('aes128gcm', [0, 6, 8, 6, 5, 6, 7]), # 38 ('aes256cbc', [0, 7, 7, 5, 6, 6, 9]),...
mit
expectocode/telegram-analysis
venn_userlist.py
2
3908
#!/usr/bin/env python3 """ A program to plot the overlap of chats """ import argparse from json import loads import matplotlib.pyplot as plt from matplotlib_venn import venn2, venn3 def main(): """ main function """ parser = argparse.ArgumentParser( description="Visualise the overlap betwee...
mit
namvo88/Thesis-Quadrotor-Code
sw/tools/calibration/calibrate_gyro.py
87
4686
#! /usr/bin/env python # Copyright (C) 2010 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later ...
gpl-2.0
tonyqtian/quora-simi
test/scoreAvg.py
1
1458
''' Created on Jun 6, 2017 @author: tonyq ''' from pandas.io.parsers import read_csv from pandas.core.frame import DataFrame from time import strftime timestr = strftime("%Y%m%d-%H%M%S-") base = '../output/candi/' file_list = '20170604-165432-XGB_leaky.clean.csv,' + \ '20170605-112337-XGB_le...
mit
UWSEDS-aut17/uwseds-group-city-fynders
cityfynders/UI_setup.py
1
7055
import dash import dash_core_components as dcc import dash_html_components as html import pandas as pd def layout_setup(pairs): """ This function returns a layout of the user interface pairs: pairs is a two_dimensional list. The first is the columns from pandas data frame, the second is the rel...
mit
JudoWill/ResearchNotebooks
HIVSystemsBio.py
1
1296
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> from pandas import * import os, os.path import csv os.chdir('/home/will/HIVSystemsBio/') # <codecell> cocaine_genes = read_csv('CocaineGeneList.csv') hiv_genes = read_csv('HIVGeneList.csv', sep = '\t') biomart_conv = read_csv('mart_export.txt', sep = ...
mit
PatrickOReilly/scikit-learn
benchmarks/bench_sparsify.py
323
3372
""" Benchmark SGD prediction time with dense/sparse coefficients. Invoke with ----------- $ kernprof.py -l sparsity_benchmark.py $ python -m line_profiler sparsity_benchmark.py.lprof Typical output -------------- input data sparsity: 0.050000 true coef sparsity: 0.000100 test data sparsity: 0.027400 model sparsity:...
bsd-3-clause
sarahgrogan/scikit-learn
sklearn/datasets/tests/test_20news.py
280
3045
"""Test the 20news downloader, if the data is available.""" import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import SkipTest from sklearn import datasets def test_20news(): try: data = dat...
bsd-3-clause
cython-testbed/pandas
pandas/tests/arrays/categorical/test_operators.py
4
11785
# -*- coding: utf-8 -*- import pytest import pandas as pd import numpy as np import pandas.util.testing as tm from pandas import Categorical, Series, DataFrame, date_range from pandas.tests.arrays.categorical.common import TestCategorical class TestCategoricalOpsWithFactor(TestCategorical): def test_categorie...
bsd-3-clause
madgik/exareme
Exareme-Docker/src/mip-algorithms/CART/step/3/local.py
1
2268
from __future__ import division from __future__ import print_function import sys from os import path from argparse import ArgumentParser import pandas as pd import numpy as np sys.path.append(path.dirname(path.dirname(path.dirname(path.dirname(path.abspath(__file__))))) + '/utils/') sys.path.append(path.dir...
mit
mhue/scikit-learn
examples/decomposition/plot_sparse_coding.py
247
3846
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
P1R/cinves
TrabajoFinal/PortadoraVariableModuladaFija/AM/TvsFrqRate-AM.py
1
1245
import numpy as np import matplotlib.pyplot as plt ''' La Frecuencia Base es de 50 Hz y las variaciones en frecuencia de rate de 30 a 200 este ejemplo es con un pawn de 50% en AM. para este experimento los valores son: tiempo de medicion: 2 minutos voltaje de generador: 0.3 volts tubo de prueba: cobre 350 cm SIN...
apache-2.0
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/pandas/tests/test_msgpack/test_except.py
15
1043
#!/usr/bin/env python # coding: utf-8 import unittest import nose import datetime from pandas.msgpack import packb, unpackb class DummyException(Exception): pass class TestExceptions(unittest.TestCase): def test_raise_on_find_unsupported_value(self): import datetime self.assertRaises(TypeEr...
artistic-2.0
legacysurvey/pipeline
py/legacyanalysis/check-fracflux.py
1
3198
import matplotlib matplotlib.use('Agg') import pylab as plt import numpy as np from tractor import * from tractor.galaxy import * from astrometry.util.util import * from astrometry.util.fits import * from astrometry.util.plotutils import * from legacypipe.runbrick import _compute_source_metrics if __name__ == '__mai...
gpl-2.0
DIRACGrid/DIRAC
src/DIRAC/Core/Utilities/Graphs/GraphData.py
2
17470
""" GraphData encapsulates input data for the DIRAC Graphs plots The DIRAC Graphs package is derived from the GraphTool plotting package of the CMS/Phedex Project by ... <to be added> """ from __future__ import print_function from __future__ import absolute_import from __future__ import division __RCSID__ = ...
gpl-3.0