repo_name
stringlengths
7
92
path
stringlengths
5
149
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
911
693k
license
stringclasses
15 values
nuclear-wizard/moose
test/tests/time_integrators/scalar/run.py
12
4487
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
OSU-CS-325/Project_Two_Coin_Change
run-files/analysisQ7.py
1
2957
import sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import random import datetime # Import the three change making algorithms sys.path.insert(0, "../divide-conquer/") sys.path.insert(0, "../dynamic-programming") sys.path.insert(0, "../greedy") from changeslow import changeslow from chan...
mit
stormvirux/vturra-cli
vturra/asys.py
1
1936
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd import numpy as np import matplotlib.pyplot as plt # from scipy import stats # import statsmodels.api as sm # from numpy.random import randn import matplotlib as mpl # import seaborn as sns # sns.set_color_palette("deep", desat=.6) mpl.rc("figure", fig...
mit
abhishekkrthakur/scikit-learn
examples/svm/plot_oneclass.py
249
2302
""" ========================================== One-class SVM with non-linear kernel (RBF) ========================================== An example using a one-class SVM for novelty detection. :ref:`One-class SVM <svm_outlier_detection>` is an unsupervised algorithm that learns a decision function for novelty detection: ...
bsd-3-clause
sssundar/Drone
rotation/viz.py
1
5332
# Python script to visualize rotation about a non-body axis. # Let the lab frame be the inertial frame S. # Let the origin of the rigid body be O, in the inertial frame S'. # Let r_ss' be the vector from S to S'. # Let the body frame relative to O be S''. # Consider a fixed point on the body, r_s' in S', and r_s'' in...
gpl-3.0
Dwii/Master-Thesis
implementation/Palabos/cavity_benchmark/plot_benchmark.py
1
1854
# Display a list of *.dat files in a bar chart. # Based on an example from https://chrisalbon.com/python/matplotlib_grouped_bar_plot.html import sys import os import matplotlib.pyplot as plt import numpy as np if len(sys.argv) > 3 and (len(sys.argv)-3) % 2 : print("usage: python3 {0} <benchmark> <image path> (<da...
mit
wanggang3333/scikit-learn
sklearn/tests/test_kernel_approximation.py
244
7588
import numpy as np from scipy.sparse import csr_matrix from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true from sklearn.utils.testing import assert_not_equal from sklearn.utils.testing import assert_array_almost_equal, assert_raises from sklearn.utils.testing import assert_less_equal from ...
bsd-3-clause
AxelTLarsson/robot-localisation
robot_localisation/main.py
1
6009
""" This module contains the logic to run the simulation. """ import sys import os import argparse import numpy as np sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from robot_localisation.grid import Grid, build_transition_matrix from robot_localisation.robot import Robot, Sensor from robot_localisatio...
mit
mutirri/bokeh
bokeh/cli/core.py
42
16025
from __future__ import absolute_import, print_function import sys, os from six.moves.urllib import request as urllib2 from six.moves import cStringIO as StringIO import pandas as pd try: import click is_click = True except ImportError: is_click = False from . import help_messages as hm from .utils import...
bsd-3-clause
yukisakurai/hhana
mva/plotting/utils.py
1
4190
import ROOT from itertools import izip from matplotlib import cm from rootpy.plotting.style.atlas.labels import ATLAS_label from rootpy.memory.keepalive import keepalive from .. import ATLAS_LABEL def set_colors(hists, colors='jet'): if isinstance(colors, basestring): colors = cm.get_cmap(colors, len(hist...
gpl-3.0
Achuth17/scikit-learn
sklearn/neighbors/tests/test_kd_tree.py
129
7848
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics import Dista...
bsd-3-clause
taotaocoule/stock
spider/data/bond.py
1
1159
# 国债指数:id=0000121;http://pdfm2.eastmoney.com/EM_UBG_PDTI_Fast/api/js?id=0000121&TYPE=k&js=(x)&rtntype=5&isCR=false&fsData1518154947301=fsData1518154947301 # 沪市企业: id=0000131;http://pdfm2.eastmoney.com/EM_UBG_PDTI_Fast/api/js?id=0000131&TYPE=k&js=(x)&rtntype=5&isCR=false&fsData1518156740923=fsData1518156740923 # 深圳企业:...
mit
shyamalschandra/scikit-learn
sklearn/neighbors/nearest_centroid.py
38
7356
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..met...
bsd-3-clause
Loisel/tmr3
tmr.py
1
15096
#!/usr/bin/python """ A module to calculate the current, the conductance and the TMR from a set of rate arrays. The rate arrays are supposed to be stored in a h5 file in the job directory. The result is stored in a h5 file. The name of the dataset contains all parameters. They are also stored as attributes in the datas...
gpl-3.0
dariox2/CADL
session-5/libs/stylenet.py
4
11350
"""Style Net w/ tests for Video Style Net. Video Style Net requires OpenCV 3.0.0+ w/ Contrib for Python to be installed. Creative Applications of Deep Learning w/ Tensorflow. Kadenze, Inc. Copyright Parag K. Mital, June 2016. """ import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import os fro...
apache-2.0
jayhetee/dask
dask/array/numpy_compat.py
9
1606
import numpy as np try: isclose = np.isclose except AttributeError: def isclose(*args, **kwargs): raise RuntimeError("You need numpy version 1.7 or greater to use " "isclose.") try: full = np.full except AttributeError: def full(shape, fill_value, dtype=None, order=N...
bsd-3-clause
google/brain-tokyo-workshop
WANNRelease/prettyNEAT/vis/lplot.py
2
2027
""" Laconic plot functions to replace some of the matplotlibs verbosity """ from matplotlib import pyplot as plt import numpy as np import seaborn as sns # -- File I/O ------------------------------------------------------------ -- # def lsave(data,fileName): np.savetxt(fileName, data, delimiter=',',fmt='%1.2e') ...
apache-2.0
samstern/Greengraph
Greengraph/tests/test_maps.py
1
2937
from ..greengraph import Greengraph from ..map import Map import geopy from nose.tools import assert_equal, assert_almost_equal import numpy.testing as np_test from mock import Mock, patch import requests from matplotlib import image import yaml import os import numpy as np #@patch.object(Greengraph, 'location_sequen...
mit
uqyge/combustionML
FPV_ANN_pureResNet/data_reader_2.py
1
5981
import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler, StandardScaler class data_scaler(object): def __init__(self): self.norm = None self.norm_1 = None self.std = None self.case = None self.scale = 1 self.bias = 1e-20 # ...
mit
andyh616/mne-python
mne/tests/test_epochs.py
1
71695
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op from copy import deepcopy from nose.tools import (assert_true, assert_equal, assert_raises, assert_not_equal) from numpy....
bsd-3-clause
yl565/statsmodels
statsmodels/examples/ex_scatter_ellipse.py
39
1367
'''example for grid of scatter plots with probability ellipses Author: Josef Perktold License: BSD-3 ''' from statsmodels.compat.python import lrange import numpy as np import matplotlib.pyplot as plt from statsmodels.graphics.plot_grids import scatter_ellipse nvars = 6 mmean = np.arange(1.,nvars+1)/nvars * 1.5 ...
bsd-3-clause
ijmarshall/cochrane-nlp
quality4.py
1
73371
from tokenizer import sent_tokenizer, word_tokenizer import biviewer import pdb import re import progressbar import collections import string from unidecode import unidecode import codecs import yaml from pprint import pprint import numpy as np import math import difflib import sklearn from sklearn.feature_extracti...
gpl-3.0
harshaneelhg/scikit-learn
examples/linear_model/plot_lasso_lars.py
363
1080
#!/usr/bin/env python """ ===================== Lasso path using LARS ===================== Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes dataset. Each color represents a different feature of the coefficient vector, and this is displayed as a function of the regulariza...
bsd-3-clause
bestwpw/BDA_py_demos
demos_ch5/demo5_2.py
19
3326
"""Bayesian Data Analysis, 3rd ed Chapter 5, demo 2 Hierarchical model for SAT-example data (BDA3, p. 102) """ from __future__ import division import numpy as np from scipy.stats import norm import scipy.io # For importing a matlab file import matplotlib.pyplot as plt # Edit default plot settings (colours from colo...
gpl-3.0
otmaneJai/Zipline
zipline/sources/data_frame_source.py
26
5253
# # Copyright 2015 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
i19870503/i19870503
Python/eggnog2go_anno.py
1
2591
import os import re import pandas as pd import string import itertools import numpy as np import sys import argparse from collections import OrderedDict if __name__ == '__main__': parser = argparse.ArgumentParser(description='Create GO annotation and enrichment file') parser.add_argument('-i',type=str,dest='i...
gpl-2.0
CCI-Tools/cate-core
cate/ops/index.py
1
8641
# The MIT License (MIT) # Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including w...
mit
huobaowangxi/scikit-learn
sklearn/mixture/tests/test_dpgmm.py
261
4490
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
bsd-3-clause
chungjjang80/FRETBursts
fretbursts/burstlib.py
1
133746
# # FRETBursts - A single-molecule FRET burst analysis toolkit. # # Copyright (C) 2013-2016 The Regents of the University of California, # Antonino Ingargiola <tritemio@gmail.com> # """ This module contains all the main FRETBursts analysis functions. `burstslib.py` defines the fundamental object `Data()`...
gpl-2.0
CoolProp/CoolProp
dev/scripts/viscosity_builder.py
2
3895
from math import sqrt, exp from CoolProp.CoolProp import Props import numpy as np import matplotlib.pyplot as plt from scipy.odr import * from math import log E_K = {'REFPROP-Ammonia': 386, 'REFPROP-Argon': 143.2 } SIGMA = {'REFPROP-Ammonia': 0.2957, 'REFPROP-Argon': 0.335 } E_K['REFPRO...
mit
sniemi/SamPy
sandbox/src1/examples/font_indexing.py
4
1299
""" A little example that shows how the various indexing into the font tables relate to one another. Mainly for mpl developers.... """ import matplotlib from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, KERNING_UNFITTED, KERNING_UNSCALED #fname = '/usr/share/fonts/sfd/FreeSans.ttf' fname = matplotlib.get_da...
bsd-2-clause
edhuckle/statsmodels
statsmodels/examples/example_enhanced_boxplots.py
33
3179
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm # Necessary to make horizontal axis labels fit plt.rcParams['figure.subplot.bottom'] = 0.23 data = sm.datasets.anes96.load_pandas() party_ID = np.arange(7) labels = ["Strong Democrat", "Weak Democr...
bsd-3-clause
Tahsin-Mayeesha/Udacity-Machine-Learning-Nanodegree
projects/titanic_survival_exploration/titanic_visualizations.py
24
5425
import numpy as np import pandas as pd import matplotlib.pyplot as plt def filter_data(data, condition): """ Remove elements that do not match the condition provided. Takes a data list as input and returns a filtered list. Conditions should be a list of strings of the following format: '<field> <...
mit
google/material-design-icons
update/venv/lib/python3.9/site-packages/fontTools/varLib/plot.py
5
4153
"""Visualize DesignSpaceDocument and resulting VariationModel.""" from fontTools.varLib.models import VariationModel, supportScalar from fontTools.designspaceLib import DesignSpaceDocument from matplotlib import pyplot from mpl_toolkits.mplot3d import axes3d from itertools import cycle import math import logging impor...
apache-2.0
cauchycui/scikit-learn
examples/mixture/plot_gmm_pdf.py
284
1528
""" ============================================= Density Estimation for a mixture of Gaussians ============================================= Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices. """ import numpy as np import ma...
bsd-3-clause
xubenben/scikit-learn
examples/manifold/plot_lle_digits.py
181
8510
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
bsd-3-clause
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/mpl_toolkits/axes_grid1/anchored_artists.py
10
12803
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib import docstring from matplotlib.offsetbox import (AnchoredOffsetbox, AnchoredText, AnnotationBbox, AuxTransformBox, DrawingArea, ...
bsd-3-clause
mganeva/mantid
qt/applications/workbench/workbench/widgets/plotselector/presenter.py
1
15293
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantid workbench....
gpl-3.0
wangkua1/sportvu
sportvu/detection_from_raw_pred.py
1
3391
"""detection_from_raw_pred.py * not super useful, a simple script that plots a) raw pred, b) gt pnr, c) detector output at 1 single setting Usage: detection_from_raw_pred.py <fold_index> <f_data_config> <f_model_config> <f_detect_config> --train Arguments: Example: """ from __future__ import absolute_import from ...
mit
nolanliou/tensorflow
tensorflow/contrib/losses/python/metric_learning/metric_loss_ops_test.py
41
20535
# Copyright 2017 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
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/ipykernel/kernelapp.py
5
19344
"""An Application for launching a kernel""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import atexit import os import sys import signal import traceback import logging from tornado import ioloop import zmq from zmq.event...
apache-2.0
jorik041/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
tortugueta/multilayers
examples/radcenter_distribution.py
1
8087
# -*- coding: utf-8 -*- """ Name : radcenter_distribution Author : Joan Juvert <trust.no.one.51@gmail.com> Version : 1.0 Description : This script calculates the influence of the distribution of : radiative centers in the active layer on the observed : spectrum. Copyright 2012 J...
gpl-3.0
dpshelio/sunpy
examples/units_and_coordinates/planet_locations.py
1
1252
""" =================================== Getting the location of the planets =================================== How to get the position of planetary bodies im the solar system using `astropy's solar system ephemeris <http://docs.astropy.org/en/stable/coordinates/solarsystem.html#solar-system-ephemerides>`__ informatio...
bsd-2-clause
armgilles/open-moulinette
caf/scripts/PajeCom.py
2
2407
# -*- coding: utf-8 -*- """ Created on Fri Oct 2 13:47:48 2015 @author: GILLES Armand """ import pandas as pd import glob df = pd.read_csv('source/PajeCom2009.csv', sep=";") df.columns = ['Communes', 'Codes_Insee', 'NB_Allocataires_2009', 'ALL_PAJE_2009', 'ALL_PRIM_2009', 'ALL_BASEP_2009', ...
mit
mxjl620/scikit-learn
sklearn/decomposition/tests/test_sparse_pca.py
160
6028
# Author: Vlad Niculae # License: BSD 3 clause import sys import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing import ass...
bsd-3-clause
google-research/google-research
smu/parser/smu_utils_lib_test.py
1
35529
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
kgullikson88/TS23-Scripts
CheckSyntheticTemperature.py
1
14868
import os import re from collections import defaultdict from operator import itemgetter import logging import pandas from scipy.interpolate import InterpolatedUnivariateSpline as spline from george import kernels import matplotlib.pyplot as plt import numpy as np import george import emcee import StarData import Spect...
gpl-3.0
codester2/devide.johannes
install_packages/ip_matplotlib.py
5
5932
# Copyright (c) Charl P. Botha, TU Delft. # All rights reserved. # See COPYRIGHT for details. import config from install_package import InstallPackage import os import shutil import sys import utils from distutils import sysconfig MPL_VER = "1.1.0" if os.name == 'posix': MPL_ARCHIVE = "matplotlib-%s.tar.gz" % (M...
bsd-3-clause
vshtanko/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
nixingyang/Kaggle-Competitions
TalkingData AdTracking Fraud Detection/perform_ensembling.py
1
2489
import os import glob import shutil import datetime import numpy as np import pandas as pd # Dataset PROJECT_NAME = "TalkingData AdTracking Fraud Detection" PROJECT_FOLDER_PATH = os.path.join(os.path.expanduser("~"), "Documents/Dataset", PROJECT_NAME) # Submission TEAM_NAME = "Auror...
mit
flennerhag/mlens
mlens/externals/sklearn/validation.py
1
27114
""" Scikit-learn 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...
mit
matousc89/padasip
padasip/filters/nlmf.py
1
5444
""" .. versionadded:: 1.1.0 The least-mean-fourth (LMF) adaptive filter implemented according to the paper :cite:`zerguine2000convergence`. The NLMF is an extension of the LMF adaptive filter (:ref:`filter-lmf`). The NLMF filter can be created as follows >>> import padasip as pa >>> pa.filters.FilterNLMF(n) ...
mit
LevinJ/Supply-demand-forecasting
implement/xgboostmodel.py
1
4070
import sys import os sys.path.insert(0, os.path.abspath('..')) from preprocess.preparedata import PrepareData import numpy as np from utility.runtype import RunType from utility.datafilepath import g_singletonDataFilePath from preprocess.splittrainvalidation import HoldoutSplitMethod import xgboost as xgb from evaluat...
mit
anntzer/scikit-learn
sklearn/linear_model/_passive_aggressive.py
2
17363
# Authors: Rob Zinkov, Mathieu Blondel # License: BSD 3 clause from ..utils.validation import _deprecate_positional_args from ._stochastic_gradient import BaseSGDClassifier from ._stochastic_gradient import BaseSGDRegressor from ._stochastic_gradient import DEFAULT_EPSILON class PassiveAggressiveClassifier(BaseSGDCl...
bsd-3-clause
cloud-fan/spark
python/pyspark/pandas/data_type_ops/base.py
1
12265
# # 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
Vimos/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
jcchin/MagnePlane
src/hyperloop/Python/ticket_cost.py
4
8796
from __future__ import print_function import numpy as np from openmdao.api import IndepVarComp, Component, Group, Problem, ExecComp import matplotlib.pylab as plt class TicketCost(Component): ''' Notes ------- This Component takes into account various cost figures from the system model and combines them to estima...
apache-2.0
jdmcbr/geopandas
benchmarks/sindex.py
2
3488
from shapely.geometry import Point from geopandas import read_file, datasets, GeoSeries # Derive list of valid query predicates based on underlying index backend; # we have to create a non-empty instance of the index to get these index = GeoSeries([Point(0, 0)]).sindex predicates = sorted(p for p in index.valid_quer...
bsd-3-clause
abhisg/scikit-learn
sklearn/linear_model/bayes.py
220
15248
""" Various bayesian regression """ from __future__ import print_function # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from .base import LinearModel from ..base import RegressorMixin from ..utils.extmath import fast_logdet, p...
bsd-3-clause
clarkfitzg/xray
setup.py
2
4581
#!/usr/bin/env python import os import re import sys import warnings from setuptools import setup, find_packages MAJOR = 0 MINOR = 5 MICRO = 1 ISRELEASED = False VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) QUALIFIER = '' DISTNAME = 'xray' LICENSE = 'Apache' AUTHOR = 'xray Developers' AUTHOR_EMAIL = 'xray-dev@goog...
apache-2.0
shangwuhencc/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
rbalda/neural_ocr
env/lib/python2.7/site-packages/matplotlib/compat/subprocess.py
19
2827
""" A replacement wrapper around the subprocess module, with a number of work-arounds: - Provides the check_output function (which subprocess only provides from Python 2.7 onwards). - Provides a stub implementation of subprocess members on Google App Engine (which are missing in subprocess). Instead of importing s...
mit
ycaihua/scikit-learn
sklearn/preprocessing/tests/test_imputation.py
28
11950
import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.preprocessing.imputa...
bsd-3-clause
SamStudio8/scikit-bio
skbio/sequence/tests/test_sequence.py
2
106092
# ---------------------------------------------------------------------------- # 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
kagayakidan/scikit-learn
examples/linear_model/plot_lasso_and_elasticnet.py
249
1982
""" ======================================== Lasso and Elastic Net for Sparse Signals ======================================== Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupted with an additive noise. Estimated coefficients are compared with the ground-truth. """ print(...
bsd-3-clause
yavalvas/yav_com
build/matplotlib/lib/mpl_examples/pylab_examples/centered_ticklabels.py
6
1355
# sometimes it is nice to have ticklabels centered. mpl currently # associates a label with a tick, and the label can be aligned # 'center', 'left', or 'right' using the horizontal alignment property: # # # for label in ax.xaxis.get_xticklabels(): # label.set_horizontalalignment('right') # # # but this doesn't...
mit
mne-tools/mne-tools.github.io
0.21/_downloads/ae7d4d6bcae82f99a78c3f8a0c94f7b0/plot_mne_inverse_envelope_correlation.py
3
4522
""" .. _ex-envelope-correlation: ============================================= Compute envelope correlations in source space ============================================= Compute envelope correlations of orthogonalized activity [1]_ [2]_ in source space using resting state CTF data. """ # Authors: Eric Larson <larso...
bsd-3-clause
dsquareindia/scikit-learn
examples/model_selection/plot_confusion_matrix.py
63
3231
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
lindemann09/pyForceDAQ
forceDAQ/data_handling/read_force_data.py
1
2147
""" Functions to read your force and event data """ __author__ = 'Oliver Lindemann' import os import sys import gzip from collections import OrderedDict import numpy as np TAG_COMMENTS = "#" TAG_UDPDATA = TAG_COMMENTS + "UDP" TAG_DAQEVENTS = TAG_COMMENTS + "T" def _csv(line): return list(map(lambda x: x.strip(...
mit
cemarchi/biosphere
Src/BioAnalyzer/Analysis/GenePrioritization/Steps/DataIntegration/IntermediateRepresentation/Transformers/MicroRnaToGeneTransformer.py
1
4546
import math import statistics from itertools import groupby from random import randint from typing import Dict, Tuple, Counter import pandas as pd from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.DataIntegration.IntermediateRepresentation.Generators import \ IntermediateRepresentationGeneratorBase from Src....
bsd-3-clause
phobson/statsmodels
statsmodels/datasets/randhie/data.py
3
2650
"""RAND Health Insurance Experiment Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """This is in the public domain.""" TITLE = __doc__ SOURCE = """ The data was collected by the RAND corporation as part of the Health Insurance Experiment (HIE). http://www.rand.org/health/projects/hie.html This ...
bsd-3-clause
pr-omethe-us/PyKED
pyked/chemked.py
1
44185
""" Main ChemKED module """ # Standard libraries from os.path import exists from collections import namedtuple from warnings import warn from copy import deepcopy import xml.etree.ElementTree as etree import xml.dom.minidom as minidom from itertools import chain import numpy as np # Local imports from .validation imp...
bsd-3-clause
chen0031/Dato-Core
src/unity/python/graphlab/test/test_sarray_sketch.py
13
11788
''' Copyright (C) 2015 Dato, Inc. All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the DATO-PYTHON-LICENSE file for details. ''' # from nose import with_setup # -*- coding: utf-8 -*- from graphlab.data_structures.sarray import SArray import pandas as pd import ...
agpl-3.0
tomlof/scikit-learn
examples/plot_digits_pipe.py
65
1652
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the predictio...
bsd-3-clause
mdhaber/scipy
scipy/optimize/_lsq/least_squares.py
12
39190
"""Generic interface for least-squares minimization.""" from warnings import warn import numpy as np from numpy.linalg import norm from scipy.sparse import issparse, csr_matrix from scipy.sparse.linalg import LinearOperator from scipy.optimize import _minpack, OptimizeResult from scipy.optimize._numdiff import approx...
bsd-3-clause
chrisburr/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
73
1232
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
stylianos-kampakis/scikit-learn
sklearn/manifold/tests/test_spectral_embedding.py
216
8091
from nose.tools import assert_true from nose.tools import assert_equal from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_raises from nose.plugins.skip import SkipTest from sk...
bsd-3-clause
aerokappa/SantaClaus
handCodedOptimum_v4.py
1
2216
import numpy as np import pandas as pd from processInput import processInput def handCodedOptimum_v4 ( ): fileName = 'gifts.csv' giftList, giftListSummary = processInput( fileName ) packedBags = [] for i in np.arange(1000): print i currentBag = [] i...
mit
combust-ml/mleap
python/tests/pyspark/feature/math_binary_test.py
2
6892
import math import os import shutil import tempfile import unittest import mleap.pyspark # noqa from mleap.pyspark.spark_support import SimpleSparkSerializer # noqa import pandas as pd from pandas.testing import assert_frame_equal from pyspark.ml import Pipeline from pyspark.sql.types import FloatType from pyspark....
apache-2.0
ryfeus/lambda-packs
Pandas_numpy/source/pandas/core/sorting.py
6
15948
""" miscellaneous sorting / groupby utilities """ import numpy as np from pandas.compat import long, string_types, PY3 from pandas.core.dtypes.common import ( _ensure_platform_int, _ensure_int64, is_list_like, is_categorical_dtype) from pandas.core.dtypes.cast import infer_dtype_from_array from pandas....
mit
WilliamDiakite/ExperimentationsACA
processing/lsa.py
1
3364
import os import sys import itertools import operator import nltk import numpy as np import matplotlib.pyplot as plt from nltk.util import ngrams from collections import Counter from spell_checker import SpellChecker from sklearn.decomposition import TruncatedSVD from sklearn.pipeline import make_pipeline from skle...
mit
JaviMerino/lisa
libs/utils/analysis/frequency_analysis.py
1
24894
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
apache-2.0
pglomski/shopnotes
drill_speed_chart.py
1
2778
#!/usr/bin/env python # -*- coding: UTF-8 -*- '''Produce a custom twist drill plot''' import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt plt.rc('text', usetex=True) # set some rcParams mpl.rcParams['font.weight'] = 'bold' mpl.rcParams['xtick.major.pad'] = 10 mpl.rcParams['xtick.direction'] =...
agpl-3.0
raghavrv/scikit-learn
examples/decomposition/plot_pca_iris.py
49
1511
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f...
bsd-3-clause
LiaoPan/scikit-learn
examples/applications/plot_outlier_detection_housing.py
243
5577
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
bsd-3-clause
LarsDu/DeepNuc
deepnuc/nucbinaryclassifier.py
2
15464
import tensorflow as tf import numpy as np import sklearn.metrics as metrics #from databatcher import DataBatcher import nucconvmodel #import dubiotools as dbt import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pprint from itertools import cycle import os import sys #Logging imports fro...
gpl-3.0
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/io/tests/test_common.py
9
2087
""" Tests for the pandas.io.common functionalities """ from pandas.compat import StringIO import os from os.path import isabs import nose import pandas.util.testing as tm from pandas.io import common try: from pathlib import Path except ImportError: pass try: from py.path import local as LocalPath e...
gpl-2.0
bdh1011/wau
venv/lib/python2.7/site-packages/pandas/io/tests/test_sql.py
1
93879
"""SQL io tests The SQL tests are broken down in different classes: - `PandasSQLTest`: base class with common methods for all test classes - Tests for the public API (only tests with sqlite3) - `_TestSQLApi` base class - `TestSQLApi`: test the public API with sqlalchemy engine - `TestSQLiteFallbackApi`: t...
mit
Pragmatismo/TimelapsePi-EasyControl
webcamcap_show_numpy.py
1
8684
#!/usr/bin/python import time import os import sys import pygame import numpy from PIL import Image, ImageDraw, ImageChops print("") print("") print(" USE l=3 to take a photo every 3 somethings, try a 1000 or 2") print(" t to take triggered photos ") print(" cap=/home/pi/folder/ to set caps path other than c...
gpl-2.0
SMTorg/smt
smt/surrogate_models/tests/test_surrogate_model_examples.py
2
17391
""" Author: John Hwang <<hwangjt@umich.edu>> This package is distributed under New BSD license. """ import unittest import matplotlib matplotlib.use("Agg") try: from smt.surrogate_models import IDW, RBF, RMTB, RMTC compiled_available = True except: compiled_available = False class Test(unittest.Tes...
bsd-3-clause
hainm/scipy
scipy/stats/_discrete_distns.py
34
21220
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from __future__ import division, print_function, absolute_import from scipy import special from scipy.special import entr, gammaln as gamln from scipy.misc import logsumexp from numpy import floor, ceil, log, exp, ...
bsd-3-clause
chinageology/GeoPython
Experimental/PreTreat.py
2
6940
# coding:utf-8 import math import sys import os import csv import random from bs4 import BeautifulSoup import pandas as pd import numpy as np from mpl_toolkits.mplot3d import Axes3D from sklearn import datasets from sklearn.decomposition import PCA from sklearn.neighbors import NearestNeighbors import matplotlib impo...
gpl-3.0
tmhm/scikit-learn
examples/model_selection/plot_roc_crossval.py
247
3253
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
endrebak/epic
tests/run/test_merge_chip_and_input.py
1
4225
import pytest import pandas as pd import numpy as np import logging from io import StringIO from joblib import delayed, Parallel @pytest.fixture def input_data(): pass @pytest.fixture def expected_result(): pass def merge_chip_and_input(windows, nb_cpu): """Merge lists of chromosome bin df chromosom...
mit
rlpy/rlpy
rlpy/Representations/LocalBases.py
1
7491
""" Representations which use local bases function (e.g. kernels) distributed in the statespace according to some scheme (e.g. grid, random, on previous samples) """ from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from ...
bsd-3-clause
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/numpy/lib/function_base.py
7
134697
from __future__ import division, absolute_import, print_function import warnings import sys import collections import operator import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d from numpy.core.numeric import ( ones, zeros, arange, concatenate, array, asarr...
gpl-2.0
Agent007/deep-learning
image-classification/helper.py
155
5631
import pickle import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelBinarizer def _load_label_names(): """ Load the label names from file """ return ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] def load_cfar10_batch(ci...
mit
JanNash/sms-tools
lectures/06-Harmonic-model/plots-code/spectral-peaks.py
22
1161
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF (fs, x) = UF...
agpl-3.0
rosswhitfield/mantid
qt/python/mantidqt/widgets/sliceviewer/test/test_sliceviewer_presenter.py
3
24997
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 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 + # T...
gpl-3.0