repo_name
stringlengths
7
90
path
stringlengths
5
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
976
581k
license
stringclasses
15 values
mmadsen/sklearn-mmadsen
setup.py
1
4354
#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Command from setuptools.command.develop import develop from setuptools.command.install import install import subprocess import os import re # create a decorator that wraps the normal develop and #...
apache-2.0
nomadcube/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
ClimbsRocks/scikit-learn
examples/applications/face_recognition.py
48
5691
""" =================================================== Faces recognition example using eigenfaces and SVMs =================================================== The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", aka LFW_: http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2...
bsd-3-clause
hugobowne/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
57
4736
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.linear_model.randomized_l1 i...
bsd-3-clause
AIML/scikit-learn
examples/applications/plot_prediction_latency.py
234
11277
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/scipy/signal/fir_filter_design.py
3
41878
# -*- coding: utf-8 -*- """Functions for FIR filter design.""" from __future__ import division, print_function, absolute_import from math import ceil, log import warnings import numpy as np from numpy.fft import irfft, fft, ifft from scipy.special import sinc from scipy.linalg import toeplitz, hankel, pinv from scipy...
gpl-3.0
X-martin/robot_quant
test/factor_method_test.py
1
1270
import db_stocks_test as dbst from datetime import datetime from datetime import timedelta import pandas as pd def base(base_factor_name, stock_list, date, args): time_list = [date] dbst.get_base_factor_val(base_factor_name, time_list, stock_list) def ma(base_factor_name, stock_list, date, args): dt = t...
mit
jmontoyam/mne-python
mne/parallel.py
8
4977
"""Parallel util function """ # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: Simplified BSD from .externals.six import string_types import logging import os from . import get_config from .utils import logger, verbose, warn from .fixes import _get_args if 'MNE_FORCE_SERIAL' in os...
bsd-3-clause
fzalkow/scikit-learn
sklearn/utils/validation.py
67
24013
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp from ..externals i...
bsd-3-clause
redmeros/Lean
Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py
1
8847
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Lice...
apache-2.0
scikit-learn-contrib/categorical-encoding
category_encoders/james_stein.py
1
25065
"""James-Stein""" import numpy as np import pandas as pd import scipy from scipy import optimize from sklearn.base import BaseEstimator from category_encoders.ordinal import OrdinalEncoder import category_encoders.utils as util from sklearn.utils.random import check_random_state __author__ = 'Jan Motl' class JamesSt...
bsd-3-clause
aminert/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
kernc/scikit-learn
sklearn/cluster/tests/test_mean_shift.py
150
3651
""" Testing for mean shift clustering methods """ import numpy as np import warnings from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import asser...
bsd-3-clause
RobertABT/heightmap
build/matplotlib/lib/matplotlib/backends/backend_gdk.py
4
16652
from __future__ import division, print_function import math import os import sys import warnings def fn_name(): return sys._getframe(1).f_code.co_name import gobject import gtk; gdk = gtk.gdk import pango pygtk_version_required = (2,2,0) if gtk.pygtk_version < pygtk_version_required: raise ImportError ("PyGTK %d....
mit
russel1237/scikit-learn
examples/text/document_clustering.py
230
8356
""" ======================================= Clustering text documents using k-means ======================================= This is an example showing how the scikit-learn can be used to cluster documents by topics using a bag-of-words approach. This example uses a scipy.sparse matrix to store the features instead of ...
bsd-3-clause
vermouthmjl/scikit-learn
examples/datasets/plot_random_dataset.py
348
2254
""" ============================================== Plot randomly generated classification dataset ============================================== Plot several randomly generated 2D classification datasets. This example illustrates the :func:`datasets.make_classification` :func:`datasets.make_blobs` and :func:`datasets....
bsd-3-clause
sangwook236/sangwook-library
python/test/signal_processing/fft_util.py
2
2939
#!/usr/bin/env python # REF [site] >> https://docs.scipy.org/doc/scipy/reference/fftpack.html from scipy import fftpack import numpy as np import matplotlib.pyplot as plt import math # REF [site] >> https://kr.mathworks.com/help/matlab/ref/fft.html def generate_toy_signal_1(time, noise=True, DC=True): sig_amp, sig_...
gpl-2.0
ClimbsRocks/scikit-learn
sklearn/linear_model/least_angle.py
15
57254
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ from __future__ import print_function # Author: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux # # License: BSD 3 ...
bsd-3-clause
cellular-nanoscience/pyotic
pyotc/plotting.py
1
8016
# -*- coding: utf-8 -*- # """ # - Author: steve simmert # - E-mail: steve.simmert@uni-tuebingen.de # - Copyright: 2015 # """ import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt col_dict = {'x': 'blue', 'y': 'green', 'z': 'orange', 'psdX': 'blue', 'psd...
apache-2.0
jiangwen84/libmesh
doc/statistics/libmesh_mailinglists.py
1
8892
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np from operator import add # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num, num2date # Number of messages to libmesh-devel and libmesh-users over the life # of the project. I cut and paste...
lgpl-2.1
joernhees/scikit-learn
examples/covariance/plot_outlier_detection.py
36
5023
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates three different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assum...
bsd-3-clause
philrosenfield/padova_tracks
eep/define_eep.py
1
11156
import os from scipy.signal import argrelextrema import matplotlib.pylab as plt import numpy as np from scipy.interpolate import splev, splprep from .critical_point import CriticalPoint, Eep from .. import utils from ..config import * from ..graphics.graphics import annotate_plot, hrd def check_for_monotonic_incr...
mit
openconnectome/ndreg
ndreg-old/ndreg-old.py
1
63081
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import numpy as np import SimpleITK as sitk import os import math import sys import subprocess import tempfile import shutil import requests import matplotlib.pyplot as plt from matplotlib.ticker import ScalarFormatter from itertools im...
apache-2.0
beiko-lab/gengis
bin/Lib/site-packages/matplotlib/backends/qt4_editor/formlayout.py
3
21226
# -*- coding: utf-8 -*- """ formlayout ========== Module creating Qt form dialogs/layouts to edit various type of parameters formlayout License Agreement (MIT License) ------------------------------------------ Copyright (c) 2009 Pierre Raybaut Permission is hereby granted, free of charge, to any person obtaining ...
gpl-3.0
ContinuumIO/xdata-feat
feat/metrics.py
1
2681
import pandas as pd def compute_quotient_metrics(filename, index_col=0, resample_period='1M', shift=0, quotient_metrics=[('Volume', 'max', 'median'), ('Clos...
mit
cligs/pyzeta
scripts/preprocess.py
1
2921
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # file: preprocess.py # author: #cf # version: 0.3.0 """ The "preprocess" module is the first step in the pyzeta pipeline. This module deals with linguistic annotation of the texts. Subsequent modules are: prepare, calculate and visualize. """ # ========================...
gpl-3.0
altairpearl/scikit-learn
examples/exercises/plot_iris_exercise.py
323
1602
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
bsd-3-clause
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/histogram2d/_colorbar.py
1
73359
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class ColorBar(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "histogram2d" _path_str = "histogram2d.colorbar" _valid_props = { "bgcolor", ...
mit
deffi/zofoplot
src/tests/matplotlib_tests.py
1
1291
import os from matplotlib import pyplot as plt print("moo") x1=[2,3,4,5] y1=[4,9,16,25] x2=[2.5, 3.4, 4.3] y2=[9, 11, 11.5] left, width = 0.1, 0.8 rect1 = [left, 0.7, width, 0.2] rect2 = [left, 0.3, width, 0.4] rect3 = [left, 0.1, width, 0.2] fig = plt.figure(facecolor='white') ax1 = fig.add_axes(rect1) ax2 = ...
agpl-3.0
rmst/chi
examples/experimental/dqn_car.py
1
5365
""" """ import chi import tensorflow as tf from chi import experiment, Experiment from chi.rl.async_dqn import DQN from chi.rl.util import print_env, Plotter, draw from chi.rl.wrappers import DiscretizeActions from chi.util import log_top, log_nvidia_smi from matplotlib import pyplot as plt import numpy as np @exper...
mit
zhenv5/scikit-learn
examples/cross_decomposition/plot_compare_cross_decomposition.py
128
4761
""" =================================== Compare cross decomposition methods =================================== Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with multivariate response, a.k.a. PLS2 - PLSRegression, with univariate response, a.k.a. PLS1 - CCA Given 2 multivari...
bsd-3-clause
statwonk/lifetimes
lifetimes/estimation.py
1
14905
from __future__ import print_function from collections import OrderedDict import numpy as np from numpy import log, exp, logaddexp, asarray, any as npany, c_ as vconcat,\ isinf, isnan, ones_like from pandas import DataFrame from scipy import special from scipy import misc from lifetimes.utils impor...
mit
ldirer/scikit-learn
sklearn/neural_network/tests/test_mlp.py
20
22194
""" Testing for Multi-layer Perceptron module (sklearn.neural_network) """ # Author: Issam H. Laradji # License: BSD 3 clause import sys import warnings import numpy as np from numpy.testing import assert_almost_equal, assert_array_equal from sklearn.datasets import load_digits, load_boston, load_iris from sklearn...
bsd-3-clause
hunter-cameron/Bioinformatics
python/checkm_select_bins.py
1
1283
import argparse import pandas parser = argparse.ArgumentParser(description="Subsets a checkm tab-separated outfile to include only entries that have the specified completeness/contamination level") parser.add_argument("-checkm", help="the checkm out file", required=True) parser.add_argument("-completeness", help="com...
mit
abhishekkrthakur/scikit-learn
sklearn/tree/export.py
30
4529
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Licence: BSD 3 ...
bsd-3-clause
chen0510566/MissionPlanner
Lib/site-packages/numpy/lib/recfunctions.py
58
34495
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ import sys import itertools import numpy as np import numpy.ma as ma from numpy import ndarray, recarray from nump...
gpl-3.0
ranjinidas/Axelrod
docs/conf.py
2
8630
# -*- coding: utf-8 -*- # # Axelrod documentation build configuration file, created by # sphinx-quickstart on Sat Mar 7 07:05:57 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
jbogaardt/chainladder-python
chainladder/utils/utility_functions.py
1
13539
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. import pandas as pd import numpy as np from chainladder.utils.cupy import cp from chainladder.utils.sparse import sp fro...
mit
chanceraine/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/pyplot.py
69
77521
import sys import matplotlib from matplotlib import _pylab_helpers, interactive from matplotlib.cbook import dedent, silent_list, is_string_like, is_numlike from matplotlib.figure import Figure, figaspect from matplotlib.backend_bases import FigureCanvasBase from matplotlib.image import imread as _imread from matplotl...
agpl-3.0
yanlend/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
Shathra/EloPredicting
random_forest.py
1
1443
import numpy as np from sklearn.ensemble import RandomForestRegressor validation_path = "validation/features/" features_path = "training/features/" features = [] features.append( "checkmate_move_done") features.append( "is_draw") features.append( "last_scores") features.append( "match_len") features.append( "mean") f...
mit
nhejazi/scikit-learn
sklearn/cluster/dbscan_.py
9
12816
# -*- coding: utf-8 -*- """ DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ # Author: Robert Layton <robertlayton@gmail.com> # Joel Nothman <joel.nothman@gmail.com> # Lars Buitinck # # License: BSD 3 clause import numpy as np from scipy import sparse from ..base import BaseEst...
bsd-3-clause
syagev/kaggle_dsb
luna16/src/candidate_merging.py
1
9496
import csv import glob import os import numpy as np from collections import defaultdict import candidates as ca import image_read_write from pandas import DataFrame as df import pandas as pd import candidates import make_candidatelist_with_unet_candidates as mcwuc import pipeline_candidates as pica import evaluate_cand...
apache-2.0
ishank08/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
86
1234
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
kklmn/xrt
examples/withRaycing/01_SynchrotronSources/U32TaperedScan.py
1
2904
# -*- coding: utf-8 -*- __author__ = "Roman Chernikov" __date__ = "08 Mar 2016" #import pickle import numpy as np #import matplotlib.pyplot as plt import os, sys; sys.path.append(os.path.join('..', '..', '..')) # analysis:ignore import xrt.backends.raycing as raycing import xrt.backends.raycing.sources as rs import ...
mit
richardwolny/sms-tools
software/models_interface/sprModel_function.py
18
3422
# function to call the main analysis/synthesis functions in software/models/sprModel.py import numpy as np import matplotlib.pyplot as plt import os, sys from scipy.signal import get_window sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/')) import utilFunctions as UF import sprMod...
agpl-3.0
zinderud/ysa
sklearn/7irisproblem.py
1
1648
""" Quick Question: If we want to design an algorithm to recognize iris species, what might the data be? Remember: we need a 2D array of size [n_samples x n_features]. What would the n_samples refer to? What might the n_features refer to? Remember that there must be a fixed number of features for each samp...
apache-2.0
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/sklearn/gaussian_process/tests/test_kernels.py
51
12799
"""Testing for kernels for Gaussian processes.""" # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause from sklearn.externals.funcsigs import signature import numpy as np from sklearn.gaussian_process.kernels import _approx_fprime from sklearn.metrics.pairwise \ import PAIRWISE_K...
mit
koverholt/bayes-fire
Example_Cases/Correlation_Fire_Size/Scripts/pymc_heat_flux_5.py
1
1660
#!/usr/bin/env python """ PyMC Radiation Heat Flux Example Series Example 5: PyMC simulation using maximum a posteriori estimate. In this example, we use the point source radiation model along with the maximum a posteriori (MAP) method to start with better initial values. Also, information is calculated for the AIC, ...
bsd-3-clause
thientu/scikit-learn
examples/exercises/plot_cv_diabetes.py
231
2527
""" =============================================== Cross-validation on diabetes Dataset Exercise =============================================== A tutorial exercise which uses cross-validation with linear models. This exercise is used in the :ref:`cv_estimators_tut` part of the :ref:`model_selection_tut` section of ...
bsd-3-clause
kjung/scikit-learn
sklearn/linear_model/tests/test_sgd.py
8
44274
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
NumCosmo/NumCosmo.github.io
examples/example_fit_snia.py
1
2225
#!/usr/bin/python2 try: import gi gi.require_version('NumCosmo', '1.0') gi.require_version('NumCosmoMath', '1.0') except: pass from math import * import matplotlib.pyplot as plt from gi.repository import GObject from gi.repository import NumCosmo as Nc from gi.repository import NumCosmoMath as Ncm # # Initi...
apache-2.0
yongfuyang/vnpy
vn.trader/ctaAlgo/ctaBacktesting.py
1
38363
# encoding: UTF-8 ''' 本文件中包含的是CTA模块的回测引擎,回测引擎的API和CTA引擎一致, 可以使用和实盘相同的代码进行回测。 ''' from __future__ import division from datetime import datetime, timedelta from collections import OrderedDict from itertools import product import multiprocessing import pymongo from ctaBase import * from ctaSetting import * import csv ...
mit
pravsripad/jumeg
jumeg/epocher/jumeg_epocher_plot.py
2
8315
# -*- coding: utf-8 -*- """ Created on 08.06.2018 @author: fboers """ import os,os.path,logging import numpy as np import matplotlib.pyplot as pl from matplotlib.backends.backend_pdf import PdfPages import mne from jumeg.base.jumeg_base import JuMEG_Base_IO logger = logging.getLogger('jumeg') __version__="2019.05...
bsd-3-clause
tspus/python-matchingPursuit
src/dictionary.py
1
9861
#!/usr/bin/env python #-*- coding: utf-8 -*- ''' # This file is part of Matching Pursuit Python program (python-MP). # # python-MP 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 ...
gpl-3.0
gnieboer/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/tensorflow_dataframe_test.py
51
12969
# 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
fspaolo/scikit-learn
examples/decomposition/plot_pca_3d.py
8
2410
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Principal components analysis (PCA) ========================================================= These figures aid in illustrating how a point cloud can be very flat in one direction--which is where PCA comes in to ch...
bsd-3-clause
zitouni/gnuradio-3.6.1
gnuradio-core/src/examples/pfb/synth_filter.py
17
2270
#!/usr/bin/env python # # Copyright 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
nwillemse/nctrader
nctrader/price_handler/yahoo_daily_csv_bar.py
1
4524
import os import pandas as pd from ..price_parser import PriceParser from .base import AbstractBarPriceHandler from ..event import BarEvent class YahooDailyCsvBarPriceHandler(AbstractBarPriceHandler): """ YahooDailyBarPriceHandler is designed to read CSV files of Yahoo Finance daily Open-High-Low-Close-...
mit
PyAbel/PyAbel
doc/transform_methods/comparison/fig_gaussian/gaussian.py
1
2409
import numpy as np import matplotlib.pyplot as plt import abel transforms = [ ("basex", abel.basex.basex_transform), ("direct", abel.direct.direct_transform), ("hansenlaw", abel.hansenlaw.hansenlaw_transform), ("onion_bordas", abel.onion_bordas.onion_bordas_transform), ("onion_peeling", a...
mit
mhoffman/catmap
docs/source/conf.py
6
11807
# -*- coding: utf-8 -*- # # CatMAP documentation build configuration file, created by # sphinx-quickstart on Tue Nov 25 08:51:50 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...
gpl-3.0
joyeshmishra/spark-tk
regression-tests/sparktkregtests/testcases/frames/bin_col_test.py
12
6666
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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
rhyolight/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_mixed.py
70
3776
from matplotlib._image import frombuffer from matplotlib.backends.backend_agg import RendererAgg class MixedModeRenderer(object): """ A helper class to implement a renderer that switches between vector and raster drawing. An example may be a PDF writer, where most things are drawn with PDF vector comm...
agpl-3.0
GuessWhoSamFoo/pandas
pandas/util/_decorators.py
1
12597
from functools import wraps import inspect from textwrap import dedent import warnings from pandas._libs.properties import cache_readonly # noqa from pandas.compat import PY2, callable, signature def deprecate(name, alternative, version, alt_name=None, klass=None, stacklevel=2, msg=None): """Retur...
bsd-3-clause
mne-tools/mne-tools.github.io
0.16/_downloads/plot_mixed_source_space_inverse.py
5
5418
""" ======================================================================= Compute MNE inverse solution on evoked data in a mixed source space ======================================================================= Create a mixed source space and compute MNE inverse solution on evoked dataset. """ # Author: Annalisa ...
bsd-3-clause
andrewnc/scikit-learn
sklearn/cross_decomposition/cca_.py
209
3150
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
alimanfoo/anhima
anhima/util.py
1
12073
# -*- coding: utf-8 -*- """ Miscellaneous utilities. """ from __future__ import division, print_function, absolute_import from anhima.compat import range # third party dependencies import numpy as np import pandas def block_take2d(dataset, row_indices, col_indices=None, block_size=None): """Select rows and o...
mit
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/computation/scope.py
24
9002
"""Module for scope operations """ import sys import struct import inspect import datetime import itertools import pprint import numpy as np import pandas as pd from pandas.compat import DeepChainMap, map, StringIO from pandas.core.base import StringMixin import pandas.computation as compu def _ensure_scope(level,...
gpl-2.0
mpharrigan/mixtape
msmbuilder/hmm/discrete_approx.py
12
6593
"""Discrete approximations to continuous distributions""" # Author: Robert McGibbon <rmcgibbo@gmail.com> # Contributors: # Copyright (c) 2014, Stanford University # All rights reserved. #----------------------------------------------------------------------------- # Imports #-------------------------------------------...
lgpl-2.1
wesley1001/formhub
utils/export_tools.py
4
30828
import os import re import csv import json from openpyxl.workbook import Workbook from openpyxl.shared.date_time import SharedDate from bson import json_util from datetime import datetime from django.conf import settings from pyxform.section import Section, RepeatingSection from pyxform.question import Question from d...
bsd-2-clause
liangz0707/scikit-learn
examples/linear_model/plot_sgd_weighted_samples.py
344
1458
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
bsd-3-clause
bdo311/chirpseq-analysis
runRetroviral.py
1
6613
# runRetroviral.py # 3/27/2016 # Makes histograms and count tables for retroviral data; requires either a # trimmed FASTQ file or a STAR-generated BAM file as input import sys import os import argparse import pandas as pd import numpy as np import collections import csv csv.register_dialect("textdialect", ...
apache-2.0
akrherz/idep
scripts/tillage_timing/dynamic_tillage_mod_rot.py
2
5319
"""Yikes, inspect WB file, do dynamic tillage dates for 2018.""" import sys import datetime import pandas as pd from pandas.io.sql import read_sql from pyiem.util import get_dbconn from pyiem.dep import read_wb from tqdm import tqdm APR15 = pd.Timestamp(year=2018, month=4, day=15) MAY30 = pd.Timestamp(year=2018, mont...
mit
tbenthompson/tectosaur
tectosaur/qd/phase_space_parallel.py
1
1876
import numpy as np import subprocess import os import uuid import cloudpickle import multiprocessing import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler LINE_WIDTH = 0.25 SIAY = 60 * 60 * 24 * 365.25 USE_N_CORES = 30 # Read Ben's data for Cascadia pts, _tris, t, slip_all, state_all = np.lo...
mit
VenkateshBejjenki/Machine_Learning_Specialization
smartcab/visuals.py
17
7709
########################################### # Suppress matplotlib user warnings # Necessary for newer version of matplotlib import warnings warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib") ########################################### # # Display inline matplotlib plots with IPython from I...
gpl-3.0
pompiduskus/scikit-learn
sklearn/manifold/tests/test_spectral_embedding.py
216
8091
from nose.tools import assert_true from nose.tools import assert_equal from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_raises from nose.plugins.skip import SkipTest from sk...
bsd-3-clause
harmslab/pytc-gui
pytc_gui/widgets/plot_box.py
2
2624
__description__ = \ """ Class for generating main plots. """ __author__ = "Hiranmayi Duvvurii" __date__ = "2017-06-01" from PyQt5 import QtWidgets as QW from PyQt5 import QtCore as QC from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure import matplo...
unlicense
hlin117/statsmodels
statsmodels/sandbox/examples/example_gam.py
33
2343
'''original example for checking how far GAM works Note: uncomment plt.show() to display graphs ''' example = 2 # 1,2 or 3 import numpy as np import numpy.random as R import matplotlib.pyplot as plt from statsmodels.sandbox.gam import AdditiveModel from statsmodels.sandbox.gam import Model as GAM #? from statsmode...
bsd-3-clause
bala4901/odoo
addons/resource/faces/timescale.py
170
3902
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
Minhua722/NMF
egs/ar/local/ar_nmf_face_recog.py
1
3323
#!/usr/bin/env python import cv2 import numpy as np import argparse import math import pickle from sklearn.decomposition import PCA from nmf_support import * import sys, os if __name__ == '__main__': #------------------------------------------------------ # Args parser #--------------------------------------...
apache-2.0
blab/stability
augur/src/analyze_validation.py
2
2524
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import cPickle plt.ion() val_data = [] res='12y' grid = [0.1, 0.3, 1.0,3.0, 10.0] for flu in ['H3N2', 'H1N1pdm', 'Vic', 'Yam']: for minaa in [0]: #,1,'epi']: for hi, lam_HI in enumerate(grid): for training in ['measuremen...
agpl-3.0
anderspitman/scikit-bio
skbio/stats/distance/tests/test_permanova.py
8
4865
# ---------------------------------------------------------------------------- # 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
initNirvana/Easyphotos
env/lib/python3.4/site-packages/IPython/extensions/sympyprinting.py
12
5609
""" A print function that pretty prints sympy Basic objects. :moduleauthor: Brian Granger Usage ===== Once the extension is loaded, Sympy Basic objects are automatically pretty-printed. As of SymPy 0.7.2, maintenance of this extension has moved to SymPy under sympy.interactive.ipythonprinting, any modifications to ...
mit
mvdroest/RTLSDR-Scanner
src/file.py
1
20503
# # rtlsdr_scan # # http://eartoearoak.com/software/rtlsdr-scanner # # Copyright 2012 - 2015 Al Brown # # A frequency scanning GUI for the OsmoSDR rtl-sdr library at # http://sdr.osmocom.org/trac/wiki/rtl-sdr # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
JaviMerino/trappy
trappy/plotter/StaticPlot.py
1
9823
# Copyright 2016-2016 ARM Limited # # 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 or agreed to in w...
apache-2.0
wlamond/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
348
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
theislab/scanpy
scanpy/plotting/_preprocessing.py
1
4222
from typing import Optional, Union import numpy as np import pandas as pd from matplotlib import pyplot as pl from matplotlib import rcParams from anndata import AnnData from . import _utils # -------------------------------------------------------------------------------- # Plot result of preprocessing functions # -...
bsd-3-clause
qrqiuren/sms-tools
lectures/03-Fourier-properties/plots-code/anal-synth.py
24
1154
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 from scipy.io.wavfile import read from scipy.fftpack import fft, ifft import math (fs, x) =...
agpl-3.0
gpersistence/tstop
scripts/plots/plot_multi_persistence.py
1
5663
#TSTOP # #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 #(at your option) any later version. # #This program is distributed in the hope that it will be useful, ...
gpl-3.0
JoeJimFlood/RugbyPredictifier
2017SuperRugby/round.py
1
6839
import os os.chdir(os.path.dirname(__file__)) import pandas as pd import matchup import xlsxwriter import xlrd import sys import time import collections import matplotlib.pyplot as plt def rgb2hex(r, g, b): r_hex = hex(r)[-2:].replace('x', '0') g_hex = hex(g)[-2:].replace('x', '0') b_hex = hex(b)[-2:].rep...
mit
mugizico/scikit-learn
sklearn/tests/test_grid_search.py
68
28778
""" Testing for grid search module (sklearn.grid_search) """ from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import sys import numpy as np import scipy.sparse as sp ...
bsd-3-clause
plin1112/pysimm
Examples/10_mof_swelling/prepare_mof.py
3
2742
import requests import re from StringIO import StringIO from pysimm import system, lmps, forcefield try: import pandas as pd except ImportError: pd = None # Check whether the pandas installed or not if not pd: print('The script requires pandas to be installed. Exiting...') exit(1) # Requesting the XY...
mit
alistairlow/tensorflow
tensorflow/examples/get_started/regression/test.py
41
4037
# 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
jwiggins/scikit-image
doc/examples/edges/plot_circular_elliptical_hough_transform.py
6
4826
""" ======================================== Circular and Elliptical Hough Transforms ======================================== The Hough transform in its simplest form is a `method to detect straight lines <http://en.wikipedia.org/wiki/Hough_transform>`__ but it can also be used to detect circles or ellipses. The algo...
bsd-3-clause
probml/pyprobml
scripts/kmeansYeastDemo.py
1
1963
from scipy.io import loadmat from sklearn.cluster import KMeans import matplotlib.pyplot as plt import pyprobml_utils as pml from matplotlib import cm from matplotlib.colors import ListedColormap,LinearSegmentedColormap data = loadmat('/pyprobml/data/yeastData310.mat') # dictionary containing 'X', 'genes', 'times' X ...
mit
AWI-Paleodyn/Python_Helpers
plot_tools/seasonal_amplitude.py
2
7150
import numpy import matplotlib.pyplot import scipy.io.netcdf from . import _find_nearest_idx from mpl_toolkits.basemap import shiftgrid, addcyclic def _decorate_x_axes_for_ymonmean(ax): # Some decoration stuff ax.set_xlabel("Month") ax.set_xlim(-1, 12) ax.xaxis.set_ticks(numpy.arange(12)) ax.xaxis...
gpl-2.0
crichardson17/starburst_atlas
Low_resolution_sims/DustFree_LowRes/Padova_cont/padova_cont_2/UV2.py
33
7365
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
vybstat/scikit-learn
examples/neighbors/plot_digits_kde_sampling.py
251
2022
""" ========================= Kernel Density Estimation ========================= This example shows how kernel density estimation (KDE), a powerful non-parametric density estimation technique, can be used to learn a generative model for a dataset. With this generative model in place, new samples can be drawn. These...
bsd-3-clause
jimsrc/seatos
etc/n_CR/for.paper/src/vmc_lo.py
1
3460
#!/usr/bin/env ipython from pylab import * #from load_data import sh, mc, cr import func_data as fd import share.funcs as ff import matplotlib.patches as patches import matplotlib.transforms as transforms #++++++++++++++++++++++++++++++++++++++++++++++++++++ dir_inp_sh = '../../../../sheaths/ascii/MCflag2/wShiftC...
mit
henridwyer/scikit-learn
sklearn/tree/tree.py
12
34690
""" 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