repo_name
stringlengths
6
112
path
stringlengths
4
204
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
714
810k
license
stringclasses
15 values
scikit-learn-contrib/py-earth
examples/plot_feature_importance.py
3
2142
""" =========================== Plotting feature importance =========================== A simple example showing how to compute and display feature importances, it is also compared with the feature importances obtained using random forests. Feature importance is a measure of the effect of the features on the outputs....
bsd-3-clause
alphatwirl/alphatwirl
alphatwirl/collector/ToDataFrameWithDatasetColumn.py
1
1326
# Tai Sakuma <tai.sakuma@gmail.com> import pandas as pd from .ToTupleListWithDatasetColumn import ToTupleListWithDatasetColumn ##__________________________________________________________________|| class ToDataFrameWithDatasetColumn: def __init__(self, summaryColumnNames, datasetColumnName = 'co...
bsd-3-clause
FilipDominec/python-meep-utils
scripts_postpro/plot_TY.py
1
4307
#!/usr/bin/env python #-*- coding: utf-8 -*- simtime = 80e-12 size_y = 1400e-6 c = 3e8 maxfreq = 2e12 ## Import common moduli import numpy as np from scipy.constants import c, hbar, pi import matplotlib, sys, os, time import matplotlib.pyplot as plt ## Start figure + subplot (interactive) fig = plt.figure(figsize=(1...
gpl-2.0
cgalleguillosm/accasim
accasim/utils/plot_factory.py
1
51706
""" MIT License Copyright (c) 2017 cgalleguillosm, AlessioNetti 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 without limitation the rights to use, copy, ...
mit
grocsvs/grocsvs
src/grocsvs/stages/refine_grid_search_breakpoints.py
1
13463
# FOR GRID SEARCH CANDIDATES import itertools import numpy import os import pandas import scipy.stats from grocsvs import step from grocsvs import structuralvariants from grocsvs.stages import sv_candidates class CombineRefinedBreakpointsStep(step.StepChunk): @staticmethod def get_steps(options): y...
mit
hugobowne/scikit-learn
sklearn/metrics/tests/test_regression.py
272
6066
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
bsd-3-clause
AMGitsKriss/Battlegrounds
battlegrounds_write_graph.py
2
1492
import pandas as pd #Enumerate colors. class COLOR: RED = "tomato" GREEN = "yellowgreen" BLUE = "lightblue" NEWLINE_INDENT = "\n " def fill(color): return f"[style=filled fillcolor=\"{color}\"]" def dual_label(weapon, n): return f"[label=\"{weapon}\" taillabel=\"{n}\"]" def solo_node(player, color): return f...
mit
Clyde-fare/scikit-learn
sklearn/metrics/ranking.py
79
25426
"""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
rs2/pandas
pandas/io/sql.py
1
62655
""" Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. """ from contextlib import contextmanager from datetime import date, datetime, time from functools import partial import re from typing import Iterator, Optional, Union, overload import warnin...
bsd-3-clause
alanlhutchison/empirical-JTK_CYCLE-with-asymmetry
previous_files/jtk7.py
1
19118
#!/usr/bin/env python """ Created on April 20 2014 @author: Alan L. Hutchison, alanlhutchison@uchicago.edu, Aaron R. Dinner Group, University of Chicago This script is one in a series of scripts for running empirical JTK_CYCLE analysis as described in Hutchison, Maienschein-Cline, and Chiang et al. Improved statisti...
mit
etkirsch/scikit-learn
examples/svm/plot_custom_kernel.py
171
1546
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
google/telluride_decoding
test/scaled_lda_test.py
1
6747
# Copyright 2020 Google 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 writing, ...
apache-2.0
jeffzheng1/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py
82
6157
# 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
DANA-Laboratory/CoolProp
Web/scripts/fluid_properties.Incompressibles.py
3
6445
from __future__ import print_function, division import os.path import CoolProp import CoolProp.CoolProp import subprocess import sys import numpy as np import matplotlib matplotlib.use('Agg') #Force mpl to use a non-GUI backend import matplotlib.pyplot as plt web_dir = os.path.abspath(os.path.join(os.path.dirname(__...
mit
JaviMerino/trappy
trappy/thermal.py
2
9812
# Copyright 2015-2016 ARM Limited # # 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 w...
apache-2.0
fengzhyuan/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
286
2378
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
ngoix/OCRF
sklearn/linear_model/ransac.py
14
17163
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np import warnings from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement fr...
bsd-3-clause
sonata-nfv/son-cli
setup.py
5
3428
# Copyright (c) 2015 SONATA-NFV, UBIWHERE # 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 app...
apache-2.0
wavelets/zipline
zipline/utils/test_utils.py
5
3103
from contextlib import contextmanager from logbook import FileHandler from zipline.finance.blotter import ORDER_STATUS from six import itervalues import pandas as pd def to_utc(time_str): return pd.Timestamp(time_str, tz='US/Eastern').tz_convert('UTC') def setup_logger(test, path='test.log'): test.log_han...
apache-2.0
shikhardb/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
linebp/pandas
doc/make.py
8
12640
#!/usr/bin/env python """ Python script for building documentation. To build the docs you must have all optional dependencies for pandas installed. See the installation instructions for a list of these. <del>Note: currently latex builds do not work because of table formats that are not supported in the latex generat...
bsd-3-clause
lip6-mptcp/ns3mptcp
src/flow-monitor/examples/wifi-olsr-flowmon.py
108
7439
# -*- Mode: Python; -*- # Copyright (c) 2009 INESC Porto # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, #...
gpl-2.0
datalyze-solutions/pandas-qt
pandasqt/views/EditDialogs.py
4
8445
import re from pandasqt.compat import QtCore, QtGui, Qt, Slot, Signal from pandasqt.models.SupportedDtypes import SupportedDtypes import numpy from pandas import Timestamp from pandas.tslib import NaTType class DefaultValueValidator(QtGui.QValidator): def __init__(self, parent=None): super(DefaultValueV...
mit
theakholic/ThinkStats2
code/timeseries.py
66
18035
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import pandas import numpy as np import statsmodels.formula.api as smf import st...
gpl-3.0
yanlend/scikit-learn
examples/datasets/plot_iris_dataset.py
283
1928
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= The Iris Dataset ========================================================= This data sets consists of 3 different types of irises' (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy...
bsd-3-clause
simon-pepin/scikit-learn
sklearn/semi_supervised/label_propagation.py
128
15312
# coding=utf8 """ Label propagation in the context of this module refers to a set of semisupervised classification algorithms. In the high level, these algorithms work by forming a fully-connected graph between all points given and solving for the steady-state distribution of labels at each point. These algorithms per...
bsd-3-clause
thp44/delphin_6_automation
data_process/2d_1d/simon/example_sim.py
1
7655
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import os import json import pandas as pd import xmltodict import shutil # RiBuild Modules from delphin_6_automation.dat...
mit
macks22/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
jkarnows/scikit-learn
benchmarks/bench_glm.py
297
1493
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
bsd-3-clause
russel1237/scikit-learn
examples/svm/plot_weighted_samples.py
188
1943
""" ===================== SVM: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. The sample weighting rescales the C parameter, which means that the classifier puts more emphasis on getting these points right. The effect might ...
bsd-3-clause
LiaoPan/scikit-learn
examples/exercises/plot_iris_exercise.py
323
1602
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
bsd-3-clause
michigraber/scikit-learn
examples/linear_model/plot_bayesian_ridge.py
248
2588
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
xzh86/scikit-learn
sklearn/manifold/tests/test_mds.py
324
1862
import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_raises from sklearn.manifold import mds def test_smacof(): # test metric smacof using the data of "Modern Multidimensional Scaling", # Borg & Groenen, p 154 sim = np.array([[0, 5, 3, 4], ...
bsd-3-clause
jschuecker/nest-simulator
pynest/examples/plot_weight_matrices.py
17
6243
# -*- coding: utf-8 -*- # # plot_weight_matrices.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 Li...
gpl-2.0
lanselin/pysal
pysal/esda/tests/test_join_counts.py
6
2224
import unittest import numpy as np from ..join_counts import Join_Counts from ...weights import lat2W from ...common import pandas PANDAS_EXTINCT = pandas is None class Join_Counts_Tester(unittest.TestCase): """Unit test for Join Counts""" def setUp(self): self.w = lat2W(4, 4) self.y = np.one...
bsd-3-clause
ah391/sc-python
datalook.py
1
1722
# coding: utf-8 import sys import numpy import matplotlib.pyplot def analyse(filename, outfile=None): """Load data and create plots. Subplots with placeholders, with set lables, layout tight """ data = numpy.loadtxt(fname=filename, delimiter=',') # Create a wide figure to hold the subplo...
mit
trungnt13/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
47
8095
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises ...
bsd-3-clause
yilei0620/3D_Conditional_Gan
lib/data_utils.py
1
1596
import numpy as np from sklearn import utils as skutils from rng import np_rng, py_rng def center_crop(x, ph, pw=None): if pw is None: pw = ph h, w = x.shape[:2] j = int(round((h - ph)/2.)) i = int(round((w - pw)/2.)) return x[j:j+ph, i:i+pw] def patch(x, ph, pw=None): if pw is None: ...
mit
martatolos/DemandAnalysis
visualizations.py
1
5518
# Plots import matplotlib.pyplot as plt import matplotlib import numpy as np import re import random def plot_several_countries(df, ylabel, title, country_list="", save=False, num="", xticks_hourly=False, kind='bar', linestyle='-', color='mbygcr', marker='o', linewidth=4.0, fontsize=16, legend=True): """ This...
gpl-2.0
mayblue9/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
Zing22/uemscode
tmp_test.py
1
1634
# -*- coding=utf-8 -*- #### for testing steps import numpy as np import matplotlib.pyplot as plt from sklearn import svm from sklearn.externals import joblib from PIL import Image from process import toBin, cropLetters from img2feature import toFeature from main import readAllFiles TEMP_DIR = 'tmp/' def test_onePi...
mit
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/linear_model/tests/test_ransac.py
52
17482
from scipy import sparse import numpy as np from scipy import sparse from numpy.testing import assert_equal, assert_raises from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from sklearn.utils import check_random_state from sklearn.utils.testing import assert_raises_rege...
bsd-3-clause
adamhajari/spyre
tests/test_app.py
1
5046
# from spyre import server from spyre import server import matplotlib.pyplot as plt import numpy as np import pandas as pd from numpy import pi class TestApp(server.App): colors = [ {"label": "Green", "value": 'g'}, {"label": "Red", "value": 'r'}, {"label": "Blue", "value": 'b'}, ...
mit
jjx02230808/project0223
benchmarks/bench_lasso.py
297
3305
""" Benchmarks of Lasso vs LassoLars First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of the training set. Then we plot the computation time as function of the number o...
bsd-3-clause
ChanderG/scikit-learn
sklearn/metrics/tests/test_regression.py
272
6066
from __future__ import division, print_function import numpy as np from itertools import product from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils....
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/io/stata.py
7
82769
""" Module contains tools for processing Stata files into DataFrames The StataReader below was originally written by Joe Presbrey as part of PyDTA. It has been extended and improved by Skipper Seabold from the Statsmodels project who also developed the StataWriter and was finally added to pandas in a once again improv...
gpl-3.0
centic9/subversion-ppa
tools/dev/graph-dav-servers.py
5
5465
#!/usr/bin/env python # # # 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 #...
apache-2.0
VirusTotal/msticpy
tests/test_ip_utils.py
1
3873
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """IP Util...
mit
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/pandas/io/tests/test_pickle.py
7
10831
# pylint: disable=E1101,E1103,W0232 """ manage legacy pickle tests """ import nose import os from distutils.version import LooseVersion import pandas as pd from pandas import Index from pandas.compat import u, is_platform_little_endian import pandas import pandas.util.testing as tm from pandas.tseries.offsets impor...
mit
DigitalSlideArchive/HistomicsTK
histomicstk/features/compute_intensity_features.py
1
5874
"""Compute intensity features in labeled image.""" import numpy as np import pandas as pd import scipy.stats from skimage.measure import regionprops def compute_intensity_features( im_label, im_intensity, num_hist_bins=10, rprops=None, feature_list=None): """Calculate intensity features from an in...
apache-2.0
kgullikson88/IGRINS_Scripts
Search_Fast.py
1
2751
import sys import os import GenericSearch import pandas # Define regions contaminated by telluric residuals or other defects. We will not use those regions in the cross-correlation badregions = [[0, 1510], # Blue end of H band (lots of water absorption) #[1561, 1615], # CO2 band that is often poorly c...
mit
SanPen/GridCal
src/research/opf/dc_opf_3.py
1
8418
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This program implements the DC power flow as a linear program This version uses the sparse structures and it the problem compilation is blazing fast compared to the full matrix version """ from pulp import * import numpy as np import pandas as pd from matplotlib import ...
gpl-3.0
jnez71/demos
signals/gaussian_markov_kernel.py
1
1646
#!/usr/bin/env python3 """ Kernel of Gaussian-transition scalar Markov process? """ import numpy as np from matplotlib import pyplot npr = np.random np.set_printoptions(suppress=True) pyplot.rcParams["font.size"] = 16 pyplot.rcParams["axes.grid"] = True ################################################## SYSTEM def...
mit
HubLot/PBxplore
pbxplore/tests/test_regression.py
2
21493
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Regression tests for PBxplore. This test suite run the various PBxplore programs with various argument, and makes sure the output is the expected one. The aim is to check that the programs are not broken during development. Be careful this test suite does not test th...
mit
JPFrancoia/scikit-learn
sklearn/preprocessing/data.py
13
70436
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Eric Martin <eric@ericmart.in> # Giorgio Patrini <giorgio.patrini@anu.edu.au> # Lic...
bsd-3-clause
jm-begon/scikit-learn
examples/cluster/plot_kmeans_silhouette_analysis.py
242
5885
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
bsd-3-clause
carpyncho/feets
doc/source/JSAnimation/examples.py
4
3126
import numpy as np from matplotlib import pyplot as plt from matplotlib import animation from JSAnimation import IPython_display def basic_animation(frames=100, interval=30): """Plot a basic sine wave with oscillating amplitude""" fig = plt.figure() ax = plt.axes(xlim=(0, 10), ylim=(-2, 2)) line, = ax....
mit
mizzao/ggplot
ggplot/stats/stat_function.py
12
4439
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd from ggplot.utils import make_iterable_ntimes from ggplot.utils.exceptions import GgplotError from .stat import stat class stat_function(stat): """ Superimpose a...
bsd-2-clause
yyjiang/scikit-learn
sklearn/covariance/tests/test_covariance.py
142
11068
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
pyoceans/pocean-core
pocean/dsg/trajectory/cr.py
1
10376
#!python # coding=utf-8 from copy import copy from collections import OrderedDict import numpy as np import pandas as pd from pocean.utils import ( create_ncvar_from_series, dict_update, downcast_dataframe, generic_masked, get_default_axes, get_dtype, get_mapped_axes_variables, get_mas...
mit
nsalomonis/AltAnalyze
AltAnalyzeViewer.py
1
282646
import os.path, sys, shutil import os import string, re import subprocess import numpy as np import unique import traceback import wx import wx.lib.scrolledpanel import wx.grid as gridlib try: import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore",category=UserWarning) ...
apache-2.0
hgrif/ds-utils
dsutils/sklearn.py
1
2913
import numpy as np from sklearn import cross_validation from sklearn import metrics from sklearn import preprocessing def multiclass_roc_auc_score(y_true, y_score, label_binarizer=None, **kwargs): """Compute ROC AUC score for multiclass. :param y_true: true multiclass predictions [n_samples] :param y_scor...
mit
amnet04/ALECMAPREADER1
funcionesCV_recurrentes.py
1
4438
import numpy as np import pandas import cv2 def cargar_imagen(archivo): ''' Carga en variables dos matrices de la imágen, una gris y otra a color, devuelve un diccionario con las dos versiones. ''' imagen = {} imagen['gris'] = cv2.imread(archivo,0) imagen['color'] = cv2.imread(archivo) ...
mit
schreiberx/sweet
benchmarks_plane/nonlinear_interaction/pp_plot_errors_single.py
2
2935
#! /usr/bin/env python3 import sys import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.lines import Line2D from mule.postprocessing.JobsData import * from mule.postprocessing.JobsDataConsolidate import * if len(sys.argv) > ...
mit
ChanChiChoi/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
appapantula/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
nuclear-wizard/moose
python/mooseutils/VectorPostprocessorReader.py
6
5970
#* 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/lgpl-2.1.html import os i...
lgpl-2.1
jlowin/airflow
scripts/perf/scheduler_ops_metrics.py
30
6536
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
apache-2.0
hasecbinusr/pysal
pysal/esda/tests/test_geary.py
5
2997
"""Geary Unittest.""" import unittest from ... import open as popen from ... import examples from .. import geary import numpy as np from ...common import pandas PANDAS_EXTINCT = pandas is None class Geary_Tester(unittest.TestCase): """Geary class for unit tests.""" def setUp(self): self.w = popen(ex...
bsd-3-clause
jereze/scikit-learn
sklearn/preprocessing/data.py
68
57385
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Eric Martin <eric@ericmart.in> # License: BSD 3 clause from itertools import chain, combina...
bsd-3-clause
friebsch/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter2_MorePyMC/separation_plot.py
86
1494
# separation plot # Author: Cameron Davidson-Pilon,2013 # see http://mdwardlab.com/sites/default/files/GreenhillWardSacks.pdf import matplotlib.pyplot as plt import numpy as np def separation_plot( p, y, **kwargs ): """ This function creates a separation plot for logistic and probit classification. Se...
mit
fw1121/BDA_py_demos
demos_ch3/demo3_2.py
19
6319
"""Bayesian Data Analysis, 3rd ed Chapter 3, demo 2 Visualise factored sampling and the corresponding marginal and conditional densities. """ from __future__ import division import os import numpy as np from scipy import stats import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # import from util...
gpl-3.0
cmoutard/mne-python
logo/generate_mne_logos.py
12
6091
# -*- coding: utf-8 -*- """ =============================================================================== Script 'mne logo' =============================================================================== This script makes the logo for MNE. """ # @author: drmccloy # Created on Mon Jul 20 11:28:16 2015 # License: BSD ...
bsd-3-clause
giorgiop/scikit-learn
sklearn/metrics/tests/test_pairwise.py
13
26241
import numpy as np from numpy import linalg from scipy.sparse import dok_matrix, csr_matrix, issparse from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing impo...
bsd-3-clause
rosswhitfield/mantid
Framework/PythonInterface/mantid/plots/resampling_image/samplingimage.py
3
10843
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2020 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 + impo...
gpl-3.0
kit-cel/wt
nt2/modulation_pulsformung/Spektren_digitale_Modulation.py
1
2940
# -*- coding: utf-8 -*- """ Created on Wed Aug 13 10:31:13 2014 NTII Demo - Quellencodierung - Auswirkungen auf Spektrum des Sendesignals Systemmodell: Quelle --> QPSK --> Pulsformung @author: Michael Schwall """ from __future__ import division import numpy as np import matplotlib.pylab as plt import scipy.signal a...
gpl-2.0
zardav/FaceDetection
FaceDetection/temp.py
1
3849
import numpy as np from scipy import ndimage, misc from matplotlib import pyplot as plt import glob from MyViola import MyViolaClassifier from Svm import Svm import funcs def find_face(img, shape, mv): res_i = (0, 0) res_j = (0, 0) res_scl = 1 max_ = 0 scales = np.arange(.2, .35, .025) m, n = ...
gpl-3.0
xuerenlv/PaperWork
my_study/pandas_study/test1.py
1
1044
# -*- coding: utf-8 -*- ''' Created on Oct 16, 2015 @author: nlp ''' import sys import traceback from store_model import Single_weibo_store import datetime from datetime import timedelta import pprint import jieba reload(sys) sys.setdefaultencoding('utf8') from sklearn import svm X = [[0, 0], [1, 1]] y = [...
apache-2.0
mwaskom/seaborn
doc/tools/generate_logos.py
2
6982
import numpy as np import seaborn as sns from matplotlib import patches import matplotlib.pyplot as plt from scipy.signal import gaussian from scipy.spatial import distance XY_CACHE = {} STATIC_DIR = "_static" plt.rcParams["savefig.dpi"] = 300 def poisson_disc_sample(array_radius, pad_radius, candidates=100, d=2, ...
bsd-3-clause
omnirom/android_kernel_htc_flounder
scripts/tracing/dma-api/plotting.py
96
4043
"""Ugly graph drawing tools""" import matplotlib.pyplot as plt import matplotlib.cm as cmap #import numpy as np from matplotlib import cbook # http://stackoverflow.com/questions/4652439/is-there-a-matplotlib-equivalent-of-matlabs-datacursormode class DataCursor(object): """A simple data cursor widget that displays...
gpl-2.0
Didou09/tofu
tofu/mag/regression_test.py
2
11158
# -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Also if needed: retab ''' Regression test ''' from __future__ import (unicode_literals, absolute_import, \ print_function, division) import argparse import matplotlib.pyplot as plt import numpy as np import os i...
mit
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/tests/test_kernel_approximation.py
78
7586
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 ...
mit
Alexsaphir/TP_EDP_Python
TP2_error.py
1
1912
# -*- coding: utf-8 -*- from numpy import * # importation du module numpy from numpy.linalg import * # importation du module numpy.linalg from numpy.random import * from matplotlib.pyplot import * from mpl_toolkits.mplot3d import Axes3D #Calcul l'erreur en faisant varier Ns def Ud(x): y = sin(2*pi*x)*sinh(2*pi) ...
lgpl-3.0
vortex-ape/scikit-learn
examples/model_selection/plot_nested_cross_validation_iris.py
9
4415
""" ========================================= Nested versus non-nested cross-validation ========================================= This example compares non-nested and nested cross-validation strategies on a classifier of the iris data set. Nested cross-validation (CV) is often used to train a model in which hyperparam...
bsd-3-clause
abergeron/pylearn2
pylearn2/utils/image.py
39
18841
""" Utility functions for working with images. """ import logging import numpy as np plt = None axes = None from theano.compat.six.moves import xrange from theano.compat.six import string_types import warnings try: import matplotlib.pyplot as plt import matplotlib.axes except (RuntimeError, ImportError, TypeErr...
bsd-3-clause
yavalvas/yav_com
build/matplotlib/doc/mpl_examples/axes_grid/demo_edge_colorbar.py
11
2597
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import AxesGrid def get_demo_image(): import numpy as np from matplotlib.cbook import get_sample_data f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False) z = np.load(f) # z is a numpy array of 15x15 return z, (-3,4,...
mit
suyashdb/hcp2bids
setup.py
1
2182
from setuptools import setup import os, glob, shutil import re, json, numpy import nibabel as ni here = os.path.abspath(os.path.dirname(__file__)) setup( name="hcp2bids", # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see ...
mit
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/pandas/tseries/plotting.py
7
9969
""" Period formatters and locators adapted from scikits.timeseries by Pierre GF Gerard-Marchant & Matt Knox """ # TODO: Use the fact that axis can have units to simplify the process import numpy as np from matplotlib import pylab from pandas.tseries.period import Period from pandas.tseries.offsets import DateOffset ...
apache-2.0
aringh/odl
odl/contrib/solvers/spdhg/misc.py
1
22813
# Copyright 2014-2018 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Functions for folders and files.""" from...
mpl-2.0
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/pandas/tseries/tests/test_base.py
9
82416
from __future__ import print_function import re from datetime import datetime, timedelta import numpy as np import pandas as pd from pandas.tseries.base import DatetimeIndexOpsMixin from pandas.util.testing import assertRaisesRegexp, assertIsInstance from pandas.tseries.common import is_datetimelike from pandas import ...
gpl-2.0
maistrovas/My-Courses-Solutions
Coursera Algorithmic Thinking (Part 1)/Module 2/Application/Application2.py
1
7494
""" Provided code for Application portion of Module 2 Answers 4/6 Application Grade is 13 out of 15 Text Answers -Question 2: All three graphs are resilient in this case. Question5: -UPA and ER graphs are steel resilient (UPA is very close to overcoming 25% roughnes) in this type of attack. """ # general imports...
mit
PatrickOReilly/scikit-learn
examples/linear_model/plot_ridge_path.py
55
2138
""" =========================================================== 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
franchenstein/master_project
main.py
1
18773
#!/usr/bin import probabilisticgraph as pg import graphgenerator as gg import dmarkov as dm import sequenceanalyzer as sa import yaml import matplotlib.pyplot as plt import synchwordfinder as swf def main(config_file, fsw=False, terminate=False, dmark=False, generate=False, gen_seq=False, an_seq=False, plot=False, ...
mit
zaxliu/deepnap
experiments/kdd-exps/experiment_message_2016-6-11_BUF2_G5_FR100_legacy.py
1
4371
# System built-in modules import time from datetime import datetime import sys import os from multiprocessing import Pool # Project dependency modules import pandas as pd pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment import lasagne # Project modules sys.path.append('...
bsd-3-clause
LaboratoireMecaniqueLille/Ximea
old/ximea_display_REC.py
1
8856
import numpy as np import cv2 import time import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import rcParams import SimpleITK as sitk from multiprocessing import Process, Pipe, Value from matplotlib.widgets import Slider, Button rcParams['font.family'] = 'serif' #ps aux | grep pyth...
gpl-2.0
rileymcdowell/genomic-neuralnet
genomic_neuralnet/methods/generic_keras_net.py
1
6998
from __future__ import print_function import os import time import json import numpy as np from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Lambda from keras.optimizers import Nadam as Trainer #from keras.optimizers import Adam as Trainer from keras.regularizers import WeightRe...
mit
tntnatbry/tensorflow
tensorflow/examples/learn/iris_custom_model.py
50
2613
# 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
matplotlib/viscm
tests.py
1
4429
from viscm.gui import * from viscm.bezierbuilder import * import numpy as np import matplotlib as mpl from matplotlib.backends.qt_compat import QtGui, QtCore from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas cms = {"viscm/examples/sample_linear.jscm", "viscm/examples/sample_dive...
mit
sanjayankur31/nest-simulator
pynest/examples/balancedneuron.py
8
7344
# -*- coding: utf-8 -*- # # balancedneuron.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
djgagne/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause