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
rahuldhote/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
ThomasMiconi/nupic.research
htmresearch/support/sp_paper_utils.py
6
11432
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
chrsrds/scikit-learn
examples/semi_supervised/plot_label_propagation_versus_svm_iris.py
21
2391
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
bsd-3-clause
rudhir-upretee/Sumo_With_Netsim
tools/visualization/mpl_dump_twoAgainst.py
3
7534
#!/usr/bin/env python """ @file mpl_dump_twoAgainst.py @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 @version $Id: mpl_dump_twoAgainst.py 11671 2012-01-07 20:14:30Z behrisch $ This script reads two dump files and plots one of the values stored therein as an x-/y- plot. matplotlib has t...
gpl-3.0
rhyolight/nupic
src/nupic/algorithms/monitor_mixin/plot.py
20
5229
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
shanzhenren/ClusType
src/algorithm.py
1
10630
from collections import defaultdict from operator import itemgetter from math import log, sqrt import random as rn import time from numpy import * # install numpy from scipy import * # install scipy from numpy.linalg import norm import numpy.linalg as npl from scipy.sparse import * import scipy.sparse.linalg as spsl fr...
gpl-3.0
neale/softmax
softmax_regression.py
1
7400
#!/usr/bin/env python import sys import time import numpy as np import random import matplotlib.pyplot as plt from collections import defaultdict cost = 0.0 lrate = .1 grad = np.array([]) lambda_factor = 0.0 nclasses = 2 def vector_to_collumn(vec): length = len(vec) A = np.array(vec) for i in range(lengt...
unlicense
OFAI/million-post-corpus
experiments/src/evaluate_lstm.py
1
13644
import math import multiprocessing import os import warnings from gensim.models.word2vec import Word2Vec import numpy import tensorflow as tf import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from sklearn.exceptions import UndefinedMetricWarning from sklearn.metrics import precision_score, recall...
mit
agutieda/QuantEcon.py
quantecon/estspec.py
7
4856
""" Filename: estspec.py Authors: Thomas Sargent, John Stachurski Functions for working with periodograms of scalar data. """ from __future__ import division, print_function import numpy as np from numpy.fft import fft from pandas import ols, Series def smooth(x, window_len=7, window='hanning'): """ Smoot...
bsd-3-clause
jakereimer/pipeline
python/pipeline/notify.py
5
1997
import datajoint as dj from datajoint.jobs import key_hash from . import experiment schema = dj.schema('pipeline_notification', locals()) # Decorator for notification functions. Ignores exceptions. def ignore_exceptions(f): def wrapper(*args, **kwargs): try: return f(*args, **kwargs) e...
lgpl-3.0
shusenl/scikit-learn
sklearn/tests/test_common.py
70
7717
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
bsd-3-clause
JaviMerino/bart
bart/common/Utils.py
1
5498
# Copyright 2015-2015 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
softwaresaved/SSINetworkGraphics
Fellows/Python/home_inst_map.py
1
1379
#!/usr/bin/python2.7 from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np # set up orthographic map projection with # perspective of satellite looking down at 50N, 100W. # use low resolution coastlines. # don't plot features that are smaller than 1000 square km. map = Basemap(pro...
bsd-3-clause
nmayorov/scikit-learn
sklearn/linear_model/stochastic_gradient.py
34
50761
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np from abc import ABCMeta, abstractmethod from ..externals.joblib import ...
bsd-3-clause
andrewnc/scikit-learn
sklearn/cluster/tests/test_spectral.py
262
7954
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
don-willingham/Sonoff-Tasmota
tools/serial-plotter.py
2
5157
#!/usr/bin/env python3 """ serial-plotter.py - for Tasmota Copyright (C) 2020 Christian Baars 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 yo...
gpl-3.0
ThiagoGarciaAlves/intellij-community
python/helpers/pydev/pydevd.py
3
69138
''' Entry point module (keep at root): This module starts the debugger. ''' import sys if sys.version_info[:2] < (2, 6): raise RuntimeError('The PyDev.Debugger requires Python 2.6 onwards to be run. If you need to use an older Python version, use an older version of the debugger.') import atexit import os import...
apache-2.0
rcharp/toyota-flask
venv/lib/python2.7/site-packages/numpy/lib/polynomial.py
35
37641
""" Functions to operate on polynomials. """ from __future__ import division, absolute_import, print_function __all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd', 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d', 'polyfit', 'RankWarning'] import re import warnings import numpy.core....
apache-2.0
pravsripad/mne-python
mne/io/edf/tests/test_edf.py
4
21326
# -*- coding: utf-8 -*- # Authors: Teon Brooks <teon.brooks@gmail.com> # Martin Billinger <martin.billinger@tugraz.at> # Alan Leggitt <alan.leggitt@ucsf.edu> # Alexandre Barachant <alexandre.barachant@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # Joan Massic...
bsd-3-clause
datapythonista/pandas
pandas/tests/frame/methods/test_is_homogeneous_dtype.py
4
1422
import numpy as np import pytest import pandas.util._test_decorators as td from pandas import ( Categorical, DataFrame, ) # _is_homogeneous_type always returns True for ArrayManager pytestmark = td.skip_array_manager_invalid_test @pytest.mark.parametrize( "data, expected", [ # empty ...
bsd-3-clause
krez13/scikit-learn
sklearn/ensemble/weight_boosting.py
23
40739
"""Weight Boosting This module contains weight boosting estimators for both classification and regression. The module structure is the following: - The ``BaseWeightBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regression and classification only differ from each ot...
bsd-3-clause
StefReck/Km3-Autoencoder
scripts/convergence_diagnosis.py
1
13188
# -*- coding: utf-8 -*- """ Create layer output histograms of the last layers of a network, while training. """ #import matplotlib #matplotlib.use('Agg') from keras.layers import Activation, Input, Lambda, Dropout, Dense, Flatten, Conv3D, MaxPooling3D, UpSampling3D,BatchNormalization, ZeroPadding3D, Conv3DTranspose, ...
mit
Aerolyzer/Aerolyzer
horizon.py
1
4599
import sys import cv2 import os import numpy as np from matplotlib import pyplot as plt def sigm(x): return 1 / (1 + np.exp(-x)) def is_sky(img): syn0 = np.array([[0.6106635051820115, -1.2018987127529588, -10.344605820189082, 1.1911213385074928, -6.818421664371254, 0.7888012143578024, 0.1930026599192343, 2....
apache-2.0
zooniverse/aggregation
experimental/dkMeansPaper/dk1.py
2
3219
#!/usr/bin/env python __author__ = 'greghines' import numpy as np import os import pymongo import sys import cPickle as pickle import bisect import csv import matplotlib.pyplot as plt import random import math import urllib import matplotlib.cbook as cbook from scipy.stats.stats import pearsonr from scipy.stats import ...
apache-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/scipy/stats/_binned_statistic.py
28
25272
from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib.six import callable, xrange from collections import namedtuple __all__ = ['binned_statistic', 'binned_statistic_2d', 'binned_statistic_dd'] BinnedStatisticResult = namedtuple('B...
gpl-3.0
idaholab/raven
tests/framework/Samplers/Categorical/StringVars/proj_second.py
2
1667
import numpy as np def run(self,Input): v0 = self.v0 y0 = self.y0 ang = 45.*np.pi/180. times = np.linspace(0,2,5) mode = self.mode if mode == 'stepper': y = stepper(v0,y0,ang,times) elif mode == 'analytic': y = analytic(v0,y0,ang,times) else: raise IOError('Unrecognized mode:',mode) self....
apache-2.0
pavanramkumar/pyglmnet
examples/plot_tikhonov.py
1
8672
# -*- coding: utf-8 -*- """ ======================== Tikhonov Regularization ======================== Tikhonov regularization is a generalized form of L2-regularization. It allows us to articulate our prior knowlege about correlations between different predictors with a multivariate Gaussian prior. Here, we demonstrat...
mit
arielmakestuff/loadlimit
test/unit/stat/test_timeseries.py
1
6054
# -*- coding: utf-8 -*- # test/unit/stat/test_timeseries.py # Copyright (C) 2016 authors and contributors (see AUTHORS file) # # This module is released under the MIT License. """Test timeseries()""" # ============================================================================ # Imports # ===========================...
mit
caisq/tensorflow
tensorflow/examples/learn/multiple_gpu.py
39
3957
# 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
lpryszcz/bin
sam2hist.py
1
2337
#!/usr/bin/env python desc="""Report histogram for given insert size data """ epilog="""Author: l.p.pryszcz+git@gmail.com Barcelona, 18/10/2012 """ import argparse, os, sys from datetime import datetime def plot( isizes,outfn ): """ """ import matplotlib.pyplot as plt # the histogram of the data ...
gpl-3.0
kazemakase/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
justincassidy/scikit-learn
examples/applications/face_recognition.py
191
5513
""" =================================================== 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
JasonKessler/scattertext
demo_category_frequencies.py
1
1662
import pandas as pd import scattertext as st ''' Sample genre frequencies from the Corpus of Contemporary American English via https://www.wordfrequency.info/100k_compare_to_60k_etc.asp . We'll examine the difference between spoken and fiction, and just consider the top 1000 words in the sample. ''' df = (pd.read_e...
apache-2.0
MurphysLab/ADAblock
Data_Sort_and_Plot_Script.py
1
70948
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Data_Sort_and_Plot_Script.py Script created by Jeffrey N. Murphy (2015); Email: jnmurphy@ualberta.ca Provided without any warranty. The directory locations will need to be modified, depending on the location of the input file. The input for this script is the file pro...
mit
matthiaskoenig/sbmlutils
src/sbmlutils/manipulation/interpolation.py
1
13801
"""Create SBML/antimony files for interpolation of datasets. https://github.com/allyhume/SBMLDataTools https://github.com/allyhume/SBMLDataTools.git TODO: fix composition with existing models TODO: support coupling with existing models via comp The functionality is very useful, but only if this can be applied to exis...
lgpl-3.0
fabianp/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py
254
2795
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
bsd-3-clause
uci-cbcl/tree-hmm
treehmm/__init__.py
2
65101
#!/usr/bin/env python """ Variational Bayes method to solve phylgoenetic HMM for histone modifications Need to: * Preprocess ** load each dataset ** call significant sites for each dataset (vs. one control dataset) ** save out resulting histogrammed data * Learn ** Init parameters randomly ** E step: optimize each q...
bsd-3-clause
joernhees/scikit-learn
examples/plot_compare_reduction.py
45
4959
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ================================================================= Selecting dimensionality reduction with Pipeline and GridSearchCV ================================================================= This example constructs a pipeline that does dimensionality reduction f...
bsd-3-clause
ChanChiChoi/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
elkingtonmcb/scikit-learn
sklearn/linear_model/tests/test_ransac.py
216
13290
import numpy as np from numpy.testing import assert_equal, assert_raises from numpy.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises_regexp from scipy import sparse from sklearn.utils.testing import assert_less from sklearn.linear_model import LinearRegression, RANSACRegressor f...
bsd-3-clause
BrechtBa/plottools
doc/source/conf.py
1
10429
# -*- coding: utf-8 -*- # # Someproject documentation build configuration file, created by # sphinx-quickstart on Mon Sep 05 08:56:23 2016. # # 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. #...
gpl-2.0
ssaeger/scikit-learn
sklearn/tree/tests/test_export.py
31
9588
""" Testing for export functions of decision trees (sklearn.tree.export). """ from re import finditer from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.ensemble import GradientBoostingClassifier from sklearn...
bsd-3-clause
xzh86/scikit-learn
examples/cluster/plot_kmeans_assumptions.py
270
2040
""" ==================================== Demonstration of k-means assumptions ==================================== This example is meant to illustrate situations where k-means will produce unintuitive and possibly unexpected clusters. In the first three plots, the input data does not conform to some implicit assumptio...
bsd-3-clause
MatthewThe/kaggle
titanic/bin/random_forest.py
1
2193
#!/usr/bin/python import csv import numpy as np from sklearn import svm from sklearn.ensemble import RandomForestClassifier import matplotlib.pyplot as plt # 0: PassengerId, 1: Survived, 2: Pclass, 3: Name, 4: Sex (male,female), 5: Age, 6: SibSp, 7: ParCh, 8: Ticket, 9: Fare, 10: Cabin, 11: Embarked (S,C,Q) # 1,0,3,"...
apache-2.0
nickdex/cosmos
code/artificial_intelligence/src/particle_swarm_optimization/gbestPSO/Gbest3D.py
3
2194
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def f(args): return np.sum([x ** 2 for x in args]) dimensions = 2 boundary = (-10, 10) particles = 20 positions = [] velocities = [] w_min = 0.01 w_max = 0.1 c1 = 0 c2 = 0 num_iters = 20 for i in range(particles): p...
gpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/skimage/transform/tests/test_radon_transform.py
2
15936
from __future__ import print_function, division import os import itertools import numpy as np from skimage import data_dir from skimage.io import imread from skimage.transform import radon, iradon, iradon_sart, rescale from skimage._shared import testing from skimage._shared.testing import test_parallel from skimage...
gpl-3.0
sunzhxjs/JobGIS
lib/python2.7/site-packages/pandas/core/dtypes.py
9
5492
""" define extension dtypes """ import re import numpy as np from pandas import compat class ExtensionDtype(object): """ A np.dtype duck-typed class, suitable for holding a custom dtype. THIS IS NOT A REAL NUMPY DTYPE """ name = None names = None type = None subdtype = None kind =...
mit
freeman-lab/dask
dask/dataframe/tests/test_multi.py
5
5300
import dask.dataframe as dd import pandas as pd from dask.dataframe.multi import (align_partitions, join_indexed_dataframes, hash_join, concat_indexed_dataframes) import pandas.util.testing as tm from dask.async import get_sync def test_align_partitions(): A = pd.DataFrame({'x': [1, 2, 3, 4, 5, 6], 'y': li...
bsd-3-clause
habi/GlobalDiagnostiX
AngularOpening.py
1
6875
# -*- coding: utf-8 -*- """ Calculate the angular opening of the lens, including the shades that we have to build in between. """ from __future__ import division import optparse import sys import os import numpy import matplotlib.pyplot as plt from matplotlib.patches import Wedge from matplotlib.patches import Rectang...
unlicense
rafaelvalle/MDI
nnet_lasagne.py
1
10609
# code adapted from lasagne tutorial # http://lasagne.readthedocs.org/en/latest/user/tutorial.html import time import os from itertools import product import numpy as np from sklearn.cross_validation import KFold import theano from theano import tensor as T import lasagne from params import nnet_params_dict, feats_tra...
mit
andresmeh/pylibnidaqmx
nidaqmx/wxagg_plot.py
16
4515
import os import sys import time import traceback import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.backends.backend_wx import NavigationToolbar2Wx import wx from matplotlib.figure import Figure class PlotFigure(wx.Frame): def OnKeyPresse...
bsd-3-clause
alephu5/Soundbyte
environment/lib/python3.3/site-packages/matplotlib/gridspec.py
1
14943
""" :mod:`~matplotlib.gridspec` is a module which specifies the location of the subplot in the figure. ``GridSpec`` specifies the geometry of the grid that a subplot will be placed. The number of rows and number of columns of the grid need to be set. Optionally, the subplot layout parameter...
gpl-3.0
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/pandas/core/reshape/merge.py
3
53914
""" SQL-style merge routines """ import copy import warnings import string import numpy as np from pandas.compat import range, lzip, zip, map, filter import pandas.compat as compat from pandas import (Categorical, Series, DataFrame, Index, MultiIndex, Timedelta) from pandas.core.frame import _mer...
mit
dhwang99/statistics_introduction
probility/dirichlet.py
1
2446
#encoding: utf8 import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats from mpl_toolkits.mplot3d import Axes3D from gamma_dist import gamma_values import pdb ''' Dir(X;alpha_vector) = (Gamma(sum(alpha_vector))/Multi(Gamma(alpha_i)) * Multi(xi^alpha_i) ''' def dir_pdf(alpha_vector, X_vector): ...
gpl-3.0
prasanna08/oppia-ml
core/classifiers/TextClassifier/TextClassifier.py
1
7667
# coding: utf-8 # # Copyright 2017 The Oppia 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 requi...
apache-2.0
yunfeilu/scikit-learn
sklearn/utils/estimator_checks.py
21
51976
from __future__ import print_function import types import warnings import sys import traceback import inspect import pickle from copy import deepcopy import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memory from sklearn.ut...
bsd-3-clause
ScopeFoundry/FoundryDataBrowser
viewers/hyperspec_h5.py
1
9105
#from ScopeFoundry.data_browser import HyperSpectralBaseView from FoundryDataBrowser.viewers.hyperspec_base_view import HyperSpectralBaseView from FoundryDataBrowser.viewers.plot_n_fit import PeakUtilsFitter import numpy as np import h5py import pyqtgraph as pg class HyperSpecH5View(HyperSpectralBaseView): name...
bsd-3-clause
bejar/kemlglearn
kemlglearn/cluster/consensus/SimpleConsensusClustering.py
1
4669
""" .. module:: SimpleConsensusClustering SimpleConsensusClustering ************* :Description: SimpleConsensusClustering :Authors: bejar :Version: :Created on: 22/01/2015 10:46 """ __author__ = 'bejar' import numpy as np from sklearn.base import BaseEstimator, ClusterMixin, TransformerMixin from s...
mit
femtotrader/arctic-updater
samples/unique.py
1
2387
import time import logging from collections import OrderedDict import pandas as pd pd.set_option('max_rows', 10) pd.set_option('expand_frame_repr', False) pd.set_option('max_columns', 6) from arctic_updater.updaters.truefx import TrueFXUpdater logging.Formatter.converter = time.gmtime logging.basicConfig(format='%(asc...
isc
adammenges/statsmodels
statsmodels/sandbox/examples/try_multiols.py
33
1243
# -*- coding: utf-8 -*- """ Created on Sun May 26 13:23:40 2013 Author: Josef Perktold, based on Enrico Giampieri's multiOLS """ #import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.sandbox.multilinear import multiOLS, multigroup data = sm.datasets.longley.load_pandas() df = data.e...
bsd-3-clause
dsc381/yahoo_cqa
fex.py
2
5492
import os import json import numpy import codecs from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import svm from sklearn.metrics import accuracy_score, precision_score def extract(f): def sample(f): hits = [] mis...
gpl-2.0
qingshuimonk/STA663
Vanilla_GAN.py
1
3445
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np import matplotlib # matplotlib.use('PS') import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import os from time import gmtime, strftime def xavier_init(size): in_dim = size[0] xavier_stdde...
mit
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/pandas/core/algorithms.py
9
18486
""" Generic data algorithms. This module is experimental at the moment and not intended for public consumption """ from __future__ import division from warnings import warn import numpy as np from pandas import compat, lib, _np_version_under1p8 import pandas.core.common as com import pandas.algos as algos import panda...
artistic-2.0
arunchaganty/presidential-debates
python/doc2vec.py
2
5109
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Label documents with doc2vec. """ import numpy as np import os from collections import Counter from pprint import pprint import csv import sys import gensim from gensim.corpora import Dictionary, HashDictionary, MmCorpus from gensim.models.doc2vec import TaggedDocume...
mit
anirudhjayaraman/scikit-learn
sklearn/datasets/samples_generator.py
103
56423
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing import MultiLabelBin...
bsd-3-clause
John-Jumper/Upside-MD
py/sim_timeseries.py
1
5583
#!/usr/bin/env python from multiprocessing import Pool import numpy as np import tables as tb import collections from glob import glob import re import sys,os import cPickle as cp from glob import glob import pandas as pd from gzip import GzipFile import time upside_dir = os.path.expanduser('~/upside/') if upside_d...
gpl-2.0
jmuhlich/pysb
pysb/tests/test_simulator_scipy.py
5
19613
from pysb.testing import * import sys import copy import numpy as np from pysb import Monomer, Parameter, Initial, Observable, Rule, Expression from pysb.simulator import ScipyOdeSimulator, InconsistentParameterError from pysb.simulator.scipyode import CythonRhsBuilder from pysb.examples import robertson, earm_1_0, tys...
bsd-2-clause
ningchi/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
PatrickChrist/scikit-learn
benchmarks/bench_isotonic.py
268
3046
""" Benchmarks of isotonic regression performance. We generate a synthetic dataset of size 10^n, for n in [min, max], and examine the time taken to run isotonic regression over the dataset. The timings are then output to stdout, or visualized on a log-log scale with matplotlib. This alows the scaling of the algorith...
bsd-3-clause
with-git/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/ops.py
77
46403
# 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
vdrhtc/Measurement-automation
lib2/correlatorMeasurement.py
1
19512
from copy import deepcopy import numpy as np import tqdm from lib2.MeasurementResult import MeasurementResult from lib2.stimulatedEmission import StimulatedEmission from datetime import datetime as dt import matplotlib.pyplot as plt from matplotlib import colorbar from scipy import signal import numba @numba.njit(p...
gpl-3.0
sirex/jsontableschema-pandas-py
tableschema_pandas/storage.py
1
4592
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import six import collections import tableschema import pandas as pd from .mapper import Mapper # Module API class Storage(tableschema.Storage)...
lgpl-3.0
js7558/pyBinance
tests/test-createOrder.py
1
4354
#!/usr/bin/python import pandas as pd import sys sys.path.append('../') from Binance import Binance import logging.config import logging.handlers import logging import os # this logging configuration is sketchy binance = logging.getLogger(__name__) logging.config.fileConfig('logging.ini') # create Binance object b...
mit
iZehan/spatial-pbs
setup.py
1
4732
""" Created on 21 May 2014 @author: Zehan Wang Copyright (C) Zehan Wang 2011-2014 and onwards Library for patch-based segmentation with spatial context. (Spatially Aware Patch-based Segmentation) """ import sys import os import shutil from distutils.command.clean import clean as Clean DISTNAME = 'spatch' DESCRIPTIO...
bsd-3-clause
rexthompson/axwx
axwx/wu_metadata_scraping.py
1
5613
""" Weather Underground PWS Metadata Scraping Module Code to scrape PWS network metadata """ import pandas as pd import urllib3 from bs4 import BeautifulSoup as BS import numpy as np import requests # import time def scrape_station_info(state="WA"): """ A script to scrape the station information published ...
mit
deepfield/ibis
ibis/pandas/execution/tests/test_cast.py
1
3838
import pytest import decimal import pandas as pd import pandas.util.testing as tm # noqa: E402 import ibis.expr.datatypes as dt # noqa: E402 import ibis pytestmark = pytest.mark.pandas @pytest.mark.parametrize('from_', ['plain_float64', 'plain_int64']) @pytest.mark.parametrize( ('to', 'expected'), [ ...
apache-2.0
amandalund/openmc
openmc/plotter.py
6
38919
from itertools import chain from numbers import Integral, Real import string import numpy as np import openmc.checkvalue as cv import openmc.data # Supported keywords for continuous-energy cross section plotting PLOT_TYPES = ['total', 'scatter', 'elastic', 'inelastic', 'fission', 'absorption', 'capture...
mit
per-andersen/Deltamu
Visualisation.py
1
30055
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.patheffects as patheffects from matplotlib.font_manager import FontProperties from mpl_toolkits.mplot3d import axes3d import pickle as pick import Contour import Deltamu ''' Program to analyse and plot output from...
gpl-3.0
askielboe/JAVELIN
examples/demo.py
1
13965
#Last-modified: 08 Dec 2013 15:54:47 import numpy as np import matplotlib.pyplot as plt from javelin.predict import PredictSignal, PredictRmap, generateLine, generateError, PredictSpear from javelin.lcio import * from javelin.zylc import LightCurve, get_data from javelin.lcmodel import Cont_Model, Rmap_Model, Pmap_Mode...
gpl-2.0
bzero/statsmodels
statsmodels/tsa/tests/test_stattools.py
26
12110
from statsmodels.compat.python import lrange from statsmodels.tsa.stattools import (adfuller, acf, pacf_ols, pacf_yw, pacf, grangercausalitytests, coint, acovf, arma_order_select_...
bsd-3-clause
Huyuwei/tvm
nnvm/tutorials/from_mxnet.py
2
5160
# 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 u...
apache-2.0
DiamondLightSource/auto_tomo_calibration-experimental
old_code_scripts/measure_resolution/lmfit-py/doc/sphinx/numpydoc/docscrape_sphinx.py
154
7759
import re, inspect, textwrap, pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): self.use_plots = config.get('use_plots', False) NumpyDocString.__init__(self, docstring, config=config) ...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/io/tests/parser/python_parser_only.py
7
7755
# -*- coding: utf-8 -*- """ Tests that apply specifically to the Python parser. Unless specifically stated as a Python-specific issue, the goal is to eventually move as many of these tests out of this module as soon as the C parser can accept further arguments when parsing. """ import csv import sys import nose impo...
gpl-3.0
michaelaye/scikit-image
doc/examples/plot_local_binary_pattern.py
17
6774
""" =============================================== Local Binary Pattern for texture classification =============================================== In this example, we will see how to classify textures based on LBP (Local Binary Pattern). LBP looks at points surrounding a central point and tests whether the surroundin...
bsd-3-clause
themrmax/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
43
26651
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from numpy.testing import run_module_suite from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from...
bsd-3-clause
MartinThoma/algorithms
ML/movielens-20m/ml-20m/movies_analysis.py
1
2395
from collections import Counter from itertools import combinations import clana.io import clana.visualize_cm import networkx as nx import numpy as np import pandas as pd import progressbar # Load the data df = pd.read_csv("movies.csv") df["genres"] = df["genres"].str.split("|") # Analyze the data list_values = [valu...
mit
shenzebang/scikit-learn
sklearn/utils/tests/test_sparsefuncs.py
157
13799
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.datasets import make_classification from sklearn.utils.sparsefuncs import (mean_variance_axis, inplace_column_scale, ...
bsd-3-clause
andrewnc/scikit-learn
sklearn/datasets/lfw.py
141
19372
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
bsd-3-clause
MyRookie/SentimentAnalyse
venv/lib/python2.7/site-packages/nltk/probability.py
3
89919
# -*- coding: utf-8 -*- # Natural Language Toolkit: Probability and Statistics # # Copyright (C) 2001-2015 NLTK Project # Author: Edward Loper <edloper@gmail.com> # Steven Bird <stevenbird1@gmail.com> (additions) # Trevor Cohn <tacohn@cs.mu.oz.au> (additions) # Peter Ljunglöf <peter.ljung...
mit
RichardTMR/homework
week3/Codelab2/tool_show_size.py
1
1681
import tensorflow as tf import matplotlib.pyplot as plt import tools cat = plt.imread('cat.jpg') #unit8 plt.imshow(cat) cat = tf.cast(cat, tf.float32) #[360, 300, 3] x = tf.reshape(cat, [1, 360, 300, 3]) #[1, 360, 300, 3] # First conv with tf.variable_scope('conv1'): w = tools.weight([3,3,3,16], is_uniform=True)...
apache-2.0
kyleabeauchamp/HMCNotes
code/correctness/run_samples_grid_ljbox.py
1
3519
import lb_loader import pandas as pd import simtk.openmm.app as app import numpy as np import simtk.openmm as mm from simtk import unit as u from openmmtools import hmc_integrators, testsystems from collections import OrderedDict def get_grid(sysname, temperature, timestep, langevin_timestep, groups, steps_per_hmc=100...
gpl-2.0
bchappet/dnfpy
src/dnfpy/cellular/rsdnf2LayerConvolutionTest.py
1
5065
from dnfpy.core.constantMap import ConstantMap import unittest import numpy as np import dnfpy.view.staticViewMatplotlib as view from dnfpy.cellular.rsdnf2LayerConvolution import Rsdnf2LayerConvolution import matplotlib.pyplot as plt class Rsdnf2LayerConvolutionTest(unittest.TestCase): def setUp(self): ...
gpl-2.0
muxiaobai/CourseExercises
python/kaggle/learn/RandomForestRegressor.py
1
2390
#!/usr/bin/python # -*- coding: UTF-8 -*- #https://www.kaggle.com/dansbecker/random-forests # vary trees import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_absolute_error from sklearn.metrics import mean_squared_error from sklearn.model_selection import train_test_sp...
gpl-2.0
live-clones/dolfin-adjoint
examples/time-distributed-control/time-distributed-control.py
1
6656
#!/usr/bin/env python # -*- coding: utf-8 -*- # .. _klein: # # .. py:currentmodule:: dolfin_adjoint # # Time-distributed controls # ========================= # # .. sectionauthor:: Simon W. Funke <simon@simula.no> # # # Background # ********** # Some time-dependent problems have control variables that are distributed ...
lgpl-3.0
lnls-fac/apsuite
apsuite/dynap/dynap_xy.py
1
10945
"""Calculate dynamic aperture.""" import numpy as _np import matplotlib.pyplot as _mpyplot import matplotlib.gridspec as _mgridspec import matplotlib.colors as _mcolors import matplotlib.text as _mtext import pyaccel.tracking as _pytrack from .base import BaseClass as _BaseClass class DynapXYParams(): """."""...
mit
jmmease/pandas
pandas/core/algorithms.py
6
51528
""" Generic data algorithms. This module is experimental at the moment and not intended for public consumption """ from __future__ import division from warnings import warn, catch_warnings import numpy as np from pandas.core.dtypes.cast import maybe_promote from pandas.core.dtypes.generic import ( ABCSeries, ABCIn...
bsd-3-clause
Odingod/mne-python
mne/epochs.py
1
85604
"""Tools for working with epoched data""" # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # Denis Engemann <denis.engemann@gmail.com> # Mainak Jas <mainak@neuro...
bsd-3-clause
ual/urbansim
urbansim/developer/developer.py
1
10647
import pandas as pd import numpy as np class Developer(object): """ Pass the dataframe that is returned by feasibility here Can also be a dictionary where keys are building forms and values are the individual data frames returned by the proforma lookup routine. """ def __init__(self, feasib...
bsd-3-clause
vkscool/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/collections.py
69
39876
""" Classes for the efficient drawing of large collections of objects that share most properties, e.g. a large number of line segments or polygons. The classes are not meant to be as flexible as their single element counterparts (e.g. you may not be able to select all line styles) but they are meant to be fast for com...
gpl-3.0
rubikloud/scikit-learn
sklearn/metrics/__init__.py
214
3440
""" The :mod:`sklearn.metrics` module includes score functions, performance metrics and pairwise metrics and distance computations. """ from .ranking import auc from .ranking import average_precision_score from .ranking import coverage_error from .ranking import label_ranking_average_precision_score from .ranking imp...
bsd-3-clause