repo_name
stringlengths
6
67
path
stringlengths
5
185
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
962k
license
stringclasses
15 values
cdegroc/scikit-learn
examples/covariance/plot_robust_vs_empirical_covariance.py
5
5860
""" ======================================= Robust vs Empirical covariance estimate ======================================= The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers in the data set. In such a case, one would have better to use a robust estimator of covariance to ga...
bsd-3-clause
rjw57/vagrant-ipython
ipython/profile_default/ipython_notebook_config.py
1
19754
# Configuration file for ipython-notebook. c = get_config() #------------------------------------------------------------------------------ # NotebookApp configuration #------------------------------------------------------------------------------ # NotebookApp will inherit config from: BaseIPythonApplication, Appli...
mit
sdh11/gnuradio
gr-digital/examples/example_fll.py
7
5704
#!/usr/bin/env python # # Copyright 2011-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
TuKo/brainiak
examples/searchlight/example_searchlight.py
5
2942
# Copyright 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 required by applicable law or agreed to...
apache-2.0
sjsrey/pysal
docsrc/conf.py
4
8315
# -*- coding: utf-8 -*- # # pysal documentation build configuration file, created by # sphinx-quickstart on Wed Jun 6 15:54:22 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
bsd-3-clause
plissonf/scikit-learn
sklearn/neighbors/graph.py
208
7031
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam import warnings from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def _check_params(X, metric, p, metric_...
bsd-3-clause
0x0all/scikit-learn
sklearn/datasets/tests/test_lfw.py
50
6849
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by running the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging ...
bsd-3-clause
ahkab/ahkab
ahkab/testing.py
1
33795
# -*- coding: utf-8 -*- # testing.py # Testing framework # Copyright 2014 Giuseppe Venturini # This file is part of the ahkab simulator. # # Ahkab 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, version 2 of ...
gpl-2.0
rjleveque/riemann_book
exact_solvers/interactive_pplanes.py
3
17630
""" Interactive phase plane plot for Euler equations with ideal gas, Euler equations with Tammann equations of state and acoustic equations. """ import sys, os import numpy as np from scipy.optimize import fsolve import matplotlib.pyplot as plt from ipywidgets import widgets from ipywidgets import interact from IPython...
bsd-3-clause
jayfans3/jieba
test/extract_topic.py
65
1463
import sys sys.path.append("../") from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn import decomposition import jieba import time import glob import sys import os import random if len(sys.argv)<2: print("usage: extract_topic.py di...
mit
nhmc/LAE
cloudy/comp7/final/model.py
6
21973
""" Make a likelihood function for use with emcee Given input Z, nH, k_C, k_N, k_Al, aUV, NHI return ln of the likelihood. This module must define the following objects: - a dictionary P with keys. The value of every key is a tuple with the same length (the number of model parameters) name : parameter names ...
mit
mne-tools/mne-tools.github.io
0.19/_downloads/8ed64d7c92012e6fcb6501cd8cdb8d25/plot_40_sensor_locations.py
1
11176
""" .. _tut-sensor-locations: Working with sensor locations ============================= This tutorial describes how to read and plot sensor locations, and how the physical location of sensors is handled in MNE-Python. .. contents:: Page contents :local: :depth: 2 As usual we'll start by importing the module...
bsd-3-clause
rohit12/opencog
opencog/python/spatiotemporal/temporal_events/animation.py
34
4896
from matplotlib.lines import Line2D from matplotlib.ticker import AutoMinorLocator from numpy.core.multiarray import zeros from spatiotemporal.temporal_events.trapezium import TemporalEventTrapezium from spatiotemporal.time_intervals import TimeInterval from matplotlib import pyplot as plt from matplotlib import animat...
agpl-3.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/sklearn/cluster/spectral.py
5
19195
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
mit
TomAugspurger/pandas
pandas/tests/tseries/holiday/test_holiday.py
2
8620
from datetime import datetime import pytest from pytz import utc import pandas._testing as tm from pandas.tseries.holiday import ( MO, SA, AbstractHolidayCalendar, DateOffset, EasterMonday, GoodFriday, Holiday, HolidayCalendarFactory, Timestamp, USColumbusDay, USLaborDay, ...
bsd-3-clause
ryanjmccall/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/table.py
69
16757
""" Place a table below the x-axis at location loc. The table consists of a grid of cells. The grid need not be rectangular and can have holes. Cells are added by specifying their row and column. For the purposes of positioning the cell at (0, 0) is assumed to be at the top left and the cell at (max_row, max_col) i...
gpl-3.0
sumspr/scikit-learn
sklearn/decomposition/nmf.py
100
19059
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck <L.J.Buitinck@uva.nl> # Author: Chih-Jen Lin, National Taiwan University (original projected gradient # NMF implementation) # Author: Anthony Di Franco (original Python and NumPy port) # License: BSD 3 clause from __future__ ...
bsd-3-clause
Udzu/pudzu
dataviz/flagsrwbpercent.py
1
2803
from pudzu.charts import * from pudzu.sandbox.bamboo import * import scipy.stats df = pd.read_csv("datasets/flagsrwbpercent.csv").set_index("country") class HeraldicPalette(metaclass=NamedPaletteMeta): ARGENT = "#ffffff" AZURE = "#0f47af" GULES = "#da121a" SABLE = "#00ff00" def flag_image(c): ret...
mit
jpinedaf/pyspeckit
setup.py
2
3802
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import glob import os import sys import ah_bootstrap from setuptools import setup #A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin_...
mit
jseabold/scikit-learn
sklearn/ensemble/tests/test_forest.py
26
41675
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: Gilles Louppe, # Brian Holt, # Andreas Mueller, # Arnaud Joly # License: BSD 3 clause import pickle from collections import defaultdict from itertools import combinations from itertools import product import numpy ...
bsd-3-clause
anurag313/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
EPFL-LCN/neuronaldynamics-exercises
neurodynex3/test/test_hopfield.py
1
1162
# import matplotlib # matplotlib.use("Agg") # needed for plotting on travis def test_pattern_factory(): """ Test hopfield_network.pattern_tools """ import neurodynex3.hopfield_network.pattern_tools as tools pattern_size = 6 factory = tools.PatternFactory(pattern_size) p1 = factory.create_checkerb...
gpl-2.0
kkozarev/mwacme
src/plot_max_spectra_synchrotron_integrated_subset.py
2
10688
import glob, os, sys,fnmatch import matplotlib.pyplot as plt from astropy.io import ascii import numpy as np def match_list_values(ls1,ls2): #Return lists of the indices where the values in two lists match #It will return only the first index of occurrence of repeating values in the lists #Written by Kame...
gpl-2.0
henridwyer/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
droundy/fac
bench/plot-benchmark.py
1
3227
#!/usr/bin/python3 from __future__ import print_function import os, sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import cats import hierarchy import dependentchains import sleepy import independent #matplotlib.rc('font', size='16.0') datadir = os.getcwd()+'/data/' ...
gpl-2.0
Srisai85/scikit-learn
sklearn/linear_model/__init__.py
270
3096
""" The :mod:`sklearn.linear_model` module implements generalized linear models. It includes Ridge regression, Bayesian Regression, Lasso and Elastic Net estimators computed with Least Angle Regression and coordinate descent. It also implements Stochastic Gradient Descent related algorithms. """ # See http://scikit-le...
bsd-3-clause
adamgreenhall/scikit-learn
examples/ensemble/plot_gradient_boosting_quantile.py
392
2114
""" ===================================================== Prediction Intervals for Gradient Boosting Regression ===================================================== This example shows how quantile regression can be used to create prediction intervals. """ import numpy as np import matplotlib.pyplot as plt from skle...
bsd-3-clause
buguen/pylayers
pylayers/gis/srtm.py
1
14250
#!/usr/bin/env python # -*- coding: utf-8 -*- # Pylint: Disable name warningsos.path.join(self.directory,continent) # pylint: disable-msg=C0103 """Load and process SRTM data.""" #import xml.dom.minidom from HTMLParser import HTMLParser import ftplib import urllib2 import re import pickle import os.path import os imp...
lgpl-3.0
Garrett-R/scikit-learn
sklearn/cluster/tests/test_dbscan.py
16
5134
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from numpy.testing import assert_raises from scipy.spatial import distance from sklearn.utils.testing import assert_equal from sklearn.cluster.dbscan_ import DBSCAN, dbscan from .common import generate_clustered_data from sklearn.metrics...
bsd-3-clause
ahye/FYS2140-Resources
examples/plotting/three_gauss.py
1
1086
#!/usr/bin/env python """ Created on Mon 2 Dec 2013 Scriptet viser hvordan man kan plotte 3D-figurer med matplotlib. @author Benedicte Emilie Braekken """ from matplotlib.pyplot import * from numpy import * from mpl_toolkits.mplot3d import Axes3D def gauss_2d( x, y ): ''' Todimensjonal gauss-kurve. ''' ...
mit
terkkila/scikit-learn
sklearn/utils/multiclass.py
92
13986
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi # # License: BSD 3 clause """ Multi-class / multi-label utility function ========================================== """ from __future__ import division from collections import Sequence from itertools import chain import warnings from scipy.sparse import issparse fro...
bsd-3-clause
abhishekkrthakur/scikit-learn
sklearn/feature_extraction/dict_vectorizer.py
20
11431
# Authors: Lars Buitinck # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from array import array from collections import Mapping from operator import itemgetter import numpy as np import scipy.sparse as sp from ..base import BaseEstimator, TransformerMixin from ..externals import six from ..ext...
bsd-3-clause
crawfordsm/pysalt
saltspec/specsens.py
2
6366
#!/usr/bin/env python # Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. # """ SPECSENS calulates the calibration curve given an observation, a standard star, and the extinction curve for the site. The task assumes a 1...
bsd-3-clause
jereze/scikit-learn
examples/mixture/plot_gmm.py
248
2817
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet process. Both models have access to five components with which to fit the data. Note that the EM model will necessari...
bsd-3-clause
RachitKansal/scikit-learn
examples/feature_selection/plot_permutation_test_for_classification.py
250
2233
""" ================================================================= Test with permutations the significance of a classification score ================================================================= In order to test if a classification score is significative a technique in repeating the classification procedure aft...
bsd-3-clause
hsaputra/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/io_test.py
137
5063
# 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
pompiduskus/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
143
22295
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises...
bsd-3-clause
tapomayukh/projects_in_python
classification/Classification_with_kNN/Single_Contact_Classification/Final/results/2-categories/test10_cross_validate_categories_mov_fixed_1200ms.py
1
4331
# Principal Component Analysis Code : from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import ro...
mit
theodoregoetz/clas12-dc-wiremap
scratch/ax.py
1
1150
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import ImageGrid import numpy as np from mpl_toolkits.axes_grid1.inset_locator import inset_axes im = np.arange(100) im.shape = 10, 10 fig = plt.figure(1, (5., 5.)) grid = ImageGrid(fig, (0.1, 0.4, 0.2, 0.2), # similar to subplot(111) nrows_...
gpl-3.0
gsnyder206/synthetic-image-morph
candelize.py
1
11413
import cProfile import pstats import math import string import sys import struct import matplotlib import numpy as np import scipy.ndimage import scipy.stats as ss import scipy.signal import scipy as sp import scipy.odr as odr import glob import os import gzip import tarfile import shutil import congrid import astropy....
gpl-2.0
taynaud/sparkit-learn
splearn/linear_model/base.py
2
5024
# encoding: utf-8 import operator import numpy as np import scipy.sparse as sp from sklearn.base import copy from sklearn.linear_model.base import LinearRegression from ..utils.validation import check_rdd class SparkLinearModelMixin(object): def __add__(self, other): """Add method for Linear models wi...
apache-2.0
GaelVaroquaux/scikits.image
doc/ext/docscrape_sphinx.py
62
7703
import re, inspect, textwrap, pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): self.use_plots = config.get('use_plots', False) NumpyDocString.__init__(self, docstring, config=config) ...
bsd-3-clause
doanduyhai/incubator-zeppelin
python/src/main/resources/grpc/python/zeppelin_python.py
9
4436
# # 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
geoscixyz/em_examples
em_examples/DCWidgetResLayer2D.py
1
28082
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from SimPEG import Mesh, Maps, SolverLU, Utils from SimPEG.Utils import ExtractCoreMesh import numpy as np from SimPEG.EM.Static import DC import matplotlib import matplotlib.pyplot as plt import matplo...
mit
fraser-lab/EMRinger
Figures/S5/S5.py
1
12942
#! /usr/bin/env phenix.python # Rotamer distribution analysis tool for validation of models generated from cryoEM data. # Written by Benjamin Barad # Written for use with Ringer's (http://bl831.als.lbl.gov/ringer/) output. # # Ringer Reference: # Lang PT, Ng HL, Fraser JS, Corn JE, Echols N, Sales M, Holton JM, Albe...
bsd-3-clause
smcantab/pele
pele/amber/amberSystem.py
4
26626
""" System class for biomolecules using AMBER ff. Set up using prmtop and inpcrd files used in Amber GMIN and Optim. Potential parameters (e.g. non-bonded cut-offs are set in TODO: Parameters ---------- prmtopFname : str prmtop file name inpcrdFname : str inpcrd file name ...
gpl-3.0
cuemacro/finmarketpy
finmarketpy/curve/fxoptionscurve.py
1
39487
__author__ = 'saeedamen' # Saeed Amen # # Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro # # 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/LI...
apache-2.0
ashhher3/pylearn2
pylearn2/scripts/train.py
34
8573
#!/usr/bin/env python """ Script implementing the logic for training pylearn2 models. This is a "driver" that we recommend using for all but the most unusual training experiments. Basic usage: .. code-block:: none train.py yaml_file.yaml The YAML file should contain a pylearn2 YAML description of a `pylearn2.t...
bsd-3-clause
choderalab/perses
perses/analysis/analyse_sams_convergence.py
1
1762
import matplotlib.pyplot as plt import os import sys from glob import glob from perses.analysis import utils if __name__ == '__main__': directory = sys.argv[1] files = sorted(glob(os.path.join(os.getcwd(), directory, '*.nc'))) files = [x for x in files if 'checkpoint' not in x] f, axarr = plt.subplots(...
mit
dimroc/tensorflow-mnist-tutorial
lib/python3.6/site-packages/matplotlib/testing/__init__.py
10
3767
from __future__ import (absolute_import, division, print_function, unicode_literals) import warnings from contextlib import contextmanager from matplotlib.cbook import is_string_like, iterable from matplotlib import rcParams, rcdefaults, use def _is_list_like(obj): """Returns whether the...
apache-2.0
dr-guangtou/hs_galspec
manga/cframe/mgCFrameRead.py
1
2529
#!/usr/bin/env python # Filename : mgCFrameRead.py import numpy import os from astropy.io import fits from matplotlib import pyplot as plt """ Data model for mgCFrame file: HDU[0] = Empty, only used to store header HDU[1] = Flux [NPixels,NFiber], in Unit of 10^(-17) erg/s/cm^2/Ang/Fiber HDU[2] = InverseVariance of t...
bsd-3-clause
MSeifert04/astropy
astropy/visualization/wcsaxes/tests/test_formatter_locator.py
7
22451
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_almost_equal from matplotlib import rc_context from astropy import units as u from astropy.tests.helper import assert_quantity_allclose from astropy.units import UnitsError from astropy.v...
bsd-3-clause
jss-emr/openerp-7-src
openerp/addons/resource/faces/timescale.py
15
3899
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
mhdella/deeppy
setup.py
16
2509
#!/usr/bin/env python import os import re from setuptools import setup, find_packages, Command from setuptools.command.test import test as TestCommand def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() with open('requirements.txt') as f: install_requires = [l.strip() for l ...
mit
bvnayak/image_recognition
recognition/classification.py
1
2384
import numpy as np from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import * from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt import utils import math # histogram intersection kernel def histogramIntersection(M, N): m = M.shape[0] n = N.shape[0] result = np.z...
mit
CforED/Machine-Learning
examples/neighbors/plot_kde_1d.py
347
5100
""" =================================== Simple 1D Kernel Density Estimation =================================== This example uses the :class:`sklearn.neighbors.KernelDensity` class to demonstrate the principles of Kernel Density Estimation in one dimension. The first plot shows one of the problems with using histogram...
bsd-3-clause
alpenwasser/laborjournal
versuche/skineffect/python/hohlzylinder_cu_frequenzabhaengig_approx2.py
1
12509
#!/usr/bin/env python3 from sympy import * from mpmath import * from matplotlib.pyplot import * import numpy as np #init_printing() # make things prettier when we print stuff for debugging. # ************************************************************************** # # Magnetic field inside copper coil with ho...
mit
carrillo/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
214
4690
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause 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.linear_model.randomized_l1 i...
bsd-3-clause
MJuddBooth/pandas
pandas/core/sparse/frame.py
1
37597
""" Data structures for sparse float data. Life is made simpler by dealing only with float64 data """ from __future__ import division import warnings import numpy as np from pandas._libs.sparse import BlockIndex, get_blocks import pandas.compat as compat from pandas.compat import lmap from pandas.compat.numpy import...
bsd-3-clause
paztronomer/kepler_tools
UncertSine_mcmc_v01.py
1
14619
# Script to estimate uncertainties in sine fit to a Kepler light curve # If use/modify/distribute, refer to: Francisco Paz-Chinchon, # francisco at dfte.ufrn.br # DFTE, UFRN, Brazil. import emcee from pandas import * import numpy as np import mat...
mit
altairpearl/scikit-learn
benchmarks/bench_isolation_forest.py
46
3782
""" ========================================== IsolationForest benchmark ========================================== A test of IsolationForest on classical anomaly detection datasets. """ print(__doc__) from time import time import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import IsolationFore...
bsd-3-clause
xbenjox/CryptoTrade
dataui.py
1
3760
from tkinter import * import matplotlib import numpy as np from os import listdir from os.path import isfile, join from lxml import etree as ET import math class DataUI(Toplevel): markets = list() doge_data = list() def __init__(self, parent, c_api): Toplevel.__init__(self, parent) self.c =...
lgpl-3.0
ligovirgo/gwdetchar
gwdetchar/scattering/tests/test_plot.py
1
1814
# -*- coding: utf-8 -*- # Copyright (C) Alex Urban (2019) # # This file is part of the GW DetChar python package. # # GW DetChar 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,...
gpl-3.0
nhejazi/scikit-learn
sklearn/decomposition/tests/test_fastica.py
70
7808
""" Test the fastica algorithm. """ import itertools import warnings import numpy as np from scipy import stats from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less ...
bsd-3-clause
jupsal/schmies-jTEM
jeremy/Test4Plotting.py
1
1876
########################################################################### # This file holds the plotting routine for the KP solution from the Schmiesy # Thesie. There is no timestepping, it plots only the initial condition. ############################################################################ import matplotli...
bsd-2-clause
Thomsen22/MissingMoney
Peak Load Reserve - EU system/PLR_optclass.py
1
8145
# Python standard modules import numpy as np import gurobipy as gb import networkx as nx from collections import defaultdict import pandas as pd # Own modules import loaddataEU as data import PLR_opt as plrmodel class expando(object): ''' # A class for capacity market clearing ''' pas...
gpl-3.0
ClinicalGraphics/scikit-image
doc/examples/edges/plot_circular_elliptical_hough_transform.py
6
4826
""" ======================================== Circular and Elliptical Hough Transforms ======================================== The Hough transform in its simplest form is a `method to detect straight lines <http://en.wikipedia.org/wiki/Hough_transform>`__ but it can also be used to detect circles or ellipses. The algo...
bsd-3-clause
Michal-Fularz/decision_tree
decision_trees/datasets/digits_raw.py
1
4649
from typing import Tuple import matplotlib.pyplot as plt import numpy as np from sklearn import datasets from sklearn import svm, metrics from decision_trees.datasets.dataset_base import DatasetBase def sample_from_scikit(): # The digits dataset digits = datasets.load_digits() # The data that we are int...
mit
hippke/TTV-TDV-exomoons
create_figures/create_figure_4a.py
1
7168
"""n-body simulator to derive TDV+TTV diagrams of planet-moon configurations. Credit for part of the source is given to https://github.com/akuchling/50-examples/blob/master/gravity.rst Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License """ import numpy import math import matplotlib.pylab as plt...
mit
sergiy-evision/math-algorithms
sf-crime/main.py
1
3238
from __future__ import division from sklearn.svm import SVC from sklearn.tree import DecisionTreeClassifier from sklearn.preprocessing import StandardScaler from sklearn.cross_validation import KFold from sklearn.cross_validation import cross_val_score from sklearn.neighbors import KNeighborsClassifier from sklearn.ens...
mit
dismalpy/dismalpy
dismalpy/model.py
1
6371
""" Model Author: Chad Fulton License: Simplified-BSD """ import numpy as np import pandas as pd class Model(object): """ Model `endog` is one of: - a name (str) k_endog = 1 nobs = 0 names = [name] endog = np.zeros((k_endog,0)) - iterable of names (str) k_...
bsd-2-clause
FluidityStokes/fluidity
examples/backward_facing_step_3d/postprocessor_3d.py
1
10081
#!/usr/bin/env python3 import glob import sys import os import vtktools import numpy import pylab import re import extract_data from math import log def get_filelist(sample, start): def key(s): return int(s.split('_')[-1].split('.')[0]) list = glob.glob("*vtu") list = [l for l in list if 'che...
lgpl-2.1
Barmaley-exe/scikit-learn
examples/cluster/plot_cluster_comparison.py
12
4718
""" ========================================================= Comparing different clustering algorithms on toy datasets ========================================================= This example aims at showing characteristics of different clustering algorithms on datasets that are "interesting" but still in 2D. The last ...
bsd-3-clause
cowlicks/blaze
blaze/server/tests/test_server.py
2
20838
from __future__ import absolute_import, division, print_function import pytest pytest.importorskip('flask') from base64 import b64encode from contextlib import contextmanager from copy import copy import datashape from datashape.util.testing import assert_dshape_equal import numpy as np from odo import odo, convert ...
bsd-3-clause
calatre/epidemics_network
models/SIR_non_spacial.py
1
2531
# Universidade de Aveiro - Physics Department # 2016/2017 Project - Andre Calatre, 73207 # "Simulation of an epidemic" - 7/6/2017 # Simulation of a (non-spacial) SIR Epidemic Model import numpy as np import matplotlib.pyplot as plt from matplotlib import animation from matplotlib import colors #Possible status of a ...
apache-2.0
openpathsampling/openpathsampling
openpathsampling/analysis/tis/crossing_probability.py
3
5290
import collections import openpathsampling as paths from openpathsampling.netcdfplus import StorableNamedObject from openpathsampling.numerics import LookupFunction import pandas as pd import numpy as np from .core import EnsembleHistogrammer, MultiEnsembleSamplingAnalyzer class FullHistogramMaxLambdas(EnsembleHistog...
mit
grahesh/Stock-Market-Event-Analysis
quicksim/strategies/bollinger.py
4
3609
''' (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 Jan 1, 2011 @author:Drew Bratcher @contact: dbratcher@gatech.edu @summary: Contains tutorial for backteste...
bsd-3-clause
wwf5067/statsmodels
statsmodels/base/model.py
25
76781
from __future__ import print_function from statsmodels.compat.python import iterkeys, lzip, range, reduce import numpy as np from scipy import stats from statsmodels.base.data import handle_data from statsmodels.tools.tools import recipr, nan_dot from statsmodels.stats.contrast import ContrastResults, WaldTestResults f...
bsd-3-clause
dymkowsk/mantid
Framework/PythonInterface/plugins/algorithms/StringToPng.py
1
1866
#pylint: disable=no-init,invalid-name from __future__ import (absolute_import, division, print_function) from six import u import mantid class StringToPng(mantid.api.PythonAlgorithm): def category(self): """ Category """ return "DataHandling\\Plots" def name(self): """ Algori...
gpl-3.0
rpalovics/Alpenglow
python/test_alpenglow/evaluation/test_DcgScore.py
2
4634
import alpenglow as prs import alpenglow.Getter as rs import alpenglow.evaluation import pandas as pd import math import unittest class TestDcgScore(unittest.TestCase): def test_dcgScore(self): ranks = [102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102...
apache-2.0
jmontgom10/PRISM_pyBDP
02_buildCalibration.py
2
14442
#This scirpt will build the master calibration fields #========== #MasterBias #MasterDark #MasterFlat #Import whatever modules will be used import os import sys import numpy as np import matplotlib.pyplot as plt from astropy.table import Table from astropy.table import Column from astropy.io import fits, ascii from sc...
mit
jat255/hyperspy
hyperspy/drawing/_widgets/range.py
4
22490
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
gpl-3.0
juanshishido/project-eta
code/utils/linear_fit.py
3
3780
from __future__ import division import numpy as np # the Python array package import pandas as pd import matplotlib.pyplot as plt # the Python plotting package from scipy.stats import gamma import nibabel as nib import numpy.linalg as npl from utils.load_data import * from utils.stimuli import events2neural def...
bsd-3-clause
mikegraham/dask
dask/dataframe/tests/test_dataframe.py
1
61150
from operator import getitem from distutils.version import LooseVersion import pandas as pd import pandas.util.testing as tm import numpy as np import pytest import dask from dask.async import get_sync from dask.utils import raises, ignoring import dask.dataframe as dd from dask.dataframe.core import (repartition_di...
bsd-3-clause
Akshay0724/scikit-learn
sklearn/neighbors/tests/test_lof.py
34
4142
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause from math import sqrt import numpy as np from sklearn import neighbors from numpy.testing import assert_array_equal from sklearn import metrics from sklearn.metr...
bsd-3-clause
alexandrebarachant/mne-python
tutorials/plot_introduction.py
1
15178
# -*- coding: utf-8 -*- """ .. _intro_tutorial: Basic MEG and EEG data processing ================================= MNE-Python reimplements most of MNE-C's (the original MNE command line utils) functionality and offers transparent scripting. On top of that it extends MNE-C's functionality considerably (customize even...
bsd-3-clause
Merinorus/adaisawesome
Homework/03 - Interactive Viz/Mapping onto Switzerland.py
1
1723
# coding: utf-8 # In this part of the exercise, we now need to put the data which we have procured about the funding levels of the different universities that are located in different cantons onto a canton map. We will do so using Folio and take the example TopoJSON mapping which they use. # In[15]: import folium i...
gpl-3.0
wmvanvliet/mne-python
examples/decoding/plot_decoding_spoc_CMC.py
9
3007
""" ==================================== Continuous Target Decoding with SPoC ==================================== Source Power Comodulation (SPoC) :footcite:`DahneEtAl2014` allows to identify the composition of orthogonal spatial filters that maximally correlate with a continuous target. SPoC can be seen as an exten...
bsd-3-clause
ADM91/PowerSystem-RL
visualize/visualize_state.py
1
10292
from matplotlib import pyplot as plt from matplotlib import animation import matplotlib.patches as mpatches import matplotlib.lines as mlines import numpy as np from oct2py import octave def visualize_state(ideal_case, ideal_state, state_list, fig_num=1, frames=20, save=False): color_map = {0: 'black', ...
gpl-3.0
gibiansky/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py
2
51684
# 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
fcooper8472/useful_scripts
system_monitor.py
1
2019
import psutil import time import matplotlib matplotlib.use('svg') from matplotlib import pyplot as plt list_of_times = [] list_of_mem_free = [] list_of_swap_used = [] start_time = time.time() timeout = 7200 # 2 hours try: while True: list_of_times.append(time.time() - start_time) # Current me...
bsd-3-clause
pranavtbhat/EE219
project3/part5.py
1
3598
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.cross_validation import KFold import part1 def load_dataset(): df = pd.read_csv( 'ml-100k/u.data', delimiter='\t', names = ['user_id', 'item_id', 'rating', 'timestamp'], header=0 ) R = df.pi...
unlicense
jjinking/datsci
datsci/recsys.py
1
4947
"""Recommender systems """ # Author : Jin Kim jjinking(at)gmail(dot)com # Creation date : 2014.03.25 # Last Modified : 2014.03.27 # # License : MIT import numpy as np import pandas as pd import scipy as sp import scipy.spatial from collections import defaultdict class RecommenderFrame(pd.DataF...
mit
lukeiwanski/tensorflow-opencl
tensorflow/examples/learn/iris.py
19
1651
# 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
INCF/pybids
bids/layout/layout.py
1
55524
"""BIDSLayout class.""" import os import json import re from collections import defaultdict from io import open from functools import partial, lru_cache from itertools import chain import copy import warnings import enum import difflib import sqlalchemy as sa from bids_validator import BIDSValidator from ..utils impo...
mit
iABC2XYZ/abc
Epics/rnn/DataRnnBPM1.5.py
1
4527
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division import numpy as np import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import tensorflow as tf import matplotlib.pyplot as plt plt.close('all') numEpoch=2000000 batchSize= 50 stepRec = 200 learningRate=0.01 rnnSize=16 rn...
gpl-3.0
kevin-intel/scikit-learn
sklearn/conftest.py
2
7197
import os from os import environ from functools import wraps import platform import sys import pytest from threadpoolctl import threadpool_limits from _pytest.doctest import DoctestItem from sklearn.utils import _IS_32BIT from sklearn.utils._openmp_helpers import _openmp_effective_n_threads from sklearn.externals imp...
bsd-3-clause
Chandra-MARX/marxs
marxs/visualization/tests/test_utils.py
2
6107
# Licensed under GPL version 3 - see LICENSE.rst import numpy as np import pytest from ..utils import (plane_with_hole, combine_disjoint_triangulations, get_color, color_tuple_to_hex, MARXSVisualizationWarning, DisplayDict) from ..mayavi import plot_object...
gpl-3.0
mne-tools/mne-python
mne/viz/backends/tests/test_utils.py
14
1696
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Eric Larson <larson.eric.d@gmail.com> # Joan Massich <mailsik@gmail.com> # Guillaume Favelier <guillaume.favelier@gmail.com> # # License: Simplified BSD import pytest from mne.viz.backends._utils import _get_colormap_from_array, _...
bsd-3-clause
CORE-GATECH-GROUP/serpent-tools
serpentTools/objects/xsdata.py
1
13731
"""Holds cross section data pertaining to Serpent xsplot output.""" from collections.abc import Mapping import numpy as np from matplotlib import pyplot from serpentTools.messages import error from serpentTools.objects.base import NamedObject from serpentTools.utils.plot import magicPlotDocDecorator, formatPlot __al...
mit