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
ucsd-ccbb/jupyter-genomics
src/networkAnalysis/drug_gene_heatprop.py
1
5526
# import some useful packages import numpy as np import matplotlib.pyplot as plt import seaborn import networkx as nx import pandas as pd import random import json import sys code_path = 'source' sys.path.append(code_path) import network_prop def load_DB_data(fname): ''' Function to load drug bank data (in f...
mit
quheng/scikit-learn
examples/exercises/plot_cv_diabetes.py
231
2527
""" =============================================== Cross-validation on diabetes Dataset Exercise =============================================== A tutorial exercise which uses cross-validation with linear models. This exercise is used in the :ref:`cv_estimators_tut` part of the :ref:`model_selection_tut` section of ...
bsd-3-clause
hsuantien/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
QuantSoftware/QuantSoftwareToolkit
QSTK/qstkfeat/classes.py
8
1658
''' (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 Nov 7, 2011 @author: John Cornwell @contact: JohnWCornwellV@gmail.com @summary: File containing various c...
bsd-3-clause
stechma2/samuraiAnalysis
PlotSamuraiXS.py
1
20610
import os import shutil import warnings from datetime import datetime as dt import matplotlib as mpl # mpl.use('PDF') from matplotlib import pyplot as plt import numpy as np import yaml from glob import glob import argparse from samuraiAnalysis import gribTools,plotFLpath,samImport_masked,samImport,samPlt,makeKML,getF...
gpl-3.0
wroscoe/donkey
donkeycar/management/base.py
1
14840
import sys import os import socket import shutil import argparse import donkeycar as dk from donkeycar.parts.datastore import Tub from .tub import TubManager PACKAGE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) TEMPLATES_PATH = os.path.join(PACKAGE_PATH, 'templates') def make_dir(path): ...
mit
wdbm/abstraction
classification_SUSY.py
1
5526
#!/usr/bin/env python """ ################################################################################ # # # classification_SUSY # # ...
gpl-3.0
kgullikson88/gullikson-scripts
kglib/stellar_models/StellarModel.py
1
50098
from __future__ import print_function, absolute_import, division import os import sys import re from collections import defaultdict import warnings from collections import OrderedDict import itertools import logging from astropy import units from scipy.interpolate import InterpolatedUnivariateSpline as spline, Linear...
mit
googleapis/google-cloud-cpp
google/cloud/storage/benchmarks/storage_throughput_vs_cpu_plots.py
1
3335
#!/usr/bin/env python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
khkaminska/scikit-learn
examples/exercises/plot_iris_exercise.py
323
1602
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
bsd-3-clause
wmvanvliet/mne-python
examples/forward/plot_forward_sensitivity_maps.py
14
4139
""" .. _ex-sensitivity-maps: ================================================ Display sensitivity maps for EEG and MEG sensors ================================================ Sensitivity maps can be produced from forward operators that indicate how well different sensor types will be able to detect neural currents f...
bsd-3-clause
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/pandas/tseries/tools.py
9
18157
from datetime import datetime, timedelta import re import sys import numpy as np import pandas.lib as lib import pandas.tslib as tslib import pandas.core.common as com from pandas.compat import StringIO, callable from pandas.core.common import ABCIndexClass import pandas.compat as compat from pandas.util.decorators i...
gpl-2.0
zihua/scikit-learn
sklearn/tree/tests/test_tree.py
7
55471
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import struct import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_random...
bsd-3-clause
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/matplotlib/backends/backend_gtk3.py
8
39097
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import os, sys def fn_name(): return sys._getframe(1).f_code.co_name try: import gi except ImportError: raise ImportError("Gtk3 backend requires pygobject to be in...
apache-2.0
rew4332/tensorflow
tensorflow/examples/skflow/iris.py
5
1597
# 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
kevin-intel/scikit-learn
sklearn/tests/test_multioutput.py
3
24614
import pytest import numpy as np import scipy.sparse as sp from joblib import cpu_count 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 import datasets from sklearn.base import clone ...
bsd-3-clause
seckcoder/lang-learn
python/sklearn/examples/cluster/plot_affinity_propagation.py
2
2258
""" ================================================= Demo of affinity propagation clustering algorithm ================================================= Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Points", Science Feb. 2007 """ print __doc__ from sklearn.cluster import...
unlicense
rosswhitfield/mantid
scripts/FilterEvents/eventFilterGUI.py
3
40646
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # py...
gpl-3.0
huongttlan/statsmodels
statsmodels/sandbox/tsa/movstat.py
34
14871
'''using scipy signal and numpy correlate to calculate some time series statistics original developer notes see also scikits.timeseries (movstat is partially inspired by it) added 2009-08-29 timeseries moving stats are in c, autocorrelation similar to here I thought I saw moving stats somewhere in python, maybe not)...
bsd-3-clause
JoseGuzman/NeuralNetworks
GCNetwork/patternseparation_patterns.py
1
9706
""" patternseparation_patterns.py Claudia Espinoza, claumespinoza@gmail.com Jose Guzman, sjm.guzman@gmail.com Last change: Tue Nov 8 12:22:19 CET 2016 Simulate random patterns and get the patterns from the network """ import numpy as np from neuron import gui, h from Cell_builder import BCbuilder, GCbuilder from...
gpl-2.0
jmikko/fairnessML
toy_problem_plot.py
1
2964
import numpy as np from scipy.interpolate import griddata import matplotlib.pyplot as plt import numpy.ma as ma from numpy.random import uniform, seed from matplotlib import cm import matplotlib.patches as mpatches def gauss(x,y,Sigma,mu): X=np.vstack((x,y)).T mat_multi=np.dot((X-mu[None,...]).dot(np.linalg.i...
gpl-3.0
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/sklearn/neighbors/base.py
8
31247
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
mit
preete-dixit-ck/incubator-airflow
tests/operators/hive_operator.py
40
14061
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
shuangshuangwang/spark
python/pyspark/sql/pandas/functions.py
1
28129
# # 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
depet/scikit-learn
examples/document_classification_20newsgroups.py
9
10380
""" ====================================================== 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
hlin117/statsmodels
statsmodels/sandbox/examples/ex_kaplan_meier.py
33
2838
#An example for the Kaplan-Meier estimator from __future__ import print_function from statsmodels.compat.python import lrange import statsmodels.api as sm import matplotlib.pyplot as plt import numpy as np from statsmodels.sandbox.survival2 import KaplanMeier #Getting the strike data as an array dta = sm.datasets.stri...
bsd-3-clause
maropu/spark
python/pyspark/pandas/spark/accessors.py
2
42892
# # 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
smartscheduling/scikit-learn-categorical-tree
sklearn/gaussian_process/tests/test_gaussian_process.py
267
6813
""" Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # Licence: BSD 3 clause from nose.tools import raises from nose.tools import assert_true import numpy as np from sklearn.gaussian_process import GaussianProcess from sklearn.gaussian_process ...
bsd-3-clause
phaustin/pyman
Book/chap8/Supporting Materials/betaDecay.py
3
2528
import numpy as np import matplotlib.pyplot as plt def LineFitWt(x, y, sig): """ Returns slope and y-intercept of weighted linear fit to (x,y) data set. Inputs: x and y data array and uncertainty array (unc) for y data set. Ouputs: slope and y-intercept of best fit to data. """ sig2 = sig**2 ...
cc0-1.0
juliusbierk/scikit-image
doc/ext/notebook.py
44
3042
__all__ = ['python_to_notebook', 'Notebook'] import json import copy import warnings # Skeleton notebook in JSON format skeleton_nb = """{ "metadata": { "name":"" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type":...
bsd-3-clause
marcocaccin/LearningMetaDynamics
grad1dtest.py
1
1626
from sklearn.kernel_ridge import KernelRidge import matplotlib.pyplot as plt import scipy as sp from gpfit import test_points def fun(x): return sp.sin(x)**2 + sp.exp(- sp.cos(x)) def dfun(x): return 2*sp.sin(x)*sp.cos(x) + sp.exp(-sp.cos(x)) * sp.sin(x) lengthscale = 1. gamma = 1 / (2 * lengthscale**2) k...
gpl-2.0
jaeilepp/eggie
mne/utils.py
1
53547
"""Some utility functions""" from __future__ import print_function # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import warnings import logging from distutils.version import LooseVersion import os import os.path as op from functools import wraps import inspect fro...
bsd-2-clause
georgeke/caravel
tests/core_tests.py
1
18555
"""Unit tests for Caravel""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from datetime import datetime import doctest import json import imp import os import unittest from mock import Mock, patch from flask import...
apache-2.0
aringh/odl
examples/solvers/deconvolution_1d.py
1
1605
"""Example of a deconvolution problem with different solvers (CPU).""" import numpy as np import matplotlib.pyplot as plt import scipy.signal import odl class Convolution(odl.Operator): def __init__(self, kernel, adjkernel=None): self.kernel = kernel self.adjkernel = (adjkernel if adjkernel is n...
mpl-2.0
pypot/scikit-learn
examples/model_selection/plot_learning_curve.py
250
4171
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
bsd-3-clause
kurtgeebelen/rawesome
studies/testMheMpc.py
2
5886
# Copyright 2012-2013 Greg Horn # # This file is part of rawesome. # # rawesome 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. ...
lgpl-3.0
OpenBookProjects/ipynb
101notebook/ipython-rel-2.1.0-examples/Parallel Computing/wave2D/parallelwave-mpi.py
4
6671
#!/usr/bin/env python """ A simple python program of solving a 2D wave equation in parallel. Domain partitioning and inter-processor communication are done by an object of class MPIRectPartitioner2D (which is a subclass of RectPartitioner2D and uses MPI via mpi4py) An example of running the program is (8 processors, 4...
mit
hansehe/Wind-Blade-Inspection
Settings/TestData.py
1
15964
''' Author: Hans Erik Heggem Email: hans.erik.heggem@gmail.com Project: Master's Thesis - Autonomous Inspection Of Wind Blades Repository: Master's Thesis - CV (Computer Vision) ''' import glob, warnings, os ''' @brief Class for getting test sets Change data sets as preferred to use for testing. ''' class Test...
mit
simon-pepin/scikit-learn
sklearn/linear_model/tests/test_coordinate_descent.py
44
22866
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing ...
bsd-3-clause
YihaoLu/statsmodels
statsmodels/examples/try_polytrend.py
33
1477
from __future__ import print_function import numpy as np #import statsmodels.linear_model.regression as smreg from scipy import special import statsmodels.api as sm from statsmodels.datasets.macrodata import data dta = data.load() gdp = np.log(dta.data['realgdp']) from numpy import polynomial from scipy import spe...
bsd-3-clause
Nacturne/CoreNLP_copy
python_tools/Commands/rootF1Global.py
1
1591
import config import argparse import pandas as pd import warnings from Core import TreeClass from sklearn import metrics parser = argparse.ArgumentParser() parser.add_argument('Original', metavar='original_file', type=str, help="The path of the original file") parser.add_argument('Predicted', metavar='predicted_file...
gpl-2.0
hbwzhsh/pyrallel
pyrallel/mmap_utils.py
2
4036
"""Utilities for Memory Mapping cross validation folds Author: Olivier Grisel <olivier@ogrisel.com> Licensed: MIT """ import os from IPython.parallel import interactive from pyrallel.common import get_host_view @interactive def persist_cv_splits(X, y, name=None, n_cv_iter=5, suffix="_cv_%03d.pkl", ...
mit
pllim/astropy
astropy/modeling/utils.py
5
28585
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides utility functions for the models package. """ # pylint: disable=invalid-name from collections import deque, UserDict from collections.abc import MutableMapping from inspect import signature import numpy as np import warnings from...
bsd-3-clause
derekjchow/models
research/deep_speech/data/download.py
4
7722
# Copyright 2018 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
ortylp/scipy
scipy/signal/spectral.py
14
34751
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import lombscargle import warnings from scipy._lib.six import string_types __all__ = ['periodogr...
bsd-3-clause
Nyker510/scikit-learn
examples/model_selection/plot_train_error_vs_test_error.py
349
2577
""" ========================= Train error vs Test error ========================= Illustration of how the performance of an estimator on unseen data (test data) is not the same as the performance on training data. As the regularization increases the performance on train decreases while the performance on test is optim...
bsd-3-clause
e-koch/VLA_Lband
14B-088/HI/analysis/higher_moments.py
1
15571
from spectral_cube import SpectralCube, Projection import numpy as np import matplotlib.pyplot as p from astropy.io import fits from astropy.wcs import WCS import astropy.units as u import os from reproject import reproject_interp from astropy.visualization import AsinhStretch from astropy.visualization.mpl_normalize ...
mit
dvro/UnbalancedDataset
examples/under-sampling/plot_nearmiss_3.py
2
1837
""" ========== Nearmiss 3 ========== An illustration of the nearmiss 3 method. """ print(__doc__) import matplotlib.pyplot as plt import seaborn as sns sns.set() # Define some color for the plotting almost_black = '#262626' palette = sns.color_palette() from sklearn.datasets import make_classification from sklear...
mit
nok/sklearn-porter
sklearn_porter/utils/Environment.py
1
3826
# -*- coding: utf-8 -*- import os import sys try: from shutil import which except ImportError: def which(cmd, mode=os.F_OK | os.X_OK, path=None): """Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file....
mit
liam2/larray
larray/inout/stata.py
2
1668
from __future__ import absolute_import, print_function import pandas as pd from larray.inout.pandas import from_frame __all__ = ['read_stata'] def read_stata(filepath_or_buffer, index_col=None, sort_rows=False, sort_columns=False, **kwargs): r""" Reads Stata .dta file and returns an Array with the contents...
gpl-3.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/neighbors/base.py
19
30908
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck # Multi-output support by Arnaud Jol...
mit
krischer/wfdiff
setup.py
1
2246
#!/usr/bin/env python # -*- encoding: utf8 -*- import glob import inspect import io import os from setuptools import find_packages from setuptools import setup changelog = os.path.join(os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))), "CHANGELOG.md") with open(changelog, "rt") as fh: ...
gpl-3.0
3manuek/scikit-learn
sklearn/preprocessing/tests/test_label.py
48
18419
import numpy as np from scipy.sparse import issparse from scipy.sparse import coo_matrix from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils.multiclass import type_of_target from sklearn.utils.testing impor...
bsd-3-clause
yl565/statsmodels
statsmodels/iolib/foreign.py
5
42776
""" Input/Output tools for working with binary data. The Stata input tools were originally written by Joe Presbrey as part of PyDTA. You can find more information here http://presbrey.mit.edu/PyDTA See also --------- numpy.lib.io """ from statsmodels.compat.python import (zip, lzip, lmap, lrange, string_types, long,...
bsd-3-clause
Hbl15/ThinkStats2
code/hinc.py
67
1494
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import numpy as np import pandas import thinkplot import thinkstats2 def Clean(s):...
gpl-3.0
eggplantbren/Flotsam
src/Python/emcee/TDModel.py
1
4258
import numpy as np import numpy.random as rng import scipy.linalg as la import matplotlib.pyplot as plt from Data import Data class Limits: """ A singleton class that just holds prior bounds """ @staticmethod def initialise(data): # Mean magnitudes Limits.magMin = data.yMean - 10.*data.yStDev Limits.magMax ...
gpl-3.0
HeraclesHX/scikit-learn
examples/cluster/plot_birch_vs_minibatchkmeans.py
333
3694
""" ================================= Compare BIRCH and MiniBatchKMeans ================================= This example compares the timing of Birch (with and without the global clustering step) and MiniBatchKMeans on a synthetic dataset having 100,000 samples and 2 features generated using make_blobs. If ``n_clusters...
bsd-3-clause
anilmuthineni/tensorflow
tensorflow/examples/learn/iris_val_based_early_stopping.py
62
2827
# 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
georgid/sms-tools
lectures/4-STFT/plots-code/blackman-even-odd.py
24
1481
import matplotlib.pyplot as plt import numpy as np from scipy.fftpack import fft, fftshift from scipy import signal M = 32 N = 128 hN = N/2 hM = M/2 fftbuffer = np.zeros(N) w = signal.blackman(M) plt.figure(1, figsize=(9.5, 6)) plt.subplot(3,2,1) plt.plot(np.arange(-hM, hM), w, 'b', lw=1.5) plt.axis([-hM, hM-1,...
agpl-3.0
blbarker/spark-tk
python/sparktk/frame/ops/classification_metrics_value.py
7
3082
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
rlnsanz/delft
delft/export_utils.py
2
37130
# -*- coding: utf-8 -*- """ Copyright 2016 Randal S. Olson This file is part of the TPOT library. The TPOT library 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 op...
gpl-3.0
TimBizeps/BachelorAP
V503_Millikan Versuch/Auswertung.py
1
3001
import matplotlib as mpl mpl.use('pgf') import numpy as np import scipy.constants as const import matplotlib.pyplot as plt from scipy.optimize import curve_fit from uncertainties import ufloat import uncertainties.unumpy as unp from uncertainties.unumpy import (nominal_values as noms, std_devs as stds) mpl.rcParams.upd...
gpl-3.0
michigraber/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
bharcode/MachineLearning
GEFlightQuest/PythonModule/geflight/summarize/diverted_or_redirected_flights_in_public_leaderboard.py
3
2338
import csv import os import pandas as pd flight_path = os.path.join(os.environ["DataPath"], "GEFlight") public_solution_path = os.path.join(flight_path, "Release 6", "FinalEvaluationSolution", "solution_combined.csv") raw_public_leaderboard_flight_history_path = os.path.join(flight_path, "RawFinalEvaluationSet", "Fli...
gpl-2.0
RachitKansal/scikit-learn
sklearn/utils/__init__.py
79
14202
""" The :mod:`sklearn.utils` module includes various utilities. """ from collections import Sequence import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, assert_all_finite, ...
bsd-3-clause
chengsoonong/acton
tests/test_integration.py
1
18921
#!/usr/bin/env python3 """ test_integration ---------------------------------- Integration tests. """ import sys sys.path.append("..") import os.path import struct import unittest import unittest.mock import acton.cli import acton.database import acton.proto.io import acton.proto.wrappers import acton.proto.acton...
bsd-3-clause
SpatialMetabolomics/SM_distributed
tests/test_es_exporter.py
2
10310
import logging from datetime import datetime from unittest.mock import MagicMock, patch import pandas as pd import time from sm.engine import MolecularDB from sm.engine.es_export import ESExporter, ESIndexManager, DATASET_SEL, ANNOTATIONS_SEL from sm.engine import DB from sm.engine.ion_centroids_gen import IonCentroid...
apache-2.0
jdrudolph/scikit-bio
skbio/stats/ordination/_redundancy_analysis.py
8
8953
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
QuLogic/specfem3d
EXAMPLES/meshfem3D_examples/cavity/DATA/py/forcesolution_generation.py
3
1297
import os import numpy as np import matplotlib.pyplot as plt from matplotlib.pyplot import figure, show, axes, sci from matplotlib import cm, colors from matplotlib.font_manager import FontProperties from numpy import amin, amax, ravel from numpy.random import rand #****************************************************...
gpl-2.0
ushiro/persistlab
persistlab/figitem.py
1
16756
""" persistlab.figitem ~~~~~~~~~~ This module provides a matplotlib figure manager to deal with the figure elements as dictionnary elements :copyright: (c) 2013 by Stephane Henry.. :license: BSD, see LICENSE for more details. Comments: ~~~~~~~ Ideally it should be possible t...
bsd-3-clause
vermouthmjl/scikit-learn
examples/bicluster/plot_spectral_coclustering.py
127
1732
""" ============================================== A demo of the Spectral Co-Clustering algorithm ============================================== This example demonstrates how to generate a dataset and bicluster it using the Spectral Co-Clustering algorithm. The dataset is generated using the ``make_biclusters`` funct...
bsd-3-clause
hugobowne/scikit-learn
examples/linear_model/plot_polynomial_interpolation.py
168
2088
#!/usr/bin/env python """ ======================== Polynomial interpolation ======================== This example demonstrates how to approximate a function with a polynomial of degree n_degree by using ridge regression. Concretely, from n_samples 1d points, it suffices to build the Vandermonde matrix, which is n_samp...
bsd-3-clause
edwintye/pygotools
bin/workingScript/testPoly.py
1
10729
## setting up G and h G = matrix(numpy.append(numpy.append(numpy.eye(2),-numpy.eye(2),axis=0),numpy.array([[-1,1]]),axis=0)) h = matrix([1.0,1.0,0.0,0.0,0.0]) from pyOptimUtil.direct import rectOperation from pyOptimUtil.direct import polyOperation boxBounds = [ (0.0,1.0), (0.0,1.0) ] sol = polyOpera...
gpl-2.0
dssg/wikienergy
disaggregator/build/pandas/pandas/computation/eval.py
14
8348
#!/usr/bin/env python """Top level ``eval`` module. """ import tokenize from pandas.core import common as com from pandas.computation.expr import Expr, _parsers, tokenize_string from pandas.computation.scope import _ensure_scope from pandas.compat import DeepChainMap, builtins from pandas.computation.engines import _...
mit
Regenerator/kdnets
lib/processors/shapenet.py
1
7588
import os import numpy as np import pandas as pd import h5py as h5 def prepare(path2data, path2save, pose='normal'): raw_label_data = pd.read_csv(path2data + '/train.csv').append(pd.read_csv(path2data + '/val.csv'), ignore_index=True) label_idx = 0 labelId2label = {} for labelId in raw_label_data['s...
mit
renmengye/deep-dashboard
demo/vae.py
1
11546
""" This code implements VAE (Variational Autoencoder) [1] on MNIST. Author: Mengye Ren (mren@cs.toronto.edu) Usage: python vae_mnist.py -logs {path to log folder} Reference: [1] D.P. Kingma, M. Welling. Auto-encoding variational Bayes. ICLR 2014. """ import cslab_environ import argparse import datetime import logg...
mit
SerCeMan/intellij-community
python/helpers/pydev/pydevconsole.py
41
15763
from _pydev_imps._pydev_thread import start_new_thread try: from code import InteractiveConsole except ImportError: from pydevconsole_code_for_ironpython import InteractiveConsole from code import compile_command from code import InteractiveInterpreter import os import sys import _pydev_threading as threadi...
apache-2.0
anaderi/lhcb_trigger_ml
tests/test_commonutils.py
1
5043
from __future__ import division, print_function, absolute_import import numpy import pandas from numpy.random.mtrand import RandomState from sklearn.metrics.pairwise import pairwise_distances from hep_ml import commonutils from hep_ml.commonutils import weighted_percentile, build_normalizer, \ compute_cut_for_effi...
mit
pypot/scikit-learn
sklearn/covariance/tests/test_graph_lasso.py
272
5245
""" Test the graph_lasso module. """ import sys import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_less from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV, empirical_...
bsd-3-clause
andrewnc/scikit-learn
benchmarks/bench_plot_fastkmeans.py
294
4676
from __future__ import print_function from collections import defaultdict from time import time import numpy as np from numpy import random as nr from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans def compute_bench(samples_range, features_range): it = 0 results = defaultdict(lambda: []) chun...
bsd-3-clause
yavalvas/yav_com
build/matplotlib/doc/mpl_examples/pylab_examples/tricontour_vs_griddata.py
3
1486
""" Comparison of griddata and tricontour for an unstructured triangular grid. """ from __future__ import print_function import matplotlib.pyplot as plt import matplotlib.tri as tri import numpy as np from numpy.random import uniform, seed from matplotlib.mlab import griddata import time seed(0) npts = 200 ngridx = 10...
mit
xiaoxiamii/scikit-learn
sklearn/metrics/scorer.py
211
13141
""" The :mod:`sklearn.metrics.scorer` submodule implements a flexible interface for model selection and evaluation using arbitrary score functions. A scorer object is a callable that can be passed to :class:`sklearn.grid_search.GridSearchCV` or :func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame...
bsd-3-clause
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/ease/model_creator.py
2
7871
#Provides interface functions to create and save models import numpy import re import nltk import sys from sklearn.feature_extraction.text import CountVectorizer import pickle import os import sklearn.ensemble from itertools import chain base_path = os.path.dirname(__file__) sys.path.append(base_path) from essay_set...
agpl-3.0
rkmaddox/mne-python
tutorials/simulation/80_dics.py
6
12327
# -*- coding: utf-8 -*- """ DICS for power mapping ====================== In this tutorial, we'll simulate two signals originating from two locations on the cortex. These signals will be sinusoids, so we'll be looking at oscillatory activity (as opposed to evoked activity). We'll use dynamic imaging of coherent sourc...
bsd-3-clause
aavanian/bokeh
examples/plotting/file/burtin.py
3
4763
from collections import OrderedDict from math import log, sqrt import numpy as np import pandas as pd from six.moves import cStringIO as StringIO from bokeh.plotting import figure, show, output_file antibiotics = """ bacteria, penicillin, streptomycin, neomycin, gram Mycobacterium tuberculosis...
bsd-3-clause
gandalfcode/gandalf
tests/grav_tests/freefall.py
1
2263
#============================================================================== # freefalltest.py # Run the freefall collapse test using initial conditions specified in the # file 'freefall.dat'. #============================================================================== from gandalf.analysis.facade import * from g...
gpl-2.0
blink1073/scikit-image
doc/examples/edges/plot_medial_transform.py
11
2257
""" =========================== Medial axis skeletonization =========================== The medial axis of an object is the set of all points having more than one closest point on the object's boundary. It is often called the **topological skeleton**, because it is a 1-pixel wide skeleton of the object, with the same ...
bsd-3-clause
zhewang/lcvis
python_scripts/PLV_SDSS/pca_with_period.py
2
2342
import argparse import csv import json import pickle import numpy as np from matplotlib.mlab import PCA def loadMagData(fileName): data_file = open(fileName, 'r') data = json.load(data_file) mag = np.array(data[0]["mag"]) phase = np.array(data[0]["phase"]) magPeak = 100 phasePeak = -1 for ...
gpl-2.0
Myasuka/scikit-learn
sklearn/linear_model/stochastic_gradient.py
130
50966
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import scipy.sparse as sp from abc import ABCMeta, abstractmethod from ...
bsd-3-clause
jpautom/scikit-learn
sklearn/linear_model/tests/test_base.py
19
12955
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_e...
bsd-3-clause
mne-tools/mne-tools.github.io
0.14/_downloads/plot_raw_objects.py
15
5335
""" .. _tut_raw_objects The :class:`Raw <mne.io.RawFIF>` data structure: continuous data ================================================================ """ from __future__ import print_function import mne import os.path as op from matplotlib import pyplot as plt ###################################################...
bsd-3-clause
vybstat/scikit-learn
sklearn/utils/metaestimators.py
283
2353
"""Utilities for meta-estimators""" # Author: Joel Nothman # Andreas Mueller # Licence: BSD from operator import attrgetter from functools import update_wrapper __all__ = ['if_delegate_has_method'] class _IffHasAttrDescriptor(object): """Implements a conditional property using the descriptor protocol. ...
bsd-3-clause
IssamLaradji/scikit-learn
sklearn/covariance/tests/test_covariance.py
28
10115
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
orbitfold/tardis
tardis/plasma/tests/conftest.py
1
8877
import os import numpy as np import pandas as pd from astropy import units as u import pytest import tardis from tardis.atomic import AtomData from tardis.plasma.standard_plasmas import LegacyPlasmaArray from tardis.plasma.properties import * # INPUTS @pytest.fixture def atomic_data(selected_atoms): atomic_db_f...
bsd-3-clause
meduz/scikit-learn
sklearn/tests/test_naive_bayes.py
72
19944
import pickle from io import BytesIO import numpy as np import scipy.sparse from sklearn.datasets import load_digits, load_iris from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert...
bsd-3-clause
puruckertom/ubertool
ubertool/beerex/tests/beerex_process_qaqc.py
1
1380
from __future__ import division #brings in Python 3.0 mixed type calculation rules import os # needs to be run whenever the qaqc csv is updated csv_path = os.path.join(os.path.dirname(__file__),"beerex_qaqc.csv") csv_in = os.path.join(os.path.dirname(__file__),"beerex_qaqc_in_transpose.csv") csv_exp = os.path.join(os...
unlicense
harisbal/pandas
pandas/tests/indexes/datetimes/test_timezones.py
2
44972
# -*- coding: utf-8 -*- """ Tests for DatetimeIndex timezone-related methods """ from datetime import date, datetime, time, timedelta, tzinfo from distutils.version import LooseVersion import dateutil from dateutil.tz import gettz, tzlocal import numpy as np import pytest import pytz from pandas._libs.tslibs import c...
bsd-3-clause
cleinias/Homeo
src/Simulator/HomeoGeneralGUI.py
1
59437
''' Provides a general interface to control a Homeostat simulation including an unlimited number of units. It can start and stop a simulation from a GUI, as well as save and graph the simulation's data. Created on May 5, 2013 @author: stefano ''' from PyQt4.QtCore import * from PyQt4.QtGui import * from Core.Homeost...
gpl-3.0
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/matplotlib/sphinxext/ipython_console_highlighting.py
11
4601
"""reST directive for syntax-highlighting ipython interactive sessions. XXX - See what improvements can be made based on the new (as of Sept 2009) 'pycon' lexer for the python console. At the very least it will give better highlighted tracebacks. """ from __future__ import (absolute_import, division, print_function, ...
gpl-2.0
tody411/ColorHistogram
color_histogram/results/hist_1d.py
2
2771
# -*- coding: utf-8 -*- # # @package color_histogram.results.hist_1d # # Compute 1D color histogram result. # @author tody # @date 2015/08/28 import os import numpy as np import matplotlib.pyplot as plt from color_histogram.io_util.image import loadRGB from color_histogram.cv.image import rgb, to32F f...
mit