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
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/examples/model_selection/grid_search_digits.py
1
2672
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.model_selection.GridS...
mit
upliftaero/mavlink
pymavlink/tools/mavgpslag.py
43
3446
#!/usr/bin/env python ''' calculate GPS lag from DF log ''' import sys, time, os from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--plot", action='store_true', default=False, help="plot errors") parser.add_argument("--minspeed", type=float, default=6, help="minimu...
lgpl-3.0
fivejjs/crosscat
crosscat/starcluster_plugin.py
1
2737
#!python # # Copyright (c) 2010-2014, MIT Probabilistic Computing Project # # Lead Developers: Dan Lovell and Jay Baxter # Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka # Research Leads: Vikash Mansinghka, Patrick Shafto # # Licensed under the Apache License, Version 2.0 (the "License"); # ...
apache-2.0
HyukjinKwon/spark
python/pyspark/pandas/tests/test_ops_on_diff_frames.py
14
74918
# # 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
Jorge-C/bipy
doc/sphinxext/numpydoc/numpydoc/tests/test_docscrape.py
39
18326
# -*- encoding:utf-8 -*- from __future__ import division, absolute_import, print_function import sys, textwrap from numpydoc.docscrape import NumpyDocString, FunctionDoc, ClassDoc from numpydoc.docscrape_sphinx import SphinxDocString, SphinxClassDoc from nose.tools import * if sys.version_info[0] >= 3: sixu = la...
bsd-3-clause
emilopez/titi
titiQt/sacd/visualization.py
1
4127
# -*- encoding: utf8 -*- import numpy as np import os #import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import processing def generateMap(maptype,level,textEdit): """ Función que genera el mapa planisferio del mundo Utilizando el parámetro maptype se genera el mapamundi. Dependie...
gpl-3.0
qrsforever/workspace
python/learn/thinkstats/estimate.py
1
3306
#!/usr/bin/python3 # -*- coding: utf-8 -*- """This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import math import matplotlib.pyplot as pyplot import myplot import Pmf import ...
mit
stulp/dmpbbo
demos_python/dmp/demoTrainDmp.py
1
3240
# This file is part of DmpBbo, a set of libraries and programs for the # black-box optimization of dynamical movement primitives. # Copyright (C) 2018 Freek Stulp # # DmpBbo 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...
lgpl-2.1
OPM/ResInsight
ThirdParty/Ert/python/ecl/summary/ecl_sum_vector.py
2
9806
# Copyright (C) 2017 Equinor ASA, Norway. # # This file is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 ...
gpl-3.0
rahul-c1/scikit-learn
sklearn/utils/estimator_checks.py
3
35097
from __future__ import print_function import warnings import sys import traceback import inspect import pickle import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from skle...
bsd-3-clause
jbloomlab/dms_tools
tests/test_merge_diffsel.py
1
2487
"""Tests merging of differential selection by ``dms_merge`` program. Written by Jesse Bloom.""" import sys import os import unittest import subprocess import numpy import pandas class TestMergeCounts(unittest.TestCase): """Runs ``dms_merge`` on test data to average differential selection values. """ d...
gpl-3.0
cbertinato/pandas
pandas/tests/reshape/merge/test_merge_index_as_string.py
7
5670
import numpy as np import pytest from pandas import DataFrame from pandas.util.testing import assert_frame_equal @pytest.fixture def df1(): return DataFrame(dict( outer=[1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4], inner=[1, 2, 3, 1, 2, 3, 4, 1, 2, 1, 2], v1=np.linspace(0, 1, 11))) @pytest.fixture...
bsd-3-clause
slinderman/pyhsmm_spiketrains
experiments/make_figure6.py
1
5868
""" Plot the MCMC samples for the hippocampal dataset. """ import os import cPickle import gzip from collections import namedtuple import numpy as np from scipy.io import loadmat import matplotlib matplotlib.rcParams.update({'axes.labelsize': 9, 'xtick.labelsize' : 9, ...
mit
fabianp/scikit-learn
sklearn/gaussian_process/tests/test_gpr.py
28
11870
"""Testing for Gaussian process regression """ # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Licence: BSD 3 clause import numpy as np from scipy.optimize import approx_fprime from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels \ import RBF, Constan...
bsd-3-clause
ehealthafrica-ci/onadata
onadata/apps/viewer/tests/test_exports.py
2
92916
import csv import datetime import json import os import shutil import StringIO import tempfile from time import sleep import zipfile from django.conf import settings from django.core.files.storage import get_storage_class from django.core.files.temp import NamedTemporaryFile from django.core.urlresolvers import revers...
bsd-2-clause
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/manifold/plot_manifold_sphere.py
258
5101
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
johnmgregoire/NanoCalorimetry
lockinmath2b.py
1
5306
import numpy, h5py, pylab from PnSC_h5io import * import scipy.optimize from matplotlib.ticker import FuncFormatter def myexpformat(x, pos): for ndigs in range(5): lab=(('%.'+'%d' %ndigs+'e') %x).replace('e+0','e').replace('e+','e').replace('e0','').replace('e-0','e') if eval(lab)==x: r...
bsd-3-clause
henrykironde/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
142
4761
""" =================================== Compare cross decomposition methods =================================== Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with multivariate response, a.k.a. PLS2 - PLSRegression, with univariate response, a.k.a. PLS1 - CCA Given 2 multivari...
bsd-3-clause
JFriel/honours_project
networkx/examples/multigraph/chess_masters.py
34
5104
#!/usr/bin/env python """ An example of the MultiDiGraph clas The function chess_pgn_graph reads a collection of chess matches stored in the specified PGN file (PGN ="Portable Game Notation") Here the (compressed) default file --- chess_masters_WCC.pgn.bz2 --- contains all 685 World Chess Championship matches from 1...
gpl-3.0
imatge-upc/saliency
shallow/preprocessing.py
2
4846
from lasagne import layers from lasagne.updates import nesterov_momentum from nolearn.lasagne import NeuralNet,BatchIterator import os import numpy as np from sklearn.utils import shuffle import cPickle as pickle import matplotlib.pyplot as plt import Image import ImageOps from scipy import misc import scipy.io import ...
mit
kursawe/MCSTracker
paper/Figures/initial_mapping_figure/make_initial_mapping_plot.py
1
4143
# Copyright 2016 Jochen Kursawe. See the LICENSE file at the top-level directory # of this distribution and at https://github.com/kursawe/MCSTracker/blob/master/LICENSE. import tracking import networkx as nx import matplotlib as mpl import matplotlib.pyplot as plt from os import path from os.path import dirname impor...
bsd-3-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/core/groupby.py
9
140196
import types from functools import wraps import numpy as np import datetime import collections import warnings import copy from pandas.compat import( zip, builtins, range, long, lzip, OrderedDict, callable, filter, map ) from pandas import compat from pandas.core.base import PandasObject from pandas.core.cate...
gpl-2.0
fspaolo/scikit-learn
examples/decomposition/plot_pca_vs_lda.py
8
1721
""" ======================================================= Comparison of LDA and PCA 2D projection of Iris dataset ======================================================= The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour and Virginica) with 4 attributes: sepal length, sepal width, petal length a...
bsd-3-clause
equialgo/scikit-learn
sklearn/metrics/cluster/tests/test_bicluster.py
394
1770
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
bsd-3-clause
Ziqi-Li/bknqgis
pandas/pandas/tests/io/test_clipboard.py
13
4988
# -*- coding: utf-8 -*- import numpy as np from numpy.random import randint from textwrap import dedent import pytest import pandas as pd from pandas import DataFrame from pandas import read_clipboard from pandas import get_option from pandas.util import testing as tm from pandas.util.testing import makeCustomDatafra...
gpl-2.0
ofgulban/scikit-image
doc/examples/transform/plot_matching.py
21
5132
""" ============================ Robust matching using RANSAC ============================ In this simplified example we first generate two synthetic images as if they were taken from different view points. In the next step we find interest points in both images and find correspondences based on a weighted sum of squ...
bsd-3-clause
kunwon1/kunwon1-evecentral
periodic/market_dump.py
1
2574
#import pylab #import matplotlib #import matplotlib.text #import matplotlib.dates import psycopg import sys from mx.DateTime import * import datetime import pickle from numpy import * sys.path.append('../lib/') from evecentral import display #import evec_func db = psycopg.connect(database='evec', user='evec', host ...
agpl-3.0
jmetzen/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
127
7477
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sklearn/feature_selection/tests/test_rfe.py
4
3061
""" Testing Recursive feature elimination """ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_equal from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris from sklearn.metrics import ...
agpl-3.0
tmhm/scikit-learn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
chrishokamp/lxmls-toolkit
lxmls/sequences/confusion_matrix.py
5
4337
import sys import numpy as np from lxmls.util.my_math_utils import * from itertools import izip import operator import pdb ## Colour for each pos tag tag_colors = { 'ADV':'Fuchsia', 'NOUN':'ForestGreen', 'ADP':'Blue', 'PRON':'DarkGreen', 'DET':'Khaki', '.':'Black', 'PRT':'LightGrey', 'N...
mit
david-ragazzi/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/_cm.py
70
375423
""" Color data and pre-defined cmap objects. This is a helper for cm.py, originally part of that file. Separating the data (this file) from cm.py makes both easier to deal with. Objects visible in cm.py are the individual cmap objects ('autumn', etc.) and a dictionary, 'datad', including all of these objects. """ im...
gpl-3.0
Microsoft/hummingbird
tests/test_sklearn_imputer_converter.py
1
3374
""" Tests sklearn Imputers: MissingIndicator and SimpleImputer """ import unittest import warnings import numpy as np import torch from sklearn.impute import MissingIndicator, SimpleImputer try: from sklearn.preprocessing import Imputer except ImportError: # Imputer was deprecate in sklearn >= 0.22 Imput...
mit
emmdim/guifiAnalyzer
proxies/squidparser/squidparser.py
1
3887
""" This module implements the backend class that communicates with MongoDB for the database that stores all the collected SQUID logs. """ from guifiAnalyzer.lib.squidlog.squidlog import SquidLog import pandas as pd import datetime import os import fnmatch from urlparse import urlparse from tldextract import extrac...
gpl-3.0
Srisai85/scikit-learn
examples/linear_model/plot_ridge_path.py
254
1655
""" =========================================================== Plot Ridge coefficients as a function of the regularization =========================================================== Shows the effect of collinearity in the coefficients of an estimator. .. currentmodule:: sklearn.linear_model :class:`Ridge` Regressi...
bsd-3-clause
mikeireland/pfi
pfi/snr_back_of_envelope.py
1
8587
""" 24.1 to 24.8 microns is Q Hi-5: snr.maglim([3.5,4.1], [290], diam=8, eta_c=0.4, eta_w=0.25, t_int=3600, snr=5, n_tel=4) """ #bp=[3.3,4.2] #"{0:5.1f} & {1:5.1f} & {2:5.1f}".format(maglim(bp,280),maglim(bp,270),maglim(bp,220)) from __future__ import division, print_function import numpy as np import scipy.optimiz...
mit
ningchi/scikit-learn
examples/bicluster/plot_spectral_coclustering.py
276
1736
""" ============================================== A demo of the Spectral Co-Clustering algorithm ============================================== This example demonstrates how to generate a dataset and bicluster it using the the Spectral Co-Clustering algorithm. The dataset is generated using the ``make_biclusters`` f...
bsd-3-clause
equialgo/scikit-learn
sklearn/cluster/dbscan_.py
24
12278
# -*- coding: utf-8 -*- """ DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ # Author: Robert Layton <robertlayton@gmail.com> # Joel Nothman <joel.nothman@gmail.com> # Lars Buitinck # # License: BSD 3 clause import numpy as np from scipy import sparse from ..base import BaseEst...
bsd-3-clause
optimizers/nlpy
nlpy/tools/nlpy_pprof2.py
3
1315
#!/usr/bin/env python # Main driver for performance profiles. from nlpy import __version__ from nlpy.tools.pprof2 import PerformanceProfile from optparse import OptionParser import matplotlib.pyplot as plt import sys usage_msg = """%prog [options] file1 file2 [... fileN] where file1 through fileN contain the statisti...
gpl-3.0
bert9bert/statsmodels
statsmodels/tsa/statespace/tools.py
1
67506
""" Statespace Tools Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np from scipy.linalg import solve_sylvester import pandas as pd from statsmodels.tools.data import _is_using_pandas import warnings compatibility_mode = False has_tr...
bsd-3-clause
JuliaSprenger/python-neo
neo/test/iotest/test_klustakwikio.py
3
14964
""" Tests of neo.io.klustakwikio """ import glob import os.path import sys import tempfile import unittest import numpy as np import quantities as pq import neo from neo.test.iotest.common_io_test import BaseTestIO from neo.test.tools import assert_arrays_almost_equal from neo.io.klustakwikio import KlustaKwikIO, H...
bsd-3-clause
samzhang111/scikit-learn
sklearn/preprocessing/__init__.py
268
1319
""" The :mod:`sklearn.preprocessing` module includes scaling, centering, normalization, binarization and imputation methods. """ from ._function_transformer import FunctionTransformer from .data import Binarizer from .data import KernelCenterer from .data import MinMaxScaler from .data import MaxAbsScaler from .data ...
bsd-3-clause
chillpop/RELAX-HARDER
effects/drifters.py
1
5902
import colorsys import matplotlib.colors import numpy import random import scipy.interpolate import time from base import EffectLayer, HeadsetResponsiveEffectLayer class ColorDrifterLayer(EffectLayer): """ Interpolates between colors in a color list. Adds those values to the values already in the frame....
mit
Windy-Ground/scikit-learn
sklearn/datasets/base.py
196
18554
""" 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 shutil from os import environ from os.pa...
bsd-3-clause
mbrucher/AudioTK
tests/Python/Tools/PyATKTools_Oversampling_test.py
1
6593
#!/usr/bin/env python from nose.tools import raises def Oversampling_2_test(): import numpy as np from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter from ATK.Tools import DoubleOversampling6points5order_2Filter from numpy.testing import assert_almost_equal ref = np.sin(np.arange(2000, ...
bsd-3-clause
cbweaver/stockscan
scans/sto_best_mean_diff.py
1
2364
#!/usr/bin/python # -*- coding: utf-8 -*- import logbook, configparser, os #import matplotlib.pyplot as plt import sqlite3 as sql import numpy as np config = configparser.ConfigParser() config.read(os.getcwd()+"/config.ini") log_handler = logbook.FileHandler(config['DEBUG']['log_fpath']) with log_handler.applicatio...
gpl-2.0
arteria-project/arteria-bcl2fastq
bcl2fastq/lib/illumina.py
3
4258
from pandas import read_csv class SampleRow: """ Provides a representation of the information presented in a Illumina Samplesheet. Different samplesheet types (e.g. HiSeq, MiSeq, etc) will provide slightly different information for each sample. This class aims at providing a interface to this that wil...
mit
yaroslavvb/tensorflow
tensorflow/examples/learn/text_classification_cnn.py
53
4430
# 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
massgame/Mohr_Envelope
mohr.py
1
3479
from scipy import stats import matplotlib.pyplot as plt import numpy as np import csv,sys class Read(): def __init__(self, promptFileName): self.fileName = promptFileName def readCsv(self): stress_Minor = [] #Minor stress stress_Major = [] #Major stress with open(self.fileName, newline='') as f: reader ...
gpl-3.0
iamjakob/lumiCalc
LumiDB/python/mpl_axes_hist_fix.py
1
15419
# This is the fix for a well-known bug in Matplotlib's # axes.Axes.hist() method for stepfilled histograms with a logarithmic # axis. The actual fix (see below) is quite small. # This is used by the create_public_lumi_plots.py script. import numpy as np import itertools import matplotlib.cbook as cbook iterable = cbo...
apache-2.0
nelson-liu/scikit-learn
examples/svm/plot_svm_regression.py
120
1520
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
bsd-3-clause
AIML/scikit-learn
sklearn/datasets/tests/test_lfw.py
230
7880
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by running the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging ...
bsd-3-clause
ahhda/sympy
examples/intermediate/sample.py
107
3494
""" Utility functions for plotting sympy functions. See examples\mplot2d.py and examples\mplot3d.py for usable 2d and 3d graphing functions using matplotlib. """ from sympy.core.sympify import sympify, SympifyError from sympy.external import import_module np = import_module('numpy') def sample2d(f, x_args): """ ...
bsd-3-clause
CVML/scikit-learn
sklearn/utils/arpack.py
265
64837
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
bsd-3-clause
drammock/mnefun
mnefun/externals/tabulate.py
11
38661
# -*- coding: utf-8 -*- """Pretty-print tabular data.""" from __future__ import print_function from __future__ import unicode_literals from collections import namedtuple from platform import python_version_tuple import re if python_version_tuple()[0] < "3": from itertools import izip_longest from functools ...
bsd-3-clause
SnippyHolloW/speech_embeddings
emb_from_ab_dist.py
2
6973
"""Learn embeddings that mimic ABX distances. speech features -> weights matrix + non-linearity -> E(X) x W (+ b) T.nnet.simoid Loss L for one X: L = 0 for all X' in examples: L += dist_{emb}(X, X') - dist_{ABX}(X, X') """ import theano, time, pandas, sys, os, h5fea...
mit
sshleifer/object_detection_kitti
cognitive_mapping_and_planning/scripts/script_plot_trajectory.py
9
12900
# 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 applicab...
apache-2.0
rafaelmds/fatiando
gallery/gravmag/euler_moving_window.py
7
3054
""" .. _gallery_euler_mw: Euler deconvolution with a moving window ---------------------------------------- Euler deconvolution attempts to estimate the coordinates of simple (idealized) sources from the input potential field data. There is a strong assumption that the sources have simple geometries, like spheres, ve...
bsd-3-clause
fengzhyuan/scikit-learn
sklearn/tests/test_common.py
127
7665
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
bsd-3-clause
vivekmishra1991/scikit-learn
sklearn/linear_model/setup.py
146
1713
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('linear_model', parent_package, top_path) cblas_libs, blas_info = get_blas_info...
bsd-3-clause
Refefer/pylearn2
pylearn2/scripts/plot_monitor.py
3
9143
#!/usr/bin/env python """ usage: plot_monitor.py model_1.pkl model_2.pkl ... model_n.pkl Loads any number of .pkl files produced by train.py. Extracts all of their monitoring channels and prompts the user to select a subset of them to be plotted. """ from __future__ import print_function __authors__ = "Ian Goodfell...
bsd-3-clause
rsivapr/scikit-learn
examples/neighbors/plot_regression.py
8
1381
""" ============================ Nearest Neighbors regression ============================ Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpolation of the target using both barycenter and constant weights. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@...
bsd-3-clause
lheagy/casingSimulations
casingSimulations/sources.py
2
32188
import numpy as np import matplotlib.pyplot as plt import os import properties import discretize from discretize.utils import closestPoints from SimPEG.utils import setKwargs from SimPEG.electromagnetics import frequency_domain as fdem from SimPEG.electromagnetics import time_domain as tdem from .base import Loadabl...
mit
zhouyejoe/spark
python/pyspark/sql/dataframe.py
3
90689
# # 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
xuewei4d/scikit-learn
examples/decomposition/plot_image_denoising.py
24
5878
""" ========================================= Image denoising using dictionary learning ========================================= An example comparing the effect of reconstructing noisy fragments of a raccoon face image using firstly online :ref:`DictionaryLearning` and various transform methods. The dictionary is fi...
bsd-3-clause
datapolitan/lede_algorithms
class4_1/doc_classifier.py
1
1664
from sklearn import preprocessing ########## FEATURES ########## # Put your features here ########## MAIN ########## if __name__ == '__main__': # First we'll do some preprocessing to create our two vectors for model training: features, which # represents the feature vector, and labels, which represent our...
gpl-2.0
ftuyama/TEEG
ai/model.py
2
10213
import numpy as n from sklearn import svm, preprocessing from sklearn.metrics import accuracy_score, confusion_matrix from sklearn.neighbors import KNeighborsClassifier import matplotlib.pyplot as graph import random import skflow import sys kind = ["raw", "spec"][1] default = ["svm", "k", "dnn"][0] #actions = ["idle"...
mit
datamindedbe/train-occupancy
delay/model.py
1
2275
import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.externals import joblib from sklearn.feature_selection import SelectKBest from sklearn.metrics import confusion_matrix from sklearn.pipeline import Pipeline from sklearn.preprocessing import Imputer from sqlalchemy i...
apache-2.0
yyjiang/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
aaltay/beam
sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py
3
4489
# # 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
RRShieldsCutler/clusterpluck
clusterpluck/wrappers/shofun.py
1
3156
#!/usr/bin/env Python import argparse import sys import os import pandas as pd from clusterpluck.wrappers.run_shogun import run_shogun from clusterpluck.scripts.otu_x_ofu import match_tables from clusterpluck.scripts.otu_x_ofu import multiply_tables from multiprocessing import cpu_count # The arg parser def make_arg...
mit
astro4dev/OAD-Data-Science-Toolkit
Teaching Materials/Machine Learning/Supervised Learning/Courses/sklearn_tutorial/notebooks/fig_code/ML_flow_chart.py
61
4970
""" Tutorial Diagrams ----------------- This script plots the flow-charts used in the scikit-learn tutorials. """ import numpy as np import pylab as pl from matplotlib.patches import Circle, Rectangle, Polygon, Arrow, FancyArrow def create_base(box_bg = '#CCCCCC', arrow1 = '#88CCFF', ...
gpl-3.0
mne-tools/mne-tools.github.io
dev/_downloads/f58ab3a8ed9d8dd4a9f0d114ff670e86/mne_inverse_label_connectivity.py
6
7480
""" ========================================================================= Compute source space connectivity and visualize it using a circular graph ========================================================================= This example computes the all-to-all connectivity between 68 regions in source space based on...
bsd-3-clause
hainm/scikit-learn
examples/linear_model/plot_logistic_l1_l2_sparsity.py
384
2601
""" ============================================== L1 Penalty and Sparsity in Logistic Regression ============================================== Comparison of the sparsity (percentage of zero coefficients) of solutions when L1 and L2 penalty are used for different values of C. We can see that large values of C give mo...
bsd-3-clause
rolando/ClickSecurity-data_hacking
dga_detection/dga_model_gen.py
6
13951
''' Build models to detect Algorithmically Generated Domain Names (DGA). We're trying to classify domains as being 'legit' or having a high probability of being generated by a DGA (Dynamic Generation Algorithm). We have 'legit' in quotes as we're using the domains in Alexa as the 'legit' set. ''' import o...
mit
adykstra/mne-python
examples/preprocessing/plot_find_ecg_artifacts.py
10
1296
""" ================== Find ECG artifacts ================== Locate QRS component of ECG. """ # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io from mne.datasets import sample print(_...
bsd-3-clause
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/music21/alpha/contour.py
1
94038
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: contour.py # Purpose: Represent a piece by its contour # # Authors: Daniel Manesh # # Copyright: Copyright © 2009-2012 Michael Scott Cuthbert and the music21 Project # License: ...
mit
MechCoder/scikit-learn
sklearn/gaussian_process/gpr.py
5
20061
"""Gaussian processes regression. """ # 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_triangular from scipy.optimize import fmin_l_bfgs_b from sklearn.base im...
bsd-3-clause
leliel12/scikit-criteria
doc/source/conf.py
1
6770
# -*- coding: utf-8 -*- # # Scikit-Criteria documentation build configuration file, created by # sphinx-quickstart on Thu Aug 3 02:18:36 2017. # # 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 fil...
bsd-3-clause
shibanis1/spark-tk
python/sparktk/frame/ops/download.py
1
4063
def download(self, n=100, offset = 0, columns=None): """ Download frame data from the server into client workspace as a pandas dataframe. Similar to the 'take' function, but puts the data into a pandas dataframe. Parameters ---------- :param n: (Optional(int)) The number of rows to download ...
apache-2.0
adamgreenhall/scikit-learn
sklearn/utils/arpack.py
265
64837
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
bsd-3-clause
ndingwall/scikit-learn
examples/bicluster/plot_bicluster_newsgroups.py
23
5764
""" ================================================================ 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
alexandrebarachant/decoding-brain-challenge-2016
cross_validation_paper.py
1
4718
import numpy as np import pandas as pd import mne from scipy.io import loadmat from glob import glob from collections import OrderedDict from copy import deepcopy from pyriemann.estimation import (XdawnCovariances, HankelCovariances, CospCovariances, ERPCovariances) from pyriemann.sp...
bsd-3-clause
jswanljung/iris
docs/iris/example_code/Meteorology/hovmoller.py
6
1622
""" Hovmoller diagram of monthly surface temperature ================================================ This example demonstrates the creation of a Hovmoller diagram with fine control over plot ticks and labels. The data comes from the Met Office OSTIA project and has been pre-processed to calculate the monthly mean sea...
lgpl-3.0
JT5D/scikit-learn
sklearn/tests/test_common.py
2
43337
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import traceback import inspect import pickle import pkg...
bsd-3-clause
bchappet/dnfpy
src/test_dnfpy/cellular/rsdnfMapTestRandomBias.py
1
1050
import matplotlib.pyplot as plt from dnfpy.core.constantMap import ConstantMap import unittest import numpy as np from rsdnfMap import RsdnfMap import dnfpy.view.staticViewMatplotlib as view class RsdnfMapTestRandomBias(unittest.TestCase): def setUp(self): self.size = 49 self.ac...
gpl-2.0
ominux/cuda-convnet2
shownet.py
180
18206
# Copyright 2014 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...
apache-2.0
funbaker/astropy
astropy/visualization/wcsaxes/patches.py
2
3394
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from matplotlib.patches import Polygon from ... import units as u from ...coordinates.representation import UnitSphericalRepresentation from ...coordinates.matrix_utilities import rotation_matrix, matrix_product __all__ = ['Spherica...
bsd-3-clause
unoebauer/tardis
tardis/conftest.py
5
4159
from astropy.tests.pytest_plugins import * def pytest_addoption(parser): parser.addoption("--remote-data", action="store_true", help="run tests with online data") parser.addoption("--open-files", action="store_true", help="fail if any test leaves files open") par...
bsd-3-clause
fengzhyuan/scikit-learn
examples/svm/plot_svm_anova.py
250
2000
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc__) import...
bsd-3-clause
sonnyhu/scikit-learn
doc/sphinxext/sphinx_gallery/notebook.py
9
3565
# -*- coding: utf-8 -*- r""" ============================ Parser for Jupyter notebooks ============================ Class that holds the Ipython notebook information """ # Author: Óscar Nájera # License: 3-clause BSD from __future__ import division, absolute_import, print_function import json import os import re imp...
bsd-3-clause
chengchingwen/moth_prediction
get_ft.py
1
1143
import sqlite3 as sql import pandas as pd import datetime as d import make_db as m date = "%d-%d-%d" datef = "%Y-%m-%d" year_end = "%Y-12-31" year_start = "%Y-01-01" query = "select * from `%d` where Time between '%s' and '%s'" def nd(s): return d.datetime.strptime(s, "%Y-%m-%d").month def get_ft_t(year, month, d...
artistic-2.0
shl198/Pipeline
Modules/PacBioEDA/PacBio_HQ.py
3
4611
#!/usr/bin/env python # Copyright (C) 2011 Genome Research Limited -- See full notice at end # of module. # Create a time plot showing the number of ZMWs not yet in # High-Quality region, in HQ, and post-HQ. # The outer loop here will loop over ZMWs. For each ZMW, we'll first # retrieve its HQ region start and stop ...
mit
hammerlab/immuno_research
Jan28.py
1
2289
import numpy as np import sklearn import sklearn.cross_validation import sklearn.ensemble import sklearn.linear_model from epitopes import iedb, amino_acid, features, reduced_alphabet """ Maybe we're overfitting when using larger n-grams of the 20-letter AA alphabet, can we generalize better using other simpler alpha...
gpl-2.0
mumuwoyou/vnpy
vn.trader/ctaAlgo/tools/multiTimeFrame/ctaStrategyMultiTF.py
18
15032
# encoding: UTF-8 """ This file tweaks ctaTemplate Module to suit multi-TimeFrame strategies. """ from strategyAtrRsi import * from ctaBase import * from ctaTemplate import CtaTemplate ######################################################################## class TC11(CtaTemplate): # Strategy name and author ...
mit
tgsmith61591/skutil
skutil/decomposition/decompose.py
1
15956
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import from abc import ABCMeta, abstractmethod import numpy as np import pandas as pd from sklearn.base import BaseEstimator, TransformerMixin from sklearn.decomposition import PCA, TruncatedSVD from sklearn.utils.validation import check...
bsd-3-clause
nborggren/zipline
zipline/finance/risk/cumulative.py
2
17428
# # Copyright 2014 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
CVML/scikit-learn
sklearn/cluster/bicluster.py
211
19443
"""Spectral biclustering algorithms. Authors : Kemal Eren License: BSD 3 clause """ from abc import ABCMeta, abstractmethod import numpy as np from scipy.sparse import dia_matrix from scipy.sparse import issparse from . import KMeans, MiniBatchKMeans from ..base import BaseEstimator, BiclusterMixin from ..external...
bsd-3-clause
chrisfroe/readdy
wrappers/python/src/python/readdy/examples/topology_fusions.py
1
3268
import numpy as np import matplotlib.pyplot as plt import contextlib as cl import time import os import random import readdy._internal as api import readdy._internal.readdybinding.api.top as top from readdy.util import topology_utils from readdy.util import io_utils api.set_logging_level("info", python_console_out=Fa...
lgpl-3.0
mohanprasath/Course-Work
data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part08-e01_regression/test/test_regression.py
1
17970
#!/usr/bin/env python3 import os import re import pandas as pd import numpy as np import statsmodels import matplotlib.pyplot as plt import matplotlib import unittest from unittest.mock import patch, MagicMock from tmc import points from tmc.utils import load, get_out, patch_helper, spy_decorator module_name="src.r...
gpl-3.0