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 |
|---|---|---|---|---|---|
mhdella/scikit-learn | examples/classification/plot_lda.py | 164 | 2224 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | bsd-3-clause |
gpersistence/tstop | scripts/plots/plot_persistence_distance.py | 1 | 13227 | #TSTOP
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
... | gpl-3.0 |
BillMills/whatAreTheGitHubHaps | whatAreTheGitHubHaps.py | 1 | 5849 | from datetime import datetime
from dateutil.parser import parse
import pytz
import requests
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import dates
from matplotlib import patches
import webbrowser
# (user, pass)
auth = ('kittens', 'rainbows')
def genericFetch(target, cutoff, route):
'''
... | mit |
CVML/scikit-learn | sklearn/metrics/tests/test_common.py | 27 | 44210 | 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 |
nschloe/voropy | meshplex/mesh_line.py | 1 | 1518 | import numpy
class MeshLine:
"""Class for handling line segment "meshes".
"""
def __init__(self, node_coords, cells):
self.node_coords = node_coords
num_cells = len(cells)
self.cells = numpy.empty(num_cells, dtype=numpy.dtype([("nodes", (int, 2))]))
self.cells["nodes"] = ... | mit |
jclark754/MesoPy | examples/Examples Source Code/Example_download_MesoWest_data_to_Netcdf.py | 3 | 8941 |
# coding: utf-8
# In[3]:
# Example scipt using MesoPy to Download multiple station/variable and save to a netcdf format using xary
# Created by Nic Wayand (https://github.com/NicWayand/MesoWestDownload)
from MesoPy import Meso
get_ipython().magic(u'matplotlib inline')
import matplotlib
import numpy as np
import matp... | mit |
google/neural-light-transport | third_party/xiuminglib/xiuminglib/vis/video.py | 1 | 6481 | from os.path import join, dirname
from io import BytesIO
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from ..log import get_logger
logger = get_logger()
from .. import const
from ..io import img as imgio
from ..os import makedirs
from ..imprt import preset_import
def make_apng(
imgs, label... | apache-2.0 |
bnaul/scikit-learn | examples/cluster/plot_kmeans_silhouette_analysis.py | 34 | 5919 | """
===============================================================================
Selecting the number of clusters with silhouette analysis on KMeans clustering
===============================================================================
Silhouette analysis can be used to study the separation distance between the... | bsd-3-clause |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/userdemo/colormap_normalizations_lognorm.py | 1 | 1868 | """
===============================
Colormap Normalizations Lognorm
===============================
Demonstration of using norm to map colormaps onto data in non-linear ways.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib.mlab import bivariate_normal
'''
Log... | mit |
linebp/pandas | pandas/tests/plotting/test_datetimelike.py | 1 | 50792 | """ Test cases for time series specific (freq conversion, etc) """
from datetime import datetime, timedelta, date, time
import pytest
from pandas.compat import lrange, zip
import numpy as np
from pandas import Index, Series, DataFrame, NaT
from pandas.compat import is_platform_mac
from pandas.core.indexes.datetimes ... | bsd-3-clause |
robbymeals/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
Parallel-in-Time/pySDC | pySDC/playgrounds/deprecated/pmesh/visualize.py | 1 | 1325 | import json
import glob
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
def plot_data(name=''):
"""
Visualization using numpy arrays (written via MPI I/O) and json description
Produces one png file per time-step, combine as movie via e.g.
> ffmpeg -i dat... | bsd-2-clause |
ZhukovGreen/UMLND | GaussianNB Deployment on Terrain Data/class_vis.py | 1 | 1819 | #!/usr/bin/python
# from udacityplots import *
import warnings
warnings.filterwarnings("ignore")
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np
# import numpy as np
# import matplotlib.pyplot as plt
# plt.ioff()
def prettyPicture(clf, X_test, y_test... | gpl-3.0 |
Tasignotas/topographica_mirror | topo/tests/buildbot/unused/plot_performance.py | 3 | 3861 | import bz2
import os
import re
from collections import defaultdict
from contextlib import closing
import matplotlib
import matplotlib.ticker
import matplotlib.pyplot
tests_to_plot = [
"examples/lissom.ty",
"examples/gcal.ty",
]
cpu_lower_bound = 98
stats_dir = "/var/lib/buildbot/master/performance"
stats_fi... | bsd-3-clause |
rrohan/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 |
toxa81/sirius | apps/timers/compter_timers2.py | 3 | 2636 | import json
import sys
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import operator as o
import numpy as np
jf1 = json.load(open(sys.argv[1], 'r'))
jf2 = json.load(open(sys.argv[2], 'r'))
jf3 = json.load(open(sys.argv[3], 'r'))
d = []
for key in jf1['timers']:
t = jf3['timers'][key][0]
if t > ... | bsd-2-clause |
cxhernandez/msmbuilder | msmbuilder/tests/test_msm.py | 9 | 13465 | from __future__ import print_function, division
import os
import tempfile
import mdtraj as md
import numpy as np
import pandas as pd
import sklearn.pipeline
from mdtraj.testing import eq
from numpy.testing import assert_approx_equal
from six import PY3
from sklearn.externals.joblib import load, dump
from sklearn.pipe... | lgpl-2.1 |
zzcclp/spark | python/pyspark/pandas/data_type_ops/date_ops.py | 6 | 4650 | #
# 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 |
Caranarq/01_Dmine | 07_Movilidad/P0714/P0714.py | 1 | 2843 | # -*- coding: utf-8 -*-
"""
Started on fri, apr 08th, 2018
@author: carlos.arana
"""
# Librerias utilizadas
import pandas as pd
import sys
module_path = r'D:\PCCS\01_Dmine\Scripts'
if module_path not in sys.path:
sys.path.append(module_path)
from VarInt.VarInt import VarInt
from classes.Meta import Meta
from Com... | gpl-3.0 |
kdebrab/pandas | pandas/core/dtypes/inference.py | 1 | 9801 | """ basic inference routines """
import collections
import re
import numpy as np
from collections import Iterable
from numbers import Number
from pandas.compat import (PY2, string_types, text_type,
string_and_binary_types, re_type)
from pandas._libs import lib
is_bool = lib.is_bool
is_inte... | bsd-3-clause |
PrashntS/scikit-learn | examples/svm/plot_svm_margin.py | 318 | 2328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM Margins Example
=========================================================
The plots below illustrate the effect the parameter `C` has
on the separation line. A large value of `C` basically tells
our model that w... | bsd-3-clause |
billy-inn/scikit-learn | sklearn/datasets/mlcomp.py | 289 | 3855 | # Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
"""Glue code to load http://mlcomp.org data as a scikit.learn dataset"""
import os
import numbers
from sklearn.datasets.base import load_files
def _load_document_classification(dataset_path, metadata, set_=None, **kwargs):
if ... | bsd-3-clause |
cauchycui/scikit-learn | examples/cluster/plot_lena_ward_segmentation.py | 271 | 1998 | """
===============================================================
A demo of structured Ward hierarchical clustering on Lena image
===============================================================
Compute the segmentation of a 2D image with Ward hierarchical
clustering. The clustering is spatially constrained in order
... | bsd-3-clause |
yanlend/scikit-learn | sklearn/preprocessing/tests/test_label.py | 156 | 17626 | import numpy as np
from scipy.sparse import issparse
from scipy.sparse import coo_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.testing impor... | bsd-3-clause |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/statsmodels-0.5.0-py2.7-linux-x86_64.egg/statsmodels/examples/ex_kernel_singleindex_dgp.py | 3 | 3399 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 06 09:50:54 2013
Author: Josef Perktold
"""
if __name__ == '__main__':
import numpy as np
import matplotlib.pyplot as plt
#from statsmodels.nonparametric.api import KernelReg
import statsmodels.sandbox.nonparametric.kernel_extras as smke
import st... | apache-2.0 |
saildata/data-science-from-scratch | code-python3/linear_algebra.py | 12 | 3566 | # -*- coding: iso-8859-15 -*-
import re, math, random # regexes, math functions, random numbers
import matplotlib.pyplot as plt # pyplot
from collections import defaultdict, Counter
from functools import partial, reduce
#
# functions for working with vectors
#
def vector_add(v, w):
"""adds two vectors componentw... | unlicense |
saulshanabrook/pushgp.py | inspyred/ec/analysis.py | 2 | 12293 | """
===============================================
:mod:`analysis` -- Optimization result analysis
===============================================
This module provides analysis methods for the results of evolutionary computations.
.. Copyright 2012 Inspired Intelligence Initiative
... | bsd-3-clause |
dpshelio/scikit-image | doc/examples/plot_ssim.py | 15 | 2238 | """
===========================
Structural similarity index
===========================
When comparing images, the mean squared error (MSE)--while simple to
implement--is not highly indicative of perceived similarity. Structural
similarity aims to address this shortcoming by taking texture into account
[1]_, [2]_.
T... | bsd-3-clause |
yanlend/scikit-learn | sklearn/preprocessing/__init__.py | 268 | 1319 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... | bsd-3-clause |
winklerand/pandas | pandas/tests/indexes/period/test_arithmetic.py | 1 | 17843 | # -*- coding: utf-8 -*-
from datetime import timedelta
import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import (Timedelta,
period_range, Period, PeriodIndex,
_np_version_under1p10)
import pandas.core.indexes.period as period
cla... | bsd-3-clause |
elmadjian/mac0499 | coletas/user_8_OK/texto/plotterd4.py | 12 | 7162 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import threading
import matplotlib.pyplot as plt
import numpy as np
import re
import sys
import time
import math
#Detector de leitura (Elmadjian, 2015)
#------------------------------------
class Detector (threading.Thread):
def __init__(self, thresh, cv):
thre... | mit |
Focom/NLPWork1 | Part2/main.py | 1 | 1607 | import detectLang
import graph
# ====================================================================================================
# La detection est rapide car toute les perplexites sont stockées dans les fichiers binaires pp_EN etc
# Pour regénerer les fichiers :
# Executer detectLang.create_all_pp_and_save_to_di... | mit |
nmayorov/scipy | doc/source/tutorial/stats/plots/kde_plot3.py | 132 | 1229 | import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
np.random.seed(12456)
x1 = np.random.normal(size=200) # random data, normal distribution
xs = np.linspace(x1.min()-1, x1.max()+1, 200)
kde1 = stats.gaussian_kde(x1)
kde2 = stats.gaussian_kde(x1, bw_method='silverman')
fig = plt.figure(figsi... | bsd-3-clause |
florian-f/sklearn | examples/covariance/plot_covariance_estimation.py | 4 | 4992 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
The usual estimator for covariance is the maximum likelihood estimator,
:class:`sklearn.covariance.Em... | bsd-3-clause |
waterponey/scikit-learn | sklearn/kernel_ridge.py | 16 | 6568 | """Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression."""
# Authors: Mathieu Blondel <mathieu@mblondel.org>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
import numpy as np
from .base import BaseEstimator, RegressorMixin
from .metrics.pairwise import pairwise... | bsd-3-clause |
hargup/sympy | sympy/utilities/runtests.py | 6 | 82022 | """
This is our testing framework.
Goals:
* it should be compatible with py.test and operate very similarly
(or identically)
* doesn't require any external dependencies
* preferably all the functionality should be in this file only
* no magic, just import the test file and execute the test functions, that's it
* po... | bsd-3-clause |
pgm/StarCluster | utils/scimage_11_10.py | 20 | 15705 | #!/usr/bin/env python
"""
This script is meant to be run inside of a ubuntu cloud image available at
uec-images.ubuntu.com::
$ EC2_UBUNTU_IMG_URL=http://uec-images.ubuntu.com/oneiric/current
$ wget $EC2_UBUNTU_IMG_URL/oneiric-server-cloudimg-amd64.tar.gz
or::
$ wget $EC2_UBUNTU_IMG_URL/oneiric-server-clo... | gpl-3.0 |
nvoron23/statsmodels | statsmodels/regression/_prediction.py | 27 | 6035 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 19 11:29:18 2014
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
# this is similar to ContrastResults after t_test, partially copied and adjusted
class PredictionResults(object):
def __init__(self, predicted_mean, var_pred_mean... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/learn/python/learn/estimators/estimators_test.py | 46 | 6682 | # 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 |
jblackburne/scikit-learn | sklearn/preprocessing/tests/test_data.py | 6 | 62084 |
# Authors:
#
# Giorgio Patrini
#
# License: BSD 3 clause
import warnings
import numpy as np
import numpy.linalg as la
from scipy import sparse
from distutils.version import LooseVersion
from sklearn.utils import gen_batches
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing im... | bsd-3-clause |
ocefpaf/iris | lib/iris/tests/idiff.py | 2 | 11221 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
# !/usr/bin/env python
"""
Provides "diff-like" comparison of images.
Currently relies on matplotlib for image processing so l... | lgpl-3.0 |
AFAgarap/gru-svm | dataset/pandas-describe.py | 1 | 1611 | # Module for getting a dataset description
# Copyright (C) 2017 Abien Fred Agarap
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option)... | agpl-3.0 |
shikhardb/scikit-learn | examples/ensemble/plot_forest_importances_faces.py | 403 | 1519 | """
=================================================
Pixel importances with a parallel forest of trees
=================================================
This example shows the use of forests of trees to evaluate the importance
of the pixels in an image classification task (faces). The hotter the pixel,
the more impor... | bsd-3-clause |
joshgabriel/MPInterfaces | mpinterfaces/mat2d/stability/analysis.py | 2 | 5881 | from __future__ import print_function, division, unicode_literals
import operator
import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from pymatgen.core.structure import Structure
from pymatgen.entries.computed_entries import ComputedEntry
from pymatgen.io.vasp.outputs import Vasprun
#f... | mit |
ybroze/trading-with-python | lib/cboe.py | 76 | 4433 | # -*- coding: utf-8 -*-
"""
toolset working with cboe data
@author: Jev Kuznetsov
Licence: BSD
"""
from datetime import datetime, date
import urllib2
from pandas import DataFrame, Index
from pandas.core import datetools
import numpy as np
import pandas as pd
def monthCode(month):
"""
perfo... | bsd-3-clause |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/numpy/core/function_base.py | 23 | 6891 | from __future__ import division, absolute_import, print_function
__all__ = ['logspace', 'linspace']
from . import numeric as _nx
from .numeric import result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
"""
Return evenly... | gpl-2.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/patches.py | 10 | 142681 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import map, zip
import math
import matplotlib as mpl
import numpy as np
import matplotlib.cbook as cbook
import matplotlib.artist as artist
from matplotlib.a... | mit |
data-8/datascience | docs/conf.py | 2 | 10073 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# datascience documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 3 21:52:53 2015.
#
# 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
... | bsd-3-clause |
brvnl/master | parser/GenerateCorpus_TFIDF.py | 1 | 4924 | # -*- coding: utf-8 -*-
import sys, logging, os, csv
import numpy as np
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0,parentdir)
from sklearn import tree
from sklearn import svm
from sklearn.naive_bayes import GaussianNB
from sklearn.neural_network import MLPClas... | gpl-3.0 |
wdm0006/petersburg | petersburg/graph.py | 1 | 10478 | """
.. module:: graph
:platform: Unix, Windows
:synopsis:
.. moduleauthor:: Will McGinnis <will@pedalwrencher.com>
"""
import json
import numpy as np
from petersburg import Node
__author__ = 'willmcginnis'
class Graph(object):
"""
A graph holds a heirarchy of nodes and edges with payoffs and costs.... | bsd-3-clause |
daodaoliang/neural-network-animation | matplotlib/tests/test_rcparams.py | 9 | 10258 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import sys
import warnings
import matplotlib as mpl
from matplotlib.tests import assert_str_equal
from matplotlib.testing.decorators import cleanup, knownfailureif
from nose.tools import ... | mit |
alvarofierroclavero/scikit-learn | sklearn/utils/estimator_checks.py | 41 | 47834 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import inspect
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memory
from sklearn.ut... | bsd-3-clause |
winklerand/pandas | pandas/tests/groupby/test_whitelist.py | 1 | 8600 | """
test methods relating to generic function evaluation
the so-called white/black lists
"""
import pytest
from string import ascii_lowercase
import numpy as np
from pandas import DataFrame, Series, compat, date_range, Index, MultiIndex
from pandas.util import testing as tm
from pandas.compat import lrange, product
A... | bsd-3-clause |
JJINDAHOUSE/deep-learning | weight-initialization/helper.py | 153 | 3649 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def hist_dist(title, distribution_tensor, hist_range=(-4, 4)):
"""
Display histogram of a TF distribution
"""
with tf.Session() as sess:
values = sess.run(distribution_tensor)
plt.title(title)
plt.hist(values, ... | mit |
rrohan/scikit-learn | examples/model_selection/plot_underfitting_overfitting.py | 230 | 2649 | """
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... | bsd-3-clause |
pbillerot/picsou | ema.py | 1 | 7939 | # THIS VERSION IS FOR PYTHON 2 #
import urllib2
import time
import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.dates as mdates
from matplotlib.finance import candlestick
import matplotlib
import pylab
matplotlib.rcParams.update({'font.size': 9})
eac... | mit |
hitszxp/scikit-learn | sklearn/neighbors/unsupervised.py | 16 | 3198 | """Unsupervised nearest neighbors learner"""
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import RadiusNeighborsMixin
from .base import UnsupervisedMixin
class NearestNeighbors(NeighborsBase, KNeighborsMixin,
RadiusNeighborsMixin, UnsupervisedMixin):
"""Unsu... | bsd-3-clause |
DSLituiev/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 59 | 35604 | from __future__ import unicode_literals
import warnings
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.fe... | bsd-3-clause |
insop/algo_code | merge/merge_sort.py | 1 | 1504 | #!/usr/bin/env python
import sys
import getopt
import numpy as np
import matplotlib.pyplot as plt
def read_f(fn):
unsorted_a = []
for line in open(fn):
unsorted_a.append(int(line))
return unsorted_a
def plot_g(unsorted_a):
la = len(unsorted_a)
x = range( 1, la+1, 1)
y = unsorted_a
plt.plot( x, y )
plt.yla... | gpl-2.0 |
janverschelde/PHCpack | src/Python/PHCpy2/examples/appolonius.py | 1 | 7961 | """
The circle problem of Apollonius has the following input/output specification:
Given three circles, find all circles that are tangent to the given circles.
Without loss of generality, we take the first circle to be the unit circle,
centered at (0, 0) and with radius 1. The origin of the second circle lies
on the f... | gpl-3.0 |
tehtechguy/mHTM | dev/mnist_novelty_detection/mnist_novelty_detection.py | 1 | 12417 | # mnist_novelty_detection.py
#
# Author : James Mnatzaganian
# Contact : http://techtorials.me
# Organization : NanoComputing Research Lab - Rochester Institute of
# Technology
# Website : https://www.rit.edu/kgcoe/nanolab/
# Date Created : 03/13/16
#
# Description : Experiment f... | mit |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/scipy/special/add_newdocs.py | 4 | 73935 | # Docstrings for generated ufuncs
#
# The syntax is designed to look like the function add_newdoc is being
# called from numpy.lib, but in this file add_newdoc puts the
# docstrings in a dictionary. This dictionary is used in
# generate_ufuncs.py to generate the docstrings for the ufuncs in
# scipy.special at the C lev... | mit |
rahuldhote/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 |
erdc-cm/air-water-vv | 2d/benchmarks/wavesloshing/phiPlot.py | 1 | 4130 | import numpy as np
from scipy import *
from pylab import *
import collections as cll
import csv
# Put relative path below
filename='pointGauge_levelset.csv'
# Reading file
with open (filename, 'rb') as csvfile:
data=csv.reader(csvfile, delimiter=",")
a=[]
time=[]
probes=[]
nRows=0
for row in ... | mit |
google/makani | analysis/aero/plot_aero_database.py | 1 | 12925 | #!/usr/bin/python
# Copyright 2020 Makani Technologies 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 applicabl... | apache-2.0 |
lispc/Paddle | v1_api_demo/gan/gan_trainer.py | 13 | 12731 | # Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
droundy/deft | papers/fuzzy-fmt/xi_fromB2.py | 1 | 4389 | #!/usr/bin/python3
#Run this program from the directory it is listed in
#with command ./xi_fromB2.py
from scipy import special
from scipy.special import iv
from scipy.special import erf
import scipy.integrate
from scipy.integrate import quad
import numpy as np
import matplotlib.pyplot as plt
import math
epsilon=1
si... | gpl-2.0 |
arahuja/scikit-learn | sklearn/datasets/samples_generator.py | 14 | 55090 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import warnings
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing impo... | bsd-3-clause |
Don86/microscopium | microscopium/serve.py | 1 | 15062 | """This module runs the bokeh server."""
import os
from os.path import dirname, join
from math import ceil, sqrt
from collections import namedtuple
import click
from skimage import io
import numpy as np
import pandas as pd
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.ap... | bsd-3-clause |
birdsarah/bokeh | bokeh/crossfilter/plotting.py | 42 | 8763 | from __future__ import absolute_import
import numpy as np
import pandas as pd
from bokeh.models import ColumnDataSource, BoxSelectTool
from ..plotting import figure
def cross(start, facets):
"""Creates a unique combination of provided facets.
A cross product of an initial set of starting facets with a new se... | bsd-3-clause |
gustavovaliati/ci724-finalwork-ppginfufpr-2016 | sklearn/plot_digits_classification.py | 1 | 2464 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | apache-2.0 |
dingocuster/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
from .docscrape import NumpyDocString
from .docscrape import FunctionDoc
from .docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots... | bsd-3-clause |
hugobowne/scikit-learn | sklearn/decomposition/tests/test_kernel_pca.py | 74 | 8472 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... | bsd-3-clause |
mayblue9/scikit-learn | examples/exercises/plot_cv_diabetes.py | 231 | 2527 | """
===============================================
Cross-validation on diabetes Dataset Exercise
===============================================
A tutorial exercise which uses cross-validation with linear models.
This exercise is used in the :ref:`cv_estimators_tut` part of the
:ref:`model_selection_tut` section of ... | bsd-3-clause |
eco32i/tweed | tasm/plotting.py | 1 | 4775 | import math
import numpy as np
import pandas as pd
# import brewer2mpl
from pylab import figure, plot
#from scipy.stats.kde import gaussian_kde
import matplotlib.pyplot as plt
from django.http import HttpResponse
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
fr... | bsd-3-clause |
pprett/scikit-learn | examples/preprocessing/plot_function_transformer.py | 158 | 1993 | """
=========================================================
Using FunctionTransformer to select columns
=========================================================
Shows how to use a function transformer in a pipeline. If you know your
dataset's first principle component is irrelevant for a classification task,
you ca... | bsd-3-clause |
NiclasEriksen/py-towerwars | src/numpy/core/tests/test_multiarray.py | 23 | 175667 | from __future__ import division, absolute_import, print_function
import tempfile
import sys
import os
import shutil
import warnings
import operator
import io
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decimal import Decimal
import numpy as np
from nose import SkipT... | cc0-1.0 |
felixsch/trollolo | scripts/plot.py | 1 | 4202 | #!/usr/bin/env python
import matplotlib.pyplot as plt
class Plot:
"Set all parameters needed to print burndown charts"
def __init__ (self, data):
self.data = data
figure_width = 11
figure_height = 6
self.plot_count = 0
self.setXKCD()
self.createFigure(figure_width, figure_height)
se... | gpl-3.0 |
NicovincX2/Python-3.5 | Statistiques/Science des données/Exploration de données/pca_ica.py | 1 | 2059 | # -*- coding: utf-8 -*-
import os
# Authors: Alexandre Gramfort, Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA, FastICA
###############################################################################
# Generate sample data
rng = np.r... | gpl-3.0 |
Enucatl/pilatus-experiments | scripts/efficiency-comparison/compare.py | 2 | 1245 | import h5py
import numpy as np
import csv
import click
import matplotlib.pyplot as plt
exposures = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10]
pictures = [1000, 1000, 1000, 500, 500, 500, 200, 200, 200, 100]
@click.command()
@click.argument("src", nargs=1, type=click.Path(exists=True))
@click.argument("dst", narg... | gpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pandas/core/dtypes/api.py | 16 | 2399 | # flake8: noqa
import sys
from .common import (pandas_dtype,
is_dtype_equal,
is_extension_type,
# categorical
is_categorical,
is_categorical_dtype,
# interval
is_interva... | mit |
DonBeo/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 42 | 2894 | 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 |
marioharper182/OptionsPricing | Gui/View/Engine_Asian.py | 1 | 1859 | __author__ = 'HarperMain'
import numpy as np
from numpy import sqrt, exp, pi
from matplotlib import pyplot
class AsianOption(object):
def __init__(self, spot, rate, sigma, expiry, N, M, strike, flag):
self.matrixengine(float(spot), float(rate), float(sigma), float(expiry),
int(N)... | apache-2.0 |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/sklearn/datasets/tests/test_20news.py | 280 | 3045 | """Test the 20news downloader, if the data is available."""
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import SkipTest
from sklearn import datasets
def test_20news():
try:
data = dat... | gpl-2.0 |
pgandhi999/spark | python/pyspark/serializers.py | 5 | 30967 | #
# 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 |
ndchorley/scipy | scipy/misc/common.py | 8 | 13260 | """
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from __future__ import division, print_function, absolute_import
import numpy
import numpy as np
from numpy import (exp, log, asarray, arange, newaxis, hstack, product, array,
zeros, eye, poly1d, r_, sum, ... | bsd-3-clause |
Li-Jiaqi/BugRiskPrediction | jiaqi/find_file.py | 2 | 5464 | #! /usr/bin/env python
#-*- coding: utf-8 -*-import numpy
import os
import pandas as pd
from datetime import datetime
import numpy as np
import timeit
df = pd.read_csv("/home/dongge/PIC/dailyMetricsUse_Sent/ChangesetsC66150-C81461.csv")
EncodedFileName = df[df.columns[3]].values
##日期格式转换
dti = df['date']
_date1 = [... | mit |
abhisg/scikit-learn | sklearn/manifold/isomap.py | 229 | 7169 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
trachelr/mne-python | tutorials/plot_cluster_methods_tutorial.py | 15 | 8431 | # doc:slow-example
"""
.. _tut_stats_cluster_methods:
======================================================
Permutation t-test on toy data with spatial clustering
======================================================
Following the illustrative example of Ridgway et al. 2012,
this demonstrates some basic ideas behin... | bsd-3-clause |
Knight13/Exploring-Deep-Neural-Decision-Trees | Breast Cancer/NNDT.py | 1 | 1881 | import numpy as np
import tensorflow as tf
import cancer_data
from neural_network_decision_tree import nn_decision_tree
import time
from sklearn.model_selection import train_test_split
x = cancer_data.feature
y = cancer_data.label
d = x.shape[1]
epochs = 100
batch_size = 100
num_cut = []
for features in xrange(d):... | unlicense |
nan86150/ImageFusion | lib/python2.7/site-packages/matplotlib/tests/test_dviread.py | 15 | 1788 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from nose.tools import assert_equal
import matplotlib.dviread as dr
import os.path
original_find_tex_file = dr.find_tex_file
def setup():
dr.find_tex_file = lambda x: x
def teardown():
dr... | mit |
ahnqirage/spark | python/pyspark/sql/types.py | 8 | 65873 | #
# 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 |
devanshdalal/scikit-learn | examples/neighbors/plot_classification.py | 58 | 1790 | """
================================
Nearest Neighbors Classification
================================
Sample usage of Nearest Neighbors classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColorm... | bsd-3-clause |
MechCoder/scikit-learn | sklearn/datasets/samples_generator.py | 8 | 56767 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing import MultiLabelBin... | bsd-3-clause |
fredhusser/scikit-learn | benchmarks/bench_mnist.py | 154 | 6006 | """
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... | bsd-3-clause |
kazemakase/scikit-learn | sklearn/cluster/tests/test_spectral.py | 262 | 7954 | """Testing for Spectral Clustering methods"""
from sklearn.externals.six.moves import cPickle
dumps, loads = cPickle.dumps, cPickle.loads
import numpy as np
from scipy import sparse
from sklearn.utils import check_random_state
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
wzbozon/scikit-learn | sklearn/utils/estimator_checks.py | 31 | 52862 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memory
from sklearn.utils.testing imp... | bsd-3-clause |
djgagne/scikit-learn | sklearn/cluster/tests/test_spectral.py | 262 | 7954 | """Testing for Spectral Clustering methods"""
from sklearn.externals.six.moves import cPickle
dumps, loads = cPickle.dumps, cPickle.loads
import numpy as np
from scipy import sparse
from sklearn.utils import check_random_state
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
mikebenfield/scikit-learn | examples/classification/plot_lda.py | 142 | 2419 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | bsd-3-clause |
meduz/scikit-learn | examples/model_selection/grid_search_text_feature_extraction.py | 99 | 4163 |
"""
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the d... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.