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
morrellk/openelections-data-or
src/progress.py
1
3077
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2017 Nick Kocharhook # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including...
mit
indhub/mxnet
example/named_entity_recognition/src/preprocess.py
10
2002
# !/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
apache-2.0
clemkoa/scikit-learn
benchmarks/bench_mnist.py
45
6977
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
marcusmueller/gnuradio
gnuradio-runtime/examples/volk_benchmark/volk_plot.py
6
6198
#!/usr/bin/env python from __future__ import division from __future__ import unicode_literals import sys, math import argparse from volk_test_funcs import * try: import matplotlib import matplotlib.pyplot as plt except ImportError: sys.stderr.write("Could not import Matplotlib (http://matplotlib.sourcefor...
gpl-3.0
krez13/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
lazywei/scikit-learn
examples/gaussian_process/gp_diabetes_dataset.py
223
1976
#!/usr/bin/python # -*- coding: utf-8 -*- """ ======================================================================== Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset ======================================================================== In this example, we fit a Gaussian Process model onto...
bsd-3-clause
466152112/scikit-learn
examples/cluster/plot_kmeans_digits.py
230
4524
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example we compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the gr...
bsd-3-clause
NYU-CAL/Disco
Python/floopAnalysis.py
1
1101
import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import discopy.util as util import discopy.geom as geom def analyzeSingle(filename): opts = util.loadOpts(filename) pars = util.loadPars(filename) print("Loading " + filename) t, x1, x2, x3, prim, dat = util.loadChe...
gpl-3.0
yavalvas/yav_com
build/matplotlib/lib/matplotlib/artist.py
11
41588
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import re import warnings import inspect import matplotlib import matplotlib.cbook as cbook from matplotlib import docstring, rcParams from .transforms import Bbox, IdentityTransform, TransformedBbo...
mit
dkainer/pyms
Display/Class.py
7
10046
""" Class to Display Ion Chromatograms and TIC """ ############################################################################# # # # PyMS software for processing of metabolomic mass-spectrometry data # # Copyright (C) 2005-2012 Vladi...
gpl-2.0
cogstat/cogstat
cogstat/cogstat_dialogs.py
1
35802
# -*- coding: utf-8 -*- import gettext import os from PyQt5 import QtWidgets, QtCore, QtGui from . import cogstat_config as csc QString = str t = gettext.translation('cogstat', os.path.dirname(os.path.abspath(__file__))+'/locale/', [csc.language], fallback=True) _ = t.gettext # Overwrite the qt _translate function...
gpl-3.0
precedenceguo/mxnet
example/reinforcement-learning/ddpg/strategies.py
42
2473
# 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
zheminzhou/GrapeTree
simulations/plot_sens_pre.py
2
1747
import numpy as np from numpy import median import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import matplotlib.lines as mlines import pandas as pd import collections import sys sum_file = sys.argv[1] df = pd.read_csv(sum_file,header=None,sep='\t') df = df[df[4] <= 0.007] #del df[4] #colors =...
gpl-3.0
jseabold/statsmodels
examples/python/quantile_regression.py
5
4049
# coding: utf-8 # DO NOT EDIT # Autogenerated from the notebook quantile_regression.ipynb. # Edit the notebook and then sync the output with this file. # # flake8: noqa # DO NOT EDIT # # Quantile regression # # This example page shows how to use ``statsmodels``' ``QuantReg`` class # to replicate parts of the analysi...
bsd-3-clause
gticket/scikit-neuralnetwork
docs/conf.py
5
1814
# -*- coding: utf-8 -*- # # scikit-neuralnetwork documentation build configuration file, created by # sphinx-quickstart on Tue Mar 31 20:28:10 2015. import sys import os project = u'scikit-neuralnetwork' copyright = u'2015, scikit-neuralnetwork developers (BSD License)' # -- Configuration of documentation --------...
bsd-3-clause
apdjustino/urbansim
urbansim/models/transition.py
4
17258
""" Use the ``TransitionModel`` class with the different transitioners to add or remove agents based on growth rates or target totals. """ from __future__ import division import logging import numpy as np import pandas as pd from . import util from ..utils.logutil import log_start_finish from ..utils.sampling impor...
bsd-3-clause
BinRoot/TensorFlow-Book
ch09_cnn/conv_visuals.py
1
1920
import numpy as np import matplotlib.pyplot as plt import cifar_tools import tensorflow as tf names, data, labels = \ cifar_tools.read_data('/home/binroot/res/cifar-10-batches-py') def show_conv_results(data, filename=None): plt.figure() rows, cols = 4, 8 for i in range(np.shape(data)[3]): im...
mit
areeda/gwpy
examples/frequencyseries/transfer_function.py
3
2451
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2014-2020) # # This file is part of GWpy. # # GWpy 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,...
gpl-3.0
chase-qi/workload-automation
wlauto/instrumentation/energy_model/__init__.py
2
42026
# Copyright 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 writin...
apache-2.0
garibaldu/radioblobs
other_scores/kl3.py
1
2900
import sys import numpy as np, numpy.random as rng import pylab as pl, matplotlib.cm as cm def do_exit(): print ('usage: python %s [image_size num_sources noise_size output_image_name]' % (sys.argv[0])) sys.exit('eg: python %s 100 3 2.0 mytestimage' % (sys.argv[0])) def calc_score_everywhere(model_sigma)...
gpl-2.0
EducationalTestingService/rsmtool
tests/test_utils_prmse.py
1
11698
import os import warnings from pathlib import Path import numpy as np import pandas as pd from nose.tools import assert_almost_equal, eq_, ok_, raises from numpy.testing import assert_array_equal from pandas.testing import assert_frame_equal from rsmtool.utils.prmse import (get_n_human_scores, ...
apache-2.0
sunzhxjs/JobGIS
lib/python2.7/site-packages/pandas/io/tests/test_json/test_ujson.py
9
54415
# -*- coding: utf-8 -*- from unittest import TestCase try: import json except ImportError: import simplejson as json import math import nose import platform import sys import time import datetime import calendar import re import decimal from functools import partial from pandas.compat import range, zip, Strin...
mit
gautam1858/tensorflow
tensorflow/tools/dist_test/python/census_widendeep.py
48
11896
# 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
Geertex/midioke
midiokeDOTexe.py
1
1777
# -*- coding: utf-8 -*- """ Created on a Sunday @author: G-man """ import pyaudio import wave import struct import math import matplotlib.pyplot as plt import numpy as np from midiutil import MIDIFile print("It is Recording.....") print("If you want to stop just press 'Ctrl + C' ") CHUNK = 4096 FORMAT = pyaudio.paIn...
gpl-3.0
mgarbanzo/radarphysics
simplecapons.py
1
2107
#!/usr/bin/python import numpy as np from scipy import fftpack, pi import matplotlib.pyplot as plt #Frequencies to be used in the signal freqs = 0.09, -0.2, 0.2, -0.3, 0.3, 0.08, -0.21, 0.22, -0.31, 0.32, 0.093, -0.24, 0.25, -0.34, 0.35, 0.098 time = np.arange(0,64,1) sgn = np.zeros_like(time)+np.zeros_like(time,com...
gpl-3.0
yan9yu/NWD
src/newwords.py
1
6475
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import division import re import os import math import config import pandas as pd from collections import Counter from collections import defaultdict __author__ = 'yan9yu' class NewWordsDetector: def __init__(self, content): self.content = content...
mit
rougier/Neurosciences
superior-colliculus/taouali-et-at-2014/fig-accuracy.py
1
3999
#!/usr/bin/env python # -*- 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...
bsd-3-clause
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/learn/python/learn/learn_io/__init__.py
42
2656
# 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...
mit
nelango/ViralityAnalysis
model/lib/pandas/core/strings.py
9
50351
import numpy as np from pandas.compat import zip from pandas.core.common import (isnull, _values_from_object, is_bool_dtype, is_list_like, is_categorical_dtype, is_object_dtype, take_1d) import pandas.compat as compat from pandas.core.base import AccessorProperty, NoNewAttributesMixin f...
mit
wright-group/WrightTools
tests/artists/test_pcolor.py
1
1139
#! /usr/bin/env python3 import WrightTools as wt from WrightTools import datasets from matplotlib import pyplot as plt import shutil import os def test_pcolor(): p = datasets.wt5.v1p0p1_MoS2_TrEE_movie p = shutil.copy(p, "./test_pcolor.wt5") data = wt.open(p) os.unlink(p) data.level(0, 2, -3) ...
mit
lyuboshen/Pose-Estimation-on-Depth-Images-of-Clinical-Patients-V2.0
src/test.py
1
6673
import cv2 import os import numpy as np import copy from openpyxl import Workbook from openpyxl import load_workbook import xlrd import xlwt import json image_rows = 424 image_cols = 512 data_path = 'images/trial_2/p3+5/middle/' image_prefix = 'p3s1d_' image_path = 'images/' label_path = 'annotations/' # depth_image...
mit
robbymeals/scikit-learn
sklearn/neighbors/tests/test_kd_tree.py
129
7848
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics import Dista...
bsd-3-clause
yl565/statsmodels
statsmodels/examples/ex_generic_mle.py
32
16462
from __future__ import print_function import numpy as np from scipy import stats import statsmodels.api as sm from statsmodels.base.model import GenericLikelihoodModel data = sm.datasets.spector.load() data.exog = sm.add_constant(data.exog, prepend=False) # in this dir probit_mod = sm.Probit(data.endog, data.exog) ...
bsd-3-clause
Canpio/Paddle
benchmark/paddle/image/plotlog.py
7
3298
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
bundgus/python-playground
matplotlib-playground/examples/event_handling/data_browser.py
3
2345
import numpy as np class PointBrowser(object): """ Click on a point to select and highlight it -- the data that generated the point will be shown in the lower axes. Use the 'n' and 'p' keys to browse through the next and previous points """ def __init__(self): self.lastind = 0 ...
mit
nwillemse/misc-scripts
ib-downloader/ib-downloader2.py
1
8772
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ ib-downloader.py Created on Tue Jul 5 15:53:45 2016 @author: nwillemse """ import click import time import pandas as pd from datetime import datetime from ib.ext.Contract import Contract from ib.opt import Connection class Downloader: def __init__( s...
mit
huzq/scikit-learn
examples/linear_model/plot_sgd_penalties.py
23
1405
""" ============== SGD: Penalties ============== Contours of where the penalty is equal to 1 for the three penalties L1, L2 and elastic-net. All of the above are supported by :class:`~sklearn.linear_model.SGDClassifier` and :class:`~sklearn.linear_model.SGDRegressor`. """ print(__doc__) import numpy as np import ma...
bsd-3-clause
cl4rke/scikit-learn
examples/model_selection/grid_search_digits.py
227
2665
""" ============================================================ Parameter estimation using grid search with cross-validation ============================================================ This examples shows how a classifier is optimized by cross-validation, which is done using the :class:`sklearn.grid_search.GridSearc...
bsd-3-clause
intel-analytics/analytics-zoo
pyzoo/zoo/chronos/model/tcmf/local_model.py
1
24645
# Copyright 2018 Analytics Zoo Authors. # # 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 i...
apache-2.0
tawsifkhan/scikit-learn
examples/cluster/plot_adjusted_for_chance_measures.py
286
4353
""" ========================================================== Adjustment for chance in clustering performance evaluation ========================================================== The following plots demonstrate the impact of the number of clusters and number of samples on various clustering performance evaluation me...
bsd-3-clause
indhub/mxnet
docs/mxdoc.py
2
13330
# 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
bo-yang/stock_analysis
symbol.py
1
53489
from stock_analysis.utils import * # conda install -c conda-forge selenium=3.0.1 from selenium import webdriver def parse_google_financial_table(tables, keyword=None): """ Parse Google Financial table into DataFrame. tables - selenium.webdriver.remote.webelement.WebElement """ tbl = None for t...
mit
ual/urbansim
urbansim/models/tests/test_dcm.py
6
22108
import numpy as np import numpy.testing as npt import pandas as pd import pytest import os import tempfile import yaml from pandas.util import testing as pdt from ...utils import testing from .. import dcm @pytest.fixture def seed(request): current = np.random.get_state() def fin(): np.random.set_s...
bsd-3-clause
OpenSourcePolicyCenter/dynamic
ogusa/get_micro_data.py
1
10394
''' ------------------------------------------------------------------------ This program extracts tax rate and income data from the microsimulation model (Tax-Calculator). ------------------------------------------------------------------------ ''' from taxcalc import Records, Calculator, Policy from pandas import Dat...
mit
DiCarloLab-Delft/PycQED_py3
pycqed/simulations/cz_superoperator_simulation_new2.py
1
31649
import adaptive from pycqed.measurement import measurement_control as mc from pycqed.instrument_drivers.meta_instrument.LutMans import flux_lutman as flm from pycqed.instrument_drivers.virtual_instruments import sim_control_CZ as scCZ from pycqed.simulations import cz_superoperator_simulation_new_functions as czf imp...
mit
dhimmel/networkx
networkx/tests/test_convert_pandas.py
43
2177
from nose import SkipTest from nose.tools import assert_true import networkx as nx class TestConvertPandas(object): numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test @classmethod def setupClass(cls): try: import pandas as pd except ImportError: ...
bsd-3-clause
yavalvas/yav_com
build/matplotlib/examples/api/histogram_path_demo.py
6
1444
""" This example shows how to use a path patch to draw a bunch of rectangles. The technique of using lots of Rectangle instances, or the faster method of using PolyCollections, were implemented before we had proper paths with moveto/lineto, closepoly etc in mpl. Now that we have them, we can draw collections of regul...
mit
kiyoto/statsmodels
statsmodels/discrete/tests/test_constrained.py
26
19635
# -*- coding: utf-8 -*- """ Created on Fri May 30 16:22:29 2014 Author: Josef Perktold License: BSD-3 """ from statsmodels.compat.python import StringIO import numpy as np from numpy.testing import assert_allclose, assert_equal, assert_ from nose import SkipTest import pandas as pd import patsy from statsmodels.d...
bsd-3-clause
walterreade/scikit-learn
examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py
87
3903
""" ============================================== Feature agglomeration vs. univariate selection ============================================== This example compares 2 dimensionality reduction strategies: - univariate feature selection with Anova - feature agglomeration with Ward hierarchical clustering Both metho...
bsd-3-clause
jonyroda97/redbot-amigosprovaveis
lib/matplotlib/backends/backend_template.py
2
9623
""" This is a fully functional do nothing backend to provide a template to backend writers. It is fully functional in that you can select it as a backend with import matplotlib matplotlib.use('Template') and your matplotlib scripts will (should!) run without error, though no output is produced. This provides a ...
gpl-3.0
alexandrejaguar/strata-sv-2015-tutorial
resources/vizarray.py
2
3634
# encoding: utf-8 """Vizualize NumPy arrays using ipythonblocks. To enable the automatic vizualization of arrays:: import vizarray vizarray.enable() To disable this:: vizarray.disable() To set the colormap (to any valid matplotlib colormap name):: vizarray.set_cmap('jet') To set the block_size in...
bsd-3-clause
toobaz/pandas
asv_bench/benchmarks/io/sql.py
1
4950
import sqlite3 import numpy as np import pandas.util.testing as tm from pandas import DataFrame, date_range, read_sql_query, read_sql_table from sqlalchemy import create_engine class SQL: params = ["sqlalchemy", "sqlite"] param_names = ["connection"] def setup(self, connection): N = 10000 ...
bsd-3-clause
blink1073/scikit-image
doc/examples/edges/plot_convex_hull.py
9
1487
""" =========== Convex Hull =========== The convex hull of a binary image is the set of pixels included in the smallest convex polygon that surround all white pixels in the input. In this example, we show how the input pixels (white) get filled in by the convex hull (white and grey). A good overview of the algorithm...
bsd-3-clause
kerrpy/kerrpy
kerrpy/utils/draw.py
2
2556
from ..universe import universe import numpy as np from matplotlib import pyplot as plt from matplotlib.patches import Circle import mpl_toolkits.mplot3d.art3d as art3d def spher2cart(points): # Retrieve the actual data r = points[:, 0] theta = points[:, 1] phi = points[:, 2] cosT = np.cos(theta...
gpl-3.0
tosolveit/scikit-learn
sklearn/decomposition/pca.py
192
23117
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Michael Eickenberg <michael.eickenberg@inria.fr> # # Lice...
bsd-3-clause
fabioticconi/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
nathania/pysal
pysal/contrib/spint/tests/test_gravity_stats.py
8
12472
""" Tests for statistics for gravity-style spatial interaction models """ __author__ = 'toshan' import unittest import numpy as np import pandas as pd import gravity as grav import mle_stats as stats class SingleParameter(unittest.TestCase): """Unit tests statistics when there is a single parameters estimated""...
bsd-3-clause
micmn/shogun
applications/tapkee/swissroll_embedding.py
12
2600
import numpy numpy.random.seed(40) tt = numpy.genfromtxt('../../data/toy/swissroll_color.dat',unpack=True).T X = numpy.genfromtxt('../../data/toy/swissroll.dat',unpack=True).T N = X.shape[1] converters = [] from shogun import LocallyLinearEmbedding lle = LocallyLinearEmbedding() lle.set_k(9) converters.append((lle, "L...
gpl-3.0
georgetown-analytics/skidmarks
bin/playin.py
1
1374
import csv import pandas as pd df = pd.read_csv('./output/trip/1_1.csv') ''' #This is the pandas library code to index and return the values of a column; the first number is rows, second is columns. The ':' is used to represent "through these values". For example, 1:10 symbolizes numbers 1 through values 10. ''...
mit
alexsavio/scikit-learn
examples/cluster/plot_kmeans_digits.py
42
4491
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example we compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the gr...
bsd-3-clause
adyavanapalli/Muon-Mass
Gabe_Owen_.py
1
3641
import numpy as np from matplotlib import pyplot as plt import math import random as ran from scipy.integrate import quad from scipy import interpolate pi = np.pi sqrt = np.sqrt cos = np.cos sin = np.sin #Assign constant hbar = 6.582*10**(-24) gw = 10**(-6) MW = .0008039 #MeV N = 10000 Nexp = 43. tp = 0.9525 #cm R ...
mit
466152112/scikit-learn
sklearn/tests/test_metaestimators.py
226
4954
"""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
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/dask/dataframe/tests/test_dataframe.py
2
108508
import sys import textwrap from distutils.version import LooseVersion from itertools import product from operator import add import pandas as pd import pandas.util.testing as tm import numpy as np import pytest import dask import dask.array as da import dask.dataframe as dd from dask.base import compute_as_if_collect...
gpl-3.0
halflings/crosscultural-media
pca_transformer.py
1
1628
from itertools import cycle import mongoengine #import matplotlib.pyplot as plt import sklearn.decomposition import config from crawler import enqueue_query, process_query import sys # Converts the 'array' type returned from pca.transform to a Python array def toArray(projection): data = [] for projPoint in...
apache-2.0
Froff/TFY4115-Simulering
python/main.py
1
1573
#!/usr/bin/python3 import matplotlib.pyplot as plt import matplotlib.text as txt import numpy as np import math import sys from Slope import Slope from SlopeDict import slopeDict from Simulation import Simulation from PhysicalSeries import PhysicalSeries import os.path slope_type = "linje" if __name__ == "__main__": ...
mit
MartinDelzant/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
RPGOne/Skynet
scikit-learn-0.18.1/examples/ensemble/plot_gradient_boosting_oob.py
82
4768
""" ====================================== Gradient Boosting Out-of-Bag estimates ====================================== Out-of-bag (OOB) estimates can be a useful heuristic to estimate the "optimal" number of boosting iterations. OOB estimates are almost identical to cross-validation estimates but they can be compute...
bsd-3-clause
carlgogo/vip_exoplanets
vip_hci/negfc/simplex_optim.py
2
25988
#! /usr/bin/env python """ Module with simplex (Nelder-Mead) optimization for defining the flux and position of a companion using the Negative Fake Companion. """ import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize from .simplex_fmerit import chisquare, get_mu_and_sigma from ..pca...
bsd-3-clause
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/setup.py
1
11778
#! /usr/bin/env python # # Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # License: 3-clause BSD import subprocess descr = """A set of python modules for machine learning and data mining""" import sys import os import shutil from distut...
mit
ueshin/apache-spark
python/pyspark/pandas/indexes/category.py
15
7766
# # 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
eastmallingresearch/crosslink
scripts/check_map_order.py
1
4311
#!/usr/bin/python #Crosslink Copyright (C) 2016 NIAB EMR see included NOTICE file for details ''' plot estimated versus correct map positions colour coded to show marker type: maternal-only/paternal-only/both ''' import argparse ap = argparse.ArgumentParser(description=__doc__,formatter_class=argparse.ArgumentDefault...
gpl-2.0
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/IPython/core/magics/basic.py
2
21310
"""Implementation of basic magic functions.""" import argparse import textwrap import io import sys from pprint import pformat from IPython.core import magic_arguments, page from IPython.core.error import UsageError from IPython.core.magic import Magics, magics_class, line_magic, magic_escapes from IPython.utils.tex...
mit
linebp/pandas
pandas/tests/frame/test_sorting.py
4
20958
# -*- coding: utf-8 -*- from __future__ import print_function import pytest import random import numpy as np import pandas as pd from pandas.compat import lrange from pandas import (DataFrame, Series, MultiIndex, Timestamp, date_range, NaT, IntervalIndex) from pandas.util.testing import assert_s...
bsd-3-clause
zaxliu/deepnap
experiments/kdd-exps/experiment_message_2016-6-12_G5_BUF2_AR1_b65_legacy.py
1
4374
# System built-in modules import time from datetime import datetime import sys import os from multiprocessing import Pool # Project dependency modules import pandas as pd pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment import lasagne # Project modules sys.path.append('...
bsd-3-clause
anurag313/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
rneher/FitnessInference
flu/src/clade_frequency_correlations.py
1
5578
#!/ebio/ag-neher/share/programs/bin/python2.7 ################################################################################ # # author: Richard Neher # email: richard.neher@tuebingen.mpg.de # # Reference: Richard A. Neher, Colin A Russell, Boris I Shraiman. # "Predicting evolution from the shape of gene...
mit
mne-tools/mne-tools.github.io
0.16/_downloads/plot_time_frequency_simulated.py
5
8402
""" ====================================================================== Time-frequency on simulated data (Multitaper vs. Morlet vs. Stockwell) ====================================================================== This example demonstrates the different time-frequency estimation methods on simulated data. It shows ...
bsd-3-clause
kylerbrown/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
214
4690
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.linear_model.randomized_l1 i...
bsd-3-clause
jgliss/pydoas
pydoas/helpers.py
1
3793
# -*- coding: utf-8 -*- # # Pydoas is a Python library for the post-analysis of DOAS result data # Copyright (C) 2017 Jonas Gliß (jonasgliss@gmail.com) # # This program is free software: you can redistribute it and/or # modify it under the terms of the BSD 3-Clause License # # This program is distributed in the hope th...
bsd-3-clause
js7558/pyBinance
tests/test-getOpenOrders.py
1
2221
#!/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 bn...
mit
joshloyal/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py
104
3139
"""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
cloudera/ibis
ibis/backends/spark/udf.py
1
6563
""" APIs for creating user-defined element-wise, reduction and analytic functions. """ import collections import functools import itertools import pyspark.sql.functions as f import pyspark.sql.types as pt import ibis.common.exceptions as com import ibis.expr.datatypes as dt import ibis.expr.signature as sig import i...
apache-2.0
zrhans/python
exemplos/Examples.lnk/bokeh/compat/mpl/lc_offsets.py
13
1067
import numpy as np import matplotlib.pyplot as plt from matplotlib.collections import LineCollection from bokeh import mpl from bokeh.plotting import show # Simulate a series of ocean current profiles, successively # offset by 0.1 m/s so that they form what is sometimes called # a "waterfall" plot or a "stagger" plot....
gpl-2.0
nmayorov/scikit-learn
examples/linear_model/plot_logistic_l1_l2_sparsity.py
384
2601
""" ============================================== L1 Penalty and Sparsity in Logistic Regression ============================================== Comparison of the sparsity (percentage of zero coefficients) of solutions when L1 and L2 penalty are used for different values of C. We can see that large values of C give mo...
bsd-3-clause
lenovor/scikit-learn
sklearn/tree/tree.py
113
34767
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
bsd-3-clause
t20100/sandbox
curves/CurvesView.py
1
12272
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
mit
0asa/scikit-learn
sklearn/pipeline.py
2
19361
""" The :mod:`sklearn.pipeline` module implements utilities to build a composite estimator, as a chain of transforms and estimators. """ # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Alexandre Gramfort # Lars Buitinck # Licence: BSD from collections import defaultdict...
bsd-3-clause
eg-zhang/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
barajasr/Baseball-Reference-Plotting
Plot.py
1
9927
import os import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np import Auxiliary as aux import BrefScraper as brf class Plot(object): """ With data obtained from BrefScraper, Plot clean the raw data and saves it to file. """ def __init__(self, scraper=brf.BrefScrape...
bsd-2-clause
mathdd/numpy
numpy/core/code_generators/ufunc_docstrings.py
51
90047
""" Docstrings for generated ufuncs The syntax is designed to look like the function add_newdoc is being called from numpy.lib, but in this file add_newdoc puts the docstrings in a dictionary. This dictionary is used in numpy/core/code_generators/generate_umath.py to generate the docstrings for the ufuncs in numpy.co...
bsd-3-clause
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/pandas/core/computation/pytables.py
7
18930
""" manage PyTables query interface via Expressions """ import ast from functools import partial import numpy as np import pandas as pd from pandas.core.dtypes.common import is_list_like import pandas.core.common as com from pandas.compat import u, string_types, DeepChainMap from pandas.core.base import StringMixin f...
mit
magic2du/contact_matrix
Contact_maps/DeepLearning/DeepLearningTool/DL_contact_matrix_load2-new10fold_12_15_2014_server.py
1
43156
# coding: utf-8 # In[3]: import sys, os sys.path.append('../../../libs/') import os.path import IO_class from IO_class import FileOperator from sklearn import cross_validation import sklearn import numpy as np import csv from dateutil import parser from datetime import timedelta from sklearn import svm import numpy ...
gpl-2.0
justincassidy/scikit-learn
examples/ensemble/plot_adaboost_multiclass.py
354
4124
""" ===================================== Multi-class AdaBoosted Decision Trees ===================================== This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction accuracy on a multi-class problem. The classification dataset is constructed by taking a ten-dimensional ...
bsd-3-clause
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/nolearn-0.5/nolearn/tests/test_lasagne.py
2
5731
from mock import patch from lasagne.layers import DenseLayer from lasagne.layers import DropoutLayer from lasagne.layers import InputLayer from lasagne.nonlinearities import identity from lasagne.nonlinearities import softmax from lasagne.updates import nesterov_momentum import numpy as np import pytest from sklearn.ba...
bsd-3-clause
marionleborgne/nupic.research
htmresearch/frameworks/capybara/embedding.py
7
3195
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, 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 progra...
agpl-3.0
revanthkolli/osf.io
scripts/analytics/addons.py
15
2140
# -*- coding: utf-8 -*- import os import re import matplotlib.pyplot as plt from framework.mongo import database from website import settings from website.app import init_app from .utils import plot_dates, oid_to_datetime, mkdirp log_collection = database['nodelog'] FIG_PATH = os.path.join(settings.ANALYTICS_PATH...
apache-2.0
trmznt/fatools
fatools/lib/fautil/_xxx/fautils.py
2
43844
# re-imagining the peakutils import numpy as np from scipy.signal import find_peaks_cwt from scipy.optimize import leastsq, curve_fit from scipy.interpolate import UnivariateSpline from matplotlib import pyplot as plt from bisect import bisect_left from operator import itemgetter from pprint import pprint from .d...
lgpl-3.0
pepcio03/python
pdftosplitandpdf.py
1
2753
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pdfsplitandpdf.py # # Copyright 2014 pepcio <piotrk0303@gmail.com> # # 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 2 o...
gpl-2.0
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/user_interfaces/wxcursor_demo.py
4
2166
""" Example to draw a cursor and report the data coords in wx """ import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure from numpy import arange, sin...
gpl-2.0
TinghuiWang/pyActLearn
examples/CASAS_Single_Test/b1_randomforest.py
1
7254
import os import pickle import logging import argparse from sklearn.ensemble import RandomForestClassifier from datetime import datetime from pyActLearn.CASAS.data import CASASData from pyActLearn.CASAS.fuel import CASASFuel from pyActLearn.performance.record import LearningResult from pyActLearn.performance import get...
bsd-3-clause