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
mmottahedi/neuralnilm_prototype
scripts/e209.py
2
6719
from __future__ import print_function, division import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid, rectify from lasagne.objectives import crossentropy, mse...
mit
hantek/deeplearn_hsi
pavia_SdA.py
1
9361
import os import sys import time import scipy.io as sio import numpy import scipy import theano import theano.tensor as T from scipy.stats import t from sklearn import svm from theano.tensor.shared_randomstreams import RandomStreams import PIL.Image from SdA import SdA from hsi_utils import * cmap = numpy.asarray( [[...
bsd-2-clause
fredhusser/scikit-learn
examples/linear_model/plot_ols.py
220
1940
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
ttm/mass
src/aux/amostras4.py
1
2236
#-*- coding: utf-8 -*- # http://matplotlib.sourceforge.net/examples/api/legend_demo.html # import pylab as p, numpy as n f=n.fft.fft #n4=n.random.rand(4)*2-1 n4=n.array([ 0.58003705, -0.30828309, -0.29797696, -0.99219078]) p.figure(figsize=(12.,6.)) p.subplots_adjust(left=0.06,bottom=0.12,right=0.995,top=0.995) p.plo...
gpl-3.0
kernc/scikit-learn
examples/plot_digits_pipe.py
70
1813
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the predictio...
bsd-3-clause
dssg/cincinnati2015-public
blight_risk_prediction/util.py
1
4914
#!/usr/bin/env python import logging import numpy as np import pdb import matplotlib.pyplot as plt import pandas as pd from sqlalchemy import create_engine import datetime import dbconfig import config logger = logging.getLogger(__name__) years = ['2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '20...
mit
ishanic/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
jayhetee/pandashells
pandashells/lib/config_lib.py
9
1826
#! /usr/bin/env python import os import json # the name of the file in which to store configuration CONFIG_FILE_NAME = '.pandashells' # valid options (option_name, [valid, option, list]) CONFIG_OPTS = sorted( [ ('io_input_type', ['csv', 'table']), ('io_output_type', ['csv', 'table', 'html']), ...
bsd-2-clause
connordurkin/CPSC_458
final_project_py2.py
1
16751
# Connor Durkin # Final Project for CPSC_458 # python 2 version import yahoo_finance from yahoo_finance import Share import numpy as np import pandas import matplotlib.pyplot as plt import datetime import cvxopt as opt from cvxopt import blas, solvers # We will do a lot of optimizations, # and don't want to see each ...
mit
cmaclell/concept_formation
concept_formation/examples/cobweb3_predict_iris.py
1
2228
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division import matplotlib.pyplot as plt import numpy as np from random import seed from concept_formation.examples.examples_utils import avg_lines from concept_formation.evaluat...
mit
Djabbz/scikit-learn
examples/applications/plot_species_distribution_modeling.py
254
7434
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
mit-crpg/openmc
tests/unit_tests/test_data_photon.py
8
5177
#!/usr/bin/env python from collections.abc import Mapping, Callable import os from pathlib import Path import numpy as np import pandas as pd import pytest import openmc.data @pytest.fixture(scope='module') def elements_endf(): """Dictionary of element ENDF data indexed by atomic symbol.""" endf_data = os.e...
mit
wmvanvliet/mne-python
examples/decoding/plot_decoding_spoc_CMC.py
9
3007
""" ==================================== Continuous Target Decoding with SPoC ==================================== Source Power Comodulation (SPoC) :footcite:`DahneEtAl2014` allows to identify the composition of orthogonal spatial filters that maximally correlate with a continuous target. SPoC can be seen as an exten...
bsd-3-clause
v00d00dem0n/PyCrashCourse
work/ch15/colormap_example.py
1
3677
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. This reference example shows all colormaps included with Matplotlib. Note that any colormap listed here can be reversed by appending "_r" (e.g., "pink_r"). These colormaps are divided into the following cate...
gpl-3.0
murphy214/berrl
example/example2.py
1
2073
import berrl as bl import pandas as pd import numpy as np import itertools # please, if possible, don't abuse this key its not difficult to get your own apikey='your api key' # all the colors currently available for input colors=['default','light green', 'blue', 'red', 'yellow', 'light blue', 'orange', 'purple', 'gre...
apache-2.0
sammosummo/sammosummo.github.io
assets/scripts/bsem.py
1
8112
"""Example of Bayesian confirmatory factor analysis in PyMC3. """ import numpy as np import pandas as pd import pymc3 as pm import theano.tensor as tt import matplotlib.pyplot as plt from os.path import exists from matplotlib import rcParams from pymc3.math import matrix_dot, matrix_inverse from tabulate import tabul...
mit
KellyChan/Python
python/crawlers/crawler/catalogs/lowes/lowes_catalogs_products_recheck.py
3
2796
__author__ = "Kelly Chan" __date__ = "Sept 9 2014" __version__ = "1.0.0" import os import sys reload(sys) sys.setdefaultencoding( "utf-8" ) import mechanize import cookielib import re import time import urllib import urllib2 from bs4 import BeautifulSoup import pandas def openBrowser(): # Browser br =...
mit
astraw/mplsizer
mpl_toolkits/mplsizer/mplsizer.py
2
20954
from __future__ import division import math import matplotlib.numerix as nx from matplotlib.axes import Axes _axes_sizer_elements = {} _sizer_flags = ['left','right','bottom','top','all', 'expand', 'align_centre', 'align_centre_vertical', 'align_centre_ho...
mit
0u812/matplotlib2tikz
test/acidtest.py
1
6448
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010--2014 Nico Schlömer # # This file is part of matplotlib2tikz. # # matplotlib2tikz 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 ver...
lgpl-3.0
amozie/amozie
studzie/abu_test/abu_test_a.py
1
1346
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import abupy abupy.env.disable_example_env_ipython() from abupy import ABuSymbolPd df = ABuSymbolPd.make_kl_df('601398') from abupy import EMarketDataFetchMode, abu abupy.env.g_data_fetch_mode = EMarketDataFetchMode.E_DATA...
apache-2.0
jetuk/pywr
tests/test_core.py
1
13701
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import pytest from fixtures import * from helpers import * from pywr._core import Timestep, ScenarioIndex from pywr.core import * from pywr.domains.river import * from pywr.parameters import Parameter, ConstantParameter, DataFramePar...
gpl-3.0
HealthCatalystSLC/healthcareai-py
setup.py
4
2465
# -*- coding: utf-8 -*- # from __future__ import unicode_literals from setuptools import setup, find_packages def readme(): # I really prefer Markdown to reStructuredText. PyPi does not. This allows me # to have things how I'd like, but not throw complaints when people are trying # to install the packag...
mit
UASLab/ImageAnalysis
scripts/archive/6b-delaunay3.py
1
10722
#!/usr/bin/python import sys sys.path.insert(0, "/usr/local/opencv3/lib/python2.7/site-packages/") import argparse import commands import cPickle as pickle import cv2 import fnmatch import itertools #import json import math import matplotlib.pyplot as plt import numpy as np import os.path from progress.bar import Bar...
mit
khalibartan/pgmpy
pgmpy/estimators/base.py
1
16920
#!/usr/bin/env python from warnings import warn from functools import lru_cache import numpy as np import pandas as pd from scipy.stats import chisquare from pgmpy.utils.decorators import convert_args_tuple class BaseEstimator(object): def __init__(self, data, state_names=None, complete_samples_only=True): ...
mit
daleloogn/singerID-BTechProject-neuralnet
prog1.py
1
5136
import os import sys import numpy from numpy import * from numpy import random from scipy import optimize as op from scipy import io import pylab from matplotlib import * import matplotlib.pyplot as plt from tempfile import TemporaryFile from PIL import Image def plotData(image): '''plots the input data ''' ...
apache-2.0
vatika/Automated-Essay-Grading
Data/feature_extractor.py
1
10539
# Copyright 2015 - Vatika Harlalka, Anurag Ghosh, Abhijeet Kumar import csv import nltk import string import json from collections import Counter from nltk.corpus import stopwords from nltk.stem.porter import PorterStemmer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.te...
gpl-2.0
nishnik/networkx
doc/make_gallery.py
35
2453
""" Generate a thumbnail gallery of examples. """ from __future__ import print_function import os, glob, re, shutil, sys import matplotlib matplotlib.use("Agg") import matplotlib.pyplot import matplotlib.image from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCa...
bsd-3-clause
manashmndl/scikit-learn
examples/text/document_classification_20newsgroups.py
222
10500
""" ====================================================== Classification of text documents using sparse features ====================================================== This is an example showing how scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a scipy.spars...
bsd-3-clause
BorisJeremic/Real-ESSI-Examples
education_examples/_Chapter_Material_Behaviour_Examples/Multi_Yield_Surface_von_Mises_GGmax/plot_stress_strain_loop.py
2
2628
import numpy as np import matplotlib.pyplot as plt # target userInput1= [0,3.16200000000000e-07,1.00000000000000e-06,3.16227766016838e-06,1.00000000000000e-05,2.23606797749979e-05,5.00000000000000e-05,7.07106781186548e-05,0.000100000000000000,0.000223606797749979,0.000500000000000000,0.000707106781186548,0.001000000...
cc0-1.0
googleinterns/amt-xpub
examples/plot_signal_to_noise_ratio_analysis_results.py
1
3393
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
alexeyum/scikit-learn
examples/cluster/plot_birch_vs_minibatchkmeans.py
333
3694
""" ================================= Compare BIRCH and MiniBatchKMeans ================================= This example compares the timing of Birch (with and without the global clustering step) and MiniBatchKMeans on a synthetic dataset having 100,000 samples and 2 features generated using make_blobs. If ``n_clusters...
bsd-3-clause
pnedunuri/scipy
scipy/interpolate/fitpack.py
25
46138
#!/usr/bin/env python """ fitpack (dierckx in netlib) --- A Python-C wrapper to FITPACK (by P. Dierckx). FITPACK is a collection of FORTRAN programs for curve and surface fitting with splines and tensor product splines. See http://www.cs.kuleuven.ac.be/cwis/research/nalag/research/topics/fitpack.html ...
bsd-3-clause
yunque/librosa
librosa/display.py
1
23327
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Display ======= .. autosummary:: :toctree: generated/ specshow waveplot time_ticks cmap """ import numpy as np import copy import matplotlib as mpl import matplotlib.image as img import matplotlib.pyplot as plt import warnings from . import cache ...
isc
ChengeLi/VehicleTracking
utilities/inspect_data.py
1
2397
# This is a program for inspecting data files import cv2 import os import sys import pdb import pickle import numpy as np import glob as glob from scipy.io import loadmat,savemat from scipy.sparse import csr_matrix import matplotlib.pyplot as plt from DataPathclass import * DataPathobj = DataPath(dataSource,VideoIndex)...
mit
turbomanage/training-data-analyst
blogs/feature_column_normalization/model_code/trainer/model.py
2
4279
#!/usr/bin/env python # Copyright 2018 Google Inc. 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
andaag/scikit-learn
sklearn/cluster/setup.py
263
1449
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration cblas_libs, blas_info = ...
bsd-3-clause
kalaytan/findatapy
findatapy/timeseries/calculations.py
1
24533
__author__ = 'saeedamen' # Saeed Amen # # Copyright 2016 Cuemacro # # 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 l...
apache-2.0
annahs/atmos_research
NC_POLAR6_flighttrack_map.py
1
6786
import sys import os import numpy as np from pprint import pprint from datetime import datetime from datetime import timedelta import mysql.connector import pickle import math import calendar import matplotlib.pyplot as plt from matplotlib import colorbar import matplotlib.colors from mpl_toolkits.basemap import Basema...
mit
Vvucinic/Wander
venv_2_7/lib/python2.7/site-packages/pandas/tests/test_generic.py
9
69277
# -*- coding: utf-8 -*- # pylint: disable-msg=E1101,W0612 from datetime import datetime, timedelta import nose import numpy as np from numpy import nan import pandas as pd from pandas import (Index, Series, DataFrame, Panel, isnull, notnull, date_range, period_range) from pandas.core.index import ...
artistic-2.0
Project-Bonfire/EHA
Scripts/include/viz_traffic.py
3
9766
# Copyright (C) 2017 Siavoosh Payandeh Azad # you can run it for example with the following: # python -c 'from viz_traffic import *; viz_traffic(2)' # this should be added later to the simulate.py script # there are some things you should be carefull with: # - if you have different packets with the same source, des...
gpl-3.0
scikit-optimize/scikit-optimize.github.io
dev/_downloads/365fdab27864494141feaa35987b301b/partial-dependence-plot-2D.py
3
3291
""" =========================== Partial Dependence Plots 2D =========================== Hvass-Labs Dec 2017 Holger Nahrstaedt 2020 .. currentmodule:: skopt Simple example to show the new 2D plots. """ print(__doc__) import numpy as np from math import exp from skopt import gp_minimize from skopt.space import Real, ...
bsd-3-clause
Eric89GXL/mne-python
examples/preprocessing/plot_muscle_detection.py
18
3308
""" =========================== Annotate muscle artifacts =========================== Muscle contractions produce high frequency activity that can mask brain signal of interest. Muscle artifacts can be produced when clenching the jaw, swallowing, or twitching a cranial muscle. Muscle artifacts are most noticeable in t...
bsd-3-clause
oduwa/Pic-Numero
PicNumero/count.py
2
1729
import os, sys import tqdm from scipy import misc from skimage.feature import blob_dog, blob_log, blob_doh from skimage.color import rgb2gray # Way to import from matplotlib without warning according to # https://github.com/matplotlib/matplotlib/issues/5836#issuecomment-223997114 import warnings; with warnings.catch_...
mit
wzbozon/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
venzozhang/GProject
src/flow-monitor/examples/wifi-olsr-flowmon.py
108
7439
# -*- Mode: Python; -*- # Copyright (c) 2009 INESC Porto # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, #...
gpl-2.0
kazemakase/scikit-learn
sklearn/utils/extmath.py
142
21102
""" Extended math utilities. """ # Authors: Gael Varoquaux # Alexandre Gramfort # Alexandre T. Passos # Olivier Grisel # Lars Buitinck # Stefan van der Walt # Kyle Kastner # License: BSD 3 clause from __future__ import division from functools import partial import ...
bsd-3-clause
ishank08/scikit-learn
sklearn/neighbors/tests/test_lof.py
34
4142
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause from math import sqrt import numpy as np from sklearn import neighbors from numpy.testing import assert_array_equal from sklearn import metrics from sklearn.metr...
bsd-3-clause
twareproj/tware
examples/mimic2/logreg.py
2
7417
import numpy as np import sys from sets import Set #classifiers from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression #preprocess from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import StandardScaler #eval from sklearn.cross_validation impor...
apache-2.0
yuanagain/seniorthesis
src/2017-04-06.py
1
6190
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import math import numdifftools as nd default_lambda_1, default_lambda_2, default_lambda_3 = 0.086, 0.141, 0.773 default_start = (0.372854105052, 0.393518965248, -0.0359026080443, -0.216701666067) x_0 = default_start res = 0.01...
mit
edlectrico/twitter_nltk_volkswagen
sentiment_mod.py
2
2898
import nltk import random #from nltk.corpus import movie_reviews from nltk.classify.scikitlearn import SklearnClassifier import pickle from sklearn.naive_bayes import MultinomialNB, BernoulliNB from sklearn.linear_model import LogisticRegression, SGDClassifier from sklearn.svm import SVC, LinearSVC, NuSVC from nltk.cla...
apache-2.0
chili-epfl/shape_learning
tools/dataset-preprocessing/preprocessDataset.py
3
3918
import itertools import numpy from scipy import interpolate #from scipy.cluster.vq import vq, kmeans, whiten from sklearn.cluster import MeanShift MIN_CLUSTER_SIZE = 8 NB_POINTS=70 def interpolate_shape(shape,numDesiredPoints): """ Interpolate the shape to reach a predefined number of points, and switch from ...
isc
eljost/rassiparse
rassiparse/mcscan_dash.py
1
8715
#!/usr/bin/env python3 import argparse import base64 import glob import logging import pprint import os import sys import tarfile import dash import dash_core_components as dcc import dash.dependencies as dep import dash_html_components as html from natsort import natsorted import plotly.graph_objs as go import nump...
gpl-3.0
gvanhorn38/multibox
visualize_detect.py
1
9994
""" Visualize detection results. """ import argparse import cPickle as pickle import json import logging from matplotlib import pyplot as plt import numpy as np import os import pprint import sys import tensorflow as tf import tensorflow.contrib.slim as slim import time from config import parse_config_file from dete...
mit
LiaoPan/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
tornadozou/tensorflow
tensorflow/contrib/timeseries/examples/known_anomaly.py
53
6786
# 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
Lawrence-Liu/scikit-learn
sklearn/metrics/cluster/tests/test_bicluster.py
394
1770
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
bsd-3-clause
ngoix/OCRF
examples/linear_model/plot_sgd_penalties.py
124
1877
""" ============== SGD: Penalties ============== Plot the contours of the three penalties. All of the above are supported by :class:`sklearn.linear_model.stochastic_gradient`. """ from __future__ import division print(__doc__) import numpy as np import matplotlib.pyplot as plt def l1(xs): return np.array([np....
bsd-3-clause
yonglehou/scikit-learn
sklearn/ensemble/forest.py
176
62555
"""Forest of trees-based ensemble methods Those methods include random forests and extremely randomized trees. The module structure is the following: - The ``BaseForest`` base class implements a common ``fit`` method for all the estimators in the module. The ``fit`` method of the base ``Forest`` class calls the ...
bsd-3-clause
hello-base/web
apps/correlations/views.py
1
2963
# -*- coding: utf-8 -*- from collections import defaultdict, OrderedDict from itertools import groupby from django.views.generic.dates import YearArchiveView from django.views.generic import DetailView from braces.views import JSONResponseMixin from pandas import DataFrame from .constants import SUBJECTS from .model...
apache-2.0
ntim/g4sipm
sample/plots/json/celltriggers.py
1
1725
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Plots the distribution of the cell triggers into a 2d-histogram. # import sys, os, glob import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import persistency def get_digi_cell_position(model, digi): """ Determines the cell position....
gpl-3.0
HeraclesHX/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
manulera/ModellingCourse
ReAct/Python/GenerateMasterEq.py
1
1118
import numpy as np from Gilles import * import matplotlib.pyplot as plt from DeviationAnalysis import * from mpl_toolkits.mplot3d import Axes3D # Initial conditions user_input = ['A', 100, 'B', 0] # Constants (this is not necessary, they could be filled up already in the reaction tuple) k = (10,10) # Re...
gpl-3.0
roxyboy/scikit-learn
examples/exercises/plot_cv_digits.py
232
1206
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
bsd-3-clause
saiwing-yeung/scikit-learn
sklearn/ensemble/partial_dependence.py
25
15121
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
bsd-3-clause
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/feature_selection/tests/test_rfe.py
56
11274
""" Testing Recursive feature elimination """ import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy import sparse from sklearn.feature_selection.rfe import RFE, RFECV from sklearn.datasets import load_iris, make_friedman1 from sklearn.metrics import zero_one_loss from sk...
bsd-3-clause
mjudsp/Tsallis
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
shyamalschandra/scikit-learn
examples/cluster/plot_mini_batch_kmeans.py
86
4092
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
bsd-3-clause
bbarrefors/CUADRnT
setup.py
4
8025
#!/usr/bin/env python """ Standard python setup.py file for cuadrnt package To build : python setup.py build To install : python setup.py install --prefix=<some dir> To clean : python setup.py clean To build doc : python setup.py doc To run tests : python setup.py test """ # system modules #import logging im...
mit
jakobj/nest-simulator
pynest/examples/spatial/conncon_sources.py
20
3212
# -*- coding: utf-8 -*- # # conncon_sources.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License...
gpl-2.0
rolandwz/pymisc
strader/trader.py
2
6455
# -*- coding: utf-8 -*- import os, datetime from numpy import array import pylab as pl import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.dates import DateFormatter from matplotlib.widgets import MultiCursor from utils.rwlogging import tradeLogger as logt from utils.rwlogging import balLogger as ...
mit
SnakeJenny/TensorFlow
tensorflow/contrib/learn/python/learn/estimators/kmeans_test.py
44
19373
# 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
RayMick/scikit-learn
sklearn/feature_extraction/tests/test_image.py
205
10378
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import numpy as np import scipy as sp from scipy import ndimage from nose.tools import assert_equal, assert_true from numpy.testing import assert_raises from sklearn...
bsd-3-clause
JanSchulz/knitpy
knitpy/documents.py
1
17172
from __future__ import absolute_import, unicode_literals import os import tempfile import re from collections import OrderedDict try: #py3 from base64 import decodebytes except ImportError: # py2 from base64 import decodestring as decodebytes from pypandoc import convert as pandoc # Basic things f...
bsd-3-clause
aburrell/davitpy
davitpy/__init__.py
2
20379
# -*- coding: utf-8 -*- # Copyright (C) 2012 VT SuperDARN Lab # Full license can be found in LICENSE.txt """ davitpy ------- The SuperDARN Data Visualization Toolkit in Python Modules ------------------------------------------------- pydarn superdarn data I/O and plotting utilities utils general utilities models py...
gpl-3.0
IntelLabs/hpat
examples/series/series_quantile.py
1
1768
# ***************************************************************************** # Copyright (c) 2020, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of sou...
bsd-2-clause
aabadie/scikit-learn
sklearn/svm/classes.py
22
41116
import warnings import numpy as np from .base import _fit_liblinear, BaseSVC, BaseLibSVM from ..base import BaseEstimator, RegressorMixin from ..linear_model.base import LinearClassifierMixin, SparseCoefMixin, \ LinearModel from ..feature_selection.from_model import _LearntSelectorMixin from ..utils import check_X...
bsd-3-clause
kernsuite-debian/lofar
CEP/Pipeline/helper_scripts/aggregate_stats.py
1
35696
# LOFAR PIPELINE FRAMEWORK # # aggregate stats # Wouter Klijn, 2014 # klijn@astron.nl # -...
gpl-3.0
sullivancolin/hexpy
tests/test_models.py
1
14073
# -*- coding: utf-8 -*- """Tests for model validation.""" import logging from typing import List import pandas as pd import pendulum import pytest import responses from _pytest.capture import CaptureFixture from pydantic import ValidationError from hexpy import ContentUploadAPI, HexpySession, MonitorAPI, Project from...
mit
nelango/ViralityAnalysis
model/lib/sklearn/linear_model/ransac.py
25
14262
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from ..utils.valid...
mit
vivekmishra1991/scikit-learn
examples/cluster/plot_lena_segmentation.py
271
2444
""" ========================================= Segmenting the picture of Lena in regions ========================================= This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogeneous regions. This procedure (spe...
bsd-3-clause
yyjiang/scikit-learn
examples/model_selection/plot_learning_curve.py
250
4171
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
bsd-3-clause
sambitgaan/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/blocking_input.py
69
12119
""" This provides several classes used for blocking interaction with figure windows: :class:`BlockingInput` creates a callable object to retrieve events in a blocking way for interactive sessions :class:`BlockingKeyMouseInput` creates a callable object to retrieve key or mouse clicks in a blocking way for int...
agpl-3.0
herilalaina/scikit-learn
examples/linear_model/plot_logistic.py
73
1568
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic function ========================================================= Shown in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or tw...
bsd-3-clause
trankmichael/scikit-learn
sklearn/utils/tests/test_extmath.py
130
16270
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis Engemann <d.engemann@fz-juelich.de> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from scipy import stats from sklearn.utils.testing import assert_eq...
bsd-3-clause
osergeev/bike
example.py
1
2271
import matplotlib.pyplot as mpl from surface import Surface import numpy as np import zoom # enable animation mode mpl.ion() # enable animation mode #fig, ax = figure.subplots() surface1 = Surface(100,100) surfacepoints = surface1.getPoints() xw1=1.5 yw1=1.5 xw2=3 yw2=1.5 xp1=1.7 yp1=2.5 xp2=2.7...
gpl-2.0
jon-courtney/cnn-autonomous-drone
shared/bagreader.py
1
1056
#!/usr/bin/env python import pandas as pd import rosbag_pandas import sys, os, pdb from PIL import Image from io import BytesIO sys.path.append(os.path.abspath('../..')) # Not clean from annotate_base import AnnotateBase class BagReader(AnnotateBase): def __init__(self, num_actions=2, newtopic=True): sup...
bsd-2-clause
h-mayorquin/camp_india_2016
project3_sustained_activity/dynamical_study.py
1
2389
from brian2 import * import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(font_scale=2.0) # Neuron Parameters g_l = 0.05 * msiemens / cm2 cm = 1.0 * ufarad / cm2 # Specific membrane capacitance E_l = -60 * mV # Resting potential V_t = -50 * mV # Threshold tau_w = 600 * ms # Adaptation ...
mit
hbldh/skboost
skboost/datasets/hastie/__init__.py
1
1474
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`hastie` =========== .. module:: hastie :platform: Unix, Windows :synopsis: .. moduleauthor:: hbldh <henrik.blidh@nedomkull.com> Created on 2015-11-10 """ from __future__ import division from __future__ import print_function from __future__ import unic...
mit
itdxer/neupy
examples/competitive/sofm_compare_weight_init.py
1
1754
from itertools import product import matplotlib.pyplot as plt from neupy import algorithms, utils, init from utils import plot_2d_grid, make_circle, make_elipse, make_square plt.style.use('ggplot') utils.reproducible() if __name__ == '__main__': GRID_WIDTH = 4 GRID_HEIGHT = 4 datasets = [ mak...
mit
samuel1208/scikit-learn
sklearn/metrics/cluster/tests/test_bicluster.py
394
1770
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
bsd-3-clause
aubreyli/hmmlearn
examples/plot_hmm_stock_analysis.py
2
2681
""" Gaussian HMM of stock data -------------------------- This script shows how to use Gaussian HMM on stock price data from Yahoo! finance. For more information on how to visualize stock prices with matplotlib, please refer to ``date_demo1.py`` of matplotlib. """ from __future__ import print_function import datetim...
bsd-3-clause
winklerand/pandas
pandas/tests/groupby/test_timegrouper.py
3
26859
""" test with the TimeGrouper / grouping with datetimes """ import pytest import pytz from datetime import datetime import numpy as np from numpy import nan import pandas as pd from pandas import (DataFrame, date_range, Index, Series, MultiIndex, Timestamp, DatetimeIndex) from pandas.compat impor...
bsd-3-clause
nysbc/Anisotropy
ThreeDFSC/ThreeDFSC_Start.py
1
12504
#!/usr/bin/env python # -*- coding: UTF-8 -*- ### Require Anaconda3 ### ============================ ### 3D FSC Software Wrapper ### Written by Philip Baldwin ### Edited by Yong Zi Tan and Dmitry Lyumkis ### Anaconda environment and Numba CUDA support by Carl Negro ### Downloaded from https://github.com/nysbc/Anisotro...
mit
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/pandas/tools/tests/test_join.py
7
30695
# pylint: disable=E1103 import nose from numpy.random import randn import numpy as np import pandas as pd from pandas.compat import lrange import pandas.compat as compat from pandas.tools.merge import merge, concat from pandas.util.testing import assert_frame_equal from pandas import DataFrame, MultiIndex, Series i...
apache-2.0
abimannans/scikit-learn
sklearn/cluster/spectral.py
233
18153
# -*- coding: utf-8 -*- """Algorithms for spectral clustering""" # Author: Gael Varoquaux gael.varoquaux@normalesup.org # Brian Cheung # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import check_rand...
bsd-3-clause
WafaaT/spark-tk
regression-tests/sparktkregtests/testcases/frames/frame_sort_test.py
10
6152
# 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
olafhauk/mne-python
mne/channels/layout.py
4
36277
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Marijn van Vliet <w.m.vanvliet@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmai...
bsd-3-clause
kpj/SDEMotif
formula_investigator.py
1
4469
""" Investigate chemical formulas """ import pickle import itertools import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from tqdm import tqdm import reaction_finder def read_combinatorial_compounds(fname='cache/rf_raw_reaction_data.pkl'): with open(fname, 'rb') as fd: comps = p...
mit
tgsmith61591/skutil
skutil/preprocessing/tests/test_impute.py
1
6525
from __future__ import print_function import pandas as pd import numpy as np from numpy.random import choice from sklearn.datasets import load_iris from skutil.preprocessing import * from skutil.utils import shuffle_dataframe from skutil.testing import assert_fails from sklearn.ensemble import RandomForestClassifier ...
bsd-3-clause
kdheepak89/mpld3
mpld3/tests/test_elements.py
3
5689
""" Test creation of basic plot elements """ import numpy as np import matplotlib.pyplot as plt from .. import fig_to_dict, fig_to_html from numpy.testing import assert_equal def test_line(): fig, ax = plt.subplots() ax.plot(np.arange(10), np.random.random(10), '--k', alpha=0.3, zorder=10, lw=2) ...
bsd-3-clause