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
JonasWallin/BayesFlow
setup.py
1
2957
# -*- coding: utf-8 -*- try: from setuptools import setup, Extension except ImportError: try: from setuptools.core import setup, Extension except ImportError: from distutils.core import setup, Extension import platform def is_numpy_installed(): try: import numpy except ImportError: return False return...
gpl-2.0
kaichogami/scikit-learn
examples/linear_model/plot_ols.py
104
1936
#!/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
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/computation/expressions.py
14
8135
""" Expressions ----------- Offer fast expression evaluation through numexpr """ import warnings import numpy as np from pandas.core.common import _values_from_object from distutils.version import LooseVersion try: import numexpr as ne ver = ne.__version__ _NUMEXPR_INSTALLED = ver >= LooseVersion('2.1')...
artistic-2.0
RapidApplicationDevelopment/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py
30
3738
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
debsankha/bedtime-programming
monte_carlo/montecarlo_visual.py
2
2794
#import numpy as np from random import uniform from math import * from visual import * #let's first calculate the initial Energy ### Here J is taken to be negative only because the expression of energy does not have a -ve sign in this program J=-1.0 #k=1.0 t=10 F=-0.1 beta=1/t print 't is\t',t #the size of the lattic...
gpl-3.0
AngLi-Leon/peloton
test/altertable/testAlterTable.py
1
6698
#!/usr/bin/env python from __future__ import print_function import os import sys import argparse import time import numpy as np import matplotlib.pyplot as plt import string from genTable import * peloton_command = "psql \"sslmode=disable\" -U postgres -h localhost" postgres_command = "sudo -u postgres psql" def...
apache-2.0
hesseltuinhof/mxnet
python/mxnet/model.py
2
39119
# pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, too-many-lines # pylint: disable=too-many-branches, too-many-statements """MXNet model module""" from __future__ import absolute_import, print_function import time import logging import warnings from collections import namedtuple import numpy ...
apache-2.0
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/_build_utils/__init__.py
80
2644
""" Utilities useful during the build. """ # author: Andy Mueller, Gael Varoquaux # license: BSD from __future__ import division, print_function, absolute_import import os from distutils.version import LooseVersion from numpy.distutils.system_info import get_info DEFAULT_ROOT = 'sklearn' CYTHON_MIN_VERSION = '0.23...
bsd-3-clause
thilbern/scikit-learn
examples/missing_values.py
11
2679
""" ====================================================== Imputing missing values before building an estimator ====================================================== This example shows that imputing the missing values can give better results than discarding the samples containing any missing value. Missing values ca...
bsd-3-clause
yunfeilu/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
michaelld/gnuradio
gr-fec/python/fec/polar/channel_construction.py
7
4644
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation, Inc. # # 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) # any later version. # # GNU Radio is...
gpl-3.0
jstoxrocky/statsmodels
statsmodels/sandbox/panel/mixed.py
31
21019
""" Mixed effects models Author: Jonathan Taylor Author: Josef Perktold License: BSD-3 Notes ------ It's pretty slow if the model is misspecified, in my first example convergence in loglike is not reached within 2000 iterations. Added stop criteria based on convergence of parameters instead. With correctly specifi...
bsd-3-clause
matthew-tucker/mne-python
examples/stats/plot_cluster_stats_time_frequency_repeated_measures_anova.py
5
9282
""" ==================================================================== Mass-univariate twoway repeated measures ANOVA on single trial power ==================================================================== This script shows how to conduct a mass-univariate repeated measures ANOVA. As the model to be fitted assume...
bsd-3-clause
hyflashstar/gupiao
src/PairTrading.py
1
3953
# -*- coding: utf-8 -*- """ Created on Thu Aug 24 20:35:51 2017 @author: 53771 """ import re import pandas as pd import numpy as np import statsmodels.api as sm from arch.unitroot import ADF class PairTrading: def SSD(self,priceX,priceY): if priceX is None or priceY is None: print('缺少价格序列') ...
apache-2.0
robbymeals/scikit-learn
sklearn/metrics/__init__.py
52
3394
""" 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
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/matplotlib/tests/test_legend.py
9
9232
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import xrange try: # mock in python 3.3+ from unittest import mock except ImportError: import mock from nose.tools import assert_equal import numpy as np from matplotlib.t...
mit
tobikausk/nest-simulator
extras/ConnPlotter/tcd_nest.py
15
6952
# -*- coding: utf-8 -*- # # tcd_nest.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # ...
gpl-2.0
desihub/desispec
py/desispec/desi_proc_time_distribution.py
1
17603
import argparse import os,glob import astropy from astropy.io import fits from astropy.table import QTable,vstack import pandas as pd import time,datetime import numpy as np import psutil from os import listdir import matplotlib.pyplot as plt #import desispec.io as desi_io class DESI_PROC_TIME_DISTRIBUTION(object):...
bsd-3-clause
DLlearn/keras
examples/addition_rnn.py
50
5900
# -*- coding: utf-8 -*- from __future__ import print_function from keras.models import Sequential, slice_X from keras.layers.core import Activation, Dense, RepeatVector from keras.layers import recurrent from sklearn.utils import shuffle import numpy as np """ An implementation of sequence to sequence learning for per...
mit
andybrnr/QuantEcon.py
scripts/test-examples.py
2
2743
#!/usr/bin/python """ Test script for QuantEcon executables ===================================== examples/*.py solutions/*.ipynb This script uses a context manager to redirect stdout and stderr to capture runtime errors for writing to the log file. It also reports basic execution statistics on the command li...
bsd-3-clause
wetdesert/rad2py
psp2py/controllers/estimate.py
8
6937
# coding: utf8 # try something like from statistics import calc_correlation, calc_significance, calc_linear_regression, calc_student_t_probability, calc_prediction_interval from draws import draw_linear_regression def get_projects_metrics(): "Query size and time metrics series summarized by project" q = d...
gpl-3.0
brsaylor/atn-tools
atntools/convergenceprocess.py
1
9223
""" Automation for generating simulations for Convergence """ import os import glob import re import logging import copy from collections import OrderedDict, Counter import json import pprint import matplotlib.pyplot as plt from atntools import settings, util, simulation, nodeconfigs, foodwebs, plotting MAX_TIMESTE...
gpl-3.0
willettk/chile2015-gender
stacked_plots.py
1
8132
from __future__ import division from matplotlib import pyplot as plt import numpy as np plt.ion() import pandas as pd gencolors =('purple','orange') q = pd.read_csv('question_data.csv') c = pd.read_csv('chair_data.csv') fig = plt.figure(1,(12,6)) # Speakers vc_speakers = q['speaker'].value_counts() # Speakers qa=l...
mit
astocko/statsmodels
statsmodels/datasets/modechoice/data.py
25
3031
#! /usr/bin/env python # -*- coding: utf-8 -*- """Travel Mode Choice""" __docformat__ = 'restructuredtext' COPYRIGHT = """This is public domain.""" TITLE = __doc__ SOURCE = """ Greene, W.H. and D. Hensher (1997) Multinomial logit and discrete choice models in Greene, W. H. (1997) LIMDEP version 7.0 user's manual rev...
bsd-3-clause
shangwuhencc/scikit-learn
sklearn/svm/tests/test_sparse.py
70
12992
from nose.tools import assert_raises, assert_true, assert_false import numpy as np from scipy import sparse from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classif...
bsd-3-clause
ppmm/python-bits
crawler-bjjs.gov.cn.py
1
2935
#! /usr/bin/python3 # coding:utf-8 ''' 北京住房和城乡建设委员会官方网站数据获取; 网站主页为:http://www.bjjs.gov.cn/; ''' import requests import datetime from lxml import etree from pandas import DataFrame class BJRealEstate(): def __init__(self): self.BASE_URL = 'http://www.bjjs.gov.cn/' self.FYHYLB_BASE_URL = 'http://2...
mit
ybalgir/Quantop
Lec3.py
1
6221
#NumPy adds support for multi-dimensional arrays and mathematical functions that allow you #to easily perform linear algebra calculations. import numpy as np import matplotlib.pyplot as plt stock_list = [3.5, 5, 2.0, 8, 4.2] returns = np.array(stock_list) my_Array1 = [[1,2],[3,4],[5,6]] my_NpArray1 = np.array(my_Arr...
gpl-3.0
blond-admin/BLonD
blond/llrf/signal_processing.py
2
16557
# coding: utf8 # Copyright 2014-2017 CERN. This software is distributed under the # terms of the GNU General Public Licence version 3 (GPL Version 3), # copied verbatim in the file LICENCE.md. # In applying this licence, CERN does not waive the privileges and immunities # granted to it by virtue of its status as a...
gpl-3.0
alexis-roche/register
doc/sphinxext/numpy_ext/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) ...
bsd-3-clause
cxhernandez/msmbuilder
msmbuilder/tests/test_kernel_approximation.py
9
1158
from __future__ import absolute_import import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.kernel_approximation import Nystroem as NystroemR from msmbuilder.decomposition.kernel_approximation import Nystroem, LandmarkNystroem def test_nystroem_vs_sklearn(): np.random.seed(42) ...
lgpl-2.1
nicmcd/ratesim
parser/parser.py
1
9324
#!/usr/bin/env python3 import argparse import json import os if 'DISPLAY' not in os.environ or os.environ['DISPLAY'] == '': import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from CloseToOne import * from RawData import * import numpy def main(args): ######################################...
bsd-3-clause
redhat-openstack/rdo-infra
ci-scripts/infra-setup/roles/rrcockpit/files/telegraf/openstack_infra_status.py
2
1592
#!/usr/bin/env python import re from datetime import datetime import influxdb_utils import pandas as pd import requests from bs4 import BeautifulSoup infra_status_regexp = re.compile( '^ *([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) *UTC *(.+)$') infra_status_url = 'https://wiki.openstack.org/wiki/Inf...
apache-2.0
google-code-export/nmrglue
doc/_build/html/examples/el/integration/integrate_1d/integrate_1d.py
10
1417
#! /usr/bin/env python # Example scipt to show integration of a 1D spectrum import nmrglue as ng import numpy as np import matplotlib.pyplot as plt # read in the data from a NMRPipe file dic,data = ng.pipe.read("1d_data.ft") length = data.shape[0] # read in the integration limits peak_list = np.recfromtxt("limits.in...
bsd-3-clause
prabhamatta/Analyzing-Open-Data
notebooks/Day_17_Midterm_with_Answers.py
2
21670
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # *Working with Open Data* Midterm (March 18, 2014) # # There are **94** points in this exam: 2 each for the **47 questions**. The questions are either **multiple choice** or **short answers**. For **multiple choice**, just write the **number** o...
apache-2.0
mvnnn/tardis
tardis/conftest.py
5
5073
from astropy.tests.pytest_plugins import * def pytest_addoption(parser): parser.addoption("--remote-data", action="store_true", help="run tests with online data") parser.addoption("--open-files", action="store_true", help="fail if any test leaves files open") par...
bsd-3-clause
gfyoung/pandas
scripts/tests/test_validate_docstrings.py
4
12511
import io import textwrap import pytest import validate_docstrings class BadDocstrings: """Everything here has a bad docstring""" def private_classes(self): """ This mentions NDFrame, which is not correct. """ def prefix_pandas(self): """ Have `pandas` prefix in ...
bsd-3-clause
lbdreyer/cartopy
lib/cartopy/tests/mpl/test_caching.py
1
8343
# (C) British Crown Copyright 2011 - 2012, Met Office # # This file is part of cartopy. # # cartopy 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)...
lgpl-3.0
clingsz/GAE
main.py
1
1502
# -*- coding: utf-8 -*- """ Created on Wed May 10 12:38:40 2017 @author: cling """ def summarizing_cross_validation(): import misc.cv.collect_ND5_3 as cv cv.fig_boxplot_cverr() def test_trainer(): import misc.data_gen as dg import gae.model.trainer as tr data = dg.get_training_data() ...
gpl-3.0
yanlend/scikit-learn
examples/manifold/plot_compare_methods.py
259
4031
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/mpl_examples/pylab_examples/fonts_demo_kw.py
12
2091
#!/usr/bin/env python """ Same as fonts_demo using kwargs. If you prefer a more pythonic, OO style of coding, see examples/fonts_demo.py. """ from matplotlib.font_manager import FontProperties from pylab import * subplot(111, axisbg='w') alignment = {'horizontalalignment':'center', 'verticalalignment':'baseline'} ##...
mit
adiIspas/Machine-Learning_A-Z
Machine Learning A-Z/Part 9 - Dimensionality Reduction/Section 45 - Kernel PCA/kernel_pca.py
5
2844
# Kernel PCA # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Social_Network_Ads.csv') X = dataset.iloc[:, [2, 3]].values y = dataset.iloc[:, 4].values # Splitting the dataset into the Training set and Test set from sklear...
mit
kyleam/pymc3
pymc/tests/test_plots.py
2
1714
import matplotlib matplotlib.use('Agg', warn=False) import numpy as np from .checks import close_to import pymc.plots from pymc.plots import * from pymc import Slice, Metropolis, find_hessian, sample def test_plots(): # Test single trace from pymc.examples import arbitrary_stochastic as asmod with asm...
apache-2.0
arahuja/scikit-learn
sklearn/neighbors/tests/test_kde.py
13
5622
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
neale/CS-program
434-MachineLearning/final_project/linearClassifier/sklearn/utils/tests/test_linear_assignment.py
421
1349
# Author: Brian M. Clapper, G Varoquaux # License: BSD import numpy as np # XXX we should be testing the public API here from sklearn.utils.linear_assignment_ import _hungarian def test_hungarian(): matrices = [ # Square ([[400, 150, 400], [400, 450, 600], [300, 225, 300]], ...
unlicense
lucaslugao/artOptimal
src/verificationTool.py
1
1789
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: lugao """ import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm def build(instructions, w, h): np.random.seed(w*h) v = np.zeros((h,w), dtype = np.int32) for l in instructions: lsplit = l.split(',') x = int(l...
mit
libsmelt/libsmelt
scripts/plotsetup.py
1
1425
from matplotlib import rc import matplotlib matplotlib.rcParams['text.latex.preamble']=[""] params = {#'text.usetex' : False, 'font.size' : 15, 'font.family' : 'sans-serif', #'text.latex.unicode': True, } matplotlib.rcParams.update(params) matplotlib.rc('xtick', labelsize=15) m...
mit
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Coupled_Contact/Steady_State_Single_Foundation_Sysytem_Under_Tension/CoupledSoftContact_NonLinHardShear/n_0.3/Plot_Results.py
15
3554
#!/usr/bin/env python #!/usr/bin/python import h5py from matplotlib import pylab import matplotlib.pylab as plt import sys from matplotlib.font_manager import FontProperties import math import numpy as np #!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as ...
cc0-1.0
amaurywalbert/twitter
graphs_examples/pyGraph.py
2
1839
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyGraph # # Copyright 2014 Leandro <Leandro@leandrowar> # import networkx as nx import matplotlib.pyplot as plt #A entrada do grafo deve ser um array com as conexões da rede graph = [ ('Green Bay Packers','Miami'), ('New York Jets','Miami'), ('Baltimore Col...
gpl-3.0
michigraber/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
jmetzen/scikit-learn
examples/linear_model/plot_robust_fit.py
26
2701
""" Robust linear estimator fitting =============================== Here a sine function is fit with a polynomial of order 3, for values close to zero. Robust fitting is demoed in different situations: - No measurement errors, only modelling errors (fitting a sine with a polynomial) - Measurement errors in X - M...
bsd-3-clause
bloody76/pyLDAvis
docs/conf.py
7
8806
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyLDAvis documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # au...
bsd-3-clause
WangWenjun559/Weiss
summary/sumy/sklearn/datasets/base.py
196
18554
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause import os import csv import shutil from os import environ from os.pa...
apache-2.0
koorukuroo/networkx_for_unicode
build/lib/networkx/readwrite/tests/test_gml.py
9
4408
#!/usr/bin/env python # encoding: utf-8 from __future__ import unicode_literals import io from nose.tools import * from nose import SkipTest import networkx class TestGraph(object): @classmethod def setupClass(cls): global pyparsing try: import pyparsing except ImportError:...
bsd-3-clause
chaubold/hytra
scripts/error_visualisation.py
1
7025
from __future__ import print_function, absolute_import, nested_scopes, generators, division, with_statement, unicode_literals import numpy as np import logging import configargparse as argparse import glob from skimage.external import tifffile import matplotlib.pyplot as plt import matplotlib from math import ceil impo...
mit
Vimos/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
hiteshagrawal/python
public-data/food.py
1
2326
#!/usr/bin/python import csv, pandas from collections import Counter #fh = open('food.csv','r') with open('food.csv','r') as fh: records = list(csv.DictReader(fh)) print type(records) print len(records) #fh.close() ## Find out the number of restaurant which passed ,failed the food test passed = [pass1 for pass1 in ...
gpl-2.0
hsiaoyi0504/scikit-learn
sklearn/cluster/tests/test_affinity_propagation.py
341
2620
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
bsd-3-clause
toobaz/pandas
pandas/tests/frame/test_sorting.py
2
26264
import random import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, IntervalIndex, MultiIndex, NaT, Series, Timestamp, date_range, ) from pandas.api.types import CategoricalDtype from pandas.tests.frame.common import TestData import pandas.ut...
bsd-3-clause
rishikksh20/scikit-learn
sklearn/ensemble/tests/test_base.py
33
5168
""" Testing for the base module (sklearn.ensemble.base). """ # Authors: Gilles Louppe # License: BSD 3 clause import numpy as np from numpy.testing import assert_equal from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_not_equal from sklearn.utils.testing import assert_tr...
bsd-3-clause
aiguofer/bokeh
scripts/interactive_tester.py
6
9332
from __future__ import print_function import argparse import importlib import os from shutil import rmtree from six.moves import input import sys import textwrap import time import json # TODO: # catch and log exceptions in examples files that fail to open DIRECTORIES = { 'plotting-file' : '../../example...
bsd-3-clause
kfoss/keras
tests/manual/check_callbacks.py
82
7540
import numpy as np import random import theano from keras.models import Sequential from keras.callbacks import Callback from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.regularizers import l2 from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.utils import np_utils...
mit
petosegan/scikit-learn
examples/mixture/plot_gmm_pdf.py
284
1528
""" ============================================= Density Estimation for a mixture of Gaussians ============================================= Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices. """ import numpy as np import ma...
bsd-3-clause
mdrumond/tensorflow
tensorflow/contrib/learn/__init__.py
42
2596
# 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
jorge2703/scikit-learn
benchmarks/bench_sgd_regression.py
283
5569
""" Benchmark for SGD regression Compares SGD regression against coordinate descent and Ridge on synthetic data. """ print(__doc__) # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD 3 clause import numpy as np import pylab as pl import gc from time import time from sklearn.linear_model i...
bsd-3-clause
spbguru/repo1
external/linux32/lib/python2.6/site-packages/matplotlib/lines.py
69
48233
""" This module contains all the 2D line class which can draw with a variety of line styles, markers and colors. """ # TODO: expose cap and join style attrs from __future__ import division import numpy as np from numpy import ma from matplotlib import verbose import artist from artist import Artist from cbook import ...
gpl-3.0
Solid-Mechanics/matplotlib-4-abaqus
mpl_toolkits/mplot3d/axes3d.py
4
83550
#!/usr/bin/python # axes3d.py, original mplot3d version by John Porter # Created: 23 Sep 2005 # Parts fixed by Reinier Heeres <reinier@heeres.eu> # Minor additions by Ben Axelrod <baxelrod@coroware.com> # Significant updates and revisions by Ben Root <ben.v.root@gmail.com> """ Module containing Axes3D, an object which...
mit
dbednarski/pyhdust
pyhdust/interftools.py
1
48126
#-*- coding:utf-8 -*- """ PyHdust *interftools* module: interferometry tools `colors` keep the *amdlib* standard. A biblioteca python XDRLIB eh MUITO lenta... Usa muitas listas!!! >>> import xdrlib A biblioteca PYDAP estah em desenvolvimento... Eh complicada de usar >>> from pydap.model import * >>> from pydap.x...
gpl-3.0
megahertz0/tusharedemo
base.py
1
2877
# -*- coding: utf-8 -*- """ Created on Wed Feb 15 12:34:11 2017 @author: megahertz """ import pandas as pd import traceback import sys import os OUTPUT_DIR = './output/' STOCK_DATA_DIR = OUTPUT_DIR + 'kdata/' MACD_FASTPERIOD=12 MACD_SLOWPERIOD=26 MACD_SIGNALPERIOD=9 MA_FAST = 5 MA_MIDDLE = 10 MA_SLOW = 20 class U...
lgpl-3.0
zihua/scikit-learn
sklearn/tests/test_metaestimators.py
52
4990
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.pipeline import Pipeline...
bsd-3-clause
eladnoor/optslope
scripts/fba.py
1
4485
#!/usr/bin/python from copy import deepcopy import matplotlib.pyplot as plt from src.analysis_toolbox import plot_multi_PPP from src import models from src.optknock import OptKnock from src.html_writer import HtmlWriter def main(): main_html = HtmlWriter('res/fba.html') main_html.write('<h1>Flux Balance Anal...
mit
epfl-lts2/pygsp
pygsp/graphs/_io.py
1
20943
# -*- coding: utf-8 -*- import os import numpy as np def _import_networkx(): try: import networkx as nx except Exception as e: raise ImportError('Cannot import networkx. Use graph-tool or try to ' 'install it with pip (or conda) install networkx. ' ...
bsd-3-clause
ilo10/scikit-learn
sklearn/feature_extraction/text.py
110
50157
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Robert Layton <robertlayton@gmail.com> # Jochen Wersdörfer <jochen@wersdoerfer.de> # Roman Sinayev <roman.sinayev@gma...
bsd-3-clause
compops/gpo-abc2015
scripts-paper/example1-gposmc.py
2
5416
############################################################################## ############################################################################## # Estimating the volatility of synthetic data # using a stochastic volatility (SV) model with Gaussian log-returns. # # The SV model is inferred using the GP...
mit
jrderuiter/pybiomart
src/pybiomart/server.py
1
3017
from __future__ import absolute_import, division, print_function # pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import from builtins import * # pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import from xml.etree.ElementTree import fromstring as xml_from_string import pandas as...
mit
flaviovdf/pyksc
src/pyksc/trend.py
1
1228
#-*- coding: utf8 import _trend from sklearn.base import BaseEstimator from sklearn.base import ClassifierMixin import numpy as np class TrendLearner(BaseEstimator, ClassifierMixin): def __init__(self, num_steps, gamma=1): self.num_steps = num_steps self.gamma = gamma self.num_labels = ...
bsd-3-clause
jminyu/PatternRecognition_library
Pattern_Recognition_lib.py
1
2816
#__Author = 'Jongmin Yu' @ Ph.D Candidate @ GIST-MLV #__Laboratory of Machine Learning and Computer Vision # #--Title.Gaussian probability density function for image file #__data format = numpy # from math import sqrt from parser import st2list import matplotlib __author__ = 'Schmitz' from matplotlib import pyplot a...
gpl-3.0
murali-munna/scikit-learn
examples/model_selection/randomized_search.py
201
3214
""" ========================================================================= Comparing randomized search and grid search for hyperparameter estimation ========================================================================= Compare randomized search and grid search for optimizing hyperparameters of a random forest. ...
bsd-3-clause
jviada/QuantEcon.py
quantecon/tests/tests_models/tests_solow/test_model.py
7
5514
""" Test suite for solow module. @author : David R. Pugh @date : 2014-11-27 """ from __future__ import division import nose import matplotlib.pyplot as plt import numpy as np import sympy as sym from .... models import solow # declare key variables for the model A, E, k, K, L = sym.symbols('A, E, k, K, L') # decl...
bsd-3-clause
sinomiko/project
IdeaProjects/PandasProj/PandasCourse5.py
1
9510
# encoding: utf-8 import pandas as pd import numpy as np # 1.2 实验知识点 # # 时间戳 Timestamp # 时间索引 DatetimeIndex # 时间转换 to_datatime # 时间序列检索 # 时间序列计算 # 二、时间序列分析介绍 # # 2.1 简介 # # 时间序列(英语:time series)是实证经济学的一种统计方法,它是采用时间排序的一组随机变量,国内生产毛额(GDP)、消费者物价指数(CPI)、股价指数、利率、汇率等等都是时间序列。时间序列的时间间隔可以是分秒(如高频金融数据),可以是日、周、月、季度、年、甚至更大的时间单位。...
bsd-3-clause
JoshuaMichaelKing/Stock-SentimentAnalysis
correlation.py
1
7514
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division import os, sys import datetime as dt from math import sqrt import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter, MaxNLocator import iohel...
mit
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/datasets/svmlight_format.py
1
16064
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
mit
mcdeaton13/dynamic
Python/dynamic/demographics.py
2
18580
''' ------------------------------------------------------------------------ Last updated 7/13/2015 Functions for generating omega, the T x S array which describes the demographics of the population This py-file calls the following other file(s): utils.py data\demographic\demographic_data.csv ...
mit
jjo31/ATHAM-Fluidity
tests/mms_sediment/function_printer.py
4
1117
from mms_sediment_tools import * from numpy import * import matplotlib import matplotlib.pyplot as plt import sys ''' run using: python function_printer.py AA BB CC DD .. n_rows where: AA, BB, CC, DD are names of functions in mms_rans_p2p1_keps_tools.py (any number can be entered) n_rows is the number of rows to dis...
lgpl-2.1
voxlol/scikit-learn
sklearn/tree/tests/test_export.py
76
9318
""" Testing for export functions of decision trees (sklearn.tree.export). """ from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor from sklearn.tree import export_graphviz from sklearn.externals.six import StringIO # toy sa...
bsd-3-clause
RecipeML/Recipe
utils/partitionpy/partitioning.py
1
3339
# -*- coding: utf-8 -*- import sys import arff from os import listdir import os import pandas as pd import numpy as np from sklearn.model_selection import StratifiedKFold import progress def to_csv(filename): data = arff.load(open(filename, 'rb')) name = filename.strip().split('.')[0] header = ','.join(str(x...
gpl-3.0
sirrice/pyplot
pygg/pygg.py
2
26233
""" run the following for help python bin/runpygg.py --help """ import os import re import subprocess import csv import tempfile import pandas quote1re = re.compile('"') quote2re = re.compile("'") R_IMAGE_SIZE = 7 # in inches IPYTHON_IMAGE_SIZE = 800 # in pixels def esc(mystr): """Escape string...
mit
rougier/Neurosciences
superior-colliculus/taouali-et-at-2014/fig-single-stimuli.py
1
3406
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright INRIA # Contributors: Wahiba Taouali (Wahiba.Taouali@inria.fr) # Nicolas P. Rougier (Nicolas.Rougier@inria.fr) # # This software is governed by the CeCILL license under French law and abidin...
bsd-3-clause
markslwong/tensorflow
tensorflow/examples/learn/mnist.py
45
3999
# 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
yuanagain/seniorthesis
venv/lib/python2.7/site-packages/matplotlib/markers.py
8
26608
""" This module contains functions to handle markers. Used by both the marker functionality of `~matplotlib.axes.Axes.plot` and `~matplotlib.axes.Axes.scatter`. All possible markers are defined here: ============================== =============================================== marker descrip...
mit
BenW0/Ctrl_Design_GUI
dumpreader.py
1
7744
######################################################## # Control Design GUI: plotting.py # Handles plotting tasks for the GUI. # # This set of routines is called from actions on the GUI; # so the actual calling code is found in the machine.xml's # <Command> field. # # Ben Weiss, University of Washington # Spring 2014...
mit
jakobworldpeace/scikit-learn
sklearn/linear_model/sag.py
1
12700
"""Solvers for Ridge and LogisticRegression using SAG algorithm""" # Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # License: BSD 3 clause import warnings import numpy as np from .base import make_dataset from .sag_fast import sag from ..exceptions import ConvergenceWarning from ..utils import check_arra...
bsd-3-clause
shoeffner/cvloop
cvloop/cvloop.py
1
18252
"""Provides a videoloop to be used in jupyter notebooks. It automatically selects the notebook backend for matplotlib, if the default notebook backend (inline) is detected. """ import itertools from IPython.core.getipython import get_ipython from IPython.core.magics.pylab import PylabMagics import numpy as np impor...
mit
imaculate/scikit-learn
examples/bicluster/bicluster_newsgroups.py
142
7183
""" ================================================================ Biclustering documents with the Spectral Co-clustering algorithm ================================================================ This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset. The 'comp.os.ms-windows...
bsd-3-clause
ishanic/scikit-learn
sklearn/linear_model/tests/test_ridge.py
130
22974
import numpy as np import scipy.sparse as sp from scipy import linalg from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
KrisCheng/ML-Learning
archive/MOOC/Deeplearning_AI/ImprovingDeepNeuralNetworks/HyperparameterTuning/Tensorflow+Tutorial.py
1
37910
# coding: utf-8 # # TensorFlow Tutorial # # Welcome to this week's programming assignment. Until now, you've always used numpy to build neural networks. Now we will step you through a deep learning framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, Paddle...
mit
lucidfrontier45/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
4
2866
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD-style. from random import Random import numpy as np import scipy.sparse as sp from nose.tools import assert_equal from nose.tools import assert_true from nose.tools import assert_false from numpy.testing import assert_array_equal from sklearn.feature_extra...
bsd-3-clause
Ninjakow/TrueSkill
lib/numpy/core/fromnumeric.py
22
98126
"""Module containing non-deprecated functions borrowed from Numeric. """ from __future__ import division, absolute_import, print_function import types import warnings import numpy as np from .. import VisibleDeprecationWarning from . import multiarray as mu from . import umath as um from . import numerictypes as nt ...
gpl-3.0
wzhfy/spark
python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py
1
20739
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
calico/basenji
bin/basenji_predict.py
1
8002
#!/usr/bin/env python # Copyright 2017 Calico 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 ...
apache-2.0
admcrae/tensorflow
tensorflow/python/estimator/inputs/queues/feeding_queue_runner_test.py
116
5164
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0