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
alvarofierroclavero/scikit-learn
examples/semi_supervised/plot_label_propagation_digits.py
268
2723
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
bsd-3-clause
RomainBrault/scikit-learn
examples/decomposition/plot_ica_vs_pca.py
306
3329
""" ========================== FastICA on 2D point clouds ========================== This example illustrates visually in the feature space a comparison by results using two different component analysis techniques. :ref:`ICA` vs :ref:`PCA`. Representing ICA in the feature space gives the view of 'geometric ICA': ICA...
bsd-3-clause
pfnet/maf_example
caffe/util/classify.py
1
1329
import maflib.util import numpy as np import matplotlib.pyplot as plt import caffe import cPickle def vis_square(data, padsize=1, padval=0): data -= data.min() data /= data.max() n = int(np.ceil(np.sqrt(data.shape[0]))) padding = ((0, n ** 2 - data.shape[0]), (0, padsize), (0, padsize)) + ((0, 0),...
bsd-3-clause
jergosh/slr_pipeline
bin/find_neighbourhood.py
1
1938
import re import sys import glob import csv from os import path from argparse import ArgumentParser from subprocess import Popen import operator from Bio import PDB import numpy as np import pandas def rid2str(r): return r.id[0] + str(r.id[1]) + r.id[2] argparser = ArgumentParser() argparser.add_argument("--pdb...
gpl-2.0
cactusbin/nyt
matplotlib/examples/api/legend_demo.py
3
1134
""" Demo of the legend function with a few features. In addition to the basic legend, this demo shows a few optional features: * Custom legend placement. * A keyword argument to a drop-shadow. * Setting the background color. * Setting the font size. * Setting the line width. """ import numpy as np...
unlicense
qbilius/streams
streams/metrics/classifiers.py
1
5903
from collections import OrderedDict import numpy as np import scipy.stats import pandas import sklearn, sklearn.svm, sklearn.preprocessing, sklearn.linear_model import streams.utils class MatchToSampleClassifier(object): def __init__(self, norm=True, nfeats=None, seed=None, C=1): """ A classifi...
gpl-3.0
phobson/statsmodels
statsmodels/tools/tools.py
1
16566
''' Utility functions models code ''' from statsmodels.compat.python import reduce, lzip, lmap, asstr2, range, long import numpy as np import numpy.lib.recfunctions as nprf import numpy.linalg as L from scipy.linalg import svdvals from statsmodels.datasets import webuse from statsmodels.tools.data import _is_using_pand...
bsd-3-clause
ronggong/jingjuSingingPhraseMatching
general/dtwSankalp.py
1
1657
import sys,os import matplotlib.pyplot as plt # the project folder: fileDir fileDir = os.path.dirname(os.path.realpath('__file__')) dtwPath = os.path.join(fileDir, '../../Library_PythonNew/similarityMeasures/dtw/') # transcribe the path string to full path dtwPath = os.path.abspath(os.path.realpath(dtwPath)) sys.path...
agpl-3.0
cython-testbed/pandas
pandas/tests/indexing/test_categorical.py
5
26870
# -*- coding: utf-8 -*- import pytest import pandas as pd import pandas.compat as compat import numpy as np from pandas import (Series, DataFrame, Timestamp, Categorical, CategoricalIndex, Interval, Index) from pandas.util.testing import assert_series_equal, assert_frame_equal from pandas.util imp...
bsd-3-clause
elenita1221/BDA_py_demos
demos_pystan/pystan_demo.py
19
12220
"""Bayesian Data Analysis, 3rd ed PyStan demo Demo for using Stan with Python interface PyStan. """ import numpy as np import pystan import matplotlib.pyplot as plt # edit default plot settings (colours from colorbrewer2.org) plt.rc('font', size=14) plt.rc('lines', color='#377eb8', linewidth=2) plt.rc('axes', color...
gpl-3.0
hrjn/scikit-learn
sklearn/neural_network/tests/test_rbm.py
225
6278
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
Obus/scikit-learn
sklearn/kernel_ridge.py
44
6504
"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression.""" # Authors: Mathieu Blondel <mathieu@mblondel.org> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, RegressorMixin from .metrics.pairwise import pairwise...
bsd-3-clause
jakirkham/bokeh
examples/models/file/latex_extension.py
3
2596
""" The LaTex example was derived from: http://matplotlib.org/users/usetex.html """ from bokeh.models import Label from bokeh.palettes import Spectral4 from bokeh.plotting import output_file, figure, show import numpy as np from scipy.special import jv output_file('external_resources.html') class LatexLabel(Label):...
bsd-3-clause
jermainewang/mxnet
example/kaggle-ndsb1/training_curves.py
52
1879
# 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 u...
apache-2.0
rinman24/ucsd_ch
coimbra_chamber/tests/access/experiment/exp_acc_integration_test.py
1
24445
"""Integration test suite for ChamberAccess.""" import dataclasses import datetime from decimal import Decimal from unittest.mock import MagicMock import dacite import pytest from nptdms import TdmsFile from pandas import DataFrame from pytz import utc from sqlalchemy import and_ from coimbra_chamber.access.experime...
mit
tmrowco/electricitymap
parsers/AU.py
1
22469
#!/usr/bin/env python3 import json # The arrow library is used to handle datetimes import arrow import numpy as np import pandas as pd # The request library is used to fetch content through HTTP import requests from .lib import AU_battery, AU_solar AMEO_CATEGORY_DICTIONARY = { 'Bagasse': 'biomass', 'Black C...
gpl-3.0
nkhuyu/neon
setup.py
5
6352
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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 # # ...
apache-2.0
CharlesGulian/Deconv
write_pixel_offset.py
1
2549
# -*- coding: utf-8 -*- """ Created on Mon Sep 26 10:37:01 2016 @author: charlesgulian """ # Add (x,y) pixel offset to .FITS header of an image import numpy as np import matplotlib.pyplot as plt from astropy.io import fits class Image: def __init__(self,filename,category,ID): self.filename = filena...
gpl-3.0
RPGOne/Skynet
test_grid_search.py
3
1451
# Copyright 2015-present Scikit Flow 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...
bsd-3-clause
wazeerzulfikar/scikit-learn
examples/decomposition/plot_ica_blind_source_separation.py
52
2228
""" ===================================== Blind source separation using FastICA ===================================== An example of estimating sources from noisy data. :ref:`ICA` is used to estimate sources given noisy measurements. Imagine 3 instruments playing simultaneously and 3 microphones recording the mixed si...
bsd-3-clause
dmordom/nipype
doc/sphinxext/numpy_ext/docscrape_sphinx.py
154
7759
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
twbattaglia/koeken
setup.py
1
1924
import setuptools from setuptools.command.install import install # Install Necessary R packages class CustomInstallPackages(install): """Customized setuptools install command - runs R package install one-liner.""" def run(self): import subprocess import shlex print "Attempting to insta...
mit
andybrnr/QuantEcon.py
examples/evans_sargent_plot1.py
7
1086
""" Plot 1 from the Evans Sargent model. @author: David Evans Edited by: John Stachurski """ import numpy as np import matplotlib.pyplot as plt from evans_sargent import T, y tt = np.arange(T) # tt is used to make the plot time index correct. n_rows = 3 fig, axes = plt.subplots(n_rows, 1, figsize=(10, 12)) plt.su...
bsd-3-clause
ch3ll0v3k/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
134
7452
""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected in...
bsd-3-clause
antoinecarme/pyaf
tests/missing_data/test_missing_data_air_passengers_generic.py
1
1810
import pandas as pd import numpy as np import pyaf.ForecastEngine as autof import pyaf.Bench.TS_datasets as tsds def add_some_missing_data_in_signal(df, col): lRate = 0.2 df.loc[df.sample(frac=lRate, random_state=1960).index, col] = np.nan return df def add_some_missing_data_in_time(df, col): lRate...
bsd-3-clause
DBernardes/ProjetoECC
Ganho/Codigo/run.py
1
2380
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Criado em 08 de Novembro de 2016 Descricao: este codigo reune todas as bibliotecas responsaveis para a caracterizacao do ganho do CCD, sao elas: plotGraph, logfile, makeList_imagesInput e Gain_processesImages. O codigo ira criar duas listas de imagens: flat e...
mit
mjasher/gac
original_libraries/flopy-master/examples/scripts/flopy_swi2_ex3.py
1
6979
import os import sys import math import numpy as np import flopy.modflow as mf import flopy.utils as fu import matplotlib.pyplot as plt # --modify default matplotlib settings updates = {'font.family':['Univers 57 Condensed', 'Arial'], 'mathtext.default':'regular', 'pdf.compressi...
gpl-2.0
nikitasingh981/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
53
13398
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import scipy.sparse as sp import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.u...
bsd-3-clause
supriyantomaftuh/innstereo
innstereo/main_ui.py
1
116913
#!/usr/bin/python3 """ This module contains the startup-function and the MainWindow-class. The MainWindow-class sets up the GUI and controls all its signals. All other modules and clases are controlled from this class. The startup-function creates the first instance of the GUI when the program starts. """ import gi ...
gpl-2.0
cg31/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_test.py
5
39527
# 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
wathen/PhD
MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/SplitMatrix/ScottTest/Hartman2D/MHDfluid.py
1
17145
#!/usr/bin/python # interpolate scalar gradient onto nedelec space import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc from dolfin import * # from MatrixOperations import * import numpy as np import PETScIO as IO import common import scipy import scipy.io import time import scipy.sparse as...
mit
josherick/bokeh
bokeh/compat/mplexporter/tools.py
75
1732
""" Tools for matplotlib plot exporting """ def ipynb_vega_init(): """Initialize the IPython notebook display elements This function borrows heavily from the excellent vincent package: http://github.com/wrobstory/vincent """ try: from IPython.core.display import display, HTML except I...
bsd-3-clause
TomAugspurger/pandas
pandas/tests/series/methods/test_update.py
2
4213
import numpy as np import pytest from pandas import CategoricalDtype, DataFrame, NaT, Series, Timestamp import pandas._testing as tm class TestUpdate: def test_update(self): s = Series([1.5, np.nan, 3.0, 4.0, np.nan]) s2 = Series([np.nan, 3.5, np.nan, 5.0]) s.update(s2) expected ...
bsd-3-clause
RUBi-ZA/MODE-TASK
assemblyCovariance.py
1
14726
#!/usr/bin/env python # assemblyCovariance.py # Calculates covariance matrices for the following: # 1) over all modes # OR # 2) specified modes # AND # 3) For a single asymmetric unit # OR # 4) For a cluster of specified asymmetric units # Author: Caroline Ross: caroross299@gmail.com # August 2017 # Calculates and Re...
gpl-3.0
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/pandas/core/config.py
13
22213
""" The config module holds package-wide configurables and provides a uniform API for working with them. Overview ======== This module supports the following requirements: - options are referenced using keys in dot.notation, e.g. "x.y.option - z". - keys are case-insensitive. - functions should accept partial/regex k...
apache-2.0
jhanley634/testing-tools
problem/bench/traffic/top_wikipedia_pages.py
1
1926
#! /usr/bin/env python # Copyright 2020 John Hanley. # # 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, modify, me...
mit
ueshin/apache-spark
python/pyspark/pandas/tests/test_rolling.py
15
6920
# # 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
hunterowens/data-pipelines
dc_pipeline.py
1
3588
import pandas as pd import requests import folium import luigi YEARS = {2012: 'http://opendata.dc.gov/datasets/5f4ea2f25c9a45b29e15e53072126739_7.csv', 2013: 'http://opendata.dc.gov/datasets/4911fcf3527246ae9bf81b5553a48c4d_6.csv', 2014: 'http://opendata.dc.gov/datasets/d4891ca6951947538f6707a6b07ae2...
mit
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/utils/tests/test_linear_assignment.py
421
1349
# Author: Brian M. Clapper, G Varoquaux # License: BSD import numpy as np # XXX we should be testing the public API here from sklearn.utils.linear_assignment_ import _hungarian def test_hungarian(): matrices = [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], ...
mit
AISystena/web_crawler
lib/image_cnn_gpu/ImageTrainer.py
1
6005
# coding: utf-8 import six import sys import os.path import pickle import numpy as np from sklearn.cross_validation import train_test_split import chainer import chainer.links as L from chainer import optimizers, cuda import matplotlib.pyplot as plt import Util from ImageCnn import ImageCnn plt.style.use('ggplot') ...
mit
davidam/python-examples
scikit/datasets/plot_out_of_core_classification.py
3
13644
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
gpl-3.0
MartinDelzant/scikit-learn
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
datascopeanalytics/scrubadub
scrubadub/comparison.py
1
13150
import re import copy import random from faker import Faker from . import filth as filth_module from .filth import Filth from .detectors.known import KnownFilthItem from typing import List, Dict, Union, Optional, Tuple import pandas as pd import sklearn.metrics def get_filth_classification_report( filth_li...
mit
byzin/Nanairo
tool/spectral_transport/spectral_transport.py
1
27081
# file: spectral_transport.py # Import system plugins import math import os import sys import time # Import custom plugins def printPluginError(plugin_name, package_name): sys.stderr.write("'{}' is required.".format(plugin_name)) sys.stderr.write(" Please install the package using 'pip install {}'.\n".format(...
mit
zihua/scikit-learn
examples/feature_selection/plot_f_test_vs_mi.py
75
1647
""" =========================================== Comparison of F-test and mutual information =========================================== This example illustrates the differences between univariate F-test statistics and mutual information. We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the targ...
bsd-3-clause
rrohan/scikit-learn
examples/classification/plot_lda.py
70
2413
""" ==================================================================== Normal and Shrinkage Linear Discriminant Analysis for classification ==================================================================== Shows how shrinkage improves classification. """ from __future__ import division import numpy as np import...
bsd-3-clause
MTgeophysics/mtpy
mtpy/imaging/plot_mt_response.py
1
63921
# -*- coding: utf-8 -*- """ ================= plot_mt_response ================= Plots the resistivity and phase for different modes and components Created 2017 @author: jpeacock """ # ============================================================================== import os import numpy as np import matplotlib.pypl...
gpl-3.0
empeeu/numpy
numpy/core/tests/test_multiarray.py
2
218049
from __future__ import division, absolute_import, print_function import collections import tempfile import sys import os import shutil import warnings import operator import io import itertools if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins from decimal import Decimal impor...
bsd-3-clause
cainiaocome/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
florian-f/sklearn
examples/linear_model/plot_sgd_separating_hyperplane.py
12
1201
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
spallavolu/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
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/SoftContact_NonLinHardSoftShear/Area/Normal_Stress_Plot.py
6
4510
#!/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
SCECcode/BBP
bbp/comps/bbp_status.py
1
9070
#!/usr/bin/env python """ Copyright 2010-2018 University Of Southern California 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 appli...
apache-2.0
faraz117/Traffic-Congestion-Estimator
EdgeDetection2.py
1
16913
from __future__ import division import cv2 import numpy as np import time import os import imutils from sklearn.externals import joblib from scipy.cluster.vq import * # initialize the current frame of the video, along with the list of # ROI points along with whether or not this is input mode roiPts = [] inputMode = F...
gpl-2.0
jseabold/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
348
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
dsquareindia/scikit-learn
sklearn/datasets/__init__.py
61
3734
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_breast_cancer from .base import load_boston from .base import load_diabetes from .base import load_digi...
bsd-3-clause
ningchi/scikit-learn
examples/applications/wikipedia_principal_eigenvector.py
233
7819
""" =============================== Wikipedia principal eigenvector =============================== A classical way to assert the relative importance of vertices in a graph is to compute the principal eigenvector of the adjacency matrix so as to assign to each vertex the values of the components of the first eigenvect...
bsd-3-clause
rcompton/black-market-recommender-systems
bmrs/parsers/silkroad2.py
1
3561
#!/usr/bin/python3 # coding: utf-8 from bs4 import BeautifulSoup import re import pandas as pd import dateutil import os import traceback import unicodedata as ud import logging FORMAT = '%(asctime)-15s %(levelname)-6s %(message)s' DATE_FORMAT = '%b %d %H:%M:%S' formatter = logging.Formatter(fmt=FORMAT, datefmt=DATE_F...
gpl-3.0
Salahub/uwaterloo-igem-2015
models/tridimensional/docking_validation/csv_results_clusterscore.py
6
10637
import argparse import csv import matplotlib.pyplot as plt import numpy as np import os import scipy.cluster.hierarchy as hac import scipy.spatial.distance as scidist from csv_results import csv_header_bugfix from constants import CSV_HEADER, DNA_ALPHABET from utility import safe_mkdir def csv_load(fullpath): ""...
mit
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/numpy/core/function_base.py
18
12340
from __future__ import division, absolute_import, print_function import warnings import operator from . import numeric as _nx from .numeric import (result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError,asanyarray) __all__ = ['logspace', 'linspace', 'geomspace'] def _index_deprecate(...
mit
lbdreyer/iris
docs/iris/src/conf.py
2
10980
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. # -*- coding: utf-8 -*- # # Iris documentation build configuration file, created by # sphinx-quickstart on Tue May 25 13:26:23...
lgpl-3.0
toastedcornflakes/scikit-learn
examples/manifold/plot_mds.py
88
2731
""" ========================= Multi-dimensional scaling ========================= An illustration of the metric and non-metric MDS on generated noisy data. The reconstructed points using the metric MDS and non metric MDS are slightly shifted to avoid overlapping. """ # Author: Nelle Varoquaux <nelle.varoquaux@gmail....
bsd-3-clause
kpolimis/sklearn-forest-ci
doc/conf.py
2
10581
# -*- coding: utf-8 -*- # # project-template documentation build configuration file, created by # sphinx-quickstart on Mon Jan 18 14:44:12 2016. # # 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 fi...
bsd-3-clause
Silmathoron/NNGT
doc/examples/groups_and_metagroups.py
1
3612
#!/usr/bin/env python #-*- coding:utf-8 -*- # # This file is part of the NNGT project to generate and analyze # neuronal networks and their activity. # Copyright (C) 2015-2019 Tanguy Fardet # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
gpl-3.0
JohnBSmith/JohnBSmith.github.io
templates/Matplotlib/plot-center.py
1
2470
# A template for simple plots, viewed on screen # and included in HTML documents. import matplotlib as mp import matplotlib.pyplot as plot from numpy import arange, array from math import pi, sin, cos, tan, exp, log lw_grid = 1.6 lw_line = 2.2 axes_color = "#505050" blue = [0,0.2,0.6,0.8] green = [0,0.46,0,0.8] mag...
cc0-1.0
ChanChiChoi/scikit-learn
sklearn/tree/tests/test_tree.py
72
47440
""" Testing for the tree module (sklearn.tree). """ import pickle from functools import partial from itertools import product import platform import numpy as np from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.random_projection import sparse_rand...
bsd-3-clause
joshpeng/Network-Intrusions-Flask
app/views.py
1
3102
""" Contains main routes for the Prediction App """ from flask import render_template from flask_wtf import Form from wtforms import fields from wtforms.validators import Required import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns from . import app, target...
mit
jakereps/qiime2
qiime2/metadata/tests/test_io.py
1
42757
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
gem/oq-engine
openquake/calculators/base.py
1
55094
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2021 GEM Foundation # # OpenQuake 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 of the Licen...
agpl-3.0
ettm2012/MissionPlanner
Lib/site-packages/numpy/doc/creation.py
94
5411
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
gpl-3.0
MBARIMike/stoqs
stoqs/contrib/analysis/classify.py
3
21623
#!/usr/bin/env python """ Script to execute steps in the classification of measurements including: 1. Labeling specific MeasuredParameters 2. Tagging MeasuredParameters based on a model Mike McCann MBARI 16 June 2014 """ import os import sys # Insert Django App directory (parent of config) into python path sys.pat...
gpl-3.0
imaculate/scikit-learn
sklearn/tests/test_grid_search.py
68
28856
""" 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 warnings import sys import numpy as np import sci...
bsd-3-clause
paulmueller/bornscat
examples/compare_mie_2d.py
2
1390
#!/usr/bin/env python # -*- coding: utf-8 -*- """ TODO compare scattered field of Rytov with Mie scattering """ from __future__ import division from __future__ import print_function import numpy as np import matplotlib matplotlib.use("wxagg") from matplotlib import pylab as plt import os import sys import time imp...
bsd-3-clause
unnikrishnankgs/va
venv/lib/python3.5/site-packages/mpl_toolkits/axes_grid1/mpl_axes.py
10
5045
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import warnings import matplotlib.axes as maxes from matplotlib.artist import Artist from matplotlib.axis import XAxis, YAxis class SimpleChainedObjects(object): def __init__(self, objects): ...
bsd-2-clause
rs2/pandas
pandas/core/flags.py
1
3566
import weakref class Flags: """ Flags that apply to pandas objects. .. versionadded:: 1.2.0 Parameters ---------- obj : Series or DataFrame The object these flags are associated with allows_duplicate_labels : bool, default True Whether to allow duplicate labels in this ob...
bsd-3-clause
jstoxrocky/statsmodels
statsmodels/genmod/_prediction.py
27
9437
# -*- coding: utf-8 -*- """ Created on Fri Dec 19 11:29:18 2014 Author: Josef Perktold License: BSD-3 """ import numpy as np from scipy import stats # this is similar to ContrastResults after t_test, partially copied and adjusted class PredictionResults(object): def __init__(self, predicted_mean, var_pred_mean...
bsd-3-clause
andyh616/mne-python
examples/inverse/plot_lcmv_beamformer_volume.py
18
3046
""" =================================================================== Compute LCMV inverse solution on evoked data in volume source space =================================================================== Compute LCMV inverse solution on an auditory evoked dataset in a volume source space. It stores the solution in...
bsd-3-clause
castelao/CoTeDe
cotede/qctests/tukey53H.py
1
3985
# -*- coding: utf-8 -*- """ Shall I use a decorator?? DATA = [25.32, 25.34, 25.34, 25.31, 24.99, 23.46, 21.85, 17.95, 15.39, 11.08, 6.93, 7.93, 5.71, 3.58, np.nan, 1, 1] tukey53H(np.array, np.maskedArray, pd.Series, xr.DataArray) delta = tukey53H(x) w = np.hamming(l) sigma = (ma.convolve(x, w, mode...
bsd-3-clause
glouppe/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
0x0all/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/numerix/__init__.py
69
5473
""" numerix imports either Numeric or numarray based on various selectors. 0. If the value "--numpy","--numarray" or "--Numeric" is specified on the command line, then numerix imports the specified array package. 1. The value of numerix in matplotlibrc: either Numeric or numarray 2. If none of the above is...
gpl-3.0
fspaolo/scikit-learn
examples/plot_isotonic_regression.py
303
1767
""" =================== Isotonic Regression =================== An illustration of the isotonic regression on generated data. The isotonic regression finds a non-decreasing approximation of a function while minimizing the mean squared error on the training data. The benefit of such a model is that it does not assume a...
bsd-3-clause
francesco-mannella/dmp-esn
parametric/parametric_dmp/bin/tr_datasets/e_cursive_curves_angles_LWPR_10/data/results/plot.py
18
1043
#!/usr/bin/env python import glob import numpy as np import matplotlib.pyplot as plt import os import sys pathname = os.path.dirname(sys.argv[0]) if pathname: os.chdir(pathname) n_dim = None trains = [] for fname in glob.glob("tl*"): t = np.loadtxt(fname) trains.append(t) tests = [] for fname in glob...
gpl-2.0
yavalvas/yav_com
build/matplotlib/lib/mpl_toolkits/axes_grid1/inset_locator.py
8
10138
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib.offsetbox import AnchoredOffsetbox #from matplotlib.transforms import IdentityTransform import matplotlib.transforms as mtrans from .parasite_axes import HostAxes # subclasses mpl...
mit
alvarofierroclavero/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
alexeyum/scikit-learn
sklearn/covariance/tests/test_covariance.py
79
12193
# 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
nuclear-wizard/moose
python/peacock/tests/postprocessor_tab/test_PostprocessorViewer.py
12
4638
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
lgpl-2.1
smarden1/airflow
airflow/hooks/postgres_hook.py
3
2076
import psycopg2 from airflow import settings from airflow.utils import AirflowException from airflow.models import Connection class PostgresHook(object): ''' Interact with Postgres. ''' def __init__( self, host=None, login=None, psw=None, db=None, port=None, postgres_conn_id=...
apache-2.0
dvida/UWO-PA-Python-Course
Lecture 6/L6_lecture.py
1
6176
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt # Let's create some noisy data that should follow a line # Parameters of a line m = 2.6 k = 10.8 # Let's define a function describing a line def line(x, m, k): return m*x + k # Generate the line data ...
mit
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/matplotlib/tests/test_agg.py
3
4896
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import io import os import numpy as np from numpy.testing import assert_array_almost_equal from matplotlib.image import imread from matplotlib.backends.backend_agg import...
apache-2.0
ibaidev/gplib
gplib/plot.py
1
7181
# -*- coding: utf-8 -*- # # Copyright 2018 Ibai Roman # # This file is part of GPlib. # # GPlib is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
gpl-3.0
yavalvas/yav_com
build/matplotlib/examples/pylab_examples/multiple_yaxis_with_spines.py
6
1582
import matplotlib.pyplot as plt def make_patch_spines_invisible(ax): ax.set_frame_on(True) ax.patch.set_visible(False) for sp in ax.spines.itervalues(): sp.set_visible(False) fig, host = plt.subplots() fig.subplots_adjust(right=0.75) par1 = host.twinx() par2 = host.twinx() # Offset the right spi...
mit
rkmaddox/expyfun
doc/conf.py
1
10310
# -*- coding: utf-8 -*- # # Expyfun documentation build configuration file, created by # sphinx-quickstart on Fri Jun 11 10:45:48 2010. # # 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. # # A...
bsd-3-clause
wsmorgan/782
docs/conf.py
1
10259
# -*- coding: utf-8 -*- # # basis documentation build configuration file, created by # sphinx-quickstart on Tue Sep 27 09:52:04 2016. # # 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...
mit
Avsecz/concise
concise/utils/plot.py
1
9272
import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import MaxNLocator from mpl_toolkits.axes_grid1 import make_axes_locatable import math from concise.preprocessing.sequence import DNA, RNA, AMINO_ACIDS from concise.utils.letters import all_letters from collections import OrderedDict from matpl...
mit
planetarymike/IDL-Colorbars
IDL_py_test/093_Multihue_Red1.py
1
8802
from matplotlib.colors import LinearSegmentedColormap from numpy import nan, inf cm_data = [[0.0000208612, 0.0000200049, 0.0000198463], [0.00038926, 0.000346551, 0.000249987], [0.00114175, 0.000989297, 0.000648277], [0.00225249, 0.00190778, 0.00116452], [0.003715, 0.00307964, 0.001769], [0.00552993, 0.00448905, 0.00244...
gpl-2.0
pprett/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
ndingwall/scikit-learn
examples/model_selection/plot_nested_cross_validation_iris.py
23
4413
""" ========================================= 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
Windy-Ground/scikit-learn
sklearn/linear_model/sag.py
64
9815
"""Solvers for Ridge and LogisticRegression using SAG algorithm""" # Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # Licence: BSD 3 clause import numpy as np import warnings from ..utils import ConvergenceWarning from ..utils import check_array from .base import make_dataset from .sgd_fast import Log, Squ...
bsd-3-clause
shusenl/scikit-learn
sklearn/linear_model/coordinate_descent.py
59
76336
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
nan86150/ImageFusion
lib/python2.7/site-packages/matplotlib/patches.py
10
142681
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import map, zip import math import matplotlib as mpl import numpy as np import matplotlib.cbook as cbook import matplotlib.artist as artist from matplotlib.a...
mit