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
biokit/biokit
biokit/viz/heatmap.py
1
13458
"""Heatmap and dendograms""" import matplotlib import pylab import scipy.cluster.hierarchy as hierarchy import scipy.spatial.distance as distance import numpy as np # get rid of this dependence import easydev import colormap from biokit.viz.linkage import Linkage __all__ = ['Heatmap'] def get_heatmap_df(): """a...
bsd-2-clause
michaelaye/pyciss
pyciss/plotting.py
1
9363
import logging from pathlib import Path import matplotlib.pyplot as plt import numpy as np from astropy import units as u from ipywidgets import fixed, interact from ._utils import which_epi_janus_resonance from .meta import get_all_resonances from .ringcube import RingCube logger = logging.getLogger(__name__) res...
isc
duttashi/Data-Analysis-Visualization
scripts/general/chiSquareTest.py
1
3347
__author__ = 'Ashoo' import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy.stats import warnings sns.set(color_codes=True) # Reading the data where low_memory=False increases the program efficiency data= pd.read_csv("gapminder.csv", low_memory=False) # setting variab...
mit
sgranitz/northwestern
predict420/grex2_Customer_Sales_Analysis.py
2
7041
# Stephan Granitz [ GrEx2 ] # Import libraries import pandas as pd import numpy as np import shelve import sqlite3 # 1 Import each of the csv files you downloaded from the SSCC into a pandas DF # Grab files folder = "C:/Users/sgran/Desktop/GrEx2/" io1 = folder + "seg6770cust.csv" io2 = folder + "seg6770item.csv" io3 ...
mit
mehdidc/scikit-learn
benchmarks/bench_sample_without_replacement.py
397
8008
""" Benchmarks for sampling without replacement of integer. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import operator import matplotlib.pyplot as plt import numpy as np import random from sklearn.externals.six.moves i...
bsd-3-clause
jwlockhart/concept-networks
nlp.py
1
2220
# utility functions for NLP-based similarity metrics # version 1.0 # code modified from: # https://stackoverflow.com/questions/8897593/similarity-between-two-text-documents import nltk import string import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer stemmer = nltk.stem.porter.PorterStem...
gpl-3.0
QuantSoftware/QuantSoftwareToolkit
bin/investors_report.py
5
6911
# # report.py # # Generates a html file containing a report based # off a timeseries of funds from a pickle file. # # Drew Bratcher # from pylab import * import numpy from QSTK.qstkutil import DataAccess as da from QSTK.qstkutil import qsdateutil as du from QSTK.qstkutil import tsutil as tsu from QSTK.q...
bsd-3-clause
nschloe/matplotlib2tikz
test/test_rotated_labels.py
1
3361
# -*- coding: utf-8 -*- # import os import tempfile import pytest from matplotlib import pyplot as plt import matplotlib2tikz def __plot(): fig, ax = plt.subplots() x = [1, 2, 3, 4] y = [1, 4, 9, 6] plt.plot(x, y, "ro") plt.xticks(x, rotation="horizontal") return fig, ax @pytest.mark.pa...
mit
alekz112/statsmodels
statsmodels/iolib/tests/test_summary.py
31
1535
'''examples to check summary, not converted to tests yet ''' from __future__ import print_function if __name__ == '__main__': from statsmodels.regression.tests.test_regression import TestOLS #def mytest(): aregression = TestOLS() TestOLS.setupClass() results = aregression.res1 r_summary = s...
bsd-3-clause
fadawar/election_wordcloud
generate.py
1
2431
#!/usr/bin/env python2 """ Generate wordclouds with specific colors. colors - list of rgb colors file_name - path to file with source text """ from os import path import random import functools from wordcloud import WordCloud import matplotlib.pyplot as plt # Smer # colors = [(195, 27, 51)] # file_name = 'progra...
mit
brodoll/sms-tools
lectures/08-Sound-transformations/plots-code/FFT-filtering.py
21
1723
import math import matplotlib.pyplot as plt import numpy as np import time, os, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF (fs, x) = UF.wavread('../../../sounds/orchestra.wav') N = 2048 start = 1.0*fs ...
agpl-3.0
anurag313/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
frank-tancf/scikit-learn
examples/datasets/plot_random_multilabel_dataset.py
278
3402
""" ============================================== Plot randomly generated multilabel dataset ============================================== This illustrates the `datasets.make_multilabel_classification` dataset generator. Each sample consists of counts of two features (up to 50 in total), which are differently distri...
bsd-3-clause
anne-urai/serialDDM
graphicalModels/examples/classic.py
7
1057
""" The Quintessential PGM ====================== This is a demonstration of a very common structure found in graphical models. It has been rendered using Daft's default settings for all the parameters and it shows off how much beauty is baked in by default. """ from matplotlib import rc rc("font", family="serif", s...
mit
jfitzgerald79/gis-1
sjoin.py
2
4016
import geopandas as gpd from geopandas import tools import numpy as np import pandas as pd import rtree from shapely import prepared r_df = gpd.GeoDataFrame.from_file('/home/akagi/GIS/2014_All_Parcel_Shapefiles/2014_Book400.shp') l_df = gpd.GeoDataFrame.from_file('/home/akagi/GIS/census/cb_2013_04_tract_500k/cb_2013_...
gpl-2.0
perimosocordiae/scipy
scipy/linalg/basic.py
4
67094
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 # and Jake Vanderplas, August 2012 from warnings import warn import numpy as np from numpy import atleast_1d, atleast_2d from .flinalg import get_flinalg_funcs from .lapack import get_lapack_funcs, _compute_lwork from ....
bsd-3-clause
Garrett-R/scikit-learn
sklearn/neighbors/unsupervised.py
16
3198
"""Unsupervised nearest neighbors learner""" from .base import NeighborsBase from .base import KNeighborsMixin from .base import RadiusNeighborsMixin from .base import UnsupervisedMixin class NearestNeighbors(NeighborsBase, KNeighborsMixin, RadiusNeighborsMixin, UnsupervisedMixin): """Unsu...
bsd-3-clause
phase4ground/DVB-receiver
modem/hdl/library/apsk_modulator/test/dut_control_apsk_modulator.py
1
12998
import cocotb from cocotb.clock import Clock from cocotb.triggers import Timer from cocotb.triggers import RisingEdge from cocotb.result import TestFailure from cocotb.drivers.amba import AXI4LiteMaster from cocotb.drivers.amba import AXI4StreamMaster from cocotb.drivers.amba import AXI4StreamSlave import sys, json sy...
gpl-3.0
pyurdme/pyurdme
examples/cylinder_demo/cylinder_demo3D.py
5
3718
#!/usr/bin/env python """ pyURDME model file for the annihilation cylinder 3D example. """ import os import pyurdme import dolfin import mshr import matplotlib.pyplot as plt import numpy # Global Constants MAX_X_DIM = 5.0 MIN_X_DIM = -5.0 TOL = 1e-9 class Edge1(dolfin.SubDomain): def inside(self, x, on_boundar...
gpl-3.0
xwolf12/scikit-learn
examples/svm/plot_custom_kernel.py
171
1546
""" ====================== SVM with custom kernel ====================== Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface and the support vectors. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data...
bsd-3-clause
benfrandsen/mPDFmodules_noDiffpy
fullfitmPDF_rhombo_nyquist_lmfit.py
1
10627
import scipy from scipy import interpolate from scipy.optimize.minpack import curve_fit import numpy as np import matplotlib.pyplot as plt import sys import random from lmfit import Parameters, minimize, fit_report from mcalculator_mod import calculateMPDF from getmPDF import j0calc def cv(x1,y1,x2,y2):...
gpl-3.0
bssrdf/sklearn-theano
examples/plot_mnist_generator.py
9
1493
""" ======================================================= Generative networks for random MNIST digits ======================================================= This demo of an MNIST generator is based on the work of I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, Y.Bengio. *G...
bsd-3-clause
JosmanPS/scikit-learn
examples/cluster/plot_ward_structured_vs_unstructured.py
320
3369
""" =========================================================== Hierarchical clustering: structured vs unstructured ward =========================================================== Example builds a swiss roll dataset and runs hierarchical clustering on their position. For more information, see :ref:`hierarchical_clus...
bsd-3-clause
alvarofierroclavero/scikit-learn
sklearn/covariance/tests/test_robust_covariance.py
213
3359
# 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
OpenDataDayBilbao/teseo2014
data/analyzer.py
2
25355
# -*- coding: utf-8 -*- """ Created on Mon Sep 22 08:55:14 2014 @author: aitor """ import mysql.connector import networkx as nx from networkx.generators.random_graphs import barabasi_albert_graph import json import os.path import numpy as np import pandas as pd from pandas import Series from pandas import DataFrame i...
apache-2.0
nushio3/cmaes
python/cma.py
1
261903
#!/usr/bin/env python2 """Module cma implements the CMA-ES, Covariance Matrix Adaptation Evolution Strategy, a stochastic optimizer for robust non-linear non-convex derivative-free function minimization for Python versions 2.6 and 2.7 (for Python 2.5 class SolutionDict would need to be re-implemented, because it d...
mit
robin-lai/scikit-learn
sklearn/svm/classes.py
126
40114
import warnings import numpy as np from .base import _fit_liblinear, BaseSVC, BaseLibSVM from ..base import BaseEstimator, RegressorMixin from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \ LinearModel from ..feature_selection.from_model import _LearntSelectorMixin from ..utils import check_X...
bsd-3-clause
amolkahat/pandas
pandas/tests/api/test_api.py
2
7464
# -*- coding: utf-8 -*- import sys import pytest import pandas as pd from pandas import api from pandas.util import testing as tm class Base(object): def check(self, namespace, expected, ignored=None): # see which names are in the namespace, minus optional # ignored ones # compare vs the...
bsd-3-clause
Jinkeycode/DeeplearningAI_AndrewNg
Course1 Neural Networks and Deep Learning/Week3 Shallow Neural Networks/planar_utils.py
3
2253
import matplotlib.pyplot as plt import numpy as np import sklearn import sklearn.datasets import sklearn.linear_model def plot_decision_boundary(model, X, y): # Set min and max values and give it some padding x_min, x_max = X[0, :].min() - 1, X[0, :].max() + 1 y_min, y_max = X[1, :].min() - 1, X[1, :].max(...
mit
adammenges/statsmodels
statsmodels/graphics/tukeyplot.py
33
2473
from statsmodels.compat.python import range import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mticker import matplotlib.lines as lines def tukeyplot(results, dim=None, yticklabels=None): npairs = len(results) fig = plt.figure() fsp = fig.add_subplot(111) fsp.axis([-50,50,...
bsd-3-clause
dpshelio/sunpy
examples/map/plot_frameless_image.py
1
1349
""" =============================== Plotting a Map without any Axes =============================== This examples shows you how to plot a Map without any annotations at all, i.e. to save as an image. """ ############################################################################## # Start by importing the necessary m...
bsd-2-clause
jstraub/dpMM
python/evalWikiWordVectors.py
1
8101
# Copyright (c) 2015, Julian Straub <jstraub@csail.mit.edu> # Licensed under the MIT license. See the license file LICENSE. import numpy as np from scipy.linalg import eig, logm import subprocess as subp import matplotlib.pyplot as plt import mayavi.mlab as mlab from matplotlib.patches import Ellipse import ipdb, re...
mit
samuelleblanc/flight_planning_dist
flight_planning/write_utils.py
2
20750
# coding: utf-8 # In[1]: def __init__(): """ Name: write_utils Purpose: Module regrouping codes that are used to write out certain tyes of files. Example: ict See each function within this module Contains the following functions: - write_ict: for writing...
gpl-3.0
Candihub/pixel
apps/data/io/parsers.py
1
7594
import logging import pandas from django.utils.translation import ugettext from hashlib import blake2b from ..models import Entry, Repository logger = logging.getLogger(__name__) class ChrFeatureParser(object): def __init__(self, file_path, database_name, root_url, skip_rows=0): self.file_path = file_...
bsd-3-clause
joernhees/scikit-learn
examples/decomposition/plot_image_denoising.py
70
6249
""" ========================================= Image denoising using dictionary learning ========================================= An example comparing the effect of reconstructing noisy fragments of a raccoon face image using firstly online :ref:`DictionaryLearning` and various transform methods. The dictionary is fi...
bsd-3-clause
mhdella/scikit-learn
sklearn/tree/tests/test_tree.py
57
47417
""" 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
wlamond/scikit-learn
sklearn/cluster/k_means_.py
9
60297
"""K-means clustering""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Thomas Rueckstiess <ruecksti@in.tum.de> # James Bergstra <james.bergstra@umontreal.ca> # Jan Schlueter <scikit-learn@jan-schlueter.de> # Nelle Varoquaux # Peter Prettenhofer <peter.prettenh...
bsd-3-clause
blueskyjunkie/timeTools
timetools/synchronization/compliance/ituTG82611/__init__.py
1
6978
# # Copyright 2017 Russell Smiley # # This file is part of timetools. # # timetools 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 option) any later version. # #...
gpl-3.0
shikhardb/scikit-learn
benchmarks/bench_plot_lasso_path.py
301
4003
"""Benchmarks of Lasso regularization path computation using Lars and CD The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function from collections import defaultdict import gc import sys from time import time import numpy as np from sklearn.linear_model import lars_pat...
bsd-3-clause
flightgong/scikit-learn
sklearn/utils/fixes.py
1
8311
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
bsd-3-clause
liangz0707/scikit-learn
sklearn/cluster/tests/test_spectral.py
262
7954
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/examples/tree/unveil_tree_structure.py
1
4786
""" ========================================= Understanding the decision tree structure ========================================= The decision tree structure can be analysed to gain further insight on the relation between the features and the target to predict. In this example, we show how to retrieve: - the binary t...
mit
cogmission/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/offsetbox.py
69
17728
""" The OffsetBox is a simple container artist. The child artist are meant to be drawn at a relative position to its parent. The [VH]Packer, DrawingArea and TextArea are derived from the OffsetBox. The [VH]Packer automatically adjust the relative postisions of their children, which should be instances of the OffsetBo...
agpl-3.0
fzalkow/scikit-learn
benchmarks/bench_sparsify.py
323
3372
""" Benchmark SGD prediction time with dense/sparse coefficients. Invoke with ----------- $ kernprof.py -l sparsity_benchmark.py $ python -m line_profiler sparsity_benchmark.py.lprof Typical output -------------- input data sparsity: 0.050000 true coef sparsity: 0.000100 test data sparsity: 0.027400 model sparsity:...
bsd-3-clause
prheenan/Research
Perkins/Projects/WetLab/Demos/PCR_Optimizations/2016-7-8-DMSO-trials/main_dmso_opt.py
1
1467
# force floating point division. Can still use integer with // from __future__ import division # This file is used for importing the common utilities classes. import numpy as np import matplotlib.pyplot as plt import sys sys.path.append("../../../../../../../") from GeneralUtil.python import PlotUtilities as pPlotUti...
gpl-3.0
GeographicaGS/daynight2geojson
daynight2geojson/daynight2geojson.py
2
3599
# -*- coding: utf-8 -*- # # Author: Cayetano Benavent, 2015. # https://github.com/GeographicaGS/daynight2geojson # # 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 ...
gpl-2.0
ctwj/crackCaptcha
captcha3.py
1
4777
#!/usr/bin/env python # -*- coding: UTF-8 -*- import random from PIL import Image, ImageDraw, ImageFont, ImageFilter import matplotlib.pyplot as plt import numpy as np default_font = "./font/DejaVuSans.ttf" # 验证码中的字符, 就不用汉字了 number = ['0','1','2','3','4','5','6','7','8','9'] alphabet = ['a','b','c','d','e','f','g',...
apache-2.0
treycausey/scikit-learn
examples/covariance/plot_robust_vs_empirical_covariance.py
8
6264
""" ======================================= Robust vs Empirical covariance estimate ======================================= The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers in the data set. In such a case, it would be better to use a robust estimator of covariance to guara...
bsd-3-clause
RapidApplicationDevelopment/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py
30
4727
# Copyright 2015 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
jayaneetha/crowdsource-platform
fixtures/createJson.py
6
2462
__author__ = 'Megha' # Script to transfer csv containing data about various models to json # Input csv file constituting of the model data # Output json file representing the csv data as json object # Assumes model name to be first line # Field names of the model on the second line # Data seperated by __DELIM__ # Examp...
mit
jpautom/scikit-learn
sklearn/manifold/tests/test_mds.py
324
1862
import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_raises from sklearn.manifold import mds def test_smacof(): # test metric smacof using the data of "Modern Multidimensional Scaling", # Borg & Groenen, p 154 sim = np.array([[0, 5, 3, 4], ...
bsd-3-clause
coin-pan/Toodledo-graphical-activity-tracker
tracker.py
1
12636
#!/usr/bin/python # -*- coding: UTF-8 -*- # # # Toodledo Activity Tracker & Plotter # Copyright (C) 2011 Marc Chauvet (marc DOT chauvet AT gmail DOT com) # # 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 ...
gpl-3.0
theislab/scanpy
scanpy/plotting/_matrixplot.py
1
12979
from typing import Optional, Union, Mapping # Special from typing import Sequence # ABCs from typing import Tuple # Classes import numpy as np import pandas as pd from anndata import AnnData from matplotlib import pyplot as pl from matplotlib import rcParams from matplotlib.colors import Normalize from .. import l...
bsd-3-clause
sbobovyc/JA-BiA-Tools
src/legacy/find_pkle.py
1
4434
""" Created on February 16, 2012 @author: sbobovyc """ """ Copyright (C) 2012 Stanislav Bobovych 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, o...
gpl-3.0
probml/pyprobml
scripts/ising_image_denoise_demo.py
1
2759
# -*- coding: utf-8 -*- """ Author: Ang Ming Liang Based on: https://github.com/probml/pmtk3/blob/master/demos/isingImageDenoiseDemo.m """ import pandas as pd import numpy as np import matplotlib.pyplot as plt #from tqdm.notebook import tqdm from tqdm import tqdm from scipy.stats import norm import pyprobml_utils a...
mit
jlegendary/scikit-learn
sklearn/cross_validation.py
96
58309
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from...
bsd-3-clause
krafczyk/spack
var/spack/repos/builtin/packages/py-elephant/package.py
4
2375
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
ambimanus/appsim
stats.py
1
9689
import sys import os from datetime import timedelta import numpy as np import scenario_factory # http://www.javascripter.net/faq/hextorgb.htm PRIMA = (148/256, 164/256, 182/256) PRIMB = (101/256, 129/256, 164/256) PRIM = ( 31/256, 74/256, 125/256) PRIMC = ( 41/256, 65/256, 94/256) PRIMD = ( 10/256, 42/256, 81...
mit
Zhenxingzhang/kaggle-cdiscount-classification
src/data_preparation/dataset.py
1
8215
import pandas as pd import numpy as np from sklearn import preprocessing from src.common import paths import tensorflow as tf from src.common import consts from os import listdir from os.path import isfile, join from src.vgg_fine_tuning.vgg_preprocessing import _preprocess_for_train, _preprocess_for_val def read_recor...
apache-2.0
swalter2/PersonalizationService
Service/feature.py
1
14598
# -*- coding: utf-8 -*- from sklearn import svm from sklearn.feature_extraction import DictVectorizer from sklearn import cross_validation import numpy as np import pickle import sys #listen nötig für cross-feature-berechnungen RESSORTS = ['Kultur','Bielefeld','Sport Bielefeld','Politik','Sport_Bund'] NORMALIZED_PAGE...
mit
CKPalk/MachineLearning
FinalProject/MachineLearning/KNN/knn.py
1
1351
''' Work of Cameron Palk ''' import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from datetime import datetime def main( argv ): try: training_filename = argv[ 1 ] testing_filename = argv[ 2 ] output_filename = argv[ 3 ] except IndexError: print( "Error, usage: \"python3 {} <t...
mit
yyjiang/scikit-learn
examples/plot_digits_pipe.py
250
1809
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the predictio...
bsd-3-clause
jasonmccampbell/numpy-refactor-sprint
doc/sphinxext/plot_directive.py
12
17831
""" A special directive for generating a matplotlib plot. .. warning:: This is a hacked version of plot_directive.py from Matplotlib. It's very much subject to change! Usage ----- Can be used like this:: .. plot:: examples/example.py .. plot:: import matplotlib.pyplot as plt plt.plot...
bsd-3-clause
ywcui1990/nupic.research
projects/sequence_prediction/continuous_sequence/run_tm_model.py
3
16411
## ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2015, 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 ...
agpl-3.0
oemof/reegis-hp
reegis_hp/waermetool/heat_demand.py
3
4420
# -*- coding: utf-8 -*- """ Created on Wed Mar 23 14:35:28 2016 @author: uwe """ import logging import time import os import pandas as pd import numpy as np from oemof.tools import logger logger.define_logging() start = time.time() sync_path = '/home/uwe/chiba/RLI/data' basic_path = os.path.join(os.path.expanduser...
gpl-3.0
bthirion/scikit-learn
examples/linear_model/plot_ransac.py
103
1797
""" =========================================== 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
josenavas/qiime
scripts/identify_paired_differences.py
15
9191
#!/usr/bin/env python # File created on 19 Jun 2013 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2013, The QIIME project" __credits__ = ["Greg Caporaso", "Jose Carlos Clemente Litran"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = ...
gpl-2.0
AISpace2/AISpace2
aipython/cspSLSPlot.py
1
12720
# cspSLS.py - Stochastic Local Search for Solving CSPs # AIFCA Python3 code Version 0.7.1 Documentation at http://aipython.org # Artificial Intelligence: Foundations of Computational Agents # http://artint.info # Copyright David L Poole and Alan K Mackworth 2017. # This work is licensed under a Creative Commons # Attr...
gpl-3.0
manifoldai/merf
setup.py
1
1024
from setuptools import setup, find_packages def readme(): with open("README.md") as f: return f.read() def read_version(filename='VERSION'): with open(filename, 'r') as f: return f.readline() setup( name="merf", version=read_version(), description="Mixed Effects Random Forest", ...
mit
amsjavan/nazarkav
nazarkav/tests/test_nazarkav.py
1
4116
import os.path as op import numpy as np import pandas as pd import numpy.testing as npt import nazarkav as sb data_path = op.join(sb.__path__[0], 'data') def test_transform_data(): """ Testing the transformation of the data from raw data to functions used for fitting a function. ...
mit
AtsushiSakai/PythonRobotics
ArmNavigation/rrt_star_seven_joint_arm_control/rrt_star_seven_joint_arm_control.py
1
14158
""" RRT* path planner for a seven joint arm Author: Mahyar Abdeetedal (mahyaret) """ import math import os import sys import random import numpy as np from mpl_toolkits import mplot3d import matplotlib.pyplot as plt sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../n_joint_arm_3d/") try:...
mit
andrewnc/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
zorroblue/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
161
1380
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
FowlerLab/Enrich2
enrich2/barcodeid.py
1
5459
import logging from .seqlib import SeqLib from .barcode import BarcodeSeqLib from .barcodemap import BarcodeMap import pandas as pd from .plots import barcodemap_plot from matplotlib.backends.backend_pdf import PdfPages import os.path class BcidSeqLib(BarcodeSeqLib): """ Class for counting data from barcoded ...
bsd-3-clause
samzhang111/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
louispotok/pandas
pandas/io/date_converters.py
11
1901
"""This module is designed for community supported date conversion functions""" from pandas.compat import range, map import numpy as np from pandas._libs.tslibs import parsing def parse_date_time(date_col, time_col): date_col = _maybe_cast(date_col) time_col = _maybe_cast(time_col) return parsing.try_pars...
bsd-3-clause
pompiduskus/scikit-learn
examples/cluster/plot_mean_shift.py
351
1793
""" ============================================= A demo of the mean-shift clustering algorithm ============================================= Reference: Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward feature space analysis". IEEE Transactions on Pattern Analysis and Machine Intelligence. 2002. ...
bsd-3-clause
cauchycui/scikit-learn
sklearn/feature_selection/variance_threshold.py
238
2594
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: 3-clause BSD import numpy as np from ..base import BaseEstimator from .base import SelectorMixin from ..utils import check_array from ..utils.sparsefuncs import mean_variance_axis from ..utils.validation import check_is_fitted class VarianceThreshold(BaseEstim...
bsd-3-clause
nilmtk/nilmtk
docs/source/conf.py
7
12943
# -*- coding: utf-8 -*- # # NILMTK documentation build configuration file, created by # sphinx-quickstart on Thu Jul 10 09:22:49 2014. # # 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. # # Al...
apache-2.0
m3drano/power-simulation
tools/plot_histogram.py
1
3433
#!/usr/bin/env python3 # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
abhitopia/tensorflow
tensorflow/examples/learn/hdf5_classification.py
60
2190
# 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
chenyyx/scikit-learn-doc-zh
examples/en/linear_model/plot_multi_task_lasso_support.py
77
2319
#!/usr/bin/env python """ ============================================= Joint feature selection with multi-task Lasso ============================================= The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected features to be the same across tasks. This example simulates...
gpl-3.0
cBeaird/SemEval_Character-Identification-on-Multiparty-Dialogues
vcu_cmsc_516_semeval4_nn.py
1
9181
#!/usr/bin/env python """ Application start for the SemEval 2018 task 4 application: conference resolution for SemEval 2018 This file is the main starting point for the application. This files allow for the application to be called with a series of input parameters to perform the different functions required by the ap...
mit
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/tests/test_triangulation.py
9
39659
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np import matplotlib.pyplot as plt import matplotlib.tri as mtri from nose.tools import assert_equal, assert_raises from numpy.testing import assert_array_equal, assert_array_almost_...
mit
kirangonella/BuildingMachineLearningSystemsWithPython
ch09/01_fft_based_classifier.py
24
3740
# 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 numpy as np from collections import defaultdict from sklearn.metrics import precision_recall_cu...
mit
Myasuka/scikit-learn
examples/cluster/plot_segmentation_toy.py
258
3336
""" =========================================== Spectral clustering for image segmentation =========================================== In this example, an image with connected circles is generated and spectral clustering is used to separate the circles. In these settings, the :ref:`spectral_clustering` approach solve...
bsd-3-clause
PredictiveScienceLab/pysmc
examples/reaction_kinetics_run_nompi.py
2
1378
""" Solve the reaction kinetics inverse problem. """ import reaction_kinetics_model import sys import os import pymc sys.path.insert(0, os.path.abspath('..')) import pysmc import matplotlib.pyplot as plt import pickle if __name__ == '__main__': model = reaction_kinetics_model.make_model() # Construct the SM...
lgpl-3.0
deot95/Tesis
Proyecto de Grado Ingeniería Electrónica/Workspace/Comparison/Small Linear/plot_vols_and_perf_mpc.py
1
4026
import numpy as np import matplotlib as mpl import matplotlib.pylab as plt import linear_env_small as linear_env from numpy.matlib import repmat state_dim = 5 Hs = 1800 A1 = 0.0020 mu1 = 250 sigma1 = 70 A2 = 0.0048 mu2 = 250 sigma2 = 70 dt = 1 x = np.arange(Hs) d = np.zeros((2,Hs)) d[0,:] = A1*np.exp((-1*(x-mu1)**2)/(...
mit
indranilsinharoy/PyZDDE
Examples/Scripts/couplingEfficiencySingleModeFibers.py
2
4996
#------------------------------------------------------------------------------- # Name: couplingEfficiencySingleModeFibers.py # Purpose: Demonstrate the following function related to POP in Zemax: # zGetPOP(), zSetPOPSettings(), zModifyPOPSettings() # Calculates the fiber coupling efficien...
mit
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/mpl_examples/pylab_examples/fill_between_demo.py
6
2268
#!/usr/bin/env python import matplotlib.mlab as mlab from matplotlib.pyplot import figure, show import numpy as np x = np.arange(0.0, 2, 0.01) y1 = np.sin(2*np.pi*x) y2 = 1.2*np.sin(4*np.pi*x) fig = figure() ax1 = fig.add_subplot(311) ax2 = fig.add_subplot(312, sharex=ax1) ax3 = fig.add_subplot(313, sharex=ax1) ax1....
mit
mne-tools/mne-tools.github.io
0.15/_downloads/plot_epochs_to_data_frame.py
1
8900
""" .. _tut_io_export_pandas: ================================= Export epochs to Pandas DataFrame ================================= In this example the pandas exporter will be used to produce a DataFrame object. After exploring some basic features a split-apply-combine work flow will be conducted to examine the laten...
bsd-3-clause
jesserobertson/pynoddy
pynoddy/experiment/TopologyAnalysis.py
1
84153
# -*- coding: utf-8 -*- """ Created on Wed Jul 15 12:14:08 2015 @author: Sam Thiele """ import os import numpy as np import scipy as sp import math from pynoddy.experiment.MonteCarlo import MonteCarlo from pynoddy.output import NoddyTopology from pynoddy.output import NoddyOutput from pynoddy.history import NoddyHist...
gpl-2.0
gsprint23/sensor_data_preprocessing
src/main.py
1
10003
''' Copyright (C) 2015 Gina L. Sprint Email: Gina Sprint <gsprint@eecs.wsu.edu> This file is part of sensor_data_preprocessing. sensor_data_preprocessing 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, e...
gpl-3.0
dennisobrien/bokeh
sphinx/source/docs/user_guide/examples/extensions_example_latex.py
6
2676
""" The LaTex example was derived from: http://matplotlib.org/users/usetex.html """ import numpy as np from bokeh.models import Label from bokeh.plotting import figure, show JS_CODE = """ import {Label, LabelView} from "models/annotations/label" export class LatexLabelView extends LabelView render: () -> #--...
bsd-3-clause
geodynamics/burnman
examples/example_gibbs_modifiers.py
2
7755
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU # GPL v2 or later. """ example_gibbs_modifiers ---------------- This example script demonstrates the modifications to the gibbs free ...
gpl-2.0
poryfly/scikit-learn
sklearn/tests/test_cross_validation.py
8
42537
"""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.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.test...
bsd-3-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/tseries/tests/test_converter.py
13
5611
from datetime import datetime, time, timedelta, date import sys import os import nose import numpy as np from numpy.testing import assert_almost_equal as np_assert_almost_equal from pandas import Timestamp, Period from pandas.compat import u import pandas.util.testing as tm from pandas.tseries.offsets import Second, ...
gpl-2.0
totalgood/pug-data
pug/data/gmm.py
1
4320
"""Generate synthetic samples from a mixture of gaussians or Gaussian Mixture Model (GMM) Most of this code is derived from Nehalem Labs examples: http://www.nehalemlabs.net/prototype/blog/2014/04/03/quick-introduction-to-gaussian-mixture-models-with-python/ References: https://en.wikipedia.org/wiki/Metropolis%E2...
mit
awni/tensorflow
tensorflow/examples/skflow/iris_val_based_early_stopping.py
2
2221
# Copyright 2015-present The 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 require...
apache-2.0
ShujiaHuang/AsmVar
src/AsmvarVarScore/modul/VariantRecalibrator.py
2
3592
""" =============================================== =============================================== Author: Shujia Huang Date : 2014-05-23 11:21:53 """ import sys import matplotlib.pyplot as plt # My own class import VariantDataManager as vdm import VariantRecalibratorEngine as vre import VariantRecalibratorArgument...
mit