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
yaojenkuo/BuildingMachineLearningSystemsWithPython
ch03/rel_post_20news.py
24
3903
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import sklearn.datasets import scipy as sp new_post = \ """Disk drive problems. Hi, I have a probl...
mit
hitszxp/scikit-learn
sklearn/linear_model/tests/test_ransac.py
40
12814
import numpy as np from numpy.testing import assert_equal, assert_raises from numpy.testing import assert_array_almost_equal from scipy import sparse from sklearn.utils.testing import assert_less from sklearn.linear_model import LinearRegression, RANSACRegressor from sklearn.linear_model.ransac import _dynamic_max_tri...
bsd-3-clause
ChanChiChoi/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
rupak0577/ginga
ginga/web/pgw/Plot.py
3
4306
# # Plot.py -- Plotting widget canvas wrapper. # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from io import BytesIO from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from ...
bsd-3-clause
AlexanderFabisch/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py
46
2798
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
bsd-3-clause
paladin74/neural-network-animation
matplotlib/tests/test_dviread.py
15
1788
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from nose.tools import assert_equal import matplotlib.dviread as dr import os.path original_find_tex_file = dr.find_tex_file def setup(): dr.find_tex_file = lambda x: x def teardown(): dr...
mit
aabadie/scikit-learn
sklearn/utils/tests/test_testing.py
24
7902
import warnings import unittest import sys from nose.tools import assert_raises from sklearn.utils.testing import ( _assert_less, _assert_greater, assert_less_equal, assert_greater_equal, assert_warns, assert_no_warnings, assert_equal, set_random_state, assert_raise_message, ig...
bsd-3-clause
phobson/statsmodels
statsmodels/sandbox/tsa/movstat.py
34
14871
'''using scipy signal and numpy correlate to calculate some time series statistics original developer notes see also scikits.timeseries (movstat is partially inspired by it) added 2009-08-29 timeseries moving stats are in c, autocorrelation similar to here I thought I saw moving stats somewhere in python, maybe not)...
bsd-3-clause
intermezzo-fr/hillary-clinton-emails
scripts/outputCsvs.py
5
3577
import numpy as np import pandas as pd def normalize_address(raw_address): for c in ["'", ",", "°", "•", "`", '"', "‘", "-"]: raw_address = raw_address.replace(c, "") raw_address = raw_address.lower() if "<" in raw_address: prefix = raw_address[:raw_address.index("<")].strip() if ...
mit
nan86150/ImageFusion
lib/python2.7/site-packages/matplotlib/tests/__init__.py
17
2578
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import difflib import os from matplotlib import rcParams, rcdefaults, use _multiprocess_can_split_ = True # Check that the test directories exist if not os.path.exists(os.path.join( os....
mit
andreugrimalt/Theano-Tutorials
5_convolutional_net.py
1
3899
import theano from theano import tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import numpy as np from load import mnist from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 imp...
mit
leesavide/pythonista-docs
Documentation/matplotlib/mpl_examples/pylab_examples/contourf_log.py
9
1350
''' Demonstrate use of a log color scale in contourf ''' from matplotlib import pyplot as P import numpy as np from numpy import ma from matplotlib import colors, ticker, cm from matplotlib.mlab import bivariate_normal N = 100 x = np.linspace(-3.0, 3.0, N) y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # A ...
apache-2.0
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/tests/test_patheffects.py
10
5445
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np from matplotlib.testing.decorators import image_comparison, cleanup import matplotlib.pyplot as plt import matplotlib.patheffects as path_effects try: # mock in python 3.3+ ...
mit
chaluemwut/fbserver
venv/lib/python2.7/site-packages/sklearn/feature_extraction/text.py
1
49725
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Robert Layton <robertlayton@gmail.com> # Jochen Wersdörfer <jochen@wersdoerfer.de> # Roman Sinayev <roman.sinayev@gma...
apache-2.0
raghavrv/scikit-learn
sklearn/neighbors/tests/test_approximate.py
12
20126
""" Testing for the approximate neighbor search using Locality Sensitive Hashing Forest module (sklearn.neighbors.LSHForest). """ # Author: Maheshakya Wijewardena, Joel Nothman import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
parrt/lolviz
prince_dtree.py
1
12296
import IPython, graphviz, re from io import StringIO from IPython.display import Image import numpy as np import pandas as pd import math from sklearn import tree from sklearn.datasets import load_boston, load_iris from collections import defaultdict import string import re YELLOW = "#fefecd" # "#fbfbd0" # "#FBFEB0" B...
bsd-3-clause
priseborough/InertialNav
code/plot_states.py
6
2287
#!/bin/python import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.cbook as cbook import numpy as np import math # State vector: # 0-3: quaternions (q0, q1, q2, q3) # 4-6: Velocity - m/sec (North, East, Down) # 7-9: Position - m (North, East, Down) # 10-12: Delta Angle bias - rad (X,Y,Z) #...
bsd-3-clause
ThomasMiconi/nupic.research
projects/l2_pooling/multi_column_convergence.py
2
22360
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it under the ...
agpl-3.0
airware/jsbsim
tests/TestScriptOutput.py
2
3376
# TestScriptInputOutput.py # # Check that <output> tags specified in a script are properly handled # # Copyright (c) 2015 Bertrand Coconnier # # 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; eit...
lgpl-2.1
cbertinato/pandas
pandas/tests/frame/test_combine_concat.py
1
34741
from datetime import datetime import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, Series, Timestamp, date_range import pandas.util.testing as tm from pandas.util.testing import assert_frame_equal, assert_series_equal class TestDataFrameConcatCommon: def test_concat_multipl...
bsd-3-clause
jungla/ICOM-fluidity-toolbox
2D/RST/plot_T_spec_res.py
1
8498
import os, sys import myfun import numpy as np import matplotlib as mpl mpl.use('ps') import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy import interpolate import lagrangian_stats import scipy.fftpack ## READ archive (too many points... somehow) # args: name, dayi, dayf, days label = ...
gpl-2.0
trankmichael/scikit-learn
sklearn/neighbors/approximate.py
128
22351
"""Approximate nearest neighbor search""" # Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk> # Joel Nothman <joel.nothman@gmail.com> import numpy as np import warnings from scipy import sparse from .base import KNeighborsMixin, RadiusNeighborsMixin from ..base import BaseEstimator from ..utils.va...
bsd-3-clause
dankolbman/BCIM
src/post.py
1
7125
import glob import os import sys import re import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np import python.DataIO as DataIO import python.graphics as graphics import python.clusters as clusters import python.counts as counts # Format settings from matplotlib i...
mit
sugartom/tensorflow-alien
tensorflow/examples/learn/text_classification.py
39
5106
# 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
aflaxman/scikit-learn
sklearn/metrics/regression.py
47
19967
"""Metrics to assess performance on regression task 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.fr> # Ma...
bsd-3-clause
capturePointer/vigra
vigranumpy/examples/grid_graph_shortestpath.py
8
3978
import vigra import vigra.graphs as vigraph import pylab import numpy np=numpy import sys import matplotlib import pylab as plt import math from matplotlib.widgets import Slider, Button, RadioButtons def makeWeights(gamma): global hessian,gradmag,gridGraph print "hessian",hessian.min(),hessian.max() print ...
mit
trungnt13/scikit-learn
examples/linear_model/plot_ols.py
220
1940
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
anirudhjayaraman/scikit-learn
sklearn/utils/tests/test_extmath.py
70
16531
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis Engemann <d.engemann@fz-juelich.de> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from scipy import stats from sklearn.utils.testing import assert_eq...
bsd-3-clause
SuperJohn/scikit-class
grid_search.py
6
1243
import pandas as pd import numpy as np df = pd.read_csv('tweets.csv') target = df['is_there_an_emotion_directed_at_a_brand_or_product'] text = df['tweet_text'] fixed_text = text[pd.notnull(text)] fixed_target = target[pd.notnull(text)] from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_b...
gpl-2.0
radiasoft/radtrack
experimental/hermite/testHermite02.py
1
6919
# # Test executable #2 to exercise the Gauss-Hermite class # Here, we fit a Gauss-Hermite expansion to an arbitrary profile. # The SciPy least squares method is used. # # Copyright (c) 2013 RadiaBeam Technologies. All rights reserved # # python imports import math # SciPy imports import numpy as np import matplotlib.p...
apache-2.0
ritviksahajpal/Py6S
Py6S/SixSHelpers/all_angles.py
1
13499
# This file is part of Py6S. # # Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file. # # Py6S is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
lgpl-3.0
wogsland/QSTK
build/lib.linux-x86_64-2.7/QSTK/qstkfeat/classes.py
8
1658
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on Nov 7, 2011 @author: John Cornwell @contact: JohnWCornwellV@gmail.com @summary: File containing various c...
bsd-3-clause
meduz/scikit-learn
examples/linear_model/plot_ransac.py
73
1859
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
nagyistoce/kaggle-galaxies
try_convnet_cc_multirotflip_3x69r45_maxout2048_extradense_pysexgen1_dup.py
7
17744
import numpy as np # import pandas as pd import theano import theano.tensor as T import layers import cc_layers import custom import load_data import realtime_augmentation as ra import time import csv import os import cPickle as pickle from datetime import datetime, timedelta # import matplotlib.pyplot as plt # plt.i...
bsd-3-clause
liyu1990/sklearn
examples/ensemble/plot_gradient_boosting_oob.py
50
4764
""" ====================================== Gradient Boosting Out-of-Bag estimates ====================================== Out-of-bag (OOB) estimates can be a useful heuristic to estimate the "optimal" number of boosting iterations. OOB estimates are almost identical to cross-validation estimates but they can be compute...
bsd-3-clause
matbra/bokeh
examples/interactions/interactive_bubble/data.py
49
1265
import numpy as np from bokeh.palettes import Spectral6 def process_data(): from bokeh.sampledata.gapminder import fertility, life_expectancy, population, regions # Make the column names ints not strings for handling columns = list(fertility.columns) years = list(range(int(columns[0]), int(columns[-...
bsd-3-clause
harterj/moose
modules/tensor_mechanics/test/tests/capped_mohr_coulomb/small_deform_hard_21.py
12
1567
#!/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
wkfwkf/statsmodels
examples/run_all.py
34
1740
"""run all examples to make sure we don't get an exception Note: If an example contaings plt.show(), then all plot windows have to be closed manually, at least in my setup. uncomment plt.show() to show all plot windows """ from __future__ import print_function from statsmodels.compat import input stop_on_error = Tru...
bsd-3-clause
massmutual/scikit-learn
sklearn/utils/estimator_checks.py
1
54609
from __future__ import print_function import types import warnings import sys import traceback import pickle from copy import deepcopy import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memory from sklearn.utils.testing imp...
bsd-3-clause
neuroidss/nupic.research
projects/sequence_classification/run_encoder_with_union.py
9
8995
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
hrjn/scikit-learn
examples/cluster/plot_birch_vs_minibatchkmeans.py
333
3694
""" ================================= Compare BIRCH and MiniBatchKMeans ================================= This example compares the timing of Birch (with and without the global clustering step) and MiniBatchKMeans on a synthetic dataset having 100,000 samples and 2 features generated using make_blobs. If ``n_clusters...
bsd-3-clause
GuLinux/PySpectrum
import_image.py
1
5892
from pyui.import_image import Ui_ImportImage from PyQt5.QtWidgets import QWidget, QToolBar, QDialog, QDialogButtonBox, QProgressDialog, QMessageBox from PyQt5.QtGui import QIcon from PyQt5.QtCore import Qt, QCoreApplication from qmathplotwidget import QMathPlotWidget, QImPlotWidget import matplotlib.pyplot as plt from ...
gpl-3.0
INM-6/python-neo
neo/io/neuralynxio_v1.py
2
105289
""" Class for reading data from Neuralynx files. This IO supports NCS, NEV and NSE file formats. This module is an older implementation with old neo.io API. A new class NeuralynxIO compunded by NeuralynxRawIO and BaseFromIO superseed this one. Depends on: numpy Supported: Read Author: Julia Sprenger, Carlos Canova...
bsd-3-clause
rlouf/patterns-of-segregation
bin/plot_scaling_classes.py
1
3443
"""plot_income_scaling.py Plot the number of households from a given class as a function of the total number of households per city """ import csv import math from matplotlib import pylab as plt from scipy.stats import linregress colours = {'Lower':'#4F8F6B', 'Higher':'#C1A62E', 'Middle':'#4B453C'} ...
bsd-3-clause
liberatorqjw/scikit-learn
sklearn/tests/test_multiclass.py
8
21910
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing ...
bsd-3-clause
dshen1/trading-with-python
lib/functions.py
76
11627
# -*- coding: utf-8 -*- """ twp support functions @author: Jev Kuznetsov Licence: GPL v2 """ from scipy import polyfit, polyval import datetime as dt #from datetime import datetime, date from pandas import DataFrame, Index, Series import csv import matplotlib.pyplot as plt import numpy as np import p...
bsd-3-clause
namccart/gnuradio
gr-digital/examples/example_costas.py
49
5316
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
tbabej/astropy
astropy/visualization/wcsaxes/tests/test_frame.py
2
5298
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import matplotlib.pyplot as plt from ....wcs import WCS from ....tests.helper import pytest, remote_data from .. import WCSAxes from ..frame import BaseFrame from ....tests.image_tests import IMAGE_REFERENCE_DIR from .test_images imp...
bsd-3-clause
blisseth/ThinkStats2
code/regression.py
62
9652
"""This file contains code used in "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, division import math import pandas import random import numpy as np import statsmode...
gpl-3.0
liyu1990/sklearn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
jarathomas/openVA-Pipeline
pipeline.py
1
49777
#-------------------------------------------------------------------------------------------------------------------------------------------# # openVA Pipeline: pipeline.py -- Software for processing Verbal Autopsy data with automated cause of death assignment. # # Copyright (C) 2018 Jason Thomas,...
gpl-3.0
gfyoung/pandas
pandas/tests/frame/indexing/test_getitem.py
2
5364
import numpy as np import pytest from pandas import ( Categorical, CategoricalDtype, CategoricalIndex, DataFrame, MultiIndex, Series, Timestamp, get_dummies, period_range, ) import pandas._testing as tm from pandas.core.arrays import SparseArray class TestGetitem: def test_get...
bsd-3-clause
hmendozap/master-arbeit-projects
autosk_dev_test/component/LinReg.py
1
8756
import numpy as np import scipy.sparse as sp from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.conditions import EqualsCondition, InCondition from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \ UniformIntegerHyperparameter, CategoricalHyperparameter...
mit
PrashntS/scikit-learn
sklearn/linear_model/ridge.py
60
44642
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
vipulroxx/sympy
sympy/physics/quantum/circuitplot.py
58
12941
"""Matplotlib based plotting of quantum circuits. Todo: * Optimize printing of large circuits. * Get this to work with single gates. * Do a better job checking the form of circuits to make sure it is a Mul of Gates. * Get multi-target gates plotting. * Get initial and final states to plot. * Get measurements to plo...
bsd-3-clause
dsquareindia/scikit-learn
sklearn/tests/test_cross_validation.py
79
47914
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from scipy import stats from sklearn.exceptions import ConvergenceWarning from sklearn.utils.testing import assert_true from sklearn.utils.t...
bsd-3-clause
srowen/spark
python/run-tests.py
15
13614
#!/usr/bin/env python3 # # 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 "L...
apache-2.0
jinglining/flink
flink-python/setup.py
5
12946
################################################################################ # 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...
apache-2.0
rhnvrm/iot-hackerearth
py/sim/wo/work.py
1
5919
from __future__ import division import requests import random import time import threading import rethinkdb as r import math import numpy as np import cv2 import matplotlib from matplotlib import pyplot as plt import matplotlib.patches as patches from scipy.misc import imread import os plt.scatter([0,5],[0,5]) plt.io...
mit
tiagofrepereira2012/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py
52
69800
# 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
shanzhenren/ClusType
src/algorithm.py
1
10630
from collections import defaultdict from operator import itemgetter from math import log, sqrt import random as rn import time from numpy import * # install numpy from scipy import * # install scipy from numpy.linalg import norm import numpy.linalg as npl from scipy.sparse import * import scipy.sparse.linalg as spsl fr...
gpl-3.0
JasonKessler/scattertext
scattertext/test/test_PriorFactory.py
1
4207
from unittest import TestCase import numpy as np import pandas as pd from scattertext import LogOddsRatioInformativeDirichletPrior from scattertext.PriorFactory import PriorFactory from scattertext.test.test_semioticSquare import get_test_corpus class TestPriorFactory(TestCase): def test_all_categories(self): ...
apache-2.0
atcemgil/notes
DrawNN.py
1
2429
#Code from https://gist.github.com/craffel/2d727968c3aaebd10359 import matplotlib.pyplot as plt def draw_neural_net(ax, left, right, bottom, top, layer_sizes, bias=0, draw_edges=False): ''' Draw a neural network cartoon using matplotilb. :usage: >>> fig = plt.figure(figsize=(12, 12)) ...
mit
uberpye/gwdetchar
gwdetchar/io/tests/test_html.py
1
22674
# -*- 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
dacb/elvizCluster
unit_tests/test_elviz_abundance_utils.py
2
1469
import unittest import pandas as pd class testCompletenessOfSummarisedData(unittest.TestCase): def test_animal_data(self): """ Make sure each sample's fraction of abundance values sums very close to 1. On toy data set only. """ animal_df = pd.read_csv("./summarised_animals...
bsd-3-clause
ajdawson/colormaps
setup.py
1
2163
"""Build and install the colormaps package.""" # Copyright (c) 2012 Andrew Dawson # # 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 right...
mit
stefan-balke/librosa
tests/test_display.py
2
9298
#!/usr/bin/env python # -*- encoding: utf-8 -*- # CREATED:2015-02-14 22:51:01 by Brian McFee <brian.mcfee@nyu.edu> '''Unit tests for display module''' import warnings # Disable cache import os try: os.environ.pop('LIBROSA_CACHE_DIR') except KeyError: pass import matplotlib matplotlib.use('Agg') matplotlib.rc...
isc
jstoxrocky/statsmodels
statsmodels/regression/tests/test_regression.py
6
37622
""" Test functions for models.regression """ # TODO: Test for LM from statsmodels.compat.python import long, lrange import warnings import pandas import numpy as np from numpy.testing import (assert_almost_equal, assert_approx_equal, assert_raises, assert_equal, assert_allclose) from scipy.l...
bsd-3-clause
google/rysim
python/results_analyzer/Main.py
1
119456
# Copyright 2014 The RySim 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 applicable law o...
apache-2.0
mmottahedi/neuralnilm_prototype
scripts/e349.py
2
6140
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
eg-zhang/scikit-learn
benchmarks/bench_mnist.py
76
6136
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
rssenar/PyToolkit
JoinDatasets.py
1
2552
#!/usr/bin/env python3.4 # ---------------------------------------------------------------------------- # import os, csv, glob, re import pandas as pd from Constants import ConvPercentage from tqdm import tqdm # ---------------------------------------------------------------------------- # os.chdir('../../../../Deskto...
bsd-2-clause
low-sky/pyspeckit
pyspeckit/spectrum/models/n2hp.py
4
11414
""" =========== N2H+ fitter =========== Reference for line params: Dore (Private Communication), improving on the determinations from L. Pagani, F. Daniel, and M. L. Dubernet A&A 494, 719-727 (2009) DOI: 10.1051/0004-6361:200810570 http://www.strw.leidenuniv.nl/~moldata/N2H+.html http://adsabs.harvard.edu/abs/2005M...
mit
agoose77/hivesystem
manual/movingpanda/panda-7.py
1
4435
import dragonfly import dragonfly.pandahive import bee from bee import connect import math, functools from panda3d.core import NodePath import dragonfly.scene.unbound import dragonfly.std import dragonfly.io import dragonfly.canvas import Spyder # ## random matrix generator from random import random def random_m...
bsd-2-clause
open2c/bioframe
bioframe/io/fileops.py
1
21340
from collections import OrderedDict from contextlib import closing import tempfile import json import io import numpy as np import pandas as pd try: import bbi except ImportError: bbi = None try: import pyBigWig except ImportError: pyBigWig = None from ..core.stringops import parse_region from ..cor...
mit
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
clemkoa/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
39
7489
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
teoliphant/numpy-refactor
numpy/lib/twodim_base.py
5
22944
""" Basic functions for manipulating 2d arrays """ __all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu', 'tril','vander','histogram2d','mask_indices', 'tril_indices','tril_indices_from','triu_indices','triu_indices_from', ] from numpy.core.numeric import asanyarr...
bsd-3-clause
boddmg/dsp-playground
experiment.py
1
2717
from matplotlib import pyplot as plt import numpy as np import math import pickle from scipy import signal from numpy.fft import rfft, irfft from numpy import argmax, sqrt, mean, absolute, arange, log10 from scipy.signal import blackmanharris import thdn def single_frequency_filter(input_signal): y_f_all = np.fft....
mit
pratapvardhan/pandas
pandas/tests/test_base.py
2
46174
# -*- coding: utf-8 -*- from __future__ import print_function import re import sys from datetime import datetime, timedelta import pytest import numpy as np import pandas as pd import pandas.compat as compat from pandas.core.dtypes.common import ( is_object_dtype, is_datetimetz, is_datetime64_dtype, needs_i8_...
bsd-3-clause
tensorflow/models
research/delf/delf/python/examples/extract_boxes.py
1
7510
# Copyright 2017 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
jurajmajor/ltl3tela
Experiments/ltlcross_runner.py
1
23078
# -*- coding: utf-8 -*- import subprocess import sys import os.path import re import math import spot from IPython.display import SVG from datetime import datetime import pandas as pd from experiments_lib import hoa_to_spot, dot_to_svg, pretty_print def bogus_to_lcr(form): """Converts a formula as it is printed in...
gpl-3.0
wcalvert/LPC11U_LPC13U_CodeBase
src/drivers/sensors/testscripts/plot_xyz_plus_mag_sma.py
2
3774
#------------------------------------------------------------------------------- # Name: plot_sensors_event.py # Purpose: Plots logged sensors_event_t data from logger.c CSV files # # Author: K. Townsend # # Created: 09/06/2013 # Copyright: (c) K. Townsend 2013 # Licence: BSD #----------------...
bsd-3-clause
transientskp/aartfaac-arthur
scripts/arthur-plot.py
1
1440
#!/usr/bin/env python3 import sys import numpy as np from arthur.imaging import full_calculation, calculate_lag from arthur.io import read_full from arthur.plot import plot_image, plot_lag, plot_chan_power, plot_corr_mat, plot_diff from arthur.constants import NUM_CHAN from matplotlib import pyplot FRQ = 58398437.5 ...
gpl-3.0
magic2du/contact_matrix
Contact_maps/DeepLearning/DeepLearningTool/DL_contact_matrix_load2-new10fold_01_09_2015_01.py
1
25014
# coding: utf-8 # In[1]: # this part imports libs and load data from csv file import sys sys.path.append('../../../libs/') import csv from dateutil import parser from datetime import timedelta from sklearn import svm import numpy as np import pandas as pd import pickle from sklearn.cross_validation import train_test...
gpl-2.0
rvraghav93/scikit-learn
sklearn/feature_extraction/tests/test_text.py
8
35969
from __future__ import unicode_literals import warnings from sklearn.feature_extraction.text import strip_tags from sklearn.feature_extraction.text import strip_accents_unicode from sklearn.feature_extraction.text import strip_accents_ascii from sklearn.feature_extraction.text import HashingVectorizer from sklearn.fe...
bsd-3-clause
allinpaybusiness/ACS
allinpay projects/creditscoreMLP/classMLP.py
1
9585
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import sys; import os; sys.path.append("allinpay projects") from creditscore.creditscore import CreditScore import numpy as np import pandas as pd import time from sklearn.model_selection import train_test_split from sklearn.linear_model ...
apache-2.0
surchs/brainbox
visu/base.py
1
8414
__author__ = 'surchs' import sys import numpy as np from matplotlib import gridspec from nilearn import plotting as nlp from matplotlib import pyplot as plt from matplotlib import colors as mpc def add_subplot_axes(ax, rect, axisbg='w'): fig = plt.gcf() box = ax.get_position() width = box.width height...
mit
rhiever/bokeh
sphinx/source/docs/tutorials/exercises/unemployment.py
23
2160
import numpy as np from bokeh.models import HoverTool from bokeh.plotting import ColumnDataSource, figure, output_file, show from bokeh.sampledata.unemployment1948 import data # Read in the data with pandas. Convert the year column to string data['Year'] = [str(x) for x in data['Year']] years = list(data['Year']) mon...
bsd-3-clause
yousrabk/mne-python
mne/viz/tests/test_misc.py
17
4858
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Cathy Nangini <cnangini@gmail.com> # Mainak Jas <mainak@neuro.hut.fi> #...
bsd-3-clause
CVML/scikit-learn
examples/model_selection/plot_underfitting_overfitting.py
230
2649
""" ============================ Underfitting vs. Overfitting ============================ This example demonstrates the problems of underfitting and overfitting and how we can use linear regression with polynomial features to approximate nonlinear functions. The plot shows the function that we want to approximate, wh...
bsd-3-clause
tipsybear/actors-simulation
tests/test_viz.py
1
1179
# test_viz # Vizualization tests # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Sun Dec 06 20:45:32 2015 -0500 # # Copyright (C) 2015 University of Maryland # For license information, see LICENSE.txt # # ID: test_viz.py [] benjamin@bengfort.com $ """ Vizualization tests """ ########################...
mit
ky822/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
DSLituiev/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
8
7473
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
bigdataelephants/scikit-learn
sklearn/datasets/tests/test_lfw.py
50
6849
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by running the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging ...
bsd-3-clause
DESHRAJ/crowdsource-platform
crowdsourcing/models.py
4
22804
from django.contrib.auth.models import User from django.db import models from django.utils import timezone from oauth2client.django_orm import FlowField, CredentialsField from crowdsourcing.utils import get_delimiter import pandas as pd import os class RegistrationModel(models.Model): user = models.OneToOneField(...
mit
elkingtonmcb/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
103
22297
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises...
bsd-3-clause
georgid/sms-tools
lectures/5-Sinusoidal-model/plots-code/sine-analysis-synthesis.py
2
1538
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import sys, os, functools, time from scipy.fftpack import fft, ifft, fftshift sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import ...
agpl-3.0
thaole16/Boids
boids/boids.py
1
4866
""" A refactored implementation of Boids from a deliberately bad implementation of [Boids](http://dl.acm.org/citation.cfm?doid=37401.37406): an exercise for class. """ from matplotlib import pyplot as plt from matplotlib import animation import numpy as np class Boids(object): def __init__(self, ...
mit
Ziqi-Li/bknqgis
pandas/pandas/tests/io/parser/quoting.py
18
5813
# -*- coding: utf-8 -*- """ Tests that quoting specifications are properly handled during parsing for all of the parsers defined in parsers.py """ import csv import pandas.util.testing as tm from pandas import DataFrame from pandas.compat import PY3, StringIO, u class QuotingTests(object): def test_bad_quote_...
gpl-2.0