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
pypyrus/pypyrus
jupyter/config/jupyter_notebook_config.py
1
19505
#--- nbextensions configuration --- from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir import os import sys # nbextensions # #data_dir = jupyter_data_dir() data_dir = os.path.join(os.getcwd(), 'jupyter', 'data') sys.path.append(os.path.join(data_dir, 'extensions')) c = get_config() c.NotebookApp.ser...
gpl-2.0
etsrepo/currentcostgui
currentcostgraphs.py
9
7933
# -*- coding: utf-8 -*- # # CurrentCost GUI # # Copyright (C) 2008 Dale Lane # # 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, or # (...
gpl-3.0
alvations/Sensible-SemEval
xgboost_ensemble.py
2
2022
import pandas as pd import numpy as np from sklearn.cross_validation import train_test_split import xgboost as xgb import operator types = {'m1': np.dtype(float), 'm2': np.dtype(float), 'm3': np.dtype(float), 'm4': np.dtype(float), 'm5': np.dtype(float), 'target': np.dtype(float)} train_valid = pd.read_csv(...
mit
kdmurray91/scikit-bio
skbio/stats/ordination/tests/test_ordination_results.py
1
12214
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
synergetics/nest
examples/nest/plot_tsodyks_depr_fac.py
13
1130
# -*- coding: utf-8 -*- # # plot_tsodyks_depr_fac.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 L...
gpl-2.0
mdboom/astropy-helpers
astropy_helpers/sphinx/conf.py
1
10879
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy shared Sphinx settings. These settings are shared between # astropy itself and affiliated packages. # # Note that not all possible configuration values are present in this file. # # All configuration values have a defau...
bsd-3-clause
effa/flocs
analysis/taskInstance/flow_on_time.py
3
1278
import numpy as np import matplotlib.pyplot as plt import pandas as pd # TODO: Create infrastructure for analysis and desribe it on our wiki. def show_flow_on_time_plot(name, show, store): data = pd.read_csv('data/{name}.csv'.format(name=name)) plot_practice_session(data) if store: plt.savefig('p...
gpl-2.0
Jimmy-Morzaria/scikit-learn
examples/svm/plot_custom_kernel.py
115
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
GuillaumeArruda/INF4705
TP2/Python/Plot/Plot/Plot.py
1
1476
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import functools import csv import scipy.optimize import numpy def main(): fxys = [] xs = [] ys = [] with open('d.csv', newline='') as file: reader = csv.reader(file, delimiter=',') for x, y, fxy in reader: ...
bsd-3-clause
robin-lai/scikit-learn
sklearn/decomposition/__init__.py
147
1421
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from .nmf import NMF, ProjectedGradientNMF from .pca import PCA, RandomizedPCA from .incrementa...
bsd-3-clause
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/dask/dataframe/io/json.py
5
6650
from __future__ import absolute_import import io import pandas as pd from dask.bytes import open_files, read_bytes import dask def to_json(df, url_path, orient='records', lines=None, storage_options=None, compute=True, encoding='utf-8', errors='strict', compression=None, **kwargs): """Wri...
gpl-3.0
kemerelab/NeuroHMM
helpers/hc3.py
1
7529
# hc3.py # helper functions to load data from CRCNS hc-3 repository import os.path import pandas as pd import numpy as np import re from mymap import Map def get_num_electrodes(sessiondir): numelec = 0 files = [f for f in os.listdir(sessiondir) if (os.path.isfile(os.path.join(sessiondir, f)))] for ff in ...
mit
thientu/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
Lawrence-Liu/scikit-learn
examples/neighbors/plot_classification.py
287
1790
""" ================================ Nearest Neighbors Classification ================================ Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColorm...
bsd-3-clause
mattjj/pyhawkes
test/test_sbm_mf.py
2
3644
import copy import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import adjusted_mutual_info_score, adjusted_rand_score from pyhawkes.models import DiscreteTimeNetworkHawkesModelSpikeAndSlab, \ DiscreteTimeNetworkHawkesModelGammaMixture from pyhawkes.plotting.plotting i...
mit
jonathanunderwood/numpy
numpy/fft/fftpack.py
4
45580
""" Discrete Fourier Transforms Routines in this module: fft(a, n=None, axis=-1) ifft(a, n=None, axis=-1) rfft(a, n=None, axis=-1) irfft(a, n=None, axis=-1) hfft(a, n=None, axis=-1) ihfft(a, n=None, axis=-1) fftn(a, s=None, axes=None) ifftn(a, s=None, axes=None) rfftn(a, s=None, axes=None) irfftn(a, s=None, axes=None...
bsd-3-clause
sanjayankur31/nest-simulator
extras/ConnPlotter/tcd_nest.py
20
6959
# -*- coding: utf-8 -*- # # tcd_nest.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
DiamondLightSource/auto_tomo_calibration-experimental
old_code_scripts/Segmentation.py
1
7058
import pylab as pl import numpy as np import matplotlib.pyplot as plt from scipy import ndimage as ndi from scipy.ndimage import measurements from scipy import optimize import EqnLine as line from skimage import io from skimage import measure, color from skimage.morphology import watershed from skimage.feature import ...
apache-2.0
SeldonIO/seldon-server
python/seldon/anomaly/AnomalyDetection.py
2
10901
import numpy as np import pandas as pd import scipy.spatial.distance as ssd from sklearn.utils import check_array import logging from time import time logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.INFO) formatter = logging.Formatter('%(asctime)s - ...
apache-2.0
projectchrono/chrono
src/demos/python/irrlicht/demo_IRR_crank_plot.py
4
5790
#------------------------------------------------------------------------------ # Name: pychrono example # Purpose: # # Author: Alessandro Tasora # # Created: 1/01/2019 # Copyright: (c) ProjectChrono 2019 #------------------------------------------------------------------------------ import pychrono...
bsd-3-clause
costypetrisor/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
gotomypc/scikit-learn
examples/neighbors/plot_species_kde.py
282
4059
""" ================================================ Kernel Density Estimate of Species Distributions ================================================ This shows an example of a neighbors-based query (in particular a kernel density estimate) on geospatial data, using a Ball Tree built upon the Haversine distance metric...
bsd-3-clause
wathen/PhD
MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/GeneralisedEigen/MHDallatonce.py
4
9242
import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc import numpy as np from dolfin import tic, toc import HiptmairSetup import PETScIO as IO import scipy.sparse as sp import matplotlib.pylab as plt import MatrixOperations as MO class BaseMyPC(object): def setup(self, pc): pass ...
mit
MattWellie/PAGE_MPO
tsv_gene_names_grab.py
1
3555
import csv, cPickle import numpy as np import matplotlib.pyplot as plt """ Something quick to get a set of genes from a csv file """ file_in = 'batch_query_no_infertile.tsv' field = 'human_gene_symbol' ddg2p = 'DDG2P.csv' annotations = 'annotations.cPickle' all_output = 'tsv_names_summary_out.txt' gene_set = set() ge...
apache-2.0
asurve/arvind-sysml2
scripts/perftest/python/google_docs/update.py
15
4666
#!/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 ...
apache-2.0
pratapvardhan/pandas
pandas/tests/series/test_constructors.py
2
43384
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytest from datetime import datetime, timedelta from collections import OrderedDict from numpy import nan import numpy as np import numpy.ma as ma import pandas as pd from pandas.api.types import CategoricalDtype from pandas.core.dtypes.common import ( is_...
bsd-3-clause
PatrickChrist/scikit-learn
examples/ensemble/plot_voting_probas.py
316
2824
""" =========================================================== Plot class probabilities calculated by the VotingClassifier =========================================================== Plot the class probabilities of the first sample in a toy dataset predicted by three different classifiers and averaged by the `VotingC...
bsd-3-clause
mattweirick/mattweirick.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
apache/arrow
dev/archery/setup.py
3
1985
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Li...
apache-2.0
ycasg/PyNLO
src/validation/Old and Partial Tests/ppln_generate_stepped_apodized_design.py
2
3351
# -*- coding: utf-8 -*- """ Created on Thu Oct 23 15:54:36 2014 This file is part of pyNLO. pyNLO 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 optio...
gpl-3.0
shangwuhencc/scikit-learn
sklearn/metrics/metrics.py
233
1262
import warnings warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in " "0.18. Please import from sklearn.metrics", DeprecationWarning) from .ranking import auc from .ranking import average_precision_score from .ranking import label_ranking_average_precision_score fro...
bsd-3-clause
stevenbergner/stevenbergner.github.io
Teaching/cmpt767/lab2/code/elevation_grid.py
1
5397
#!/usr/bin/env python3 """ Efficient, local elevation lookup using intermediate tile representation of world-wide SRTM elevation data. Examples: import elevation_grid as eg import numpy as np el = eg.get_elevation(50, -123.1) print("A place near Whistler, BC is {} m above sea level".format(el)) import matplotlib...
mit
olafhauk/mne-python
examples/time_frequency/plot_source_power_spectrum.py
19
1959
""" ====================================================== Compute source power spectral density (PSD) in a label ====================================================== Returns an STC file containing the PSD (in dB) of each of the sources within a label. """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> ...
bsd-3-clause
eickenberg/scikit-learn
sklearn/preprocessing/__init__.py
3
1041
""" The :mod:`sklearn.preprocessing` module includes scaling, centering, normalization, binarization and imputation methods. """ from .data import Binarizer from .data import KernelCenterer from .data import MinMaxScaler from .data import Normalizer from .data import StandardScaler from .data import add_dummy_feature ...
bsd-3-clause
ntung/ramp
gaussian_process_no_normalization_of_inputs.py
1
34661
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause from __future__ import print_function import numpy as np from scipy import linalg, optimize from sklearn.base import BaseEstimator, RegressorMixin from skl...
bsd-3-clause
pastas/pastas
pastas/rfunc.py
1
30984
# coding=utf-8 """This module contains all the response functions available in Pastas. """ import numpy as np from pandas import DataFrame from scipy.integrate import quad from scipy.special import (gammainc, gammaincinv, k0, k1, exp1, erfc, lambertw, erfcinv) __all__ = ["Gamma", "Exponent...
mit
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/pandas/core/indexes/category.py
4
24566
import numpy as np from pandas._libs import index as libindex from pandas import compat from pandas.compat.numpy import function as nv from pandas.core.dtypes.generic import ABCCategorical, ABCSeries from pandas.core.dtypes.common import ( is_categorical_dtype, _ensure_platform_int, is_list_like, is_in...
mit
Jokiva/Computational-Physics
lecture 9/Problem 1.py
1
1279
from fitting import * import numpy as np import matplotlib.pyplot as plt # linear function def f(x, coeffs): if len(coeffs) != 2: raise ValueError('the length of coefficient array should be two') return coeffs[0] + coeffs[1] * x # data 1 x_1 = np.array([10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5]) y_1 = n...
gpl-3.0
mmottahedi/neuralnilm_prototype
scripts/e430.py
2
7309
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
murali-munna/scikit-learn
sklearn/neighbors/base.py
115
29783
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
bsd-3-clause
KT12/hands_on_machine_learning
time_series_rnn_without_wrapper.py
1
3226
# Predict time series w/o using OutputProjectWrapper import tensorflow as tf import numpy as np import matplotlib.pyplot as plt # Create time series t_min, t_max = 0, 30 resolution = 0.1 def time_series(t): return t * np.sin(t) / 3 + 2 * np.sin(t * 5) def next_batch(batch_size, n_steps): t0 = np.random.rand...
mit
MartinSavc/scikit-learn
benchmarks/bench_sgd_regression.py
283
5569
""" Benchmark for SGD regression Compares SGD regression against coordinate descent and Ridge on synthetic data. """ print(__doc__) # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD 3 clause import numpy as np import pylab as pl import gc from time import time from sklearn.linear_model i...
bsd-3-clause
chetan51/nupic
examples/opf/clients/cpu/cpu.py
17
3151
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
matthiasplappert/motion_classification
src/evaluate_features.py
1
7928
# coding=utf8 from collections import namedtuple from argparse import ArgumentParser import timeit import os import logging from itertools import chain, combinations import csv import numpy as np from sklearn.cross_validation import ShuffleSplit from sklearn.preprocessing import MinMaxScaler from toolkit.hmm.impl_hmm...
mit
oduwa/Wheat-Count
PicNumero/build_classifier.py
2
8319
import Display import Helper from skimage.color import rgb2gray import numpy as np from scipy import misc from sklearn import svm, grid_search, metrics from sklearn.neural_network import MLPClassifier from skimage.feature import greycomatrix, greycoprops from skimage import img_as_ubyte, io from sklearn import decompos...
mit
eickenberg/scikit-learn
benchmarks/bench_glm.py
297
1493
""" A comparison of different methods in GLM Data comes from a random square matrix. """ from datetime import datetime import numpy as np from sklearn import linear_model from sklearn.utils.bench import total_seconds if __name__ == '__main__': import pylab as pl n_iter = 40 time_ridge = np.empty(n_it...
bsd-3-clause
MJuddBooth/pandas
pandas/core/groupby/ops.py
1
29237
""" Provide classes to perform the groupby aggregate operations. These are not exposed to the user and provide implementations of the grouping operations, primarily in cython. These classes (BaseGrouper and BinGrouper) are contained *in* the SeriesGroupBy and DataFrameGroupBy objects. """ import collections import n...
bsd-3-clause
dsquareindia/scikit-learn
examples/ensemble/plot_random_forest_regression_multioutput.py
46
2640
""" ============================================================ Comparing random forests and the multi-output meta estimator ============================================================ An example to compare multi-output regression with random forest and the :ref:`multioutput.MultiOutputRegressor <multiclass>` meta-e...
bsd-3-clause
wangyum/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/dataframe_test.py
62
3753
# 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
luckyharryji/smoking-modeling
smoking/map/test_map.py
1
1030
from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np import json class Map(object): def __init__(self): self.m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c') self.min_marker_size = ...
mit
aymen82/kaggler-competitions-scripts
dev/rossman/rossmann.py
1
11046
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> %matplotlib inline import pandas as pd import argparse import os import matplotlib.pyplot as plt import numpy as np # <codecell> def rmspe(tru, pred): if tru==0.0 or isinstance(tru, str) or np.isnan(tru) or np.isnan(pred): return 0.0 re...
bsd-3-clause
AIML/scikit-learn
examples/linear_model/plot_logistic_path.py
349
1195
#!/usr/bin/env python """ ================================= Path with L1- Logistic Regression ================================= Computes path on IRIS dataset. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from datetime import datetime import numpy as np import...
bsd-3-clause
nmayorov/scikit-learn
examples/cluster/plot_digits_linkage.py
369
2959
""" ============================================================================= Various Agglomerative Clustering on a 2D embedding of digits ============================================================================= An illustration of various linkage option for agglomerative clustering on a 2D embedding of the di...
bsd-3-clause
alephu5/Soundbyte
environment/lib/python3.3/site-packages/pandas/tools/tests/test_tile.py
1
7578
import os import nose import numpy as np from pandas.compat import zip from pandas import DataFrame, Series, unique import pandas.util.testing as tm from pandas.util.testing import assertRaisesRegexp import pandas.core.common as com from pandas.core.algorithms import quantile from pandas.tools.tile import cut, qcut ...
gpl-3.0
Dhivyap/ansible
hacking/aws_config/build_iam_policy_framework.py
25
11861
# Requires pandas, bs4, html5lib, and lxml # # Call script with the output from aws_resource_actions callback, e.g. # python build_iam_policy_framework.py ['ec2:AuthorizeSecurityGroupEgress', 'ec2:AuthorizeSecurityGroupIngress', 'sts:GetCallerIdentity'] # # The sample output: # { # "Version": "2012-10-17", # "S...
gpl-3.0
arahuja/scikit-learn
sklearn/neighbors/tests/test_dist_metrics.py
3
5300
import itertools import pickle import numpy as np from numpy.testing import assert_array_almost_equal import scipy from scipy.spatial.distance import cdist from sklearn.neighbors.dist_metrics import DistanceMetric from nose import SkipTest def dist_func(x1, x2, p): return np.sum((x1 - x2) ** p) ** (1. / p) de...
bsd-3-clause
Tong-Chen/scikit-learn
sklearn/tree/tree.py
1
29287
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
Adai0808/scikit-learn
examples/classification/plot_classification_probability.py
242
2624
""" =============================== Plot classification probability =============================== Plot the classification probability for different classifiers. We use a 3 class dataset, and we classify it with a Support Vector classifier, L1 and L2 penalized logistic regression with either a One-Vs-Rest or multinom...
bsd-3-clause
wcalvert/LPC11U_LPC13U_CodeBase
src/drivers/filters/iir/python/iir_f_noisysine_test.py
2
2628
#------------------------------------------------------------------------------- # Name: iir_f_tester # # Purpose: Displays IIR output of a sine wave with optional random noise # # Author: K. Townsend (microBuilder.eu) # # Created: 05/05/2013 # Copyright: (c) K. Townsend 2013 # Licence: BSD # ...
bsd-3-clause
jjx02230808/project0223
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/ipykernel/pylab/config.py
10
4485
"""Configurable for configuring the IPython inline backend This module does not import anything from matplotlib. """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full lice...
gpl-3.0
binhqnguyen/ln
src/flow-monitor/examples/wifi-olsr-flowmon.py
108
7439
# -*- Mode: Python; -*- # Copyright (c) 2009 INESC Porto # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, #...
gpl-2.0
graphistry/pygraphistry
docs/source/conf.py
1
7678
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
bsd-3-clause
VikParuchuri/simpsons-scripts
tasks/train.py
1
16847
from __future__ import division from itertools import chain from sklearn.feature_extraction.text import CountVectorizer import numpy as np import pandas as pd from fisher import pvalue import re import collections from nltk.stem.porter import PorterStemmer import math from percept.tasks.base import Task from percept.fi...
apache-2.0
nrhine1/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
m4734/mysql_pio
boost_1_59_0/libs/numeric/odeint/performance/plot_result.py
43
2225
""" Copyright 2011-2014 Mario Mulansky Copyright 2011-2014 Karsten Ahnert Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) """ import numpy as np from matplotlib import pyplot as plt plt.rc("font", size=16) def g...
gpl-2.0
hadim/spindle_tracker
spindle_tracker/tracking/begin_mitosis_tracker.py
1
7324
import gc import logging import numpy as np import pandas as pd import scipy from skimage import measure from ..trajectories import Trajectories from ..tracker.solver import ByFrameSolver from ..io import TiffFile from ..tracking import Tracker log = logging.getLogger(__name__) class BeginMitosisTracker(Tracker):...
bsd-3-clause
datapythonista/pandas
pandas/tests/indexes/timedeltas/test_searchsorted.py
4
1040
import numpy as np import pytest from pandas import ( Series, TimedeltaIndex, Timestamp, array, ) import pandas._testing as tm class TestSearchSorted: @pytest.mark.parametrize("klass", [list, np.array, array, Series]) def test_searchsorted_different_argument_classes(self, klass): idx ...
bsd-3-clause
binghongcha08/pyQMD
GWP/2D/1.0.2/plt.py
14
1041
##!/usr/bin/python import numpy as np import pylab as plt import seaborn as sns sns.set_context('poster') #with open("traj.dat") as f: # data = f.read() # # data = data.split('\n') # # x = [row.split(' ')[0] for row in data] # y = [row.split(' ')[1] for row in data] # # fig = plt.figure() # # ax1 ...
gpl-3.0
MikeDMorgan/gwas_pipeline
scripts/snpPriority.py
1
11661
''' snpPriority.py - score SNPs based on their LD score and SE weighted effect sizes =============================================================================== :Author: Mike Morgan :Release: $Id$ :Date: |today| :Tags: Python Purpose ------- .. Score SNPs based on their LD score and SE weighted effect sizes from...
mit
stefanodoni/mtperf
main.py
2
18296
#!/usr/bin/python3 import os import argparse import csv import sqlite3 import sqlalchemy as sqlal import pandas as pd import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from database import DBConstants from datasets.BenchmarkDataset import BenchmarkDataset from graph_plotters.HTM...
gpl-2.0
Delphine-L/tools-iuc
tools/repmatch_gff3/repmatch_gff3_util.py
22
17958
import bisect import csv import os import shutil import sys import tempfile import matplotlib matplotlib.use('Agg') from matplotlib import pyplot # noqa: I202,E402 # Graph settings Y_LABEL = 'Counts' X_LABEL = 'Number of matched replicates' TICK_WIDTH = 3 # Amount to shift the graph to make labels fit, [left, right,...
mit
cloud-fan/spark
python/pyspark/pandas/tests/test_numpy_compat.py
15
8672
# # 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
phdowling/scikit-learn
sklearn/tests/test_multiclass.py
136
23649
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
btabibian/scikit-learn
sklearn/tests/test_base.py
15
14534
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp import sklearn from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.uti...
bsd-3-clause
microsoft/Azure-Kinect-Sensor-SDK
src/python/k4a/examples/image_transformations.py
1
4449
''' image_transformations.py A simple program that transforms images from one camera coordinate to another. Requirements: Users should install the following python packages before using this module: matplotlib Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. Kinect For Azu...
mit
k2kobayashi/sprocket
sprocket/model/tests/test_ms.py
1
1786
import unittest import numpy as np from sprocket.model import MS from sprocket.util import low_pass_filter import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt saveflag = True dim = 4 class MSTest(unittest.TestCase): def test_MSstatistics(self): ms = MS() datalist = [] ...
mit
Djabbz/scikit-learn
examples/gaussian_process/plot_gpr_co2.py
9
5718
""" ======================================================== Gaussian process regression (GPR) on Mauna Loa CO2 data. ======================================================== This example is based on Section 5.4.3 of "Gaussian Processes for Machine Learning" [RW2006]. It illustrates an example of complex kernel engine...
bsd-3-clause
CGATOxford/CGATPipelines
CGATPipelines/pipeline_rnaseqqc.py
1
57789
""" ==================== RNASeqQC pipeline ==================== Overview ======== This pipeline should be run as the first step in your RNA seq analysis work flow. It will help detect error and biases within your raw data. The output of the pipeline can be used to filter out problematic cells in a standard RNA seq...
mit
kevin-intel/scikit-learn
sklearn/model_selection/tests/test_successive_halving.py
3
24213
from math import ceil import pytest from scipy.stats import norm, randint import numpy as np from sklearn.datasets import make_classification from sklearn.dummy import DummyClassifier from sklearn.experimental import enable_halving_search_cv # noqa from sklearn.model_selection import StratifiedKFold from sklearn.mod...
bsd-3-clause
steinnymir/RegAscope2017
test_scripts/GUI_test/qt_mpl_dataplot.py
1
8289
""" Series of data are loaded from a .csv file, and their names are displayed in a checkable list view. The user can select the series it wants from the list and plot them on a matplotlib canvas. Use the sample .csv file that comes with the script for an example of data series. Eli Bendersky (eliben@gmail.com) L...
mit
Bismarrck/tensorflow
tensorflow/contrib/losses/python/metric_learning/metric_loss_ops_test.py
24
20551
# 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 applica...
apache-2.0
bitemyapp/ggplot
ggplot/geoms/geom_boxplot.py
12
1218
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.cbook as cbook from .geom import geom from ggplot.utils import is_string from ggplot.utils import is_categorical class g...
bsd-2-clause
QJonny/CyNest
extras/ConnPlotter/ConnPlotter.py
4
80722
# ConnPlotter --- A Tool to Generate Connectivity Pattern Matrices # # This file is part of ConnPlotter. # # Copyright (C) 2009 Hans Ekkehard Plesser/UMB # # ConnPlotter 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 Fou...
gpl-2.0
sandiegodata/age-friendly-communities
users/david/RCFE_Capacity.py
1
2036
""" @author: David Albrecht anaconda 4.2.13 python 3.5.2 pandas 0.19.1 Dataset Name: CDSS RCFE List - https://secure.dss.ca.gov/CareFacilitySearch/Home/DownloadData Purpose: Answer the first two bullet points within the first question block, "RCFE Capacity": 1) What is the number of RCFEs in a given c...
mit
IndraVikas/scikit-learn
sklearn/utils/fixes.py
133
12882
"""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
davidam/python-examples
scikit/plot_voting_regressor.py
6
1745
""" ================================================= Plot individual and voting regression predictions ================================================= .. currentmodule:: sklearn Plot individual and averaged regression predictions for Boston dataset. First, three exemplary regressors are initialized (:class:`~ense...
gpl-3.0
Windy-Ground/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
bptripp/grasp-convnet
py/perspective.py
1
30382
__author__ = 'bptripp' from os import listdir from os.path import isfile, join import time import numpy as np import matplotlib.pyplot as plt import cPickle from PIL import Image from scipy.optimize import bisect from quaternion import angle_between_quaterions, to_quaternion def get_random_points(n, radius, surface=...
mit
rosspalmer/DataTools
depr/0.2.5/dtools/holder.py
1
2726
from .formatting import format from .source import data_source import pandas as pd class data_holder(object): def __init__(self): self.ds = {} self.x = None self.y = None self.current_ds = None self.current_index = [] self.remain_index = [] self.subs = {}...
mit
rbalda/neural_ocr
env/lib/python2.7/site-packages/scipy/stats/_discrete_distns.py
6
21463
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from __future__ import division, print_function, absolute_import from scipy import special from scipy.special import entr, gammaln as gamln from scipy.misc import logsumexp from numpy import floor, ceil, log, exp, ...
mit
saiphcita/crowdsource-platform
fixtures/createJson.py
16
2463
__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
xuewei4d/scikit-learn
sklearn/linear_model/tests/test_sag.py
8
32096
# Authors: Danny Sullivan <dbsullivan23@gmail.com> # Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # License: BSD 3 clause import math import pytest import numpy as np import scipy.sparse as sp from scipy.special import logsumexp from sklearn.linear_model._sag import get_auto_step_size from sklearn.linear_...
bsd-3-clause
HarryRybacki/SensorDataResearchReproduction
workbook.py
1
3412
import matplotlib.pyplot as pyplot import helpers """ Begin phase one - Read Input Note: This phase will need slight tweaking for each data source as they do not follow a truly standard data format. As a result, interfaces will likely need to be written for each source akin to read_ibrl_data() Note: While I had or...
apache-2.0
rseubert/scikit-learn
examples/linear_model/plot_lasso_coordinate_descent_path.py
254
2639
""" ===================== Lasso and Elastic Net ===================== Lasso and elastic net (L1 and L2 penalisation) implemented using a coordinate descent. The coefficients can be forced to be positive. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import num...
bsd-3-clause
logston/plottags
setup.py
1
1160
from setuptools import setup import plottags with open("LICENSE") as fd: LICENSE = fd.read() with open("README.rst") as fd: README = fd.read() setup( name='plottags', version=plottags.__version__, description='A package for plotting the tag history of repositories', license=LICENSE, lon...
bsd-3-clause
monkeybutter/AeroMetTree
datasets/dataset_generator.py
1
2702
import numpy as np import pandas as pd from random import random, randint from datetime import datetime def randomizer(i0, i1, prob): if random() < prob and i0 < i1-1: new_i0 = randint(i0, i1-1) new_i1 = randint(new_i0+1, i1) return (new_i0, new_i1) else: return None def splitt...
mit
MLWave/kepler-mapper
setup.py
1
2366
#!/usr/bin/env python from setuptools import setup import re VERSIONFILE="kmapper/_version.py" verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: verstr = mo.group(1) else: raise RuntimeError("Unable to find version string in ...
mit
masasin/spirit
src/analysis/ttest_analysis.py
1
2526
from collections import namedtuple from pathlib import Path import numpy as np import pandas as pd from scipy import stats from .csv_analysis import analyze_data, load_surveys from ..data.survey_utils import ExperimentType TTEST_DIR = Path(__file__).parent.joinpath("../../models") ColResult = namedtuple("ColResult...
mit
dp7-PU/QCLAS_public
src/qclasGUI.py
1
30542
""" Make a GUI for qclas. This program uses HAPI to generate absorption profiles. The program comes in without HITRAN data files. User can use the program to download lines they need. GUI of the program is based on PyQt4. Da Pan, v-alpha, started on 02/13/2016 """ import hapi import numpy as np from Py...
mit