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
BoltzmannBrain/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/ticker.py
69
37420
""" Tick locating and formatting ============================ This module contains classes to support completely configurable tick locating and formatting. Although the locators know nothing about major or minor ticks, they are used by the Axis class to support major and minor tick locating and formatting. Generic t...
agpl-3.0
lfairchild/PmagPy
programs/histplot.py
1
2907
#!/usr/bin/env python import sys import numpy as np import matplotlib if matplotlib.get_backend() != "TKAgg": matplotlib.use("TKAgg") from matplotlib import pyplot as plt from pmagpy import pmagplotlib def main(): """ NAME histplot.py DESCRIPTION makes histograms for data OPTIONS ...
bsd-3-clause
mantidproject/mantid
qt/applications/workbench/workbench/app/start.py
3
8312
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
huobaowangxi/scikit-learn
sklearn/ensemble/voting_classifier.py
178
8006
""" Soft Voting/Majority Rule classifier. This module contains a Soft Voting/Majority Rule classifier for classification estimators. """ # Authors: Sebastian Raschka <se.raschka@gmail.com>, # Gilles Louppe <g.louppe@gmail.com> # # Licence: BSD 3 clause import numpy as np from ..base import BaseEstimator f...
bsd-3-clause
xiaoxiamii/scikit-learn
examples/calibration/plot_calibration_multiclass.py
272
6972
""" ================================================== 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...
bsd-3-clause
tomlof/scikit-learn
sklearn/manifold/tests/test_isomap.py
121
4301
from itertools import product import numpy as np from numpy.testing import (assert_almost_equal, assert_array_almost_equal, assert_equal) from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing fro...
bsd-3-clause
zorojean/scikit-learn
examples/classification/plot_lda_qda.py
164
4806
""" ==================================================================== Linear and Quadratic Discriminant Analysis with confidence ellipsoid ==================================================================== Plot the confidence ellipsoids of each class and decision boundary """ print(__doc__) from scipy import lin...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/metrics/tests/test_common.py
43
44042
from __future__ import division, print_function from functools import partial from itertools import product import numpy as np import scipy.sparse as sp from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinarizer, MultiLabelBinarizer from sklearn.utils.multiclass impo...
bsd-3-clause
shangwuhencc/scikit-learn
examples/linear_model/plot_lasso_and_elasticnet.py
249
1982
""" ======================================== Lasso and Elastic Net for Sparse Signals ======================================== Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupted with an additive noise. Estimated coefficients are compared with the ground-truth. """ print(...
bsd-3-clause
padilha/biclustlib
biclustlib/algorithms/wrappers/spectral.py
1
1977
""" biclustlib: A Python library of biclustering algorithms and evaluation measures. Copyright (C) 2017 Victor Alexandre Padilha This file is part of biclustlib. biclustlib is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by...
gpl-3.0
X-DataInitiative/tick
tick/preprocessing/utils.py
2
2833
# License: BSD 3 clause import numpy as np import pandas as pd from warnings import warn def safe_array(X, dtype=np.float64): """Checks if the X has the correct type, dtype, and is contiguous. Parameters ---------- X : `pd.DataFrame` or `np.ndarray` or `crs_matrix` The input data. dtype...
bsd-3-clause
rogerallen/kaggle
utils/utils.py
1
7643
from __future__ import division,print_function import math, os, json, sys, re import cPickle as pickle from glob import glob import numpy as np from matplotlib import pyplot as plt from operator import itemgetter, attrgetter, methodcaller from collections import OrderedDict import itertools from itertools import chain ...
apache-2.0
Extintor/piva
practica3/p3script2.py
1
1848
# -*- coding: utf-8 -*- """ Created on Fri Mar 11 13:07:07 2016 @author: paul """ import matplotlib.pyplot as plt import numpy as np def separaimatge(secret,bitsred,bitsgreen,bitsblue): secretredshift = np.right_shift(secret,8-bitsred) secretgreenshift = np.mod(np.right_shift(secret,8-bitsred-bitsgreen),2**...
gpl-3.0
aflaxman/scikit-learn
sklearn/decomposition/tests/test_online_lda.py
38
16445
import sys import numpy as np from scipy.linalg import block_diag from scipy.sparse import csr_matrix from scipy.special import psi from sklearn.decomposition import LatentDirichletAllocation from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d, _diri...
bsd-3-clause
vybstat/scikit-learn
sklearn/discriminant_analysis.py
19
26162
""" 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
philrosenfield/TPAGB-calib
tpagb_calibration/sfhs/star_formation_histories.py
1
16329
from __future__ import print_function import logging import os import matplotlib.pylab as plt import numpy as np import ResolvedStellarPops as rsp from ResolvedStellarPops.convertz import convertz logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) __all__ = ['StarFormationHistories', 'pars...
bsd-3-clause
victorbergelin/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
230
19795
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
Dmitry94/Image_Processing
lab_5_fft/run.py
1
1656
import cv2 import numpy as np from matplotlib import pyplot as plt def show_spectrum_and_original(image): f = cv2.dft(np.float32(image), flags = cv2.DFT_COMPLEX_OUTPUT) fshift = np.fft.fftshift(f) magnitude_spectrum = 20*np.log(cv2.magnitude(fshift[:,:,0], fshift[:,:,1])) plt.subplot(121), plt.imshow...
mit
cseed/hail
hail/python/hail/backend/spark_backend.py
1
13877
import pkg_resources import sys import os import json import socket import socketserver from threading import Thread import py4j import pyspark from hail.utils.java import Env, scala_package_object, scala_object from hail.expr.types import dtype from hail.expr.table_type import ttable from hail.expr.matrix_type import...
mit
jmetzen/scikit-learn
sklearn/svm/setup.py
321
3157
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 config = Configuration('svm', parent_package, top_path) config.add_subpackage('tests') # Section L...
bsd-3-clause
tanayz/Kaggle
BCI/btb_gbm.py
1
2694
__author__ = 'tanay' ## author: phalaris ## kaggle bci challenge gbm benchmark from __future__ import division import numpy as np import pandas as pd import sklearn.ensemble as ens train_subs = ['02','06','07','11','12','13','14','16','17','18','20','21','22','23','24','26'] test_subs = ['01','03','04','05','08','09'...
apache-2.0
pgmpy/pgmpy
pgmpy/models/BayesianNetwork.py
2
38570
#!/usr/bin/env python3 import itertools from collections import defaultdict import logging from operator import mul from functools import reduce import networkx as nx import numpy as np import pandas as pd from tqdm import tqdm from joblib import Parallel, delayed from pgmpy.base import DAG from pgmpy.factors.discre...
mit
rsouza01/eos.maxwell.construction
src/eos.maxwell.construction/eos_maxwell_construction.py
1
6444
#!/usr/bin/python # eos.maxwell.construction - EoS merger based on the Maxwell Construction # Copyright (C) 2015 Rodrigo Souza <rsouza01@gmail.com> # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundati...
gpl-2.0
WangWenjun559/Weiss
summary/sumy/sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
apache-2.0
adamgreenhall/scikit-learn
sklearn/metrics/tests/test_common.py
83
41144
from __future__ import division, print_function from functools import partial from itertools import product import numpy as np import scipy.sparse as sp from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinarizer from sklearn.utils.multiclass import type_of_target fro...
bsd-3-clause
anntzer/scikit-learn
sklearn/linear_model/tests/test_bayes.py
8
10014
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause from math import log import numpy as np from scipy.linalg import pinvh import pytest from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing im...
bsd-3-clause
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/pandas/tests/io/parser/converters.py
7
4914
# -*- coding: utf-8 -*- """ Tests column conversion functionality during parsing for all of the parsers defined in parsers.py """ from datetime import datetime import pytest import numpy as np import pandas as pd import pandas.util.testing as tm from pandas._libs.lib import Timestamp from pandas import DataFrame, ...
mit
moonbury/pythonanywhere
github/MasteringMLWithScikit-learn/8365OS_04_Codes/ch42.py
3
1763
import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split from sklearn.metrics import precision_score, recall_score, roc_auc_score, auc, confusion_matrix import numpy as np from scipy.sparse i...
gpl-3.0
GitYiheng/reinforcement_learning_test
test00_previous_files/save_a_video.py
1
1303
import gym from gym import wrappers import numpy as np import matplotlib.pyplot as plt import time def get_action(s, w): return 1 if s.dot(w) > 0 else 0 def play_one_episode(env, params): observation = env.reset() done = False t = 0 while not done and t < 1000: #env.render() #time.sleep(0.01) t += 1 act...
mit
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/examples/api/artist_demo.py
3
3442
""" Show examples of matplotlib artists http://matplotlib.sourceforge.net/api/artist_api.html Several examples of standard matplotlib graphics primitives (artists) are drawn using matplotlib API. Full list of artists and the documentation is available at http://matplotlib.sourceforge.net/api/artist_api.html Copyright...
gpl-2.0
mxjl620/scikit-learn
examples/linear_model/plot_multi_task_lasso_support.py
249
2211
#!/usr/bin/env python """ ============================================= Joint feature selection with multi-task Lasso ============================================= The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected features to be the same across tasks. This example simulates...
bsd-3-clause
dssg/education-college-public
code/etl/pipeline/tableuploader.py
1
6366
''' Defines two classes that create tables & load data to our Postgres database. These are used to create and populate all the tables that are in our database. ''' import pandas as pd import psycopg2 import re import os import tempfile from util import cred # load SQL credentials from util.SQL_helpers import connect_...
mit
ClimbsRocks/scikit-learn
sklearn/utils/tests/test_shortest_path.py
303
2841
from collections import defaultdict import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.utils.graph import (graph_shortest_path, single_source_shortest_path_length) def floyd_warshall_slow(graph, directed=False): N = graph.shape[0] #set nonzer...
bsd-3-clause
mariusvniekerk/impyla
impala/tests/test_bdf.py
2
2471
# Copyright 2014 Cloudera 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
taohaoge/vincent
examples/grouped_bar_examples.py
11
2923
# -*- coding: utf-8 -*- """ Vincent Grouped Bar Examples """ #Build a Grouped Bar Chart from scratch import pandas as pd from vincent import * from vincent.core import KeyedList farm_1 = {'apples': 10, 'berries': 32, 'squash': 21, 'melons': 13, 'corn': 18} farm_2 = {'apples': 15, 'berries': 40, 'squash': 17, 'melo...
mit
jiajunshen/partsNet
pnet/rotatable_extensionParts_layer_new.py
1
9794
from __future__ import division, print_function, absolute_import import matplotlib as mpl mpl.use('Agg') from scipy.special import logit import numpy as np import itertools as itr import amitgroup as ag from pnet.layer import Layer from pnet.cyfuncs import index_map_pooling import pnet @Layer.register('rotatable_ext...
bsd-3-clause
xavierwu/scikit-learn
sklearn/mixture/tests/test_dpgmm.py
261
4490
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
bsd-3-clause
person142/scipy
scipy/io/wavfile.py
3
14263
""" Module to read / write wav files using NumPy arrays Functions --------- `read`: Return the sample rate (in samples/sec) and data from a WAV file. `write`: Write a NumPy array as a WAV file. """ import sys import numpy import struct import warnings __all__ = [ 'WavFileWarning', 'read', 'write' ] c...
bsd-3-clause
mne-tools/mne-tools.github.io
0.21/_downloads/51837e4937aff2566886026e28ab3651/plot_30_epochs_metadata.py
9
7846
""" .. _tut-epochs-metadata: Working with Epoch metadata =========================== This tutorial shows how to add metadata to :class:`~mne.Epochs` objects, and how to use :ref:`Pandas query strings <pandas:indexing.query>` to select and plot epochs based on metadata properties. .. contents:: Page contents :loca...
bsd-3-clause
aarchiba/scipy
scipy/signal/filter_design.py
3
159923
"""Filter design. """ from __future__ import division, print_function, absolute_import import math import operator import warnings import numpy import numpy as np from numpy import (atleast_1d, poly, polyval, roots, real, asarray, resize, pi, absolute, logspace, r_, sqrt, tan, log10, ...
bsd-3-clause
WarrenWeckesser/scikits-image
doc/examples/plot_seam_carving.py
8
2357
""" ============ Seam Carving ============ This example demonstrates how images can be resized using seam carving [1]_. Resizing to a new aspect ratio distorts image contents. Seam carving attempts to resize *without* distortion, by removing regions of an image which are less important. In this example we are using th...
bsd-3-clause
chenjun0210/tensorflow
tensorflow/python/client/notebook.py
109
4791
# 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
TomAugspurger/pandas
pandas/tests/indexes/interval/test_base.py
1
3184
import numpy as np import pytest from pandas import IntervalIndex, Series, date_range import pandas._testing as tm from pandas.tests.indexes.common import Base class TestBase(Base): """ Tests specific to the shared common index tests; unrelated tests should be placed in test_interval.py or the specific t...
bsd-3-clause
sumspr/scikit-learn
sklearn/datasets/__init__.py
176
3671
""" 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
numpy/numpy-refactor
numpy/core/code_generators/ufunc_docstrings.py
57
85797
# Docstrings for generated ufuncs docdict = {} def get(name): return docdict.get(name) def add_newdoc(place, name, doc): docdict['.'.join((place, name))] = doc add_newdoc('numpy.core.umath', 'absolute', """ Calculate the absolute value element-wise. Parameters ---------- x : array_like...
bsd-3-clause
jmetzen/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
zuku1985/scikit-learn
examples/model_selection/plot_validation_curve.py
141
1931
""" ========================== 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
rodluger/planetplanet
docs/conf.py
1
6109
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # planetplanet documentation build configuration file, created by # sphinx-quickstart on Wed Aug 9 19:49:05 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this...
gpl-3.0
spallavolu/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
rna-seq/raisin.recipe.dashboard
raisin/recipe/dashboard/nested.py
1
4970
import pandas as pd import csv import itertools from types import StringType MEASURE = None class Coordinates: def __init__(self): self.coordinates = [] def __iter__(self): for item in self.coordinates: yield item def __len__(self): return len(self.coordinates) ...
gpl-3.0
numenta-archive/htmresearch
projects/wavelet_dataAggregation/runDatetimeEncoderExperiment.py
11
8678
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 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 progra...
agpl-3.0
mrustl/flopy
examples/Testing/flopy3_CrossSectionExample.py
3
3478
import sys import os import platform import numpy as np import matplotlib.pyplot as plt import matplotlib.colors import flopy #Set name of MODFLOW exe # assumes executable is in users path statement version = 'mf2005' exe_name = 'mf2005' if platform.system() == 'Windows': exe_name = 'mf2005.exe' mfexe = exe_name...
bsd-3-clause
kseetharam/genPolaron
datagen_static_cart.py
1
4937
import numpy as np import pandas as pd import xarray as xr import Grid import pf_static_cart import os from timeit import default_timer as timer import sys if __name__ == "__main__": start = timer() # ---- INITIALIZE GRIDS ---- (Lx, Ly, Lz) = (21, 21, 21) (dx, dy, dz) = (0.375, 0.375, 0.375) x...
mit
marcdata/pynba-tfo
tfo_gameqtr.py
1
12485
# Look at how and whether teams end up with the last shot of the quarter. # # Reconstruct mini-game log, of shots. # Reshape data to support game-quarter type of analysis. # ------------------------------------------------------------------------------ # Imports, Load in bigdf dataset. # ----------------------...
gpl-2.0
vitaly-krugl/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
mlperf/training_results_v0.7
NVIDIA/benchmarks/ssd/implementations/pytorch/visualize.py
5
5886
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
rayNymous/nupic
examples/audiostream/audiostream_tp.py
32
9991
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
chrisburr/scikit-learn
sklearn/linear_model/ridge.py
3
47708
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
astrolitterbox/SAMI
utils.py
1
6843
from __future__ import division import numpy as np from astropy.coordinates.distances import Distance import matplotlib.pyplot as plt import pyfits import db import pyfits from string import * from astroML.plotting import hist from geom import getIncl def simple_plot(x, y, vel, filename): fig = plt.figure(figsize=(1...
gpl-2.0
meduz/scikit-learn
examples/model_selection/plot_confusion_matrix.py
63
3231
""" ================ 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
platinhom/ManualHom
Coding/Python/scipy-html-0.16.1/generated/scipy-stats-gengamma-1.py
1
1124
from scipy.stats import gengamma import matplotlib.pyplot as plt fig, ax = plt.subplots(1, 1) # Calculate a few first moments: a, c = 4.42, 3.12 mean, var, skew, kurt = gengamma.stats(a, c, moments='mvsk') # Display the probability density function (``pdf``): x = np.linspace(gengamma.ppf(0.01, a, c), ...
gpl-2.0
miha-skalic/ITEKA
qt_design/__init__.py
1
14477
""" Main window and functions for ITEKA """ # windows from qt_design.main_ui import * from qt_design.widget_windows import * import calculations import qt_design.reaction_plots as reaction_plots from qt_design.calc_functions import * import pickle import sys import os import PyQt4.QtCore as qc QtCore.QLocale.setDef...
gpl-3.0
douggeiger/gnuradio
gr-filter/examples/reconstruction.py
49
5015
#!/usr/bin/env python # # Copyright 2010,2012,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 ...
gpl-3.0
mlyundin/scikit-learn
sklearn/neighbors/approximate.py
71
22357
"""Approximate nearest neighbor search""" # Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk> # Joel Nothman <joel.nothman@gmail.com> import numpy as np import warnings from scipy import sparse from .base import KNeighborsMixin, RadiusNeighborsMixin from ..base import BaseEstimator from ..utils.va...
bsd-3-clause
amolkahat/pandas
pandas/tests/arrays/sparse/test_array.py
1
41433
from pandas.compat import range import re import operator import pytest import warnings from numpy import nan import numpy as np import pandas as pd from pandas.core.sparse.api import SparseArray, SparseSeries, SparseDtype from pandas._libs.sparse import IntIndex from pandas.util.testing import assert_almost_equal i...
bsd-3-clause
michaelaye/planet4
planet4/dbscan.py
1
22144
#!/usr/bin/env python import logging import math from itertools import product from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import pyaml import seaborn as sns from scipy.stats import circmean, circstd from sklearn.cluster import DBSCAN from . import io, markings log...
isc
jaantollander/Fourier-Legendre
src/analysis/convergence.py
8
1917
# coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numba import numpy as np import pandas from numba import float64, int64 @numba.jit(float64(float64, float64, float64, float64), nopython=True, cac...
mit
nmayorov/scikit-learn
sklearn/ensemble/gradient_boosting.py
18
71095
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
bsd-3-clause
istellartech/OpenTsiolkovsky
bin/make_plot.py
1
18051
# -*- coding: utf-8 -*- # Copyright (c) 2017 Interstellar Technologies Inc. All Rights Reserved. # Authors : Takahiro Inagawa # # Lisence : MIT Lisence # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in th...
mit
brunojulia/ultracoldUB
brightsolitons/Alejandro/bs_v1.py
1
14708
# coding: utf-8 # ## FFT solver for 1D Gross-Pitaevski equation # We look for the complex function $\psi(x)$ satisfying the GP equation # # $ i\partial_t \psi = \frac{1}{2}(-i\partial_x - \Omega)^2\psi+ V(x)\psi + g|\psi|^2\psi $, # # with periodic boundary conditions. # # Integration: pseudospectral method with ...
gpl-3.0
PatrickOReilly/scikit-learn
examples/linear_model/plot_sgd_separating_hyperplane.py
84
1221
""" ========================================= SGD: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a linear Support Vector Machines classifier trained using SGD. """ print(__doc__) import numpy as n...
bsd-3-clause
tmills/neural-assertion
scripts/keras/singletask/assertion_train-and-package.py
1
2599
#!/usr/bin/env python from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.optimizers import SGD from keras.utils import np_utils #from sklearn.datasets import load_svmlight_file import sklearn as sk import sklearn.cross_validation import numpy as np from ctakesneural.io i...
apache-2.0
pgroth/independence-indicators
Temporal-Coauthor-Networks/vincent/examples/stacked_bar_examples.py
11
2691
# -*- coding: utf-8 -*- """ Vincent Stacked Bar Examples """ #Build a Stacked Bar Chart from scratch import pandas as pd from vincent import * farm_1 = {'apples': 10, 'berries': 32, 'squash': 21, 'melons': 13, 'corn': 18} farm_2 = {'apples': 15, 'berries': 40, 'squash': 17, 'melons': 10, 'corn': 22} farm_3 = {'app...
gpl-2.0
ctogle/dilapidator
src/dilap/BROKEN/graph/graph.py
1
15113
import dilap.core.base as db import dilap.core.tools as dpr import dilap.core.vector as dpv import dilap.core.pointset as dps #import dilap.core.graphnode as gnd #import dilap.core.graphedge as geg import dilap.mesh.tools as dtl import matplotlib.pyplot as plt import pdb class geometry(db.base): def radius(se...
mit
sunlightlabs/fcc-net-neutrality-comments
scripts/feature_agglomeration.py
1
5336
import sys import os import json import csv from glob import glob sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir)) import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', filename='log/feature_agglomeration.log', filemode='a', ...
mit
NelisVerhoef/scikit-learn
sklearn/qda.py
140
7682
""" Quadratic Discriminant Analysis """ # Author: Matthieu Perrot <matthieu.perrot@gmail.com> # # License: BSD 3 clause import warnings import numpy as np from .base import BaseEstimator, ClassifierMixin from .externals.six.moves import xrange from .utils import check_array, check_X_y from .utils.validation import ...
bsd-3-clause
irhete/predictive-monitoring-benchmark
transformers/LastStateTransformer.py
1
1601
from sklearn.base import TransformerMixin import pandas as pd from time import time class LastStateTransformer(TransformerMixin): def __init__(self, case_id_col, cat_cols, num_cols, fillna=True): self.case_id_col = case_id_col self.cat_cols = cat_cols self.num_cols = num_cols s...
apache-2.0
iproduct/course-social-robotics
11-dnn-keras/venv/Lib/site-packages/matplotlib/tests/test_mathtext.py
1
14629
import io import os import re import numpy as np import pytest import matplotlib as mpl from matplotlib.testing.decorators import check_figures_equal, image_comparison import matplotlib.pyplot as plt from matplotlib import mathtext math_tests = [ r'$a+b+\dot s+\dot{s}+\ldots$', r'$x \doteq y$', r'\$100....
gpl-2.0
sprax/python
txt/sim_tfidf_nltk.py
1
21467
#!/usr/bin/env python3 '''Text similarity (between words, phrases, or short sentences) using NLTK''' import heapq import string import time import nltk from sklearn.feature_extraction.text import TfidfVectorizer import pdb import qa_csv import text_fio STEMMER = nltk.stem.porter.PorterStemmer() TRANS_NO_PUNCT = str.m...
lgpl-3.0
ppp2006/runbot_number0
qbo_stereo_anaglyph/hrl_lib/src/hrl_lib/geometry.py
4
5946
# # Copyright (c) 2009, Georgia Tech Research 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 source code must retain the above copyright # notice, thi...
lgpl-2.1
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sklearn/tree/export.py
35
16873
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
mit
TIGER-NET/Processing-SWAT
OSFWF_Assimilate_a.py
2
4123
""" *************************************************************************** OSFWF_Assimilate_a.py ------------------------------------- Copyright (C) 2014 TIGER-NET (www.tiger-net.org) *************************************************************************** * This plugin is part of the Water Obser...
gpl-3.0
gauthiier/mailinglists
analyse.py
1
7237
import os # matplot view/windows import matplotlib matplotlib.interactive(True) # pd display import pandas as pd pd.set_option('display.max_colwidth', 100) from analysis.archive import Archive from analysis.query import Query from analysis.plot import Plot import analysis.format # spectre: slategrey # nettime: red...
gpl-3.0
ouedraog/quantfi-project
base/views.py
1
1557
""" Views for the base application """ from django.shortcuts import render import QSTK.qstkutil.qsdateutil as du import QSTK.qstkutil.tsutil as tsu import QSTK.qstkutil.DataAccess as da # Third Party Imports import datetime as dt import pandas as pd def home(request): """ Default view for the root """ return ...
bsd-3-clause
wackymaster/QTClock
Libraries/matplotlib/testing/jpl_units/StrConverter.py
8
5340
#=========================================================================== # # StrConverter # #=========================================================================== """StrConverter module containing class StrConverter.""" #=========================================================================== # Place al...
mit
jkarnows/scikit-learn
sklearn/metrics/classification.py
42
65685
"""Metrics to assess performance on classification task given classe prediction 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.gram...
bsd-3-clause
anurag313/scikit-learn
sklearn/linear_model/tests/test_logistic.py
23
27579
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.util...
bsd-3-clause
ilo10/scikit-learn
examples/ensemble/plot_partial_dependence.py
249
4456
""" ======================== Partial Dependence Plots ======================== Partial dependence plots show the dependence between the target function [1]_ and a set of 'target' features, marginalizing over the values of all other features (the complement features). Due to the limits of human perception the size of t...
bsd-3-clause
maropu/spark
python/pyspark/pandas/usage_logging/usage_logger.py
14
4949
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
holdenk/spark
python/pyspark/sql/pandas/serializers.py
23
12308
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
yyjiang/scikit-learn
sklearn/tests/test_learning_curve.py
225
10791
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de> # # License: BSD 3 clause import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import warnings from sklearn.base import BaseEstimator from sklearn.learning_curve import learning_curve, validation_curve from sklearn.u...
bsd-3-clause
gauthiier/mailinglists
analysis/archive.py
1
4681
import numpy as np import pandas as pd import email, email.parser import os, datetime, json, gzip, re import analysis.util import analysis.query import search.archive ## circular... def filter_date(msg, archive_name): time_tz = analysis.util.format_date(msg, archive_name) if not time_tz: return None dt = dat...
gpl-3.0
nschloe/quadpy
tests/test_c3.py
1
1869
import numpy as np import orthopy import pytest from helpers import find_best_scheme from matplotlib import pyplot as plt import quadpy @pytest.mark.parametrize("scheme", quadpy.c3.schemes.values()) def test_scheme(scheme, print_degree=False): scheme = scheme() assert scheme.points.dtype in [np.float64, np....
mit
tasoc/photometry
run_ffimovie.py
1
17717
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Create movie of FFIs and extracted backgrounds. This program will create a MP4 movie file with an animation of the extracted backgrounds and flags from an HDF5 file created by the photometry pipeline. This program requires the program `FFmpeg <https://ffmpeg.org/>`_ ...
gpl-3.0
qianfengzh/ML-source-code
algorithms/treeExplore.py
1
2429
#coding=utf-8 ''' 用于构建树管理器界面的 Tkinter 小部件 ''' import numpy as np from Tkinter import * import reTrees def reDraw(tolS, tolN): pass def drawNewTree(): pass root = Tk() Label(root, text='Plot Place Holder').grid(row=0, columnspan=3) Label(root, text='tolN').grid(row=1, column=0) tolNentry = Entry(root) tolNen...
gpl-2.0
c-benko/Molecular_Alignment
Align_SEq_Obj_RK4/ffa_sim.py
1
2110
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import ode import time # import my classes from laser import * from molecule import * from integrator import * from const import * from expectation_values import * # close old plots. # plt.close('all') class ffa_sim: ''' simulator of fi...
mit
ishanic/scikit-learn
examples/decomposition/plot_sparse_coding.py
247
3846
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
fdeheeger/mpld3
mpld3/__init__.py
20
1109
""" Interactive D3 rendering of matplotlib images ============================================= Functions: General Use ---------------------- :func:`fig_to_html` convert a figure to an html string :func:`fig_to_dict` convert a figure to a dictionary representation :func:`show` launch a web server to view...
bsd-3-clause
cni/MRS
MRS/version.py
2
1899
"""MRS version/release information""" # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" _version_major = 0 _version_minor = 1 _version_micro = '' # use '' for first of series, number for 1 and above _version_extra = 'dev' _version_extra = '' # Uncomment this for full releases # Construct ...
mit
probcomp/cgpm
src/factor/factor.py
1
13620
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # 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 # Unles...
apache-2.0