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
cdiazbas/LMpyMilne
milne.py
1
6532
# Author: cdiazbas@iac.es # Code: Zeeman pattern # ADDED: velocidad LOS # ADDED: signo a eta_blue y eta_red # ADDED: normalization factor in p,b,r eta + rho profiles from math import pi, sin, cos from numpy import sqrt, arange # from zeeman import * # from fvoigt import fvoigt from copy import deepcopy from mutils2 i...
mit
zeromon77/EMtools
convert_tot_V01.py
1
4418
#!/usr/bin/env python3 ## This script convert 'dm3' image files from Gatan and 'ser' image files from FEI ## Prerequsits: hyperspy, numpy, matplotlib # Script information for the file. __author__ = "Daesung Park" __email__ = "zeromon.park@gmail.com" __version__ = "0.1" __copyright__ = "Copyright (c) 2017 Daesung Par...
gpl-2.0
victorbergelin/scikit-learn
sklearn/tests/test_learning_curve.py
225
10791
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.learning_curve import learning_curve, validation_curve from sklearn.u...
bsd-3-clause
andyfaff/scipy
scipy/signal/wavelets.py
16
14046
import numpy as np from scipy.linalg import eig from scipy.special import comb from scipy.signal import convolve __all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'morlet2', 'cwt'] def daub(p): """ The coefficients for the FIR low-pass filter producing Daubechies wavelets. p>=1 gives the order of...
bsd-3-clause
zorojean/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
348
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
mendes-jose/xde-sim
src/aiv/scripts/table2chart.py
1
21339
import numpy as np import numpy.linalg as LA import matplotlib as mpl import matplotlib.pyplot as plt import os import csv import xml.etree.ElementTree as ET from optparse import OptionParser #C:\Users\JM246044\workspace\dev\xde\xde\xde\xde\build\out\Release\bin\..\..\..\..\src\aiv\ def wrapTo2Pi(angle): """ Map a...
gpl-3.0
ejhumphrey/icml16-dml
dml/driver.py
1
3025
"""Primary training driver for the NLSE models. Example ------- $ python dml/driver.py \ data/nlse_config.yaml \ --output_file training_config.yaml """ from __future__ import print_function import argparse import copy import optimus import os import pandas as pd import yaml import dml.data as D import dml.m...
mit
wpreimes/gldas
docs/conf.py
1
9151
# -*- coding: utf-8 -*- # # 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. # # All configuration values have a default; values that are commented out # serve to show the default. import os impo...
bsd-3-clause
tomsilver/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backend_bases.py
69
69740
""" Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a matplotlib backend :class:`RendererBase` An abstract base class to handle drawing/rendering operations. :class:`FigureCanvasBase` The abstraction layer that separates the :class:`matplotlib.fi...
gpl-3.0
chenyyx/scikit-learn-doc-zh
examples/en/gaussian_process/plot_gpc_iris.py
100
2269
""" ===================================================== Gaussian process classification (GPC) on iris dataset ===================================================== This example illustrates the predicted probability of GPC for an isotropic and anisotropic RBF kernel on a two-dimensional version for the iris-dataset. ...
gpl-3.0
elkingtonmcb/cloudbiolinux
installed_files/ipython_config.py
15
14156
# Configuration file for ipython. c = get_config() c.InteractiveShell.autoindent = True c.InteractiveShell.colors = 'Linux' c.InteractiveShell.confirm_exit = False c.AliasManager.user_aliases = [ ('ll', 'ls -l'), ('lt', 'ls -ltr'), ] #------------------------------------------------------------------------------ #...
mit
canard0328/malss
malss/app/learning_curve_base.py
1
2255
# coding: utf-8 from PyQt5.QtWidgets import QSizePolicy from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from .content import Content class LearningCurveBase(Content): def __init__(self, parent=None, title='', params=None): su...
mit
panda0881/pycharmtesting
testing2.py
1
6320
import datetime import numpy as np import matplotlib.colors as colors import matplotlib.finance as finance import matplotlib.dates as mdates import matplotlib.ticker as mticker import matplotlib.mlab as mlab import matplotlib.pyplot as plt import matplotlib.font_manager as font_manager startdate = datetime.date(2015, ...
apache-2.0
GuessWhoSamFoo/pandas
pandas/core/indexes/range.py
2
24595
from datetime import timedelta import operator from sys import getsizeof import warnings import numpy as np from pandas._libs import index as libindex, lib import pandas.compat as compat from pandas.compat import get_range_parameters, lrange, range from pandas.compat.numpy import function as nv from pandas.util._deco...
bsd-3-clause
BigTone2009/sms-tools
software/transformations_interface/sineTransformations_function.py
25
5018
# function call to the transformation functions of relevance for the sineModel import numpy as np import matplotlib.pyplot as plt from scipy.signal import get_window import sys, os sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/')) sys.path.append(os.path.join(os.path.dirname(os.p...
agpl-3.0
trustedanalytics/spark-tk
regression-tests/sparktkregtests/testcases/frames/frame_group_by_test.py
13
10492
# 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
jdgwartney/boundary-api-cli
boundary/measurement_plot.py
4
4824
# # Copyright 2015 BMC Software, 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 or agreed to in ...
apache-2.0
rosswhitfield/mantid
scripts/HFIR_4Circle_Reduction/mpl2dgraphicsview.py
3
12888
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + #pyl...
gpl-3.0
ARudiuk/mne-python
examples/realtime/plot_compute_rt_decoder.py
4
3602
""" ======================= Decoding real-time data ======================= Supervised machine learning applied to MEG data in sensor space. Here the classifier is updated every 5 trials and the decoding accuracy is plotted """ # Authors: Mainak Jas <mainak@neuro.hut.fi> # # License: BSD (3-clause) import numpy as np...
bsd-3-clause
nvoron23/scikit-learn
sklearn/covariance/robust_covariance.py
198
29735
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
bsd-3-clause
sarahgrogan/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
127
7477
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
heplesser/nest-simulator
pynest/examples/sinusoidal_gamma_generator.py
8
11885
# -*- coding: utf-8 -*- # # sinusoidal_gamma_generator.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 ...
gpl-2.0
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/sklearn/utils/tests/test_utils.py
27
9605
from itertools import chain, product import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import pinv2 from scipy.sparse.csgraph import laplacian from sklearn.utils.testing import (assert_equal, assert_raises, assert_true, assert_almost_equal, assert_array_...
mit
tmadl/semisup-learn
examples/plotutils.py
1
1768
import matplotlib.pyplot as plt import numpy as np cols = [np.array([1,0,0]),np.array([0,1,0])] # colors def evaluate_and_plot(model, Xs, ys, ytrue, lbl, subplot = None, block=False): if subplot != None: plt.subplot(2,2,subplot) # predict, and evaluate pred = model.predict(Xs) acc = ...
mit
JosmanPS/scikit-learn
examples/linear_model/plot_ridge_path.py
254
1655
""" =========================================================== Plot Ridge coefficients as a function of the regularization =========================================================== Shows the effect of collinearity in the coefficients of an estimator. .. currentmodule:: sklearn.linear_model :class:`Ridge` Regressi...
bsd-3-clause
mikeengland/fireant
fireant/queries/builder/dimension_latest_query_builder.py
1
2059
import pandas as pd from fireant.dataset.fields import Field from fireant.utils import ( alias_for_alias_selector, immutable, ) from .query_builder import QueryBuilder, QueryException, add_hints from ..execution import fetch_data from ..sql_transformer import make_latest_query class DimensionLatestQueryBuild...
apache-2.0
gef756/statsmodels
statsmodels/datasets/statecrime/data.py
3
3141
#! /usr/bin/env python """Statewide Crime Data""" __docformat__ = 'restructuredtext' COPYRIGHT = """Public domain.""" TITLE = """Statewide Crime Data 2009""" SOURCE = """ All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below. """ DESCRSHORT = """State ...
bsd-3-clause
xwolf12/scikit-learn
examples/cluster/plot_lena_compress.py
271
2229
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Vector Quantization Example ========================================================= The classic image processing example, Lena, an 8-bit grayscale bit-depth, 512 x 512 sized image, is used here to illustrate how ...
bsd-3-clause
flash-center/PROBLEM
examples/donut/plot_images.py
1
1378
import numpy as np import matplotlib.pyplot as plt import problem.deflect # Load the plasma coordinates. X = np.loadtxt('x.dat', delimiter=',') Y = np.loadtxt('y.dat', delimiter=',') # Checkpoint interval. interval = 1000 # Plasma parameters. ri = 1.3 # Distance from proton source to plasma. li = 0.2 # Distance acro...
mit
aewhatley/scikit-learn
examples/decomposition/plot_sparse_coding.py
247
3846
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
iohannez/gnuradio
gr-filter/examples/fir_filter_ccc.py
7
4023
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
hydroffice/hyo_soundspeed
hyo2/soundspeed/profile/ray_tracing/tracedprofile.py
1
8365
import numpy as np import math import logging from scipy.interpolate import interp1d logger = logging.getLogger(__name__) class TracedProfile: def __init__(self, ssp, half_swath=65, avg_depth=10000, tss_depth=None, tss_value=None): # PyDateTime_IMPORT self.avg_depth = avg_depth self.half...
lgpl-2.1
openfisca/reformator
openfisca_reformator/econometrics.py
1
1376
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt def get_cumulative(revs): revs = sorted(revs) cum_revs = [] current = 0 for rev in revs: current = current + rev cum_revs.append(current) return cum_revs def draw_ginis(old_revenus, new_revenus): fig = plt.figure() ax...
agpl-3.0
conversationai/conversationai-crowdsource
constructiveness_toxicity_crowdsource/common/data_visualization_functions.py
1
1535
import matplotlib.pyplot as plt import pandas as pd import numpy as np import krippendorff from krippendorff import alpha # create and save plots def plot_donut_chart(size, labels, colors, title = 'Test', dpi = 300): ''' :param size: (list of floats) Sizes for each slice in the donut plot :param label...
apache-2.0
rhattersley/iris
docs/iris/example_tests/extest_util.py
4
3110
# (C) British Crown Copyright 2010 - 2016, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
EricCline/CEM_inc
env/lib/python2.7/site-packages/IPython/core/tests/test_pylabtools.py
15
7752
"""Tests for pylab tools module. """ #----------------------------------------------------------------------------- # Copyright (c) 2011, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #---------...
mit
dhaitz/CalibFW
plotting/plotbase.py
1
20971
# -*- coding: utf-8 -*- """Basic plot formatting and helper module. This module contains all the often used plotting tools """ import os import os.path import sys import copy import matplotlib.pyplot as plt from time import clock import inspect import math import matplotlib import pkgutil from matplotlib.backends.ba...
gpl-2.0
bigdataelephants/scikit-learn
examples/svm/plot_iris.py
62
3251
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
bsd-3-clause
ChinaQuants/zipline
zipline/utils/tradingcalendar.py
6
11182
# # Copyright 2013 Quantopian, 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 or agreed to in wr...
apache-2.0
shaunstanislaus/BDA_py_demos
demos_ch3/demo3_3.py
19
7882
"""Bayesian Data Analysis, 3rd ed Chapter 3, demo 3 Visualise the marginal distribution of mu as a mixture of normals. """ from __future__ import division import os, threading import numpy as np from scipy import stats import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # import from utilities im...
gpl-3.0
SimeonFritz/aima-python
submissions/VanderKallen/myNN.py
13
3398
import traceback from submissions.VanderKallen import slavery from sklearn.neural_network import MLPRegressor from sklearn.neural_network import MLPClassifier class DataFrame: data = [] feature_names = [] target = [] target_names = [] slaveTot = DataFrame() slaveAS = DataFrame() slaveBoth = DataFrame(...
mit
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/sklearn/linear_model/tests/test_sgd.py
30
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 ...
mit
vladcalin/eventer
quartz/lib/utilscripts/generate_chart.py
1
1594
import json import argparse import random import datetime import matplotlib.pyplot as plt def parse_data(data): with open(data, "r") as f: return json.load(f) def make_line_chart(args): data = parse_data(args.data) plt.plot(range(len(data)), data) plt.title(args.title) plt.savefig(args....
mit
robcarver17/pysystemtrade
sysobjects/instruments.py
1
8540
from syscore.objects import arg_not_supplied from syscore.genutils import flatten_list from dataclasses import dataclass import pandas as pd EMPTY_INSTRUMENT = "" class futuresInstrument(object): def __init__(self, instrument_code: str): self._instrument_code = instrument_code @property def inst...
gpl-3.0
kastnerkyle/speech_density
speech_mel_lstmrbm.py
1
18503
# Author: Kratarth Goel # BITS Pilani (2014) # LSTM-RBM for music generation import sys import os import tables import tarfile import fnmatch import random import numpy import numpy as np from scipy.io import wavfile import theano import theano.tensor as T from theano.tensor.shared_randomstreams import RandomStreams f...
bsd-3-clause
MohammedWasim/scikit-learn
examples/decomposition/plot_sparse_coding.py
247
3846
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
costypetrisor/scikit-learn
sklearn/feature_selection/tests/test_from_model.py
244
1593
import numpy as np import scipy.sparse as sp from nose.tools import assert_raises, assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression from sklearn.linear_model import SGD...
bsd-3-clause
crisbarros/trading-with-python
nautilus/nautilus.py
77
5403
''' Created on 26 dec. 2011 Copyright: Jev Kuznetsov License: BSD ''' from PyQt4.QtCore import * from PyQt4.QtGui import * from ib.ext.Contract import Contract from ib.opt import ibConnection from ib.ext.Order import Order import tradingWithPython.lib.logger as logger from tradingWithPython.lib.eve...
bsd-3-clause
noxer-org/noxer
examples/vae_gaussian.py
2
1702
""" Simplistic example usage of Variational Auto Encoder for generation of artificial data. """ import numpy as np X = np.zeros((1024, 1)) Y = np.random.randn(len(X), 3) from sklearn.preprocessing import RobustScaler, StandardScaler from sklearn.base import clone from sklearn.pipeline import make_pipeline from skle...
mit
jeffsilverm/presentation
SeaGL-2018/Plotting_the_results_of_measure2.sh.py
1
7102
#! /usr/bin/python3 # coding: utf-8 # From http://pandas.pydata.org/pandas-docs/version/0.23/visualization.html # http://pandas.pydata.org/pandas-docs/version/0.23/visualization.html # #scatter-matrix-plot # From https://pythonprogramming.net/matplotlib-3d-scatterplot-tutorial/ # This does NOT work in a jupyter noteboo...
gpl-2.0
alexeyum/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
stylianos-kampakis/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
josl/ThinkStats2
code/hinc_soln.py
67
4296
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import numpy as np import pandas import hinc import thinkplot import thinkstats2 ""...
gpl-3.0
hvanwyk/quadmesh
tests/test_plot.py
1
6466
''' Created on Feb 24, 2017 @author: hans-werner ''' import unittest from plot import Plot from mesh import Mesh from fem import System, QuadFE import matplotlib.pyplot as plt #from mpl_toolkits.mplot3d import * # @UnresolvedImport import numpy as np class TestPlot(unittest.TestCase): def test_plot_mesh(self)...
mit
terkkila/scikit-learn
sklearn/feature_extraction/dict_vectorizer.py
234
12267
# Authors: Lars Buitinck # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from array import array from collections import Mapping from operator import itemgetter import numpy as np import scipy.sparse as sp from ..base import BaseEstimator, TransformerMixin from ..externals import six from ..ext...
bsd-3-clause
pianomania/scikit-learn
sklearn/decomposition/pca.py
7
28653
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <denis-alexander.engemann@inria.fr> # Michael Eickenberg <michael.eickenberg@inria.fr>...
bsd-3-clause
Adai0808/scikit-learn
examples/mixture/plot_gmm.py
248
2817
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet process. Both models have access to five components with which to fit the data. Note that the EM model will necessari...
bsd-3-clause
jetuk/pywr
examples/two_reservoir_moea.py
1
8924
""" This example shows the trade-off (pareto frontier) of deficit against cost by altering a reservoir control curve. Two types of control curve are possible. The first is a monthly control curve containing one value for each month. The second is a harmonic control curve with cosine terms around a mean. Both Parameter...
gpl-3.0
jreinhardt/manual-labour
src/manuallabour/exporters/gantt.py
1
2764
# Manual labour - a library for step-by-step instructions # Copyright (C) 2014 Johannes Reinhardt <jreinhardt@ist-dein-freund.de> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; eith...
lgpl-2.1
nesterione/scikit-learn
sklearn/gaussian_process/gaussian_process.py
83
34544
# -*- 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 ..base import BaseEstimator, RegressorMixin from ..metrics...
bsd-3-clause
shaharkadmiel/pySW4
pySW4/utils/spectral.py
2
9858
""" Python module for spectral analysis. .. module:: spectral :author: Shahar Shani-Kadmiel (s.shanikadmiel@tudelft.nl) :copyright: Shahar Shani-Kadmiel :license: This code is distributed under the terms of the GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.htm...
gpl-3.0
moonbury/notebooks
github/MasteringMLWithScikit-learn/8365OS_04_Codes/ch42.py
3
1763
import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split from sklearn.metrics import precision_score, recall_score, roc_auc_score, auc, confusion_matrix import numpy as np from scipy.sparse i...
gpl-3.0
JackKelly/neuralnilm_prototype
scripts/e536.py
2
7704
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) from neuralnilm.source import (standardise, discretize, fdiff, power_and_fdiff, ...
mit
jm-begon/scikit-learn
sklearn/preprocessing/tests/test_imputation.py
213
11911
import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.preprocessing.imputa...
bsd-3-clause
MechCoder/scikit-learn
examples/decomposition/plot_image_denoising.py
6
5958
""" ========================================= 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
statkraft/shyft-doc
notebooks/nea-example/simulation-api.py
1
18932
import os import datetime as dt import pandas as pd import sys from matplotlib import pyplot as plt from netCDF4 import Dataset os.environ['SHYFTDATA'] = '/home/johnbur/workspace/shyft_workspace/shyft-data/' sys.path.insert(0, '/home/johnbur/workspace/shyft_workspace/shyft') from shyft import api import shyft from ...
lgpl-3.0
droundy/deft
papers/square-well-fluid/figs/animate-liquid-vapor.py
1
4121
#!/usr/bin/python2 import matplotlib, sys if 'show' not in sys.argv: matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy, time, os matplotlib.rc('text', usetex=True) import readandcompute ww = float(sys.argv[1]) #arg ww = [1.3] ff = float(sys.argv[2]) #arg ff = [0.1, 0.2, 0.3] lenx = float(sys.arg...
gpl-2.0
gfyoung/pandas
pandas/core/array_algos/putmask.py
2
5055
""" EA-compatible analogue to to np.putmask """ from typing import Any import warnings import numpy as np from pandas._libs import lib from pandas._typing import ArrayLike from pandas.core.dtypes.cast import convert_scalar_for_putitemlike, maybe_promote from pandas.core.dtypes.common import is_float_dtype, is_intege...
bsd-3-clause
shusenl/scikit-learn
sklearn/metrics/tests/test_common.py
54
41186
from __future__ import division, print_function from functools import partial from itertools import product import numpy as np import scipy.sparse as sp from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinarizer from sklearn.utils.multiclass import type_of_target fro...
bsd-3-clause
jwdegee/2017_eLife
hddm_regression.py
1
14598
#!/usr/bin/env python # encoding: utf-8 """ Created by Jan Willem de Gee on 2011-02-16. Copyright (c) 2011 __MyCompanyName__. All rights reserved. """ import os, sys, pickle, time import datetime import math import numpy as np import scipy as sp import matplotlib matplotlib.use('Agg') # Force matplotlib to not use any ...
mit
Djabbz/scikit-learn
examples/decomposition/plot_incremental_pca.py
244
1878
""" =============== Incremental PCA =============== Incremental principal component analysis (IPCA) is typically used as a replacement for principal component analysis (PCA) when the dataset to be decomposed is too large to fit in memory. IPCA builds a low-rank approximation for the input data using an amount of memo...
bsd-3-clause
wdurhamh/statsmodels
statsmodels/datasets/template_data.py
31
1680
#! /usr/bin/env python """Name of dataset.""" __docformat__ = 'restructuredtext' COPYRIGHT = """E.g., This is public domain.""" TITLE = """Title of the dataset""" SOURCE = """ This section should provide a link to the original dataset if possible and attribution and correspondance information for the da...
bsd-3-clause
pyrocko/pyrocko
test/base/test_gmtpy.py
1
11149
from __future__ import division, print_function, absolute_import import os import math import tempfile import shutil import unittest import numpy as num from numpy.testing import assert_allclose from matplotlib import image, pyplot as plt from pyrocko import util from pyrocko.plot import gmtpy from pyrocko.plot.gmtpy ...
gpl-3.0
lmccalman/reverend
demo/visualise_filtering.py
1
1882
# Reverend -- Practical Bayesian Inference with Kernel Embeddings # Copyright (C) 2013 Lachlan McCalman # lachlan@mccalman.info # Reverend 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 t...
gpl-3.0
changsiyao/mousestyles
mousestyles/classification/clustering.py
3
7621
from __future__ import (absolute_import, division, print_function, unicode_literals) from scipy.cluster.hierarchy import linkage from sklearn.cluster import AgglomerativeClustering, KMeans from sklearn import metrics import numpy as np from scipy.cluster.hierarchy import cophenet from scipy.spa...
bsd-2-clause
asimshankar/tensorflow
tensorflow/examples/learn/iris_custom_model.py
13
3469
# 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
stevenzhang18/Indeed-Flask
lib/pandas/io/stata.py
9
78805
""" Module contains tools for processing Stata files into DataFrames The StataReader below was originally written by Joe Presbrey as part of PyDTA. It has been extended and improved by Skipper Seabold from the Statsmodels project who also developed the StataWriter and was finally added to pandas in a once again improv...
apache-2.0
nlpub/russe-evaluation
russe/common.py
1
8514
import pandas as pd import codecs from os.path import splitext from pandas import read_csv from collections import defaultdict import re from pymystem3 import Mystem # dependenies to the dsl nlp repository from nlp.common import wc from nlp.patterns import re_numbers _mystem = Mystem() def get_pos(text): pos = ...
mit
rollend/trading-with-python
lib/extra.py
77
2540
''' Created on Apr 28, 2013 Copyright: Jev Kuznetsov License: BSD ''' from __future__ import print_function import sys import urllib import os import xlrd # module for excel file reading import pandas as pd class ProgressBar: def __init__(self, iterations): self.iterations = iterations ...
bsd-3-clause
boxcontrol/lesAdmin
app/loginMap.py
1
1161
#import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from geopy.geocoders import GoogleV3 geolocator = GoogleV3() cities = ['Amsterdam', 'Milan', 'Dallas', 'Los Angeles', 'Montreal', 'Lenoir', 'Nottingham', 'Rotterdam', 'Dusseldorf', 'Falkenstein...
cc0-1.0
fabianp/scikit-learn
examples/svm/plot_separating_hyperplane_unbalanced.py
329
1850
""" ================================================= SVM: Separating hyperplane for unbalanced classes ================================================= Find the optimal separating hyperplane using an SVC for classes that are unbalanced. We first find the separating plane with a plain SVC and then plot (dashed) the ...
bsd-3-clause
liyu1990/sklearn
sklearn/utils/tests/test_sparsefuncs.py
30
17391
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn.datasets import make_classification from sklearn.utils.sparsefuncs import (mean_variance_axis...
bsd-3-clause
NICTA/dora
setup.py
1
1537
""" Setup utility for the dora package. """ from setuptools import setup, find_packages # from setuptools.command.test import test as TestCommand setup( name='dora', version='0.1', description='Active sampling using a non-parametric regression model.', url='http://github.com/nicta/dora', ...
apache-2.0
rahulreddy1004/pso_multiObj
tesst.py
2
10255
import numpy as np import numpy.matlib as matlib import random from math import sin, sqrt import matplotlib.pyplot as plt ''' Problem Definition''' def MOP2(x): n=len(x) z1=1-np.exp(-np.sum(np.power((x-1/sqrt(n)),2))) #ckeck exp for single z2=1-np.e...
bsd-2-clause
hsuantien/scikit-learn
examples/mixture/plot_gmm.py
248
2817
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet process. Both models have access to five components with which to fit the data. Note that the EM model will necessari...
bsd-3-clause
eranchetz/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_ps.py
69
50262
""" A PostScript backend, which can produce both PostScript .ps and .eps """ from __future__ import division import glob, math, os, shutil, sys, time def _fn_name(): return sys._getframe(1).f_code.co_name try: from hashlib import md5 except ImportError: from md5 import md5 #Deprecated in 2.5 from tempfile im...
agpl-3.0
tomhunter-gh/Lean
Algorithm.Python/PythonPackageTestAlgorithm.py
2
6403
# 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 Li...
apache-2.0
johnbachman/rasmodel
ras_gdp_binding.py
6
2813
from rasmodel.scenarios.default import model import numpy as np from matplotlib import pyplot as plt from pysb.integrate import Solver from pysb import * from tbidbaxlipo.util import fitting # Zero out all initial conditions for ic in model.initial_conditions: ic[1].value = 0 # In this first experiment, 0.5 uM ...
mit
kdebrab/pandas
doc/source/conf.py
5
21946
# -*- coding: utf-8 -*- # # pandas documentation build configuration file, created by # # 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. # # All configuration values have a default; values tha...
bsd-3-clause
shyamalschandra/scikit-learn
sklearn/externals/joblib/__init__.py
23
4764
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
glorizen/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/figure.py
69
38331
""" The figure module provides the top-level :class:`~matplotlib.artist.Artist`, the :class:`Figure`, which contains all the plot elements. The following classes are defined :class:`SubplotParams` control the default spacing of the subplots :class:`Figure` top level container for all plot elements """ impo...
agpl-3.0
yavalvas/yav_com
build/matplotlib/lib/mpl_examples/user_interfaces/rec_edit_gtk_custom.py
9
1306
""" generate an editable gtk treeview widget for record arrays with custom formatting of the cells and show how to limit string entries to a list of strings """ from __future__ import print_function import gtk import numpy as np import matplotlib.mlab as mlab import matplotlib.cbook as cbook import mpl_toolkits.gtktool...
mit
Barmaley-exe/scikit-learn
sklearn/utils/tests/test_shortest_path.py
42
2894
from collections import defaultdict import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.utils.graph import (graph_shortest_path, single_source_shortest_path_length) def floyd_warshall_slow(graph, directed=False): N = graph.shape[0] #set nonzer...
bsd-3-clause
ThomasMiconi/htmresearch
projects/wavelet_dataAggregation/runDataAggregationExperiment.py
11
21206
from os.path import isfile, join, exists import pandas as pd import numpy as np from scipy import signal import numpy.matlib import csv import os import time os.environ['TZ'] = 'GMT' time.tzset() display = True if display: import matplotlib.pyplot as plt plt.close('all') plt.ion() def plotWaveletPower(sig, cw...
agpl-3.0
saiwing-yeung/scikit-learn
sklearn/decomposition/tests/test_incremental_pca.py
297
8265
"""Tests for Incremental PCA.""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises from sklearn import datasets from sklearn.decomposition import PCA, IncrementalPCA iris = datasets.load...
bsd-3-clause
jundongl/PyFeaST
skfeature/function/similarity_based/SPEC.py
3
3515
import numpy.matlib import numpy as np from scipy.sparse import * from sklearn.metrics.pairwise import rbf_kernel from numpy import linalg as LA def spec(X, **kwargs): """ This function implements the SPEC feature selection Input ----- X: {numpy array}, shape (n_samples, n_features) input...
gpl-2.0
yukisakurai/hhana
mva/plotting/classify.py
5
12122
# stdlib imports import os # local imports from . import log from ..variables import VARIABLES from .. import PLOTS_DIR from .draw import draw from statstools.utils import efficiency_cut, significance # matplotlib imports from matplotlib import cm from matplotlib import pyplot as plt from matplotlib.ticker import Ma...
gpl-3.0
google-research/understanding-transfer-learning
libtrain.py
1
8720
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
stinebuu/nest-simulator
pynest/examples/gif_population.py
7
5050
# -*- coding: utf-8 -*- # # gif_population.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,...
gpl-2.0
radiasoft/pypi-shadow3
examples/primer/primer_ch24_run1.py
1
2535
# # example of running shadow under python # # corresponds to the example in Chapter 2.4 of the SHADOW Primer: # http://ftp.esrf.eu/pub/scisoft/shadow3/Shadow3Primer.pdf # # Notes: # # -This example sets directly the parameters of the sorce and optical # element for the corresponding case. This is the "direct" ...
gpl-3.0