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
yyjiang/scikit-learn
benchmarks/bench_plot_nmf.py
206
5890
""" Benchmarks of Non-Negative Matrix Factorization """ from __future__ import print_function from collections import defaultdict import gc from time import time import numpy as np from scipy.linalg import norm from sklearn.decomposition.nmf import NMF, _initialize_nmf from sklearn.datasets.samples_generator import...
bsd-3-clause
openpathsampling/openpathsampling
openpathsampling/tests/test_pathsimulator.py
2
38311
from __future__ import division from __future__ import absolute_import from builtins import str from builtins import range from past.utils import old_div from builtins import object from .test_helpers import (raises_with_message_like, data_filename, CalvinistDynamics, make_1d_traj, ...
mit
timothy1191xa/project-epsilon-1
code/utils/scripts/eda.py
3
3524
""" This script plots some exploratory analysis plots for the raw and filtered data: - Moisaic of the mean voxels values for each brain slices Run with: python eda.py from this directory """ from __future__ import print_function, division import sys, os, pdb import numpy as np import matplotlib.pyplot as ...
bsd-3-clause
darthcloud/cube64-dx
notes/js_scale.py
1
4921
#!/usr/bin/env python3 """Script for generating GC joysticks scaling tables. --Jacques Gagnon <darthcloud@gmail.com> """ from collections import namedtuple from scipy import stats from scipy.interpolate import interp1d import matplotlib.pyplot as plt import numpy as np from controller_data import CTRL_DATA, Maximum ...
gpl-2.0
frank-tancf/scikit-learn
sklearn/gaussian_process/tests/test_gpr.py
23
11915
"""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
Eric89GXL/scikit-learn
sklearn/tests/test_grid_search.py
7
22530
""" Testing for grid search module (sklearn.grid_search) """ from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import sys import warnings import numpy as np import sci...
bsd-3-clause
equialgo/scikit-learn
sklearn/setup.py
69
3201
import os from os.path import join import warnings from sklearn._build_utils import maybe_cythonize_extensions def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError import numpy lib...
bsd-3-clause
fulmicoton/pylearn2
pylearn2/models/independent_multiclass_logistic.py
44
2491
""" Multiclass-classification by taking the max over a set of one-against-rest logistic classifiers. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googleg...
bsd-3-clause
LucaDiStasio/thinPlyMechanics
python/analyzeToyaSolution.py
1
6627
#!/usr/bin/env Python # -*- coding: utf-8 -*- ''' ===================================================================================== Copyright (c) 2016-2018 Université de Lorraine & Luleå tekniska universitet Author: Luca Di Stasio <luca.distasio@gmail.com> <luca.distasio@ingpec.eu> This pr...
apache-2.0
hnawner/musical-forms
key-meter-id/nets/key-meter-id-rnn.py
1
4597
#!/usr/bin/env python from __future__ import division, print_function import tensorflow as tf import numpy as np import k_m_id_utils as utils from sklearn.utils import shuffle from sklearn.model_selection import train_test_split as tts from tensorflow.contrib.layers import fully_connected class RNN: n_outputs = ...
mit
mumuwoyou/vnpy
vn.trader/ctaAlgo/FoldStratrgy.py
1
12283
# encoding: UTF-8 from ctaBase import * from ctaTemplate import CtaTemplate import talib import numpy as np class FOLDSTRATEGY(CtaTemplate): """ 策略基本思路是:如果连续两根K线收阳,就在两根K线的最高点回撤 一定的幅度挂多单进场单,止盈为两根K线的最高点,止损为连根K线 的最低点;做空策略相反。 注意:测试策略,切勿实盘。后果自负 """ className = 'FOLDSTRATEGY' ...
mit
ryfeus/lambda-packs
Pandas_numpy/source/pandas/util/_doctools.py
5
6816
import numpy as np import pandas as pd import pandas.compat as compat class TablePlotter(object): """ Layout some DataFrames in vertical/horizontal layout for explanation. Used in merging.rst """ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): self.cell_width = cell_...
mit
airanmehr/bio
Scripts/HLI/Tibet/samples.py
1
1117
import os import matplotlib as mpl mpl.use('TkAgg') import pandas as pd; import numpy as np; import seaborn as sns np.set_printoptions(linewidth=200, precision=5, suppress=True) import pandas as pd; from matplotlib.backends.backend_pdf import PdfPages pd.options.display.max_rows = 50; pd.options.display.expand_fra...
mit
RobertABT/heightmap
build/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
3
5765
""" Render to qt from agg """ from __future__ import division, print_function import os, sys import ctypes import matplotlib from matplotlib.figure import Figure from backend_agg import FigureCanvasAgg from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\ show, draw_if_interactive, backend_ve...
mit
BioroboticsLab/diktya
tests/test_gan.py
1
4589
# Copyright 2015 Leon Sixt # # 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, sof...
apache-2.0
jlegendary/scikit-learn
examples/tree/plot_tree_regression.py
206
1476
""" =================================================================== Decision Tree Regression =================================================================== A 1D regression with decision tree. The :ref:`decision trees <tree>` is used to fit a sine curve with addition noisy observation. As a result, it learns ...
bsd-3-clause
DamCB/tyssue
tyssue/io/csv.py
2
1111
import pandas as pd import numpy as np def write_storm_csv( filename, points, coords=["x", "y", "z"], split_by=None, **csv_args ): """ Saves a point cloud array in the storm format """ columns = ["frame", "x [nm]", "y [nm]", "z [nm]", "uncertainty_xy", "uncertainty_z"] points = points.dropna()...
gpl-3.0
brianlorenz/COSMOS_IMACS_Redshifts
Data_Conversion/verb_to_txt.py
1
3517
#Converts the verb files to .txt (eg j7_verb.txt to j7.txt) ###Usage - run verb_to_txt.py 'a6' #this will convert verb_a6.txt to a6.txt import numpy as np from astropy.io import ascii import sys, os, string import pandas as pd letnum = sys.argv[1] #Location of verb_xx.txt verbloc = '/Users/blorenz/COSMOS/COSMOSData...
mit
markslwong/tensorflow
tensorflow/examples/tutorials/word2vec/word2vec_basic.py
28
9485
# Copyright 2015 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
draperjames/bokeh
bokeh/charts/builders/chord_builder.py
7
12304
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Chord class which lets you build your Chord charts just passing the arguments to the Chart class and calling the proper functions. """ # --------------------------------------------------------------...
bsd-3-clause
FofanovLab/VaST
VaST/analyze.py
1
10882
from __future__ import absolute_import, print_function, division import argparse import sys import json import logging import os import ast import pandas as pd import numpy as np from glob import glob from collections import Counter, defaultdict from itertools import chain, product, starmap from utils import file_type...
mit
bartosh/zipline
zipline/__main__.py
1
9888
import errno import os from functools import wraps import click import logbook import pandas as pd from six import text_type from zipline.data import bundles as bundles_module from zipline.utils.cli import Date, Timestamp from zipline.utils.run_algo import _run, load_extensions try: __IPYTHON__ except NameError:...
apache-2.0
PanDAWMS/panda-bigmon-core
core/dashboards/dtctails.py
1
8943
import pandas as pd from matplotlib import pyplot as plt import urllib.request as urllibr from urllib.error import HTTPError import json import datetime import numpy as np import os from sklearn.preprocessing import scale from core.views import initRequest, setupView, DateEncoder, setCacheData from django.shortcuts imp...
apache-2.0
Clyde-fare/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
TheChymera/pyMTF
pyMTF.py
1
6039
#!/usr/bin/env python from __future__ import division __author__ = 'Horea Christian' import Image import gtk import numpy as np from pylab import figure, show, errorbar import matplotlib.pyplot as plt from matplotlib import axis if gtk.pygtk_version < (2,3,90): print "PyGtk 2.3.90 or later required for Plot-It" ...
gpl-3.0
NicovincX2/Battleship
setup.py
1
1287
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages import os import io import naval_battle here = os.path.abspath(os.path.dirname(__file__)) def read(*filenames, **kwargs): """Lit plusieurs fichiers et les assemble. """ encoding = kwargs.get('encoding', 'utf-8') ...
gpl-3.0
marcocaccin/scikit-learn
sklearn/svm/tests/test_sparse.py
8
13176
from nose.tools import assert_raises, assert_true, assert_false import numpy as np from scipy import sparse from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classif...
bsd-3-clause
lcharleux/compmod
doc/sandbox/ludovic/cuboidTest_pseudohomo.py
1
5515
from compmod.models import CuboidTest_BC from abapy import materials from abapy.misc import load import matplotlib.pyplot as plt from matplotlib import cm import numpy as np import pickle, copy import platform def field_func(outputs, step): """ A function that defines the scalar field you want to plot ...
gpl-2.0
snnn/tensorflow
tensorflow/python/estimator/canned/linear_testing_utils.py
3
87977
# 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
jm-begon/scikit-learn
sklearn/grid_search.py
103
36232
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
bsd-3-clause
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/neighbors/tests/test_ball_tree.py
30
9727
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics impo...
bsd-3-clause
boada/desCluster
mkSurvey/plotting/mk_bettermap.py
4
5280
import matplotlib.pyplot as plt from matplotlib.patches import Polygon import numpy as np from astLib.astCoords import decimal2hms import h5py as hdf def rectangle(m,lon1,lat1,lon2,lat2,ec='0.3',shading=None, step=100, ax=None): """Draw a projection correct rectangle on the map. RAmax, DECmax, RAmin, DECmin is...
mit
dwhswenson/openpathsampling
openpathsampling/tests/test_histogram.py
2
11957
from __future__ import division from __future__ import absolute_import from past.utils import old_div from builtins import object from .test_helpers import assert_items_almost_equal, assert_items_equal import pytest import logging logging.getLogger('openpathsampling.initialization').setLevel(logging.CRITICAL) logging.g...
mit
pprett/statsmodels
statsmodels/tsa/base/tests/test_datetools.py
1
3208
from datetime import datetime import numpy.testing as npt from statsmodels.tsa.base.datetools import (_date_from_idx, _idx_from_dates, date_parser, date_range_str, dates_from_str, dates_from_range, _infer_freq, _freq_to_pandas) def test_date_from_idx(): d1 = datetime(2008, 12, 31) ...
bsd-3-clause
kastnerkyle/ift6268h15
hw3/plot_it.py
1
1492
import numpy as np import matplotlib.pyplot as plt import sys def dispims_color(M, border=0, bordercolor=[0.0, 0.0, 0.0], *imshow_args, **imshow_keyargs): """ Display an array of rgb images. The input array is assumed to have the shape numimages x numpixelsY x numpixelsX x 3 """ bordercolor = np.array...
bsd-3-clause
hlin117/scikit-learn
sklearn/metrics/ranking.py
25
27863
"""Metrics to assess performance on classification task given scores Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria....
bsd-3-clause
comocheng/RMG-Py
rmgpy/cantherm/main.py
9
10533
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the # RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of cha...
mit
rahuldhote/scikit-learn
sklearn/decomposition/pca.py
192
23117
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Michael Eickenberg <michael.eickenberg@inria.fr> # # Lice...
bsd-3-clause
FCP-INDI/nipype
doc/sphinxext/numpy_ext/docscrape_sphinx.py
10
7893
from __future__ import absolute_import import re import inspect import textwrap import pydoc import sphinx from .docscrape import NumpyDocString, FunctionDoc, ClassDoc from nipype.external.six import string_types class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): self.use_plo...
bsd-3-clause
pyspace/test
pySPACE/missions/nodes/sink/classification_performance_sink.py
1
55361
# This Python file uses the following encoding: utf-8 # The upper line is needed for one comment in this module. """ Calculate performance measures from classification results and store them All performance sink nodes interface to the :mod:`~pySPACE.resources.dataset_defs.metric` datasets, where the final metric value...
gpl-3.0
robbymeals/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
keskitalo/healpy
doc/create_images.py
3
1125
import healpy as hp import numpy as np import matplotlib.pyplot as plt SIZE = 400 DPI = 60 m = np.arange(hp.nside2npix(32)) hp.mollview(m, nest=True, xsize=SIZE, title="Mollview image NESTED") plt.savefig("static/moll_nside32_nest.png", dpi=DPI) hp.mollview(m, nest=False, xsize=SIZE, title="Mollview image RING") plt...
gpl-2.0
rspavel/spack
var/spack/repos/builtin/packages/py-umi-tools/package.py
5
1429
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyUmiTools(PythonPackage): """Tools for handling Unique Molecular Identifiers in NGS data ...
lgpl-2.1
georgesung/ssd_tensorflow_traffic_sign_detection
train.py
2
7894
''' Train the model on dataset ''' import tensorflow as tf from settings import * from model import SSDModel from model import ModelHelper import numpy as np from sklearn.model_selection import train_test_split import cv2 import math import os import time import pickle from PIL import Image def next_batch(X, y_conf, ...
mit
saketkc/statsmodels
statsmodels/graphics/functional.py
31
14477
"""Module for functional boxplots.""" from statsmodels.compat.python import combinations, range import numpy as np from scipy import stats from scipy.misc import factorial from . import utils __all__ = ['fboxplot', 'rainbowplot', 'banddepth'] def fboxplot(data, xdata=None, labels=None, depth=None, method='MBD', ...
bsd-3-clause
wathen/PhD
MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/GeneralisedEigen/GeneralisedEigenvalues.py
2
3030
import scipy.sparse as sp import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc import CheckPetsc4py as CP import MatrixOperations as MO import matplotlib.pylab as plt from scipy.linalg import eigvals def IndexSet(W): if str(W.__class__).find('list') == -1: n = W.num_sub_spaces() ...
mit
henrykironde/scikit-learn
benchmarks/bench_multilabel_metrics.py
276
7138
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from __future__ import division from __future__ import print_function from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as...
bsd-3-clause
earlbellinger/asteroseismology
misc/ce.py
1
3716
import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np #import pandas as pd n, l, nu, dnu = np.loadtxt('../regression/data/16CygB-freqs.dat', skiprows=1).T def normalize(x): return (x-np.min(x))/(np.max(x)-np.min(x)) plt.figure() xs = normalize(nu%234) ys = nor...
gpl-2.0
cbertinato/pandas
pandas/tests/io/parser/test_na_values.py
1
14002
""" Tests that NA values are properly handled during parsing for all of the parsers defined in parsers.py """ from io import StringIO import numpy as np import pytest from pandas import DataFrame, Index, MultiIndex import pandas.util.testing as tm import pandas.io.common as com def test_string_nas(all_parsers): ...
bsd-3-clause
materialsproject/MPContribs
mpcontribs-portal/mpcontribs/users/dilute_solute_diffusion/pre_submission.py
1
10916
import os, json, requests, sys from pandas import read_excel, isnull, ExcelWriter, Series from mpcontribs.io.core.recdict import RecursiveDict from mpcontribs.io.core.utils import clean_value, nest_dict from mpcontribs.io.archieml.mpfile import MPFile from pymatgen.ext.matproj import MPRester project = "dilute_solute_...
mit
Achuth17/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
exa-analytics/exatomic
exatomic/va/va.py
2
41588
# -*- coding: utf-8 -*- # Copyright (c) 2015-2020, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Vibrational Averaging ######################### Collection of classes for VA program """ import numpy as np import pandas as pd import glob import re import os from exa.util.cons...
apache-2.0
heliopython/heliopy
heliopy/data/util.py
1
13179
""" Utility functions for data downloading. **Note**: these methods are liable to change at any time. """ import abc import collections as coll import datetime as dt import io import logging import os import pathlib as path import re import shutil import sys import urllib.error as urlerror import urllib.request as url...
gpl-3.0
myuuuuun/NumericalCalculation
chapter2/chap2.py
1
11780
#!/usr/bin/python #-*- encoding: utf-8 -*- """ Copyright (c) 2015 @myuuuuun https://github.com/myuuuuun/NumericalCalculation This software is released under the MIT License. """ from __future__ import division, print_function import math import numpy as np import functools import sys import types import matplotlib.pyp...
mit
vogelsgesang/checkmate
checkmate/contrib/plugins/git/test/lib/test_repository.py
3
4705
""" This file is part of checkmate, a meta code checker written in Python. Copyright (C) 2015 Andreas Dewes, QuantifiedCode UG This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3...
agpl-3.0
rishikksh20/scikit-learn
sklearn/datasets/tests/test_samples_generator.py
25
16022
from __future__ import division from collections import defaultdict from functools import partial import numpy as np import scipy.sparse as sp from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing imp...
bsd-3-clause
fyffyt/scikit-learn
examples/ensemble/plot_gradient_boosting_regression.py
227
2520
""" ============================ Gradient Boosting regression ============================ Demonstrate Gradient Boosting on the Boston housing dataset. This example fits a Gradient Boosting model with least squares loss and 500 regression trees of depth 4. """ print(__doc__) # Author: Peter Prettenhofer <peter.prett...
bsd-3-clause
Obus/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
ACarfi/Regularization-networks
regularizationNetworks/holdoutCVKernRLS.py
1
3384
import numpy as np from regularizedKernLSTrain import regularizedkernlstrain from regularizedKernLSTest import regularizedkernlstest def holdoutcvkernrls(x, y, kernel, perc, nrip, intlambda, intkerpar): ''' Input: xtr: the training examples ytr: the training labels kernel: the kernel function...
mit
jougs/nest-simulator
pynest/nest/tests/test_spatial/test_plotting.py
12
5748
# -*- coding: utf-8 -*- # # test_plotting.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, ...
gpl-2.0
shikhardb/scikit-learn
sklearn/calibration.py
12
18774
"""Calibration of predicted probabilities.""" # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Balazs Kegl <balazs.kegl@gmail.com> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Mathieu Blondel <mathieu@mblondel.org> # # License: BSD 3 clause from __future__ impo...
bsd-3-clause
ResourceHog/POMDPCapstone
simulator.py
1
15092
# -*- coding: utf-8 -*- """ Created on Mon Feb 13 16:48:10 2017 @author: ECOWIZARD """ ########################################### # Suppress matplotlib user warnings # Necessary for newer version of matplotlib import warnings warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib")...
gpl-3.0
mindriot101/bokeh
examples/plotting/file/elements.py
5
1855
import pandas as pd from bokeh.models import ColumnDataSource, LabelSet from bokeh.plotting import figure, show, output_file from bokeh.sampledata.periodic_table import elements elements = elements.copy() elements = elements[elements["atomic number"] <= 82] elements = elements[~pd.isnull(elements["melting point"])] m...
bsd-3-clause
weissercn/learningml
learningml/GoF/p_value_scoring_object.py
1
14168
from __future__ import print_function import sys import numpy as np from scipy import stats import adaptive_binning_chisquared_2sam def weisser_searchsorted(l_test1, l_test2): l_test1, l_test2 = np.array(l_test1), np.array(l_test2) #print("l_test1 : ", l_test1) l_tot = np.sort(np.append(l_test...
mit
caidongyun/Dato-Core
src/unity/python/graphlab/data_structures/sgraph.py
13
58501
""" .. warning:: This product is currently in a beta release. The API reference is subject to change. This package defines the GraphLab Create SGraph, Vertex, and Edge objects. The SGraph is a directed graph, consisting of a set of Vertex objects and Edges that connect pairs of Vertices. The methods in this module are...
agpl-3.0
mantidproject/mantid
qt/python/mantidqt/widgets/plotconfigdialog/test/test_apply_all_properties.py
3
18083
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2019 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
alexeyum/scikit-learn
benchmarks/bench_covertype.py
57
7378
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
lht142934/trading-with-python
cookbook/getDataFromYahooFinance.py
77
1391
# -*- coding: utf-8 -*- """ Created on Sun Oct 16 18:37:23 2011 @author: jev """ from urllib import urlretrieve from urllib2 import urlopen from pandas import Index, DataFrame from datetime import datetime import matplotlib.pyplot as plt sDate = (2005,1,1) eDate = (2011,10,1) symbol = 'SPY' fNa...
bsd-3-clause
jswoboda/MahaliPlotting
makeTECtimeplot.py
1
1446
#!/usr/bin/env python """ Created on Thu Mar 3 14:45:35 2016 @author: swoboj """ import os, glob,getopt,sys import scipy as sp import matplotlib matplotlib.use('Agg') # for use where you're running on a command line import matplotlib.pyplot as plt import matplotlib.colors as colors from GeoData.plotting import scatt...
mit
luigift/pybrain
examples/supervised/evolino/superimposed_sine.py
25
3496
from __future__ import print_function #!/usr/bin/env python __author__ = 'Michael Isik' from pylab import plot, show, ion, cla, subplot, title, figlegend, draw import numpy from pybrain.structure.modules.evolinonetwork import EvolinoNetwork from pybrain.supervised.trainers.evolino import EvolinoTrainer from l...
bsd-3-clause
ithemal/Ithemal
learning/pytorch/data/data.py
1
2131
#main data file import numpy as np import common_libs.utilities as ut import random import torch.nn as nn import torch.autograd as autograd import torch.optim as optim import torch import matplotlib.pyplot as plt class Data(object): """ Main data object which extracts data from a database, partition it and ...
mit
cybernet14/scikit-learn
sklearn/tree/tree.py
59
34839
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
abhishekgahlot/scikit-learn
examples/linear_model/plot_sgd_comparison.py
167
1659
""" ================================== Comparing various online solvers ================================== An example showing how different online solvers perform on the hand-written digits dataset. """ # Author: Rob Zinkov <rob at zinkov dot com> # License: BSD 3 clause import numpy as np import matplotlib.pyplot a...
bsd-3-clause
hugobowne/scikit-learn
sklearn/neural_network/tests/test_mlp.py
46
18585
""" Testing for Multi-layer Perceptron module (sklearn.neural_network) """ # Author: Issam H. Laradji # Licence: BSD 3 clause import sys import warnings import numpy as np from numpy.testing import assert_almost_equal, assert_array_equal from sklearn.datasets import load_digits, load_boston from sklearn.datasets i...
bsd-3-clause
liyu1990/sklearn
sklearn/utils/tests/test_estimator_checks.py
69
3894
import scipy.sparse as sp import numpy as np import sys from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.testing import assert_raises_regex, assert_true from sklearn.utils.estimator_checks import check_estimator from sklearn.utils....
bsd-3-clause
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/SoftContact_ElPPlShear/Shear_Zone_Length/SZ_h_1e3/Normal_Stress_Plot.py
72
2800
#!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as np; import matplotlib; import math; from matplotlib.ticker import MaxNLocator plt.rcParams.update({'font.size': 28}) # set tick width mpl.rcParams['xtick.major.size'] = 10 mpl.rcParams['xtick.major.width']...
cc0-1.0
bkomboz/pymltk
pymltk/exploration.py
1
6123
# imports import numpy as np import pandas as pd import dask.dataframe as dd import matplotlib.pyplot as plt from . import utils # functions def summarize(data=None, features=None, size=5, digits=3, as_df=False, verbose=True, **kwargs): """ Summarize features of a given pandas/dask dataframe. ...
apache-2.0
Adai0808/scikit-learn
examples/mixture/plot_gmm_sin.py
248
2747
""" ================================= Gaussian Mixture Model Sine Curve ================================= This example highlights the advantages of the Dirichlet Process: complexity control and dealing with sparse data. The dataset is formed by 100 points loosely spaced following a noisy sine curve. The fit by the GMM...
bsd-3-clause
nhzandi/openface
util/align-dlib.py
12
6566
#!/usr/bin/env python2 # # Copyright 2015-2016 Carnegie Mellon University # # 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
AlexanderFabisch/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
348
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
shahankhatch/scikit-learn
sklearn/tests/test_cross_validation.py
29
46740
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from scipy import stats from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.test...
bsd-3-clause
rstoneback/pysat
setup.py
2
3859
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup # To use a consistent encoding import codecs import os import sys here = os.path.abspath(os.path.dirname(__...
bsd-3-clause
florentchandelier/zipline
zipline/utils/calendars/us_holidays.py
6
4015
from pandas import ( Timestamp, DateOffset, date_range, ) from pandas.tseries.holiday import ( Holiday, sunday_to_monday, nearest_workday, ) from dateutil.relativedelta import ( MO, TH ) from pandas.tseries.offsets import Day from zipline.utils.calendars.trading_calendar import ( ...
apache-2.0
markslwong/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/dataframe_test.py
62
3753
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
chris-ch/cointeg
src/mktdatadb/__init__.py
1
7663
from collections import OrderedDict from decimal import Decimal import glob import logging import os from urllib.parse import quote, unquote from zipfile import ZipFile from datetime import timedelta, datetime import itertools import pandas import pytz __author__ = 'Christophe' ON_TIME_NYSEARCA = '093000' OFF_TIME_NY...
gpl-3.0
zorojean/scikit-learn
benchmarks/bench_sgd_regression.py
283
5569
""" Benchmark for SGD regression Compares SGD regression against coordinate descent and Ridge on synthetic data. """ print(__doc__) # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD 3 clause import numpy as np import pylab as pl import gc from time import time from sklearn.linear_model i...
bsd-3-clause
RomainBrault/scikit-learn
examples/gaussian_process/plot_compare_gpr_krr.py
84
5205
""" ========================================================== Comparison of kernel ridge and Gaussian process regression ========================================================== Both kernel ridge regression (KRR) and Gaussian process regression (GPR) learn a target function by employing internally the "kernel trick...
bsd-3-clause
anntzer/scikit-learn
sklearn/inspection/tests/test_permutation_importance.py
5
19332
import pytest import numpy as np from numpy.testing import assert_allclose from sklearn.compose import ColumnTransformer from sklearn.datasets import load_diabetes from sklearn.datasets import load_iris from sklearn.datasets import make_classification from sklearn.datasets import make_regression from sklearn.dummy im...
bsd-3-clause
ScienceStacks/SciSheets
mysite/scisheets/plugins/test_groupBy.py
2
3305
""" Tests for groupBy. """ from scisheets.core.helpers_test import TEST_DIR from groupBy import groupBy from roundValues import roundValues import os import pandas as pd import numpy as np import pickle import unittest CAT1 = ['a', 'a', 'b', 'b'] CAT2 = ['x', 'y', 'x', 'y'] CAT1_LIST = list(CAT1) CAT1_LIST.extend(CAT...
apache-2.0
bert9bert/statsmodels
statsmodels/graphics/tests/test_boxplots.py
3
2315
import numpy as np from numpy.testing import dec from statsmodels.graphics.boxplots import violinplot, beanplot from statsmodels.datasets import anes96 try: import matplotlib.pyplot as plt have_matplotlib = True except: have_matplotlib = False @dec.skipif(not have_matplotlib) def test_violinplot_beanpl...
bsd-3-clause
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/example/ssd/dataset/pycocotools/coco.py
11
17747
__author__ = 'tylin' __version__ = '2.0' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Pleas...
apache-2.0
cwu2011/scikit-learn
sklearn/ensemble/gradient_boosting.py
126
65552
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
bsd-3-clause
jjunell/paparazzi
sw/airborne/test/ahrs/ahrs_utils.py
86
4923
#! /usr/bin/env python # Copyright (C) 2011 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later ...
gpl-2.0
ambikeshwar1991/gnuradio-3.7.4
gr-digital/examples/berawgn.py
17
4897
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
nextgenusfs/amptk
amptk/amptk.py
1
46407
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import os import importlib from natsort import natsorted from amptk import amptklib from pkg_resources import get_distribution __version__ = get_distribution('amptk').version d...
bsd-2-clause
CforED/Machine-Learning
doc/sphinxext/gen_rst.py
106
40198
""" Example generation for the scikit learn Generate the rst files for the examples by iterating over the python example files. Files that generate images should start with 'plot' """ from __future__ import division, print_function from time import time import ast import os import re import shutil import traceback i...
bsd-3-clause
tgsmith61591/smrt
smrt/balance/tests/test_smote.py
1
1656
# -*- coding: utf-8 -*- # # Author: Taylor Smith <taylor.smith@alkaline-ml.com> # # Test the SMOTE balancer from __future__ import division, absolute_import, division from numpy.testing import assert_almost_equal, assert_array_almost_equal from smrt.testing import load_imbalanced_mnist from sklearn.datasets import loa...
bsd-3-clause
verdverm/pypge
experiments/01_baseline/thegp.py
1
6425
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import pandas as pd from sklearn.metrics import r2_score import data as DATA import operator import math import random import numpy import multiprocessing from deap import algorithms fro...
mit
kyleabeauchamp/HMCNotes
code/obsolete/analyze_inefficiency_alanine.py
1
2886
import statsmodels.api as sm import schwalbe_couplings import mdtraj as md import msmbuilder.decomposition, msmbuilder.featurizer, msmbuilder.msm import pymbar import pandas as pd lag_time = 25 filename0 = "./data/mixed_alanineexplicit_LangevinIntegrator_2.000_0.%s" #filename1 = "./data/mixed_alanineexplicit_XCGHMCRE...
gpl-2.0
jaidevd/scikit-learn
examples/linear_model/plot_sgd_comparison.py
112
1819
""" ================================== Comparing various online solvers ================================== An example showing how different online solvers perform on the hand-written digits dataset. """ # Author: Rob Zinkov <rob at zinkov dot com> # License: BSD 3 clause import numpy as np import matplotlib.pyplot a...
bsd-3-clause