repo_name
stringlengths
7
92
path
stringlengths
5
149
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
911
693k
license
stringclasses
15 values
loganlinn/mlia
resources/Ch10/kMeans.py
3
6419
''' Created on Feb 16, 2011 k Means Clustering for Ch10 of Machine Learning in Action @author: Peter Harrington ''' from numpy import * def loadDataSet(fileName): #general function to parse tab -delimited floats dataMat = [] #assume last column is target value fr = open(fileName) ...
epl-1.0
frrp/trading-with-python
cookbook/getDataFromYahooFinance.py
77
1391
# -*- coding: utf-8 -*- """ Created on Sun Oct 16 18:37:23 2011 @author: jev """ from urllib import urlretrieve from urllib2 import urlopen from pandas import Index, DataFrame from datetime import datetime import matplotlib.pyplot as plt sDate = (2005,1,1) eDate = (2011,10,1) symbol = 'SPY' fNa...
bsd-3-clause
verificarlo/verificarlo
src/tools/ci/vfc_ci_report/inspect_runs.py
1
24408
############################################################################# # # # This file is part of Verificarlo. # # # # Copyr...
gpl-3.0
Barmaley-exe/scikit-learn
sklearn/datasets/tests/test_base.py
39
5607
import os import shutil import tempfile import warnings import nose import numpy from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn.datasets import load_sample_image from sklearn.da...
bsd-3-clause
elkingtonmcb/scikit-learn
sklearn/neural_network/tests/test_rbm.py
225
6278
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
elijah513/scikit-learn
examples/model_selection/plot_validation_curve.py
229
1823
""" ========================== Plotting Validation Curves ========================== In this plot you can see the training scores and validation scores of an SVM for different values of the kernel parameter gamma. For very low values of gamma, you can see that both the training score and the validation score are low. ...
bsd-3-clause
WhatWorksWhenForWhom/nlppln
nlppln/commands/save_ner_data.py
1
1125
#!/usr/bin/env python import click import os import codecs import json import pandas as pd from nlppln.utils import create_dirs, get_files @click.command() @click.argument('in_dir', type=click.Path(exists=True)) @click.option('--out_dir', '-o', default=os.getcwd(), type=click.Path()) @click.option('--name', '-n', de...
apache-2.0
tudarmstadt-lt/context-eval
twsi_upper_bound.py
2
1796
import twsi_eval import argparse from pandas import read_csv from twsi_eval import TWSI_INVENTORY, map_sense_inventories, calculate_evaluation_scores TWSI_DATASET = 'data/Dataset-TWSI-2.csv' def evaluate_uppper_bound(twsi_dataset_fath, user2twsi): print 'Estimating upper bound performance: ', twsi_dataset_fath ...
apache-2.0
jenfly/atmos-read
scripts/merra-replace-data.py
1
5275
""" Replace corrupted data files with daily data re-downloaded with wget """ import sys sys.path.append('/home/jwalker/dynamics/python/atmos-tools') sys.path.append('/home/jwalker/dynamics/python/atmos-read') import os import shutil import xarray as xray import numpy as np import collections import time import matplo...
mit
ezietsman/msc-thesis
images/makeunflat2.py
1
1059
from pylab import * import astronomy as ast # to format the labels better from matplotlib.ticker import FormatStrFormatter fmt = FormatStrFormatter('%1.2g') # or whatever X1 = load('ec2117ans_1_c.dat') x1 = X1[:,0] y1 = 10**(X1[:,2]/(-2.5)) y1 /= average(y1) T0 = 2453964.3307097 P = 0.1545255 figure(figsize=(6,4)...
mit
Parallel-in-Time/pySDC
pySDC/playgrounds/Allen_Cahn/AllenCahn_contracting_circle_standard_integrators.py
1
5930
import time import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh from pySDC.implementations.problem_classes.AllenCahn_2D_FD import allencahn_fullyimplicit, allencahn_semiimplicit # http://www.personal.psu.edu/qu...
bsd-2-clause
fspaolo/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
5
7058
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012 # License: BSD 3 clause import warnings from tempfile import mkdtemp import numpy as np from scipy import sparse from scipy.cluster import hierarchy from sklearn.utils.testing import assert_true fr...
bsd-3-clause
fluxcapacitor/source.ml
jupyterhub.ml/notebooks/train_deploy/zz_under_construction/zz_old/TensorFlow/Word2Vec/word2vec_basic.py
8
8995
# 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
INM-6/elephant
elephant/sta.py
2
13537
# -*- coding: utf-8 -*- """ Functions to calculate spike-triggered average and spike-field coherence of analog signals. .. autosummary:: :toctree: _toctree/sta spike_triggered_average spike_field_coherence :copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`. :license: Modified BSD...
bsd-3-clause
aflaxman/scikit-learn
benchmarks/bench_sgd_regression.py
50
5569
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt import gc from time import time from sklearn.linear_model import Ridge, SGDRegressor, ElasticNet from sklearn.metrics import mean_squared_error from sklearn.datasets.samples_generat...
bsd-3-clause
ThomasSweijen/TPF
examples/adaptiveintegrator/simple-scene-plot-NewtonIntegrator.py
6
2027
#!/usr/bin/python # -*- coding: utf-8 -*- import matplotlib matplotlib.use('TkAgg') O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_Cundall...
gpl-2.0
caltech-chimera/pychimera
scripts/multiphot.py
1
9783
#!/usr/bin/env python """ -------------------------------------------------------------------------- Routine to perform aperture photometry on CHIMERA science frames. Usage: python fastphot.py [options] image coords Authors: Navtej Saini, Lee Rosenthal Organization: Caltech, Pas...
mit
btabibian/scikit-learn
examples/cluster/plot_cluster_comparison.py
46
6620
""" ========================================================= Comparing different clustering algorithms on toy datasets ========================================================= This example shows characteristics of different clustering algorithms on datasets that are "interesting" but still in 2D. With the exception ...
bsd-3-clause
asteca/ASteCA
packages/best_fit/DEPRECATED/abcpmc_algor_DEPRECATED.py
1
9822
import numpy as np from scipy.optimize import differential_evolution as DE import time as t from .abcpmc import sampler, threshold from ..synth_clust import synth_cluster from . import likelihood from .emcee_algor import varPars, closeSol, discreteParams, convergenceVals def main( lkl_method, e_max, err_lst, com...
gpl-3.0
sadimanna/computer_vision
clustering/kmeansppclustering_with_gap_statistic.py
1
2599
#K-Means++ Clustering with Gap Statistic to determine the optimal number of clusters import sys import numpy as np import scipy.io as sio #import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.svm import SVC filename = sys.argv[1] datafile = sio.loadmat(filename) data = datafile['bow'] sizeda...
gpl-3.0
toobaz/pandas
pandas/tests/indexes/datetimes/test_timezones.py
2
47130
""" Tests for DatetimeIndex timezone-related methods """ from datetime import date, datetime, time, timedelta, tzinfo import dateutil from dateutil.tz import gettz, tzlocal import numpy as np import pytest import pytz from pandas._libs.tslibs import conversion, timezones import pandas.util._test_decorators as td imp...
bsd-3-clause
elkingtonmcb/h2o-2
py/testdir_multi_jvm/test_GLM2grid_hastie.py
9
2649
import unittest, time, sys, copy sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_util, h2o_import as h2i ## Dataset created from this: # # from sklearn.datasets import make_hastie_10_2 # import numpy as np # i = 1000000 # f = 10 # (X,y) = make_hastie_10_2(n_samples=i,random_state=None) # y.sh...
apache-2.0
eusoubrasileiro/fatiando
fatiando/vis/mpl.py
2
35331
""" Wrappers for :mod:`matplotlib` functions to facilitate plotting grids, 2D objects, etc. This module loads all functions from :mod:`matplotlib.pyplot`, adds new functions and overwrites some others (like :func:`~fatiando.vis.mpl.contour`, :func:`~fatiando.vis.mpl.pcolor`, etc). **Grids** * :func:`~fatiando.vis.mp...
bsd-3-clause
mattsep/TDSE
src/animate.py
1
1444
import scipy as sp import matplotlib.pyplot as plt import matplotlib.animation as animation # animation of the probability density of the wavefunction over the course # of time def probabilityDensity(x, t, V, psi): # convert to the probability density Nt = len(t) rho = sp.real(sp.conjugate(psi)*psi) ...
gpl-3.0
jgoppert/pymola
test/xml_test.py
1
4050
#!/usr/bin/env python """ Test XML backend """ import os import sys import time import unittest import pymoca.parser as mo_parser from pymoca.backends.xml import analysis, generator, sim_scipy from pymoca.backends.xml import parser as xml_parser # get matplotlib from analysis, since logic for plotting # without displa...
bsd-3-clause
trankmichael/scipy
scipy/signal/waveforms.py
64
14818
# Author: Travis Oliphant # 2003 # # Feb. 2010: Updated by Warren Weckesser: # Rewrote much of chirp() # Added sweep_poly() from __future__ import division, print_function, absolute_import import numpy as np from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \ exp, cos, sin, polyval, po...
bsd-3-clause
trachelr/mne-python
examples/preprocessing/plot_find_ecg_artifacts.py
19
1304
""" ================== Find ECG artifacts ================== Locate QRS component of ECG. """ # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io from mne.datasets import sample print(_...
bsd-3-clause
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
python-packages/mne-python-0.10/mne/fixes.py
1
29568
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. # XXX : copied from scikit-learn """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael...
bsd-3-clause
rexshihaoren/scikit-learn
examples/linear_model/plot_ransac.py
250
1673
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
wongkaiweng/LTLMoP
src/lib/handlers/share/MotionControl/BugControllerHandler.py
8
39771
#!/usr/bin/env python # -*- coding: utf-8 -*- """ =================================================================== BugController.py - Bug Algorithm Motion Controller =================================================================== This motion controller uses the Bug 2 algorithm developed by V. Lumelsky and A. St...
gpl-3.0
awni/tensorflow
tensorflow/contrib/skflow/python/skflow/tests/test_multioutput.py
1
1502
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
mgruben/morse-code
python/MorseCodeDecoder.py
1
16481
import re import matplotlib.pyplot as plt import seaborn as sns MORSE_CODE = { ".-": "A", "-...": "B", "-.-.": "C", "-..": "D", ".": "E", "..-.": "F", "--.": "G", "....": "H", "..": "I", ".---": "J", "-.-": "K", ".-..": "L", "--": "M", "-.": "N", "---": "O",...
gpl-3.0
toobaz/pandas
pandas/tests/indexes/timedeltas/test_setops.py
2
6937
import numpy as np import pytest import pandas as pd from pandas import Int64Index, TimedeltaIndex, timedelta_range import pandas.util.testing as tm from pandas.tseries.offsets import Hour class TestTimedeltaIndex: def test_union(self): i1 = timedelta_range("1day", periods=5) i2 = timedelta_ran...
bsd-3-clause
nvoron23/scikit-learn
sklearn/linear_model/tests/test_theil_sen.py
234
9928
""" Testing for Theil-Sen module (sklearn.linear_model.theil_sen) """ # Author: Florian Wilhelm <florian.wilhelm@gmail.com> # License: BSD 3 clause from __future__ import division, print_function, absolute_import import os import sys from contextlib import contextmanager import numpy as np from numpy.testing import ...
bsd-3-clause
sanja7s/SR_Twitter
src_general/explain_FORMATION_DELETION_REL.py
1
6415
#!/usr/bin/env python # a bar plot with errorbars import matplotlib import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse, Polygon from pylab import * width = 0.28 # the width of the bars font = {'family' : 'sans-serif', 'variant' : 'normal', 'weight' : 'light', ...
mit
MalkIPP/ipp_work
ipp_work/example/tax_rate_by_decile.py
1
1569
# -*- coding: utf-8 -*- """ Created on Mon Jun 1 17:07:33 2015 @author: malkaguillot """ from ipp_work.utils import survey_simulate, df_weighted_average_grouped from ipp_work.simulations.ir_marg_rate import varying_survey_simulation from ipp_work.example.quantiles_of_revimp import make_weighted_deciles_of_variable i...
agpl-3.0
MarkRegalla27/ThinkStats2
code/hypothesis.py
75
10162
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import nsfg import nsfg2 import first import thinkstats2 import thinkplot ...
gpl-3.0
bikash/kaggleCompetition
microsoft malware/code/_untuned_modeling.py
1
5556
###################################################### # _untuned_modeling.py # author: Gert Jacobusse, gert.jacobusse@rogatio.nl # licence: FreeBSD """ Copyright (c) 2015, Gert Jacobusse All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that...
apache-2.0
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/svm/plot_separating_hyperplane.py
62
1274
""" ========================================= SVM: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a Support Vector Machines classifier with linear kernel. """ print(__doc__) import numpy as np impo...
bsd-3-clause
MadsJensen/malthe_alpha_project
source_connectivity_permutation.py
1
6505
# -*- coding: utf-8 -*- """ Created on Wed Sep 9 08:41:17 2015. @author: mje """ import numpy as np import numpy.random as npr import os import socket import mne # import pandas as pd from mne.connectivity import spectral_connectivity from mne.minimum_norm import (apply_inverse_epochs, read_inverse_operator) # Pe...
mit
gtesei/fast-furious
competitions/santander-customer-transaction-prediction/base_light_gbm1.py
1
2556
import lightgbm as lgb import pandas as pd import numpy as np import sys from datetime import datetime from pathlib import Path from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import RepeatedStratifiedKFold path=Path("data/") train=pd.read_csv(path/"train.csv").drop("ID_code",axis=1) ...
mit
DucQuang1/py-earth
doc/generate_figures.py
1
1933
import matplotlib as mpl mpl.use('Agg') import numpy from pyearth import Earth from matplotlib import pyplot #========================================================================= # V-Function Example #========================================================================= # Create some fake data numpy.random.se...
bsd-3-clause
mihail911/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/axes.py
69
259904
from __future__ import division, generators import math, sys, warnings, datetime, new import numpy as np from numpy import ma import matplotlib rcParams = matplotlib.rcParams import matplotlib.artist as martist import matplotlib.axis as maxis import matplotlib.cbook as cbook import matplotlib.collections as mcoll im...
gpl-3.0
TuKo/brainiak
examples/fcma/classification.py
1
9141
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
gmsanchez/nmpc_comparison
cstr_startup_colloc.py
1
9778
# Linear and nonlinear control of startup of a CSTR. import mpctools as mpc import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec import time # Define some parameters and then the CSTR model. Nx = 3 Nu = 2 Nd = 1 # Ny = Nx Delta = .25 # eps = 1e-6 # Use this as a small number. T0 = 350 c0...
gpl-3.0
fzalkow/scikit-learn
examples/exercises/plot_cv_diabetes.py
231
2527
""" =============================================== Cross-validation on diabetes Dataset Exercise =============================================== A tutorial exercise which uses cross-validation with linear models. This exercise is used in the :ref:`cv_estimators_tut` part of the :ref:`model_selection_tut` section of ...
bsd-3-clause
jomivega/ASE4156
tests/test_stocks.py
1
3024
"""This module is for testing stocks""" from unittest import mock from django.test import TestCase from stocks.models import Stock, DailyStockQuote import pandas as pd from yahoo_historical import Fetcher from authentication.plaid_middleware import PlaidMiddleware import pytest class StocksViewTests(TestCase): ""...
apache-2.0
xyguo/scikit-learn
examples/decomposition/plot_image_denoising.py
70
6249
""" ========================================= Image denoising using dictionary learning ========================================= An example comparing the effect of reconstructing noisy fragments of a raccoon face image using firstly online :ref:`DictionaryLearning` and various transform methods. The dictionary is fi...
bsd-3-clause
KellyChan/Python
python/data_science/NYC/analysis3_predictions.py
3
3515
import numpy as np import pandas def normalize_features(array): """ Normalize the features in our data set. """ array_normalized = (array-array.mean())/array.std() mu = array.mean() sigma = array.std() return array_normalized, mu, sigma def compute_cost(features, values, theta): """ Comp...
mit
hstau/manifold-cryo
fit_1D_open_manifold_3D.py
1
5015
import numpy as np import get_fit_1D_open_manifold_3D_param import solve_d_R_d_tau_p_3D import a from scipy.io import loadmat import matplotlib.pyplot as plt #import matplotlib.pyplot as plt ''' function [a,b,tau] = fit_1D_open_manifold_3D(psi) % % fit_1D_open_manifold_3D % % fit the eigenvectors for ...
gpl-2.0
jmcarp/osf.io
scripts/analytics/addons.py
21
2200
# -*- 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
mihaic/brainiak
examples/fcma/mvpa_voxel_selection.py
2
3996
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
bibarz/bibarz.github.io
dabble/ab/auth_algorithms.py
1
17145
# Import any required libraries or modules. import numpy as np from sklearn import svm from sklearn.ensemble import RandomForestClassifier from sklearn.neighbors import KNeighborsClassifier import csv import sys class MetaParams: n_lda_ensemble = 101 lda_ensemble_feature_fraction = 0.4 mode = 'lda_ensembl...
mit
wanglei828/apollo
modules/tools/plot_planning/speed_dsteering_data.py
1
3396
#!/usr/bin/env python ############################################################################### # Copyright 2019 The Apollo 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 ...
apache-2.0
PanDAWMS/panda-server
pandaserver/daemons/scripts/copyArchive.py
1
71078
import os import re import sys import time import fcntl import shelve import datetime import traceback import requests from urllib3.exceptions import InsecureRequestWarning import pandaserver.userinterface.Client as Client from pandaserver.taskbuffer import EventServiceUtils from pandacommon.pandalogger.PandaLogger i...
apache-2.0
alephu5/Soundbyte
environment/lib/python3.3/site-packages/pandas/tests/test_msgpack/test_except.py
15
1043
#!/usr/bin/env python # coding: utf-8 import unittest import nose import datetime from pandas.msgpack import packb, unpackb class DummyException(Exception): pass class TestExceptions(unittest.TestCase): def test_raise_on_find_unsupported_value(self): import datetime self.assertRaises(TypeEr...
gpl-3.0
rmcgibbo/scipy
scipy/stats/_discrete_distns.py
15
20781
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from __future__ import division, print_function, absolute_import from scipy import special from scipy.special import entr, gammaln as gamln from numpy import floor, ceil, log, exp, sqrt, log1p, expm1, tanh, cosh, s...
bsd-3-clause
linebp/pandas
pandas/tests/reshape/test_reshape.py
1
43476
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 import pytest from pandas import DataFrame, Series import pandas as pd from numpy import nan import numpy as np from pandas.util.testing import assert_frame_equal from pandas.core.reshape.reshape import ( melt, lreshape, get_dummies, wide_to_long) impor...
bsd-3-clause
xclxxl414/rqalpha
rqalpha/mod/rqalpha_mod_alphaStar_utils/mod.py
1
2371
#coding=utf-8 """ @author: evilXu @file: mod.py @time: 2018/2/28 16:59 @description: """ from rqalpha.interface import AbstractMod from rqalpha.utils.logger import system_log,user_system_log import pandas as pd from rqalpha.api import * class UtilsMod(AbstractMod): def __init__(self): self._inject_api()...
apache-2.0
Arn-O/kadenze-deep-creative-apps
session-5/libs/inception.py
13
4890
""" Creative Applications of Deep Learning w/ Tensorflow. Kadenze, Inc. Copyright Parag K. Mital, June 2016. """ import os import numpy as np from tensorflow.python.platform import gfile import tensorflow as tf import matplotlib.pyplot as plt from skimage.transform import resize as imresize from .utils import download_...
apache-2.0
DailyActie/Surrogate-Model
01-codes/deap-master/examples/coev/coop_evol.py
1
6195
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
mit
trustedanalytics/spark-tk
regression-tests/sparktkregtests/testcases/scoretests/svm_model_test.py
10
3519
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
quheng/scikit-learn
sklearn/preprocessing/tests/test_data.py
71
38516
import warnings import numpy as np import numpy.linalg as la from scipy import sparse from distutils.version import LooseVersion from sklearn.utils.testing import assert_almost_equal, clean_warning_registry from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal...
bsd-3-clause
karstenw/nodebox-pyobjc
examples/Extended Application/sklearn/examples/calibration/plot_calibration_multiclass.py
1
7780
""" ================================================== Probability Calibration for 3-class classification ================================================== This example illustrates how sigmoid calibration changes predicted probabilities for a 3-class classification problem. Illustrated is the standard 2-simplex, wher...
mit
alfonsokim/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/quiver.py
69
36790
""" Support for plotting vector fields. Presently this contains Quiver and Barb. Quiver plots an arrow in the direction of the vector, with the size of the arrow related to the magnitude of the vector. Barbs are like quiver in that they point along a vector, but the magnitude of the vector is given schematically by t...
agpl-3.0
AnthonyHullDiamond/scanning
org.eclipse.scanning.points/scripts/scanpointgenerator/plotgenerator.py
2
4453
### # Copyright (c) 2016, 2017 Diamond Light Source Ltd. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: #...
epl-1.0
anshumang/picongpu-evpath
examples/ThermalTest/tools/dispersion.py
11
2689
#!/usr/bin/env python # # Copyright 2013 Heiko Burau, Axel Huebl # # This file is part of PIConGPU. # # PIConGPU is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
gpl-3.0
massmutual/scikit-learn
sklearn/discriminant_analysis.py
3
27324
""" Linear Discriminant Analysis and Quadratic Discriminant Analysis """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .extern...
bsd-3-clause
sumspr/scikit-learn
sklearn/tests/test_base.py
216
7045
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing impo...
bsd-3-clause
ovgu-FINken/paparazzi_pre_merge
sw/airborne/test/math/compare_utm_enu.py
77
2714
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import sys import os PPRZ_SRC = os.getenv("PAPARAZZI_SRC", "../../../..") sys.path.append(PPRZ_SRC + "/sw/lib/python") from pprz_math.geodetic import * from pprz_math.algebra import DoubleRMat, DoubleEulers, DoubleVect3 from math ...
gpl-2.0
prabhamatta/Analyzing-Open-Data
notebooks/Day_06_B_Generators.py
3
10025
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Goals # <markdowncell> # **To practice using generators to yield geographical entities of various types.** # # Generators are a bit complicated, and I won't try to explain all the intricacies here. I will show you how to use `yield` in...
apache-2.0
billy-inn/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
BiaDarkia/scikit-learn
sklearn/utils/tests/test_sparsefuncs.py
22
18104
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from numpy.random import RandomState from sklearn.datasets import make_classification from sklearn.utils.s...
bsd-3-clause
mblondel/scikit-learn
sklearn/utils/tests/test_utils.py
23
6045
import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import pinv2 from sklearn.utils.testing import (assert_equal, assert_raises, assert_true, assert_almost_equal, assert_array_equal, SkipTest) from sklearn.utils import c...
bsd-3-clause
mjvakili/ccppabc
ccppabc/code/archive/wp_covariance.py
1
1717
from halotools.empirical_models import Zheng07 , model_defaults from halotools.mock_observables import wp from halotools.mock_observables.clustering import tpcf from halotools.empirical_models.mock_helpers import (three_dim_pos_bundle, infer_mask_from_kwargs) from ha...
mit
dgrtwo/gleam
examples/baseball.py
1
2364
import os from collections import OrderedDict from flask import Flask from wtforms import fields from ggplot import (aes, stat_smooth, geom_point, geom_text, ggtitle, ggplot, xlab, ylab) import numpy as np import pandas as pd from gleam import Page, panels # setup stats = ['At-Bats (AB)', 'Runs...
mit
ywang037/delta-ntu-slerp4
Training/train_mobilenet_casia_1771.py
1
7420
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 4 14:47:47 2017 @author: slerp4 Compared with _debug version, this version excludes RMSprop optimizer """ #import tensorflow as tf from keras import backend as K from keras.applications.mobilenet import MobileNet from keras.preprocessing.image im...
mit
endolith/scipy
scipy/stats/stats.py
5
316939
# Copyright 2002 Gary Strangman. All rights reserved # Copyright 2002-2016 The SciPy Developers # # The original code from Gary Strangman was heavily adapted for # use in SciPy by Travis Oliphant. The original code came with the # following disclaimer: # # This software is provided "as-is". There are no expressed or...
bsd-3-clause
annayqho/TheCannon
presentations/for_michigan/make_talk_plots.py
1
4618
import pickle import matplotlib import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # make sample spectra plot(dataset.wl, dataset.tr_flux[2,:], alpha=0.7, c='k') title(r"Typical High-S/N LAMOST Spectrum", fontsize=27) xlim(3500, 9500) tick_params(axis='x', labelsize=27) tick_para...
mit
fabianp/scikit-learn
examples/linear_model/plot_bayesian_ridge.py
248
2588
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
sanketloke/scikit-learn
examples/model_selection/plot_confusion_matrix.py
47
2495
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
ch3ll0v3k/scikit-learn
sklearn/linear_model/coordinate_descent.py
37
74167
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
Cadair/solarbextrapolation
solarbextrapolation/analyticalmodels/base.py
1
8605
# -*- coding: utf-8 -*- """ Created on Mon Sep 28 19:30:22 2015 @author: alex_ """ # General Imports import matplotlib as mpl mpl.use('TkAgg') # Force mpl backend not to use qt. Else we have a conflict. import numpy as np #import pickle import time from datetime import datetime #from collections import namedtuple imp...
mit
zorojean/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
zfrenchee/pandas
pandas/tests/io/json/test_ujson.py
1
56098
# -*- coding: utf-8 -*- try: import json except ImportError: import simplejson as json import math import pytz import pytest import time import datetime import calendar import re import decimal import dateutil from functools import partial from pandas.compat import range, zip, StringIO, u import pandas._libs.j...
bsd-3-clause
lifeinoppo/littlefishlet-scode
RES/REF/python_sourcecode/ipython-master/IPython/sphinxext/ipython_directive.py
12
42845
# -*- coding: utf-8 -*- """ Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. It also allows you to input code as a pure pyth...
gpl-2.0
cs-chan/Deep-Plant
GRU-CFA/Codes/visualClef.py
1
18504
# -*- coding: utf-8 -*- """ Created on Mon Apr 2 15:24:59 2018 @author: root """ import cPickle as pkl import numpy import cv2 import matplotlib.pyplot as plt import matplotlib.cm as cm import skimage import skimage.transform import skimage.io from PIL import Image, ImageEnhance import scipy.misc import tensorfl...
bsd-3-clause
CforED/Machine-Learning
sklearn/datasets/__init__.py
72
3807
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
lin-credible/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
rhyolight/nupic.research
projects/sequence_prediction/continuous_sequence/run_elm.py
10
8061
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-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...
gpl-3.0
joshloyal/scikit-learn
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]], ...
bsd-3-clause
skggm/skggm
examples/trace_plot_example.py
1
3138
""" Visualize Regularization Path ============================= Plot the edge level coefficients (inverse covariance entries) as a function of the regularization parameter. """ import sys import numpy as np from sklearn.datasets import make_sparse_spd_matrix sys.path.append("..") from inverse_covariance import Quic...
mit
niun/pyoscope
tests/display_wr.py
2
1164
#!/usr/bin/env python # # PyUSBtmc # display_channel.py # # Copyright (c) 2011 Mike Hadmack # Copyright (c) 2010 Matt Mets # This code is distributed under the MIT license # # This script is just to test waverunner functionality as a module # import numpy from matplotlib import pyplot import sys import os sys.path.app...
mit
rgommers/numpy
numpy/core/numeric.py
7
76727
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( _fastCopyAndTranspose as fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, arr...
bsd-3-clause
clairetang6/bokeh
bokeh/charts/builders/bar_builder.py
5
12416
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Bar class which lets you build your Bar charts just passing the arguments to the Chart class and calling the proper functions. It also add a new chained stacked method. """ # ------------------------...
bsd-3-clause
Balandat/cont_no_regret
old_code/testing.py
1
3136
''' Created on Feb 24, 2015 @author: balandat ''' import numpy as np from scipy.integrate import quad import matplotlib.pyplot as plt from ContNoRegret.Domains import S from ContNoRegret.Distributions import Uniform from ContNoRegret.utils import create_random_Sigmas from ContNoRegret.LossFunctions import GaussianLos...
mit
mjudsp/Tsallis
examples/preprocessing/plot_robust_scaling.py
85
2698
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Robust Scaling on Toy Data ========================================================= Making sure that each Feature has approximately the same scale can be a crucial preprocessing step. However, when data contains o...
bsd-3-clause
shusenl/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
297
1247
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import pylab as pl from sklearn.utils import check_random_state from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels def plot(func): random_state = check_random_state(0) ...
bsd-3-clause
mne-tools/mne-tools.github.io
0.19/_downloads/33b5e3cff5c172d72c79c6eec192b031/plot_label_from_stc.py
20
4093
""" ================================================= Generate a functional label from source estimates ================================================= Threshold source estimates and produce a functional label. The label is typically the region of interest that contains high values. Here we compare the average time ...
bsd-3-clause
hfut721/RPN
tools/demo.py
10
5028
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """ Demo script showing detections in sample i...
mit