repo_name
stringlengths
7
90
path
stringlengths
5
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
976
581k
license
stringclasses
15 values
DJArmstrong/autovet
Features/Centroiding/scripts/old/simulate_signal.py
4
8723
# -*- coding: utf-8 -*- """ Created on Wed Nov 2 15:05:11 2016 @author: Maximilian N. Guenther Battcock Centre for Experimental Astrophysics, Cavendish Laboratory, JJ Thomson Avenue Cambridge CB3 0HE Email: mg719@cam.ac.uk """ import numpy as np import matplotlib.pyplot as plt import batman import eb def simulate(...
gpl-3.0
surligas/gnuradio
gr-digital/examples/berawgn.py
32
4886
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
JsNoNo/scikit-learn
benchmarks/bench_plot_svd.py
325
2899
"""Benchmarks of Singular Value Decomposition (Exact and Approximate) The data is mostly low rank but is a fat infinite tail. """ import gc from time import time import numpy as np from collections import defaultdict from scipy.linalg import svd from sklearn.utils.extmath import randomized_svd from sklearn.datasets.s...
bsd-3-clause
kohr-h/odl
odl/tomo/analytic/filtered_back_projection.py
2
21537
# coding: utf-8 # Copyright 2014-2019 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/. from __future__ import print...
mpl-2.0
justincassidy/ThinkStats2
code/scatter.py
69
4281
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import sys import numpy as np import math import brfss import thinkplot import ...
gpl-3.0
timqian/sms-tools
lectures/6-Harmonic-model/plots-code/f0-TWM-errors-1.py
22
3586
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackman import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF def TWM (pfreq, p...
agpl-3.0
mwcraig/aplpy
aplpy/tests/test_beam.py
3
4530
import os import matplotlib matplotlib.use('Agg') import numpy as np from astropy.tests.helper import pytest from astropy import units as u from astropy.io import fits from .. import FITSFigure header_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data/2d_fits') HEADER = fits.Header.fromtextfile(...
mit
BRD-CD/superset
tests/celery_tests.py
8
11738
"""Unit tests for Superset Celery worker""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import os import subprocess import time import unittest from past.builtins import basestring import pandas as pd ...
apache-2.0
dotpmrcunha/gnuradio
gr-digital/examples/ofdm/gr_plot_ofdm.py
77
10957
#!/usr/bin/env python # # Copyright 2007 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 option) ...
gpl-3.0
alvarofierroclavero/scikit-learn
examples/ensemble/plot_forest_importances_faces.py
403
1519
""" ================================================= Pixel importances with a parallel forest of trees ================================================= This example shows the use of forests of trees to evaluate the importance of the pixels in an image classification task (faces). The hotter the pixel, the more impor...
bsd-3-clause
cathywu/Sentiment-Analysis
PyML-0.7.9/PyML/evaluators/resultsObjects.py
2
28145
import numpy import random import math import os import tempfile import copy import time from PyML.utils import myio,misc from PyML.evaluators import roc as roc_module """functionality for assessing classifier performance""" __docformat__ = "restructuredtext en" def scatter(r1, r2, statistic = 'roc', x1Label = '', ...
gpl-2.0
funbaker/astropy
astropy/visualization/tests/test_norm.py
2
6687
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy import ma from numpy.testing import assert_allclose from ..mpl_normalize import ImageNormalize, simple_norm from ..interval import ManualInterval from ..stretch import SqrtStretch try: import matplotlib ...
bsd-3-clause
Fireblend/scikit-learn
sklearn/externals/joblib/parallel.py
86
35087
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
bsd-3-clause
DeveloperJose/Vision-Rat-Brain
feature_matching_v3/slider.py
2
1193
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider, Button, RadioButtons fig, ax = plt.subplots() plt.subplots_adjust(left=0.25, bottom=0.25) t = np.arange(0.0, 1.0, 0.001) a0 = 5 f0 = 3 s = a0*np.sin(2*np.pi*f0*t) l, = plt.plot(t, s, lw=2, color='red') plt.axis([0, 1, -10, 10]) ...
mit
yunque/librosa
librosa/feature/rhythm.py
1
5253
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Rhythmic feature extraction''' import numpy as np import scipy.signal import six from .. import util from ..core.audio import autocorrelate from ..util.exceptions import ParameterError __all__ = ['tempogram'] # -- Rhythmic features -- # def tempogram(y=None, sr=22...
isc
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/benchmarks/bench_plot_parallel_pairwise.py
1
1250
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import pylab as pl from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils import check_random_state def plot(func): random_state = check_random_state(0) ...
mit
BhallaLab/moose-examples
neuroml/LIF/twoLIFxml_firing.py
2
3087
# -*- coding: utf-8 -*- ## all SI units ######################################################################################## ## Plot the membrane potential for a leaky integrate and fire neuron with current injection ## Author: Aditya Gilra ## Creation Date: 2012-06-08 ## Modification Date: 2012-06-08 #############...
gpl-2.0
dominicelse/scipy
scipy/interpolate/tests/test_rbf.py
14
4604
# Created by John Travers, Robert Hetland, 2007 """ Test functions for rbf module """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_, assert_array_almost_equal, assert_almost_equal, run_module_suite) from numpy import l...
bsd-3-clause
Vishluck/sympy
sympy/interactive/session.py
43
15119
"""Tools for setting up interactive sessions. """ from __future__ import print_function, division from distutils.version import LooseVersion as V from sympy.core.compatibility import range from sympy.external import import_module from sympy.interactive.printing import init_printing preexec_source = """\ from __futu...
bsd-3-clause
pizzathief/numpy
numpy/lib/recfunctions.py
2
56721
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ from __future__ import division, absolute_import, print_function import sys import itertools import numpy as np im...
bsd-3-clause
GuessWhoSamFoo/pandas
pandas/tests/arrays/test_integer.py
1
22287
# -*- coding: utf-8 -*- import numpy as np import pytest from pandas.core.dtypes.generic import ABCIndexClass import pandas as pd from pandas.api.types import is_float, is_float_dtype, is_integer, is_scalar from pandas.core.arrays import IntegerArray, integer_array from pandas.core.arrays.integer import ( Int8Dty...
bsd-3-clause
hlin117/scikit-learn
examples/calibration/plot_calibration_multiclass.py
95
6971
""" ================================================== Probability Calibration for 3-class classification ================================================== This example illustrates how sigmoid calibration changes predicted probabilities for a 3-class classification problem. Illustrated is the standard 2-simplex, wher...
bsd-3-clause
srowen/spark
python/pyspark/pandas/tests/test_window.py
15
13671
# # 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
giuliavezzani/giuliavezzani.github.io
markdown_generator/talks.py
199
4000
# coding: utf-8 # # Talks markdown generator for academicpages # # Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i...
mit
liberatorqjw/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
imapp-pl/golem
scripts/blenderstats.py
3
2743
import click import statistics import math import random import matplotlib.pyplot as plt @click.command() @click.argument("results") @click.option("--probs", default=0) @click.option("--name", default="Rendering time") @click.option("--plot/--no-plot", default=True) @click.option("--repeat_prob/--no-repeat_prob", def...
gpl-3.0
roaminsight/roamresearch
BlogPosts/Outlier_detection/roam_outliers.py
1
4609
import numpy as np import pandas as pd from rpy2.robjects.packages import importr from rpy2.robjects import pandas2ri outlier = importr('outlierDetection') anomaly = importr('AnomalyDetection') def make_time_series(start_dt, end_dt, time_step, functions, random_state=None): """ Sklearn-style dataset creation...
apache-2.0
olgabot/seaborn
seaborn/palettes.py
4
28814
from __future__ import division import colorsys from itertools import cycle import numpy as np import matplotlib as mpl from .external import husl from .external.six import string_types from .external.six.moves import range from .utils import desaturate, set_hls_values, get_color_cycle from .xkcd_rgb import xkcd_rgb...
bsd-3-clause
blutooth/gp-svi
examples/maxsvi.py
1
4900
from __future__ import absolute_import from __future__ import print_function import matplotlib.pyplot as plt import autograd.numpy as np import autograd.numpy.random as npr import autograd.scipy.stats.multivariate_normal as mvn import autograd.scipy.stats.norm as norm import gaussian_process as gp import autograd.scip...
mit
a-holm/MachinelearningAlgorithms
Regression/SimpleLinearRegression/regularLinearRegression2.py
1
1740
# -*- coding: utf-8 -*- """Simple linear regression for machine learning. This file demonstrate knowledge of linear regression. By using conventional libraries.The idea of linear regression is to take continuous data and find the best fit of it to a line. Simple linear regression just refers to the fact that the feat...
mit
licode/xray-vision
xray_vision/qt_widgets/real_time.py
6
10948
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
bsd-3-clause
dwillmer/numpy
numpy/core/fromnumeric.py
9
98023
"""Module containing non-deprecated functions borrowed from Numeric. """ from __future__ import division, absolute_import, print_function import types import warnings import numpy as np from .. import VisibleDeprecationWarning from . import multiarray as mu from . import umath as um from . import numerictypes as nt ...
bsd-3-clause
quantumlib/Cirq
cirq-google/cirq_google/engine/calibration_test.py
1
6828
# Copyright 2019 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
joferkington/tutorials
1512_Semblance_coherence_and_discontinuity/figures/figure_2.py
1
5644
""" Note that this is a very hackish script to put together this figure. Forgive the sloppy approach. """ import numpy as np import scipy.ndimage import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import basic_methods from parent_directory import image_dir def main(): fig, axe...
apache-2.0
UKPLab/sentence-transformers
examples/training/distillation/dimensionality_reduction.py
1
4588
""" The pre-trained models produce embeddings of size 512 - 1024. However, when storing a large number of embeddings, this requires quite a lot of memory / storage. In this example, we reduce the dimensionality of the embeddings to e.g. 128 dimensions. This significantly reduces the required memory / storage while mai...
apache-2.0
bzero/statsmodels
statsmodels/tools/tests/test_pca.py
25
13934
from __future__ import print_function, division from unittest import TestCase import warnings import numpy as np from numpy.testing import assert_allclose, assert_equal, assert_raises from numpy.testing.decorators import skipif import pandas as pd try: import matplotlib.pyplot as plt missing_matplotlib = Fal...
bsd-3-clause
rahul-c1/scikit-learn
examples/applications/plot_model_complexity_influence.py
25
6378
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
jmmease/pandas
pandas/tests/io/parser/header.py
2
9626
# -*- coding: utf-8 -*- """ Tests that the file header is properly handled or inferred during parsing for all of the parsers defined in parsers.py """ import pytest import numpy as np import pandas.util.testing as tm from pandas import DataFrame, Index, MultiIndex from pandas.compat import StringIO, lrange, u cla...
bsd-3-clause
jamiebull1/geomeppy
geomeppy/view_geometry.py
1
5755
"""Tool for visualising geometry.""" from typing import Optional, TYPE_CHECKING # noqa if TYPE_CHECKING: from geomeppy import IDF from eppy.function_helpers import getcoords from eppy.iddcurrent import iddcurrent from six import StringIO from six.moves.tkinter import TclError try: from mpl_toolkits.mplot3d i...
mit
trislett/TFCE_mediation
tfce_mediation/misc_scripts/ica_tmi.py
1
10476
#!/usr/bin/env python # tm_maths: math functions for vertex and voxel images # Copyright (C) 2016 Tristram Lett # This program 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
kazemakase/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
355
2843
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
rafiqsaleh/VERCE
verce-hpc-pe/src/wavePlot_INGV.py
2
3058
from verce.processing import * import matplotlib.pyplot as plt import matplotlib.dates as mdt class WavePlot_INGV(SeismoPreprocessingActivity): def compute(self): self.outputdest=self.outputdest+"%s" % (self.parameters["filedestination"],); try: i...
mit
hrjn/scikit-learn
sklearn/datasets/base.py
13
29166
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import sys import shutil from os import environ...
bsd-3-clause
jjx02230808/project0223
sklearn/cluster/tests/test_hierarchical.py
230
19795
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
CVML/scikit-learn
examples/svm/plot_svm_nonlinear.py
268
1091
""" ============== Non-linear SVM ============== Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a XOR of the inputs. The color map illustrates the decision function learned by the SVC. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn imp...
bsd-3-clause
m3wolf/scimap
scimap/fullprof_refinement.py
1
33866
# -*- coding: utf-8 -*- import logging log = logging.getLogger(__name__) from enum import Enum import math import os from shutil import copy2 import re from subprocess import call import contextlib import logging log = logging.getLogger(__name__) import warnings import jinja2 import pandas as pd import numpy as np ...
gpl-3.0
cmorgan/trading-with-python
historicDataDownloader/historicDataDownloader.py
77
4526
''' Created on 4 aug. 2012 Copyright: Jev Kuznetsov License: BSD a module for downloading historic data from IB ''' import ib import pandas from ib.ext.Contract import Contract from ib.opt import ibConnection, message from time import sleep import tradingWithPython.lib.logger as logger from pandas impor...
bsd-3-clause
xwolf12/scikit-learn
sklearn/metrics/cluster/tests/test_unsupervised.py
230
2823
import numpy as np from scipy.sparse import csr_matrix from sklearn import datasets from sklearn.metrics.cluster.unsupervised import silhouette_score from sklearn.metrics import pairwise_distances from sklearn.utils.testing import assert_false, assert_almost_equal from sklearn.utils.testing import assert_raises_regexp...
bsd-3-clause
voxlol/scikit-learn
examples/plot_multilabel.py
87
4279
# Authors: Vlad Niculae, Mathieu Blondel # License: BSD 3 clause """ ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ...
bsd-3-clause
nmartensen/pandas
pandas/tests/groupby/test_nth.py
4
10186
import numpy as np import pandas as pd from pandas import DataFrame, MultiIndex, Index, Series, isna from pandas.compat import lrange from pandas.util.testing import ( assert_frame_equal, assert_produces_warning, assert_series_equal) from .common import MixIn class TestNth(MixIn): def test_first_las...
bsd-3-clause
cshallue/models
research/keypointnet/main.py
4
21991
# Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
scienceopen/starscale
PlotContrastStretch.py
1
1828
#!/usr/bin/env python """ Example of the Contrast Stretch options in AstroPy, that you might find handy in cytometry or other non-astronomical pursuits as well. """ from pathlib import Path from astropy.io import fits import astropy.visualization as vis from astropy.visualization.mpl_normalize import ImageNormalize fro...
gpl-3.0
eseidel/native_client_patches
tools/modular-build/btarget.py
1
20589
# Copyright 2010 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. import hashlib import itertools import optparse import os import re import subprocess import sys import dirtree import treemappers def Unrepr(x): ...
bsd-3-clause
jreback/pandas
pandas/core/indexes/interval.py
1
41420
""" define the IntervalIndex """ from functools import wraps from operator import le, lt import textwrap from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union, cast import numpy as np from pandas._config import get_option from pandas._libs import lib from pandas._libs.interval import Interval, Interval...
bsd-3-clause
vitaly-krugl/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qtagg.py
73
4972
""" Render to qt from agg """ from __future__ import division import os, sys import matplotlib from matplotlib import verbose from matplotlib.figure import Figure from backend_agg import FigureCanvasAgg from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\ show, draw_if_interactive, backend_version, \ ...
agpl-3.0
wrightni/OSSP
lib/debug_tools.py
1
6515
from skimage import segmentation, exposure import matplotlib.pyplot as plt import matplotlib.colors as colors import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn import metrics from lib import utils def display_image(raw,watershed,classified,type): # Save a color empty_color...
mit
studywolf/REACH-paper
analysis/06b-CB_correlations_plot.py
1
4942
import matplotlib.pyplot as plt import numpy as np import seaborn import sys folder = 'data/correlations-CB' filename = 'CB_spikes' n_trials = 10 # can be up to 100 n_neurons = 10000 # to plot correlations with different movement parameters call # script with an argument corresponding to data type you want to plot ...
gpl-3.0
wanderknight/trading-with-python
lib/vixFutures.py
79
4157
# -*- coding: utf-8 -*- """ set of tools for working with VIX futures @author: Jev Kuznetsov Licence: GPL v2 """ import datetime as dt from pandas import * import os import urllib2 #from csvDatabase import HistDataCsv m_codes = dict(zip(range(1,13),['F','G','H','J','K','M','N','Q','U','V','X','Z'])) #m...
bsd-3-clause
jamesjarlathlong/resourceful
two_agents.py
1
8233
import os from agent import * import asyncio from qlearn import QLearn from sarsa import Sarsa import itertools import functools import json import random import sklearn import collections import websockets import json import copy import time ###Helper functions### def merge(dicts): super_dict = collections.defaul...
mit
rbaravalle/imfractal
tests/testcomparison.py
1
8144
""" Copyright (c) 2013 Rodrigo Baravalle All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following...
bsd-3-clause
fermiPy/fermipy
fermipy/stack/stack_plotting_utils.py
1
13559
#!/usr/bin/env python # """ Utilities to plot dark matter analyses """ import numpy as np from fermipy import sed_plotting ENERGY_AXIS_LABEL = r'Energy [MeV]' ENERGY_FLUX_AXIS_LABEL = r'Energy Flux [MeV s$^{-1}$ cm$^{-2}$]' FLUX_AXIS_LABEL = r'Flux [ph s$^{-1}$ cm$^{-2}$]' DELTA_LOGLIKE_AXIS_LABEL = r'$\Delta \log...
bsd-3-clause
ckinzthompson/biasd
biasd/gui/plotter.py
1
2859
# -*- coding: utf-8 -*-® ''' PyQt trace plotter widget ''' from PyQt5.QtWidgets import QWidget,QSizePolicy # Make sure that we are using QT5 import matplotlib matplotlib.use('Qt5Agg') import numpy as np from matplotlib.backends.backend_qt5agg import FigureCanvas import matplotlib.pyplot as plt class trace_plotter(Fi...
mit
ZhangXinNan/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
39
32726
# 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
stinebuu/nest-simulator
pynest/examples/mc_neuron.py
12
7554
# -*- coding: utf-8 -*- # # mc_neuron.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, or #...
gpl-2.0
sebastian-nagel/cc-crawl-statistics
plot/crawl_size.py
1
10348
import pandas import re import sys import types from collections import defaultdict from hyperloglog import HyperLogLog from crawlplot import CrawlPlot from crawlstats import CST, CrawlStatsJSONDecoder, HYPERLOGLOG_ERROR,\ MonthlyCrawl class CrawlSizePlot(CrawlPlot): def __init__(self): self.size =...
apache-2.0
mashaoze/esp-idf
tools/tiny-test-fw/Utility/LineChart.py
3
1681
# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD # # 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 ...
apache-2.0
mefortunato/pysimm
Examples/11_pim_adsorption/run.py
1
6555
from pysimm import cassandra from pysimm import system from os import path as osp import numpy import re from matplotlib import pyplot as mplp try: import pyiast import pandas except ImportError: print('Either PyIAST or Pandas (that is PyIAST dependence) packages are not installed or cannot be found by thi...
mit
vidartf/hyperspyUI
hyperspyui/mdi_mpl_backend.py
1
11413
# -*- coding: utf-8 -*- # Copyright 2014-2016 The HyperSpyUI developers # # This file is part of HyperSpyUI. # # HyperSpyUI 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 #...
gpl-3.0
LiuVII/Machine_learning_and_AI
Tensorflow_MNIST/fcnn_2hl_mnist.py
1
3743
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import math import csv import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", o...
mit
perimosocordiae/scipy
scipy/special/_precompute/wright_bessel.py
12
12928
"""Precompute coefficients of several series expansions of Wright's generalized Bessel function Phi(a, b, x). See https://dlmf.nist.gov/10.46.E1 with rho=a, beta=b, z=x. """ from argparse import ArgumentParser, RawTextHelpFormatter import numpy as np from scipy.integrate import quad from scipy.optimize import minimize...
bsd-3-clause
mikebenfield/scikit-learn
sklearn/utils/tests/test_testing.py
29
7316
import warnings import unittest import sys from sklearn.utils.testing import ( assert_raises, assert_less, assert_greater, assert_less_equal, assert_greater_equal, assert_warns, assert_no_warnings, assert_equal, set_random_state, assert_raise_message, ignore_warnings) from ...
bsd-3-clause
tencrance/cool-config
ml_keras_learn/tutorials/sklearnTUT/sk7_normalization.py
2
1190
# View more python learning tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial """ Please note, this code is only for python 3+. If you are using python 2+, please modify the code acco...
mit
eickenberg/scikit-learn
examples/cluster/plot_cluster_comparison.py
8
4865
""" ========================================================= 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
tiagofrepereira2012/tensorflow
tensorflow/contrib/metrics/python/kernel_tests/histogram_ops_test.py
130
9577
# 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
cactusbin/nyt
matplotlib/examples/mplot3d/trisurf3d_demo2.py
8
1761
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.tri as mtri # u, v are parameterisation variables u = (np.linspace(0, 2.0 * np.pi, endpoint=True, num=50) * np.ones((10, 1))).flatten() v = np.repeat(np.linspace(-0.5, 0.5, endpoint=True, num=10), repeats=50).f...
unlicense
ElectronicNose/Electronic-Nose
analysis.py
1
27688
#analysis files from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QFileDialog from analysis_gui import Ui_Analysis import numpy as np import matplotlib,math,csv matplotlib.use('Qt5Agg') from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backen...
mit
huobaowangxi/scikit-learn
benchmarks/bench_plot_incremental_pca.py
374
6430
""" ======================== IncrementalPCA benchmark ======================== Benchmarks for IncrementalPCA """ import numpy as np import gc from time import time from collections import defaultdict import matplotlib.pyplot as plt from sklearn.datasets import fetch_lfw_people from sklearn.decomposition import Incre...
bsd-3-clause
bioinfo-core-BGU/neatseq-flow_modules
neatseq_flow_modules/Liron/cgMLST_and_MLST_typing_module/Merge_tab_files.py
2
7863
import os, re import argparse import pandas as pd STRING_TYPES = (str, str, bytes) parser = argparse.ArgumentParser(description='Merge tabular files') parser.add_argument('-D', type=str,dest='directory', nargs='+', help='Location to search') parser.add_argument('-R', dest='Regular', type=str, ...
gpl-3.0
georgetown-analytics/skidmarks
bin/stop.py
1
3543
# -*- coding: utf-8 -*- ############################################################################### # Information ############################################################################### # Created by Linwood Creekmore # Input by Vikram Mittal # In partial fulfillment of the requirements for the Georgetow...
mit
JT5D/scikit-learn
examples/decomposition/plot_pca_iris.py
8
1783
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <http://en.wikipedia.org/wiki/Iris_flower_data_set>`_ fo...
bsd-3-clause
BhallaLab/moose-full
moose-core/tests/python/Rallpacks/rallpacks_cable_hhchannel.py
2
8099
#!/usr/bin/env python """rallpacks_cable_hhchannel.py: A cable with 1000 compartments with HH-type channels in it. Last modified: Wed May 21, 2014 09:51AM """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2013, NCBS Bangalore" __credits__ = ["NCBS Bangalore", "Bhalla L...
gpl-2.0
kojiagile/CLAtoolkit
clatoolkit_project/dashboard/utils.py
1
63217
from django.db import connection from gensim import corpora, models, similarities from collections import defaultdict import pyLDAvis.gensim import os import re import json import copy import funcy as fp import numpy as np import subprocess import jgraph import igraph import datetime from pprint import pprint from coll...
gpl-3.0
desihub/desispec
py/desispec/desi_create_bias_dark.py
1
4950
import argparse import os import fitsio import astropy.io.fits as pyfits from astropy.io import fits import subprocess import pandas as pd import time import numpy as np import psycopg2 import hashlib import pdb from os import listdir import matplotlib.pyplot as plt """ ################################################...
bsd-3-clause
mkraemer67/pylearn2
pylearn2/models/independent_multiclass_logistic.py
44
2491
""" Multiclass-classification by taking the max over a set of one-against-rest logistic classifiers. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googleg...
bsd-3-clause
AndrewRook/PyWPA
nflwin/model.py
1
25071
"""Tools for creating and running the model.""" from __future__ import print_function, division import os import numpy as np from scipy import integrate from scipy import stats from sklearn.ensemble import RandomForestClassifier from sklearn.externals import joblib from sklearn.linear_model import LogisticRegression...
mit
abhishekgahlot/scikit-learn
sklearn/preprocessing/tests/test_imputation.py
28
11950
import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.preprocessing.imputa...
bsd-3-clause
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
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/misc/coords_report.py
1
1190
""" ============= Coords Report ============= Override the default reporting of coords. """ import matplotlib.pyplot as plt import numpy as np # nodebox section if __name__ == '__builtin__': # were in nodebox import os import tempfile W = 800 inset = 20 size(W, 600) plt.cla() plt.clf(...
mit
mantidproject/mantid
Framework/PythonInterface/test/python/mantid/plots/compatabilityTest.py
3
8145
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
breznak/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/mlab.py
69
104273
""" Numerical python functions written for compatability with matlab(TM) commands with the same names. Matlab(TM) compatible functions ------------------------------- :func:`cohere` Coherence (normalized cross spectral density) :func:`csd` Cross spectral density uing Welch's average periodogram :func:`detrend`...
agpl-3.0
moutai/scikit-learn
examples/linear_model/plot_sgd_iris.py
58
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause
beepee14/scikit-learn
sklearn/linear_model/stochastic_gradient.py
65
50308
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import scipy.sparse as sp from abc import ABCMeta, abstractmethod from ...
bsd-3-clause
wazeerzulfikar/scikit-learn
sklearn/ensemble/tests/test_bagging.py
7
29340
""" Testing for the bagging ensemble module (sklearn.ensemble.bagging). """ # Author: Gilles Louppe # License: BSD 3 clause import numpy as np from sklearn.base import BaseEstimator from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.te...
bsd-3-clause
stylianos-kampakis/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
LevinJ/ud730-Deep-Learning
A1_notmnistdataset/extractimage.py
1
2248
from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from scipy import ndimage from sklearn.linear_model import LogisticRegression from six.moves.urllib.request import urlretrieve from six.moves import cPi...
gpl-2.0
deuxpi/pytrainer
pytrainer/gui/windowmain.py
1
103653
#!/usr/bin/python # -*- coding: utf-8 -*- #Copyright (C) Fiz Vazquez vud1@sindominio.net # Modified by dgranda #This program 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, or...
gpl-2.0
google/eng-edu
ml/guides/text_classification/vectorize_data.py
1
3645
"""Module to vectorize data. Converts the given training and validation texts into numerical tensors. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np from tensorflow.python.keras.preprocessing import sequence ...
apache-2.0
maciekcc/tensorflow
tensorflow/contrib/learn/python/learn/dataframe/transforms/in_memory_source.py
26
6490
# 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
zooniverse/aggregation
active_weather/old/paper_otsu.py
1
5306
import matplotlib import matplotlib.pyplot as plt import cv2 from skimage import data from skimage.morphology import disk from skimage.filters import threshold_otsu, rank from skimage.util import img_as_ubyte from os import popen from active_weather import ActiveWeather import numpy as np directory = "/home/ggdhines/D...
apache-2.0
Nyker510/scikit-learn
sklearn/covariance/graph_lasso_.py
127
25626
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
bsd-3-clause