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
microhh/microhh
kernel_tuner/statistics.py
5
1185
import matplotlib.pyplot as pl import numpy as np import json import glob pl.close('all') pl.ion() def get_timings(kernel_name, gridsizes): dt = np.zeros_like(gridsizes, dtype=float) for i,gridsize in enumerate(gridsizes): with open( '{0}_{1:03d}.json'.format(kernel_name, gridsize) ) as f: ...
gpl-3.0
altairpearl/scikit-learn
examples/manifold/plot_mds.py
88
2731
""" ========================= Multi-dimensional scaling ========================= An illustration of the metric and non-metric MDS on generated noisy data. The reconstructed points using the metric MDS and non metric MDS are slightly shifted to avoid overlapping. """ # Author: Nelle Varoquaux <nelle.varoquaux@gmail....
bsd-3-clause
timpalpant/KaggleTSTextClassification
scripts/plot_feature_label_correlations.py
1
1976
#!/usr/bin/env python ''' Compute mutual information between individual features and labels ''' import argparse import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from common import * def opts(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('feat...
gpl-3.0
harlowja/networkx
examples/algorithms/blockmodel.py
32
3009
#!/usr/bin/env python # encoding: utf-8 """ Example of creating a block model using the blockmodel function in NX. Data used is the Hartford, CT drug users network: @article{, title = {Social Networks of Drug Users in {High-Risk} Sites: Finding the Connections}, volume = {6}, shorttitle = {Social Networks of Drug ...
bsd-3-clause
MannyGrewal/Manny.CIFAR
Manny.CIFAR/CIFAR/CIFARPlotter.py
1
1321
import math import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import pylab ######################################################################## # 2017 - Manny Grewal # Purpose of this class is to visualise a list of images from the CIFAR dataset # How many columns to show...
mit
terkkila/scikit-learn
sklearn/cross_decomposition/cca_.py
209
3150
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
mailhexu/pyDFTutils
pyDFTutils/vasp/procar_reader.py
2
3569
#!/usr/bin/env python from numpy import zeros,inner import numpy as np import re from pyDFTutils.ase_utils import symbol_number import matplotlib.pyplot as plt def fix_line(line): line=re.sub("(\d)-(\d)", r'\1 -\2',line) return line class procar_reader(): def __init__(self,fname='PROCAR'): self.re...
lgpl-3.0
alalbiol/trading-with-python
lib/qtpandas.py
77
7937
''' Easy integration of DataFrame into pyqt framework Copyright: Jev Kuznetsov Licence: BSD ''' from PyQt4.QtCore import (QAbstractTableModel,Qt,QVariant,QModelIndex,SIGNAL) from PyQt4.QtGui import (QApplication,QDialog,QVBoxLayout, QHBoxLayout, QTableView, QPushButton, QWidget,QTabl...
bsd-3-clause
shiinoandra/wavegano
Program/Wavegano/Wavegano/Wavegano.py
1
21939
import operation as op import random import math import Helper import GRDEI import RDE import GDE import Wave import os import numpy import matplotlib.pyplot as plt numpy.set_printoptions(threshold=numpy.nan) #def encode(payload_path,cover_path,threshold,segment_size,partition_segment_size,method): # file_name = c...
mit
drandykass/fatiando
gallery/gravmag/eqlayer_transform.py
6
3046
""" Equivalent layer for griding and upward-continuing gravity data ------------------------------------------------------------------------- The equivalent layer is one of the best methods for griding and upward continuing gravity data and much more. The trade-off is that performing this requires an inversion and lat...
bsd-3-clause
g2p/systems
lib/systems/context.py
1
17949
# vim: set fileencoding=utf-8 sw=2 ts=2 et : from __future__ import absolute_import from __future__ import with_statement from logging import getLogger import networkx as NX import yaml from systems.collector import Aggregate, CResource from systems.registry import get_registry from systems.typesystem import EResour...
gpl-2.0
hsiaoyi0504/scikit-learn
sklearn/manifold/t_sne.py
106
20057
# Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de> # License: BSD 3 clause (C) 2014 # This is the standard t-SNE implementation. There are faster modifications of # the algorithm: # * Barnes-Hut-SNE: reduces the complexity of the gradient computation from # N^2 to N log N (http://arxiv.org/abs/1301....
bsd-3-clause
canast02/csci544_fall2016_project
yelp-sentiment/experiments/sentiment_stochasticGradientDescent.py
1
2641
import numpy as np from nltk import TweetTokenizer, accuracy from nltk.stem.snowball import EnglishStemmer from sklearn import svm, linear_model from sklearn.cross_validation import StratifiedKFold from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import accuracy_score from sklearn.metric...
gpl-3.0
Lyleo/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/numerix/__init__.py
69
5473
""" numerix imports either Numeric or numarray based on various selectors. 0. If the value "--numpy","--numarray" or "--Numeric" is specified on the command line, then numerix imports the specified array package. 1. The value of numerix in matplotlibrc: either Numeric or numarray 2. If none of the above is...
gpl-3.0
sliwhu/UWHousingTeam
model/house_price_model.py
1
6622
""" Contains the house price model. DON'T USE THIS MODEL! Use the HousePriceModel in house_price_model_2.py. """ import os import numpy as np import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import RidgeCV # Constants BASE_DATE = pd.to_datetime('20140101', format='%Y%...
mit
renatopp/liac
liac/dataset/__init__.py
1
3050
# ============================================================================= # Federal University of Rio Grande do Sul (UFRGS) # Connectionist Artificial Intelligence Laboratory (LIAC) # Renato de Pontes Pereira - rppereira@inf.ufrgs.br # ============================================================================= ...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/scipy/signal/spectral.py
4
66089
"""Tools for spectral analysis. """ from __future__ import division, print_function, absolute_import import numpy as np from scipy import fftpack from . import signaltools from .windows import get_window from ._spectral import _lombscargle from ._arraytools import const_ext, even_ext, odd_ext, zero_ext import warning...
gpl-3.0
se4u/pylearn2
pylearn2/sandbox/cuda_convnet/bench.py
44
3589
__authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import numpy as np from theano....
bsd-3-clause
0asa/sparklingpandas
sparklingpandas/test/pandas_groupby_tests.py
2
9480
""" Test our groupby support based on the pandas groupby tests. """ # # This file is licensed under the Pandas 3 clause BSD license. # from tempfile import NamedTemporaryFile from sparklingpandas.test.sparklingpandastestcase import \ SparklingPandasTestCase import sys import pandas as pd from pandas import date_ra...
apache-2.0
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/matplotlib/tests/test_coding_standards.py
7
12216
from __future__ import (absolute_import, division, print_function, unicode_literals) from fnmatch import fnmatch import os from nose.tools import assert_equal from nose.plugins.skip import SkipTest from matplotlib.testing.noseclasses import KnownFailureTest try: import pep8 except ImportE...
mit
tedmeeds/tcga_encoder
tcga_encoder/utils/helpers.py
1
3776
import tensorflow import tcga_encoder import sys, os, yaml import numpy as np import scipy as sp import pylab as pp import pandas as pd from sklearn.metrics import roc_auc_score, roc_curve from sklearn.model_selection import KFold from collections import * import itertools import pdb def xval_folds( n, K, randomize = F...
mit
weidel-p/nest-simulator
pynest/nest/tests/test_spatial/test_plotting.py
12
5748
# -*- coding: utf-8 -*- # # test_plotting.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
mattilyra/scikit-learn
sklearn/__init__.py
27
3086
""" Machine learning module for Python ================================== sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). It aims to provide simple and efficient solutions to learning problems that are acc...
bsd-3-clause
samgoodgame/sf_crime
iterations/KK_scripts/transform_test_data.py
2
6405
# -*- coding: utf-8 -*- """ Created on Sun Aug 20 11:25:06 2017 @author: kalvi """ #required imports import pandas as pd import numpy as np import csv import time import calendar def get_test_data(test_transformed_path, test_path, earlyWeatherDataPath, weatherData1, weatherData2): x_data = pd.read_csv(test_tran...
mit
NelisVerhoef/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
justinbois/fish-activity
tests/test_parse.py
1
8083
import pytest import numpy as np import pandas as pd from pandas.util.testing import assert_frame_equal import fishact def test_sniffer(): n_header, delimiter, line = fishact.parse._sniff_file_info( 'tests/single_gtype.txt') assert n_header == 2 assert deli...
mit
CVML/scikit-learn
examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py
227
5170
""" ================================================= Hyper-parameters of Approximate Nearest Neighbors ================================================= This example demonstrates the behaviour of the accuracy of the nearest neighbor queries of Locality Sensitive Hashing Forest as the number of candidates and the numb...
bsd-3-clause
huzq/scikit-learn
examples/cluster/plot_mean_shift.py
23
1775
""" ============================================= A demo of the mean-shift clustering algorithm ============================================= Reference: Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward feature space analysis". IEEE Transactions on Pattern Analysis and Machine Intelligence. 2002. ...
bsd-3-clause
waterponey/scikit-learn
examples/neighbors/plot_lof.py
30
1939
""" ================================================= Anomaly detection with Local Outlier Factor (LOF) ================================================= This example presents the Local Outlier Factor (LOF) estimator. The LOF algorithm is an unsupervised outlier detection method which computes the local density deviat...
bsd-3-clause
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/scipy/spatial/tests/test__plotutils.py
15
2140
from __future__ import division, print_function, absolute_import import pytest from numpy.testing import assert_, assert_array_equal from scipy._lib._numpy_compat import suppress_warnings try: import matplotlib matplotlib.rcParams['backend'] = 'Agg' import matplotlib.pyplot as plt from matplotlib.coll...
mit
anntzer/seaborn
seaborn/_core.py
1
44884
import warnings import itertools from copy import copy from functools import partial from collections.abc import Iterable, Sequence, Mapping from numbers import Number from datetime import datetime import numpy as np import pandas as pd import matplotlib as mpl from ._decorators import ( share_init_params_with_ma...
bsd-3-clause
jeffwdoak/free_energies
free_energies/electronicdos.py
1
14960
#!/usr/bin/python # electronicdos.py v0.5 5-16-2012 Jeff Doak jeff.w.doak@gmail.com import numpy as np from scipy.interpolate import UnivariateSpline from scipy.integrate import quad from scipy.optimize import fsolve import sys, subprocess BOLTZCONST = 8.617e-5 #eV/K class ElectronicDOS: """ Class to calcula...
mit
magne-max/zipline-ja
tests/history/generate_csvs.py
8
5432
# # Copyright 2015 Quantopian, Inc. # # 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 wr...
apache-2.0
xwolf12/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
DouglasLeeTucker/DECam_PGCM
bin/rawdata_se_objects_split.py
1
5996
#!/usr/bin/env python """ rawdata_se_objects_split.py Example: rawdata_se_objects_split.py --help rawdata_se_objects_split.py --inputFileListFile inputfilelist.csv --outputFileListFile outputfilelist.csv --verbose 2 """ ###...
gpl-3.0
arabenjamin/scikit-learn
sklearn/linear_model/tests/test_sgd.py
129
43401
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
foolcage/fooltrader
fooltrader/spiders/america/sp500_spider.py
1
3418
# -*- coding: utf-8 -*- import pandas as pd import scrapy from scrapy import Request from scrapy import Selector from scrapy import signals from fooltrader.contract.files_contract import get_kdata_path from fooltrader.utils.utils import index_df_with_time, to_time_str, to_float class Sp500Spider(scrapy.Spider): ...
mit
flennerhag/mlens
mlens/ensemble/tests/test_a_sklearn.py
1
7958
""" Test Scikit-learn """ import numpy as np from mlens.ensemble import SuperLearner, Subsemble, BlendEnsemble, TemporalEnsemble from mlens.testing.dummy import return_pickled try: from sklearn.utils.estimator_checks import check_estimator from sklearn.linear_model import Lasso, LinearRegression from sklear...
mit
paveldedik/thesis
models/models.py
1
30072
# -*- coding: utf-8 -*- """ Evaluation Models ================= """ from __future__ import division from copy import copy from itertools import izip from collections import defaultdict import numpy as np import pandas as pd import tools __all__ = ( 'DummyPriorModel', 'EloModel', 'EloResponseTime', ...
mit
gotomypc/scikit-learn
examples/linear_model/plot_sgd_iris.py
286
2202
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print(__doc__) ...
bsd-3-clause
giruenf/GRIPy
app/app_utils.py
1
29345
import re import os import json import importlib import timeit import inspect import collections from enum import Enum from pathlib import Path import numpy as np from matplotlib.cm import cmap_d import wx import app import fileio from classes.om.base.manager import ObjectManager from app import log ...
apache-2.0
DEVELByte/incubator-airflow
airflow/www/views.py
2
91943
# -*- coding: utf-8 -*- # # 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 writing, software ...
apache-2.0
woutdenolf/spectrocrunch
spectrocrunch/visualization/tests/test_scene.py
1
2667
# -*- coding: utf-8 -*- import unittest import matplotlib.pyplot as plt import numpy as np from .. import scene from ...patch.pint import ureg class test_scene(unittest.TestCase): def test_images(self): n0, n1 = 5, 10 img = np.arange(n0 * n1).reshape(n0, n1) unit0 = ureg.mm uni...
mit
dato-code/SFrame
oss_src/unity/python/sframe/test/test_sarray.py
5
120681
# -*- coding: utf-8 -*- ''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' from ..data_structures.sarray import SArray from ..util.timezone import GMT from . import util import binascii import pandas ...
bsd-3-clause
paultopia/auto-sklearn
autosklearn/data/competition_data_manager.py
5
16248
# Functions performing various input/output operations for the ChaLearn AutoML challenge # Main contributor: Arthur Pesah, August 2014 # Edits: Isabelle Guyon, October 2014 # ALL INFORMATION, SOFTWARE, DOCUMENTATION, AND DATA ARE PROVIDED "AS-IS". # ISABELLE GUYON, CHALEARN, AND/OR OTHER ORGANIZERS OR CODE AUTHORS DI...
bsd-3-clause
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/pandas/tests/api/test_types.py
15
3674
# -*- coding: utf-8 -*- import pytest from warnings import catch_warnings import numpy as np import pandas from pandas.core import common as com from pandas.api import types from pandas.util import testing as tm from .test_api import Base class TestTypes(Base): allowed = ['is_bool', 'is_bool_dtype', ...
mit
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/pandas/tests/test_common.py
3
4870
# -*- coding: utf-8 -*- import pytest import numpy as np from pandas import Series, Timestamp from pandas.compat import range, lmap import pandas.core.common as com import pandas.util.testing as tm def test_mut_exclusive(): msg = "mutually exclusive arguments: '[ab]' and '[ab]'" with tm.assert_raises_regex...
mit
adybbroe/atrain_match
atrain_match/reshaped_files_scr/plot_ctth_boxplots_mlvl2_temperature_pressure_height.py
1
16002
"""Read all matched data and make some plotting """ import os import re from glob import glob import numpy as np from matchobject_io import (readCaliopImagerMatchObj, CalipsoImagerTrackObject) from plot_kuipers_on_area_util import (PerformancePlottingObject, ...
gpl-3.0
afruizc/microsoft_malware_challenge
src/models/first_model/get_conf_matrix.py
2
2842
""" This is a script that is used to generate a confussion matrix for a classification method. This uses 10-k cross_validation with in order to provide sensible resutls and not overfit. """ __author__ = "Andres Ruiz" __license__ = "Apache" __email__ = "afruizc __thingy__ cs unm edu" import numpy as np from sklearn.cr...
apache-2.0
carrillo/scikit-learn
sklearn/utils/tests/test_testing.py
107
4210
import warnings import unittest import sys from nose.tools import assert_raises from sklearn.utils.testing import ( _assert_less, _assert_greater, assert_less_equal, assert_greater_equal, assert_warns, assert_no_warnings, assert_equal, set_random_state, assert_raise_message) from ...
bsd-3-clause
hmtai6/universe_NeonRace-v0
DQN_breakout/DQN.py
1
9601
import argparse import logging import sys import gc import cv2 import matplotlib.pyplot as plt import gym import universe # register the universe environments from universe import wrappers from collections import deque from skimage.color import rgb2gray from skimage.transform import resize import numpy as np import t...
mit
trungnt13/scikit-learn
sklearn/tests/test_kernel_ridge.py
342
3027
import numpy as np import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils.testing import ignore_warnings from sklearn.utils.testing import assert...
bsd-3-clause
IamJeffG/geopandas
geopandas/io/tests/test_io.py
1
1794
from __future__ import absolute_import import fiona from geopandas import read_postgis, read_file from geopandas.tests.util import download_nybb, connect, create_db, \ PANDAS_NEW_SQL_API, unittest, validate_boro_df class TestIO(unittest.TestCase): def setUp(self): nybb_filename, nybb_zip_path = dow...
bsd-3-clause
libAtoms/matscipy
examples/electrochemistry/pnp_batch/cell_1d/stern_layer_sweep/pnp_plot.py
2
6741
# positional args # datadir, figfile, param, param_label import os.path, re, sys import numpy as np from glob import glob from cycler import cycler from itertools import cycle from itertools import groupby import matplotlib.pyplot as plt # Ensure variable is defined try: datadir except NameError: try: ...
gpl-2.0
jakobworldpeace/scikit-learn
sklearn/metrics/tests/test_score_objects.py
33
17877
import pickle import tempfile import shutil import os import numbers import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regexp from sklearn.utils.t...
bsd-3-clause
vortex-ape/scikit-learn
sklearn/kernel_approximation.py
4
23032
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
evanthebouncy/nnhmm
uai_network/draw.py
7
2929
import numpy as np import matplotlib.pylab as plt import multiprocessing as mp from matplotlib import figure from data import * FIG = plt.figure() def draw_coord(coord, name, lab=[1.0, 0.0]): color = 1.0 if lab[0] > lab[1] else -1.0 ret = np.zeros(shape=[L,L,1]) coord_x, coord_y = coord coord_x_idx = np.argm...
mit
droter/trading-with-python
lib/backtest.py
74
7381
#------------------------------------------------------------------------------- # Name: backtest # Purpose: perform routine backtesting tasks. # This module should be useable as a stand-alone library outide of the TWP package. # # Author: Jev Kuznetsov # # Created: 03/07/2014 ...
bsd-3-clause
Upward-Spiral-Science/claritycontrol
code/scripts/roi_analysis.py
1
2744
#!/usr/bin/python #-*- coding:utf-8 -*- __author__ = 'david' from __builtin__ import * import gc import numpy as np from skimage.feature import greycomatrix, greycoprops import matplotlib as mpl mpl.use('TkAgg') # Solve runtime issue import matplotlib.pyplot as plt ## Fake imge and label volumes to fast test funct...
apache-2.0
kostajaitachi/shogun
examples/undocumented/python_modular/graphical/regression_lars.py
26
3327
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from modshogun import RegressionLabels, RealFeatures from modshogun import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression from modshogun import MeanSquaredError # we compare LASSO with ordinary least-squares (OLE) # in the idea...
gpl-3.0
kmiernik/Pyspectr
bin/spectrum_fitter.py
1
6663
#!/usr/bin/env python3 """ K. Miernik 2013 k.a.miernik@gmail.com GPL v3 Spectrum fitting code """ import argparse import math import numpy import os import sys import time import xml.etree.ElementTree as ET import matplotlib.pyplot as plt from lmfit import minimize, Parameters, report_errors from P...
gpl-3.0
SeldonIO/seldon-server
python/seldon/pipeline/sklearn_transform.py
2
1944
from collections import defaultdict import pandas as pd import numpy as np from sklearn.base import BaseEstimator,TransformerMixin from seldon.util import DeprecationHelper class SklearnTransform(BaseEstimator,TransformerMixin): """ Allow sklearn transformers to be run on Pandas dataframes. Parameters ...
apache-2.0
mlperf/training_results_v0.6
NVIDIA/benchmarks/minigo/implementations/tensorflow/minigo/oneoffs/embeddings_graphs.py
8
3394
#!/usr/bin/env python3 # Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
erp12/pyshgp
pyshgp/gp/evaluation.py
1
7737
"""The :mod:`evaluation` module defines classes to evaluate program CodeBlocks.""" from abc import ABC, abstractmethod from typing import Sequence, Union, Callable from collections import defaultdict import numpy as np import pandas as pd from pyshgp.push.interpreter import PushInterpreter, Program from pyshgp.tap imp...
mit
madjelan/scikit-learn
sklearn/semi_supervised/label_propagation.py
128
15312
# coding=utf8 """ Label propagation in the context of this module refers to a set of semisupervised classification algorithms. In the high level, these algorithms work by forming a fully-connected graph between all points given and solving for the steady-state distribution of labels at each point. These algorithms per...
bsd-3-clause
calatre/epidemics_network
treat/excel_clipper.py
1
1352
# Universidade de Aveiro - Physics Department # 2016/2017 Project - Andre Calatre, 73207 # "Simulation of an epidemic" - 28/6/2017 # Selecting Data from an excel file to another #import numpy as np import pandas as pd from openpyxl import load_workbook #r = [0, 301, 302, 303, 304, 305, 306] #desired = ['S_Avg', 'I_Av...
apache-2.0
piskvorky/gensim
gensim/sklearn_api/atmodel.py
4
10965
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author: Chinmaya Pancholi <chinmayapancholi13@gmail.com> # Copyright (C) 2017 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """Scikit learn interface for :class:`~gensim.models.atmodel.AuthorTopicModel...
lgpl-2.1
wesleybowman/karsten
project/rawADCPclass.py
1
4107
from __future__ import division import numpy as np import sys sys.path.append('/home/wesley/github/UTide/') from utide import ut_solv, ut_reconstr #from shortest_element_path import shortest_element_path #import matplotlib.pyplot as plt #import matplotlib.tri as Tri #import matplotlib.ticker as ticker #import seaborn i...
mit
lancezlin/ml_template_py
lib/python2.7/site-packages/sklearn/semi_supervised/tests/test_label_propagation.py
5
1998
""" test the label propagation module """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {...
mit
RPGOne/Skynet
scikit-learn-0.18.1/sklearn/manifold/tests/test_mds.py
99
1873
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.manifold import mds from sklearn.utils.testing import assert_raises def test_smacof(): # test metric smacof using the data of "Modern Multidimensional Scaling", # Borg & Groenen, p 154 sim = np.array([[0, 5, 3, 4], ...
bsd-3-clause
runt18/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/colors.py
1
31702
""" A module for converting numbers or color arguments to *RGB* or *RGBA* *RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the range 0-1. This module includes functions and classes for color specification conversions, and for mapping numbers to colors in a 1-D array of colors called a colormap. Color...
agpl-3.0
agoose77/hivesystem
manual/movingpanda/panda-11d.py
1
6687
import dragonfly import dragonfly.pandahive import bee from bee import connect import math, functools from panda3d.core import NodePath import dragonfly.scene.unbound, dragonfly.scene.bound import dragonfly.std import dragonfly.io import dragonfly.canvas import Spyder # ## random matrix generator from random impor...
bsd-2-clause
smunaut/gnuradio
gr-filter/examples/fir_filter_ccc.py
6
4023
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
harisbal/pandas
pandas/core/reshape/merge.py
2
61308
""" SQL-style merge routines """ import copy import string import warnings import numpy as np from pandas._libs import hashtable as libhashtable, join as libjoin, lib import pandas.compat as compat from pandas.compat import filter, lzip, map, range, zip from pandas.errors import MergeError from pandas.util._decorato...
bsd-3-clause
ajm/pulp
explore/management/commands/okapibm25.py
2
2542
# This file is part of PULP. # # PULP 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 option) any later version. # # PULP is distributed in the hope that it will ...
gpl-3.0
Aasmi/scikit-learn
sklearn/datasets/mldata.py
309
7838
"""Automatically download MLdata datasets.""" # Copyright (c) 2011 Pietro Berkes # License: BSD 3 clause import os from os.path import join, exists import re import numbers try: # Python 2 from urllib2 import HTTPError from urllib2 import quote from urllib2 import urlopen except ImportError: # Pyt...
bsd-3-clause
xzturn/tensorflow
tensorflow/lite/micro/examples/micro_speech/apollo3/compare_1k.py
9
5012
# Copyright 2018 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
djgagne/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
natasasdj/OpenWPM
analysis/05_images_pixels.py
2
6264
import os import sqlite3 import pandas as pd from matplotlib.colors import LogNorm import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter from statsmodels.distributions.empirical_distribution import ECDF def thousands(x, pos): if x>=1e9: return '%dB' % (x*1e-9) elif x>=1e6: ...
gpl-3.0
semiautomaticgit/SemiAutomaticClassificationPlugin
semiautomaticclassificationplugin.py
1
86616
# -*- coding: utf-8 -*- ''' /************************************************************************************************************************** SemiAutomaticClassificationPlugin The Semi-Automatic Classification Plugin for QGIS allows for the supervised classification of remote sensing images, provid...
gpl-3.0
ran5515/DeepDecision
tensorflow/examples/learn/text_classification_cnn.py
29
5677
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
drammock/mne-python
tutorials/stats-sensor-space/40_cluster_1samp_time_freq.py
10
5666
""" =============================================================== Non-parametric 1 sample cluster statistic on single trial power =============================================================== This script shows how to estimate significant clusters in time-frequency power estimates. It uses a non-parametric statisti...
bsd-3-clause
nikhilgahlawat/ThinkStats2
code/populations.py
68
2609
"""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 import csv import logging import sys import numpy as np import pandas import thinkpl...
gpl-3.0
pdamodaran/yellowbrick
tests/rand.py
1
3176
# tests.random # A visualizer that draws a random scatter plot for testing. # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Wed Mar 21 17:51:15 2018 -0400 # # ID: random.py [] benjamin@bengfort.com $ """ A visualizer that draws a random scatter plot for testing. """ ########################...
apache-2.0
mortada/tensorflow
tensorflow/examples/learn/boston.py
33
1981
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
start-jsk/jsk_apc
jsk_apc2016_common/python/jsk_apc2016_common/rbo_segmentation/evaluate.py
1
7455
from apc_data import APCDataSet, APCSample from probabilistic_segmentation import ProbabilisticSegmentationRF, ProbabilisticSegmentationBP import pickle import os import matplotlib.pyplot as plt import numpy as np import copy import rospkg def _fast_hist(a, b, n): k = (a >= 0) & (a < n) hist = np.bincount(n ...
bsd-3-clause
zaxtax/scikit-learn
sklearn/svm/tests/test_sparse.py
35
13182
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
licco/zipline
zipline/history/history_container.py
1
18509
# # Copyright 2014 Quantopian, Inc. # # 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 wr...
apache-2.0
JeanKossaifi/scikit-learn
sklearn/preprocessing/tests/test_function_transformer.py
176
2169
from nose.tools import assert_equal import numpy as np from sklearn.preprocessing import FunctionTransformer def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X): def _func(X, *args, **kwargs): args_store.append(X) args_store.extend(args) kwargs_store.update(kwargs) ...
bsd-3-clause
shashankrajput/seq2seq
seq2seq/tasks/dump_attention.py
6
4850
# Copyright 2017 Google Inc. # # 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 writing,...
apache-2.0
ldirer/scikit-learn
examples/cluster/plot_digits_agglomeration.py
377
1694
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Feature agglomeration ========================================================= These images how similar features are merged together using feature agglomeration. """ print(__doc__) # Code source: Gaël Varoquaux #...
bsd-3-clause
souljourner/fab
EDA/FOMC.py
2
5156
from __future__ import print_function from bs4 import BeautifulSoup from urllib.request import urlopen import re import pandas as pd import pickle import threading import sys class FOMC (object): ''' A convenient class for extracting meeting minutes from the FOMC website Example Usage: fomc = FOM...
mit
gmartinvela/Incubator
Incubator/mongo_save.py
1
2777
from pymongo import MongoClient import urllib2 import time import datetime import json import sqlite3 import pandas.io.sql as psql from data_utils import retrieve_DBs, extract_data_from_DB mongo_client = MongoClient() mongo_db = mongo_client.incubator measures_collection = mongo_db.measures local_path_SHT1xdb = "/ho...
mit
chrisburr/scikit-learn
sklearn/metrics/ranking.py
17
26927
"""Metrics to assess performance on classification task given scores Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria....
bsd-3-clause
ZENGXH/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
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/subplots_axes_and_figures/custom_figure_class.py
1
1517
""" =================== Custom Figure Class =================== You can pass a custom Figure constructor to figure if you want to derive from the default Figure. This simple example creates a figure with a figure title. """ import matplotlib.pyplot as plt #import figure, show from matplotlib.figure import Figure # n...
mit
hanteng/babel
scripts/geoname_cldr.py
1
2479
#!/usr/bin/env python # -*- coding: utf-8 -*- #歧視無邊,回頭是岸。鍵起鍵落,情真情幻。 # url_target="https://raw.githubusercontent.com/datasets/country-codes/master/data/country-codes.csv" import csv import pandas as pd import codecs def export_to_csv(df, ex_filename, sep=','): if sep==',': df.to_csv(ex_filename, sep=sep, q...
bsd-3-clause
kdebrab/pandas
pandas/tests/indexes/multi/test_set_ops.py
2
8078
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import pandas.util.testing as tm from pandas import (CategoricalIndex, DatetimeIndex, MultiIndex, PeriodIndex, Series, TimedeltaIndex) def test_setops_errorcases(idx): # # non-iterable input cases = [0.5, 'xxx'] methods =...
bsd-3-clause
LiaoPan/scikit-learn
examples/ensemble/plot_gradient_boosting_quantile.py
392
2114
""" ===================================================== Prediction Intervals for Gradient Boosting Regression ===================================================== This example shows how quantile regression can be used to create prediction intervals. """ import numpy as np import matplotlib.pyplot as plt from skle...
bsd-3-clause
atantet/ergoPack
example/numericalFP/numericalFP_Hopf.py
1
5115
import numpy as np import pylibconfig2 from scipy import sparse from scipy.sparse import linalg import matplotlib.pyplot as plt from matplotlib import cm from ergoNumAna import ChangCooper readEigVal = False #readEigVal = True def hopf(x, mu, omega): f = np.empty((2,)) f[0] = x[0] * (mu - (x[0]**2 + x[1]**2))...
gpl-3.0