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 |
|---|---|---|---|---|---|
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/userdemo/simple_axis_direction03.py | 1 | 1463 | """
=======================
Simple Axis Direction03
=======================
"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as axisartist
# nodebox section
if __name__ == '__builtin__':
# were in nodebox
import os
import tempfile
W = 800
inset = 20
size(W, 600)
plt.cla(... | mit |
0asa/scikit-learn | sklearn/utils/tests/test_multiclass.py | 11 | 15420 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from itertools import product
from functools import partial
from sklearn.externals.six.moves import xrange
from sklearn.externals.six import iteritems
from scipy.sparse import issparse
from scipy.sparse import csc_matrix
from scipy.sparse im... | bsd-3-clause |
madmax983/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_weights_var_impGBM.py | 1 | 6354 | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
import random
def weights_var_imp():
def check_same(data1, data2, min_rows_scale):
gbm1_regression = H2OGradientBoostingEstimator(min_rows=5,
... | apache-2.0 |
khkaminska/scikit-learn | examples/covariance/plot_lw_vs_oas.py | 248 | 2903 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... | bsd-3-clause |
RomainBrault/scikit-learn | examples/mixture/plot_gmm_covariances.py | 89 | 4724 | """
===============
GMM covariances
===============
Demonstration of several covariances types for Gaussian mixture models.
See :ref:`gmm` for more information on the estimator.
Although GMM are often used for clustering, we can compare the obtained
clusters with the actual classes from the dataset. We initialize th... | bsd-3-clause |
benaustin2000/ShanghaiHousePrice | GetChengJiaoListV0.2.5.py | 1 | 12643 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 27 23:40:50 2018
@author: austin
20181213 add .drop_duplicates() for Dataframe
20181215 add combine csv in funtino
20181220 skip index column when import
20181230 add GetDetail() function for 近30天内成交
"""
import requests
import re
from bs4 import BeautifulSou... | apache-2.0 |
tuos/FlowAndCorrelations | healpy/validation/toyModel/toyModelAna_updated.py | 1 | 3613 | import sys
import healpy as hp
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import scipy.special as spc
import math
from scipy.special import lpmn
import scipy.integrate as integrate
from scipy.integrate import quad
from numpy import sin, cos
nside = 8
npix = hp.nside2npix(nside)
#wit... | mit |
mayblue9/scikit-learn | sklearn/manifold/setup.py | 99 | 1243 | import os
from os.path import join
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | bsd-3-clause |
saran87/machine-learning | Titanic/random_forest.py | 1 | 4276 | #The first thing to do is to import the relevant packages
# that I will need for my script,
#these include the Numpy (for maths and arrays)
#and csv for reading and writing csv files
#If i want to use something from this I need to call
#csv.[function] or np.[function] first
import csv as csv
import numpy as np
# Im... | mit |
Vutshi/qutip | examples/paper/appendix_B_5_figure_8.py | 1 | 2809 | #This file is part of QuTIP.
#
# QuTIP 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.
#
# QuTIP is distributed in the ho... | gpl-3.0 |
chanceraine/nupic | nupic/research/monitor_mixin/monitor_mixin_base.py | 27 | 5512 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, 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 |
ndingwall/scikit-learn | examples/cluster/plot_linkage_comparison.py | 17 | 4881 | """
================================================================
Comparing different hierarchical linkage methods on toy datasets
================================================================
This example shows characteristics of different linkage
methods for hierarchical clustering on datasets that are
"intere... | bsd-3-clause |
calancha/DIRAC | Core/Utilities/Graphs/QualityMapGraph.py | 10 | 6794 | ########################################################################
# $HeadURL$
########################################################################
""" QualityGraph represents a Quality Map of entities as a special color schema
The DIRAC Graphs package is derived from the GraphTool plotting package... | gpl-3.0 |
js850/PyGMIN | examples/connecting_minima/connect_no_system_class.py | 1 | 4226 | """
example for how to run a double ended connect routine without using the system class.
We strongly recommend not doing it this way and setting up a system class first. It
will be much easier for you.
We will do the connections for a cluster of 38 Lennard-Jones atoms.
We will load two sets of coordinates from a fil... | gpl-3.0 |
abhisg/scikit-learn | sklearn/kernel_ridge.py | 37 | 6556 | """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 |
thientu/scikit-learn | sklearn/datasets/tests/test_base.py | 205 | 5878 | import os
import shutil
import tempfile
import warnings
import nose
import numpy
from pickle import loads
from pickle import dumps
from sklearn.datasets import get_data_home
from sklearn.datasets import clear_data_home
from sklearn.datasets import load_files
from sklearn.datasets import load_sample_images
from sklearn... | bsd-3-clause |
yl565/statsmodels | statsmodels/multivariate/pca.py | 2 | 31406 | """Principal Component Analysis
Author: josef-pktd
Modified by Kevin Sheppard
"""
from __future__ import print_function, division
import numpy as np
import pandas as pd
from statsmodels.compat.python import range
from statsmodels.compat.numpy import nanmean
from statsmodels.tools.sm_exceptions import (ValueWarning,
... | bsd-3-clause |
ntnu-tdat2004/machine-learning | 2_linear_regression_3d_visualization.py | 1 | 3709 | import numpy as np
import matplotlib
matplotlib.use('TkAgg')
from mpl_toolkits.mplot3d import axes3d, art3d
import matplotlib.pyplot as plt
from matplotlib import cm
matplotlib.rcParams.update({'font.size': 11})
# regarding the notations, see http://stats.stackexchange.com/questions/193908/in-machine-learning-why-a... | mit |
RPGOne/scikit-learn | sklearn/utils/tests/test_random.py | 85 | 7349 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from scipy.misc import comb as combinations
from numpy.testing import assert_array_almost_equal
from sklearn.utils.random import sample_without_replacement
from sklearn.utils.random import random_choice_csc
from sklearn.utils.testing import ... | bsd-3-clause |
YU6326/YU6326.github.io | code/tin.py | 1 | 4997 | from pyautocad import Autocad,APoint,ACAD,aShort
import tkinter.filedialog as tkFileDialog
from pyptlist import PointSet,toLightWeightPolyline
from scipy.spatial import Delaunay,ConvexHull,KDTree
import numpy as np
import matplotlib.pyplot as plt
def tin():
"""
从文件中读取点,生成tin
"""
acad=Autocad()
ptl... | mit |
kashif/scikit-learn | sklearn/metrics/pairwise.py | 14 | 45532 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck ... | bsd-3-clause |
kristianfoerster/melodist | melodist/station.py | 1 | 16151 | # -*- coding: utf-8 -*-
###############################################################################################################
# This file is part of MELODIST - MEteoroLOgical observation time series DISaggregation Tool #
# a program to disaggregate daily values of meteorological variables to ... | gpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/backends/backend_gtk3cairo.py | 21 | 2321 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from . import backend_gtk3
from . import backend_cairo
from .backend_cairo import cairo, HAS_CAIRO_CFFI
from matplotlib.figure import Figure
class RendererGTK3Cairo(backend_cairo.RendererCairo):
... | mit |
bbcdli/xuexi | fenlei_tf/script_2019Nov/src/version1/tensor_trainOLDerror.py | 2 | 103140 | #originally by Hamed, 25Apr.2016
#hy:Changes by Haiyan, 21Dec.2016 v0.45
#sudo apt-get install python-h5py
# Added evaluation function for multiple models, their result file names contain calculated mAP.
# Added functionality to set different dropout rate for each layer for 3conv net
# Moved auxiliary functions to a ne... | apache-2.0 |
VHarisop/Parallel | ex1/report/mpi_results/plots.py | 2 | 1190 | #!/usr/bin/env python
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['KerkisSans']})
try:
msize = sys.argv[1]
except IndexError:
sys.stderr.write("Usage: ./plots.py size\n")
exit(0)
keys = {"seidel": 'Seidel SOR', ... | gpl-2.0 |
HamsterHuey/easyplot | easyplot/easyplot.py | 1 | 16185 | # -*- coding: utf-8 -*-
"""
Author: Sudeep Mandal
"""
import matplotlib.pyplot as plt
import matplotlib as mpl
if not plt.isinteractive():
print("\nMatplotlib interactive mode is currently OFF. It is "
"recommended to use a suitable matplotlib backend and turn it "
"on by calling matplotlib.py... | mit |
felipeam86/otwrapy | otwrapy/_otwrapy.py | 2 | 19844 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
General purpose OpenTURNS python wrapper tools
"""
import os
import gzip
import pickle
from tempfile import mkdtemp
import shutil
from functools import wraps
import logging
import openturns as ot
import numpy as np
__author__ = "Felipe Aguirre Martinez"
__copyright__... | lgpl-3.0 |
kiranvm/kiranvm.github.io | markdown_generator/publications.py | 197 | 3887 |
# coding: utf-8
# # Publications markdown generator for academicpages
#
# Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_g... | mit |
clemkoa/scikit-learn | sklearn/gaussian_process/gpc.py | 13 | 32112 | """Gaussian processes classification."""
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve
from scipy.optimize import fmin_l_bfgs_b
from scipy.special import erf... | bsd-3-clause |
wegamekinglc/alpha-mind | alphamind/data/engines/sqlengine/mysql.py | 1 | 37862 | # -*- coding: utf-8 -*-
"""
Created on 2020-10-11
@author: cheng.li
"""
import os
from typing import Iterable
from typing import List
from typing import Tuple
from typing import Union
from typing import Dict
import numpy as np
import pandas as pd
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy i... | mit |
wathen/PhD | MHD/FEniCS/ShiftCurlCurl/Maxwell.py | 1 | 7136 | #!/usr/bin/python
from dolfin import *
import numpy as np
import matplotlib.pylab as plt
import scipy.sparse as sps
import os
import scipy.io
import PETScIO as IO
import MatrixOperations as MO
import PyTrilinos.ML as ml
from PyTrilinos import AztecOO, Epetra
def StoreMatrix(A,name):
test ="".join([name,".mat"]... | mit |
soulmachine/scikit-learn | benchmarks/bench_tree.py | 297 | 3617 | """
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... | bsd-3-clause |
Atzingen/controleForno-interface | imagens/bind.py | 1 | 1237 | # -*- coding: latin-1 -*-
import numpy as np
import cv2
from matplotlib import pyplot as plt
perfil = cv2.imread('temperatura.jpg')
forno = cv2.imread('forno-pre.jpg')
col_perfil, lin_perfil, _ = perfil.shape
col_forno, lin_forno, _ = forno.shape
print 'perfil antes:', lin_perfil, col_perfil, 'forno:', lin_forno, col... | mit |
qifeigit/scikit-learn | sklearn/cluster/__init__.py | 364 | 1228 | """
The :mod:`sklearn.cluster` module gathers popular unsupervised clustering
algorithms.
"""
from .spectral import spectral_clustering, SpectralClustering
from .mean_shift_ import (mean_shift, MeanShift,
estimate_bandwidth, get_bin_seeds)
from .affinity_propagation_ import affinity_propagati... | bsd-3-clause |
plotly/python-api | packages/python/plotly/plotly/graph_objs/histogram2dcontour/_marker.py | 2 | 3439 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram2dcontour"
_path_str = "histogram2dcontour.marker"
_valid_props = {"color", "colors... | mit |
rsteed11/GAT | gat/service/SmartSearch/smart_search_thread.py | 1 | 18052 | import os
import math
import threading
import spacy
import time
import datefinder
import pandas as pd
from newspaper import Article
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from gat.service.SmartSearch.SEARCH_BING_MODULE import bingURL
from gat.service import file_io
from nltk import data
from datepa... | mit |
lkuchenb/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 |
jonycgn/scipy | scipy/special/add_newdocs.py | 11 | 70503 | # 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... | bsd-3-clause |
ebattenberg/librosa | librosa/decompose.py | 1 | 6345 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Spectrogram decomposition"""
import numpy as np
import scipy
import scipy.signal
import sklearn.decomposition
import librosa.core
from . import cache
def decompose(S, n_components=None, transformer=None, sort=False):
"""Decompose a feature matrix.
Given a s... | isc |
jlegendary/scikit-learn | examples/ensemble/plot_random_forest_embedding.py | 286 | 3531 | """
=========================================================
Hashing feature transformation using Totally Random Trees
=========================================================
RandomTreesEmbedding provides a way to map data to a
very high-dimensional, sparse representation, which might
be beneficial for classificati... | bsd-3-clause |
nkhuyu/airflow | airflow/hooks/base_hook.py | 20 | 1812 | from builtins import object
import logging
import os
import random
from airflow import settings
from airflow.models import Connection
from airflow.utils import AirflowException
CONN_ENV_PREFIX = 'AIRFLOW_CONN_'
class BaseHook(object):
"""
Abstract base class for hooks, hooks are meant as an interface to
... | apache-2.0 |
danlwo/Hadoop-Spark-Python-Log-Parser | def_400_visualizations/def_400_pickle2CSV_distCount/def_400_pickle2CSV_distCount.py | 1 | 4777 | # Christina CJ Chen & Dan Lwo from Logitech
# python 2.7.10 $ spark-2.1.1-bin-hadoop2.7
# --- CAUTION! SAFETY RISK! ---
import credencialInfo
# --- Make sure env. variables set! ---
import findspark
findspark.init()
print '--- [INfO] FINDSPARK session successfully FINISHED. ---'
# --- Improt necessary modules ---
impo... | mit |
tpsatish95/OCR-on-Indus-Seals | code/Test/get_parts.py | 1 | 7940 | # -*- coding: utf-8 -*-
import skimage.io
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import selectivesearch
import numpy as np
import skimage.transform
import os
import shutil
import caffe
candidates = set()
merged_candidates = set()
refined = set()
final = set()
final_extended = set()
def ... | apache-2.0 |
zero323/spark | python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py | 4 | 20792 | #
# 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 |
tritemio/FRETBursts | fretbursts/utils/examples/timetrace_scroll_pygraphqt.py | 2 | 3476 | """
A PyGraphQT timetrace plot figure with a slider to scroll the time axis
back and forth.
Adapted from:
http://stackoverflow.com/questions/16824718/python-matplotlib-pyside-fast-timetrace-scrolling
"""
from PySide import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
N_SAMPLES = 1e6
def test_plot():
... | gpl-2.0 |
martinwicke/tensorflow | tensorflow/examples/learn/text_classification_cnn.py | 13 | 4470 | # 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 |
gtesei/fast-furious | dataset/images2/serializerDogsCatsSURF_Test.py | 1 | 1695 | import mahotas as mh
from sklearn import cross_validation
from sklearn.linear_model.logistic import LogisticRegression
import numpy as np
from glob import glob
from edginess import edginess_sobel
def features_for(im):
im = mh.imread(im,as_grey=True).astype(np.uint8)
#return mh.features.haralick(im).mean(0)
... | mit |
jkthompson/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/delaunay/interpolate.py | 73 | 7068 | import numpy as np
from matplotlib._delaunay import compute_planes, linear_interpolate_grid, nn_interpolate_grid
from matplotlib._delaunay import nn_interpolate_unstructured
__all__ = ['LinearInterpolator', 'NNInterpolator']
def slice2gridspec(key):
"""Convert a 2-tuple of slices to start,stop,steps for x and y.... | gpl-3.0 |
modong/pcc | convergence/live_plot_pcc_tcp_convergence.py | 2 | 3448 | import matplotlib.pyplot as plt
import copy
import matplotlib.animation as animation
import time
import os
f, axarr = plt.subplots(2, 1, sharey=True, sharex=True)
base_time_line = -1
which_flow = 0
time_offset = {}
base_line = {}
base_line["rate_tcp1"] = -1
base_line["rate_tcp2"] = -1
base_line["rate_pcc1"] = -1
bas... | gpl-3.0 |
dmargala/qusp | examples/estimate_lya_deltas.py | 1 | 9371 | #!/usr/bin/env python
"""
"""
import argparse
import numpy as np
import scipy.stats
import scipy.interpolate
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import h5py
import qusp
def main():
# parse command-line arguments
parser = argparse.ArgumentParser(
formatter_class=a... | mit |
rohit21122012/DCASE2013 | runs/2016/baseline128/src/dataset.py | 37 | 78389 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import urllib2
import socket
import locale
import zipfile
import tarfile
from sklearn.cross_validation import StratifiedShuffleSplit, KFold
from ui import *
from general import *
from files import *
class Dataset(object):
"""Dataset base class.
The sp... | mit |
hsuantien/scikit-learn | benchmarks/bench_covertype.py | 154 | 7296 | """
===========================
Covertype dataset benchmark
===========================
Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART
(decision tree), RandomForest and Extra-Trees on the forest covertype dataset
of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ... | bsd-3-clause |
pdamodaran/yellowbrick | tests/test_contrib/test_missing/test_dispersion.py | 1 | 3917 | # tests.test_contrib.test_missing.test_dispersion
# Tests for the alpha selection visualizations.
#
# Author: Nathan Danielsen <nathan.danielsen@gmail.com>
# Created: Thu Mar 29 12:13:04 2018 -0500
#
# Copyright (C) 2018 District Data Labs
# For license information, see LICENSE.txt
#
# ID: test_dispersion.py [7d3f5e6... | apache-2.0 |
hollerith/trading-with-python | lib/extra.py | 77 | 2540 | '''
Created on Apr 28, 2013
Copyright: Jev Kuznetsov
License: BSD
'''
from __future__ import print_function
import sys
import urllib
import os
import xlrd # module for excel file reading
import pandas as pd
class ProgressBar:
def __init__(self, iterations):
self.iterations = iterations
... | bsd-3-clause |
rhshah/basicfiltering | mutect/filter_mutect.py | 1 | 9096 | #!/usr/bin/python
'''
@Description : This tool helps to filter muTect v1.14 txt and vcf through command line.
@Created : 07/17/2016
@Updated : 04/18/2017
@author : Ronak H Shah
'''
from __future__ import division
import argparse
import sys
import os
import time
import logging
logging.basicConfig(
format='%(... | apache-2.0 |
RedhawkSDR/integration-gnuhawk | gnuradio/gr-digital/examples/example_fll.py | 17 | 4821 | #!/usr/bin/env python
from gnuradio import gr, digital
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
try:
import scipy
except ImportError:
print "Error: could not import scipy (http://www.scipy.org/)"
sys.exit(1)
try:
import pylab
excep... | gpl-3.0 |
arabenjamin/scikit-learn | sklearn/tests/test_cross_validation.py | 27 | 41664 | """Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy import stats
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn... | bsd-3-clause |
jasonyaw/SFrame | oss_src/unity/python/sframe/data_structures/gframe.py | 9 | 10723 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from .sframe import SFrame
from ..cython.context import debug_trace as cython_context
from .sarray import SArray, _create_sequential_sarray
impo... | bsd-3-clause |
jviada/QuantEcon.py | examples/perm_inc_figs.py | 7 | 1538 | """
Plots consumption, income and debt for the simple infinite horizon LQ
permanent income model with Gaussian iid income.
"""
import random
import numpy as np
import matplotlib.pyplot as plt
r = 0.05
beta = 1 / (1 + r)
T = 60
sigma = 0.15
mu = 1
def time_path():
w = np.random.randn(T+1) # w_... | bsd-3-clause |
and2egg/philharmonic | philharmonic/scheduler/tests/test_bcffs_scheduler.py | 1 | 6948 | from nose.tools import *
from mock import MagicMock, patch
import pandas as pd
from philharmonic import Schedule
from philharmonic.scheduler.bcffs_scheduler import *
from philharmonic.simulator.environment import FBFSimpleSimulatedEnvironment
from philharmonic.simulator.simulator import FBFSimulator
from philharmonic... | gpl-3.0 |
victorbergelin/scikit-learn | examples/cluster/plot_dbscan.py | 346 | 2479 | # -*- coding: utf-8 -*-
"""
===================================
Demo of DBSCAN clustering algorithm
===================================
Finds core samples of high density and expands clusters from them.
"""
print(__doc__)
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn... | bsd-3-clause |
bamford/astrobamf | osiris_leastsq_demo.py | 1 | 4729 | # demonstration of fitting a function to data
from math import sqrt, pi
import numpy
from scipy.optimize import leastsq
from numpy.polynomial import Polynomial
from numpy.polynomial.chebyshev import Chebyshev
from numpy.random import normal, uniform
from matplotlib import pyplot
colors='bgrcmy'*100
def fit_example(... | mit |
neutrons/Licorne-Py | licorne/layerplot.py | 1 | 6557 | from __future__ import (absolute_import, division, print_function)
from PyQt5 import QtCore, QtWidgets
import numpy as np
import copy
from licorne.layer import Layer
from licorne.generateSublayers import generateSublayers
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.... | gpl-3.0 |
JsNoNo/scikit-learn | sklearn/externals/joblib/__init__.py | 72 | 4795 | """ Joblib is a set of tools to provide **lightweight pipelining in
Python**. In particular, joblib offers:
1. transparent disk-caching of the output values and lazy re-evaluation
(memoize pattern)
2. easy simple parallel computing
3. logging and tracing of the execution
Joblib is optimized to be **fast*... | bsd-3-clause |
jmargeta/scikit-learn | examples/ensemble/plot_adaboost_multiclass.py | 3 | 3612 | """
=====================================
Multi-class AdaBoosted Decision Trees
=====================================
This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can
improve prediction accuracy on a multi-class problem. The classification
dataset is constructed by taking a ten-dimensional ... | bsd-3-clause |
abimannans/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
xuewei4d/scikit-learn | examples/miscellaneous/plot_kernel_ridge_regression.py | 17 | 6290 | """
=============================================
Comparison of kernel ridge regression and SVR
=============================================
Both kernel ridge regression (KRR) and SVR learn a non-linear function by
employing the kernel trick, i.e., they learn a linear function in the space
induced by the respective k... | bsd-3-clause |
cauchycui/scikit-learn | sklearn/feature_selection/variance_threshold.py | 238 | 2594 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: 3-clause BSD
import numpy as np
from ..base import BaseEstimator
from .base import SelectorMixin
from ..utils import check_array
from ..utils.sparsefuncs import mean_variance_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(BaseEstim... | bsd-3-clause |
arabenjamin/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 |
mmccombe/sp17-i524 | project/S17-IO-3012/code/bin/benchmark_shard_mapreduce.py | 19 | 5313 | import matplotlib.pyplot as plt
import sys
import pandas as pd
def get_parm():
"""retrieves mandatory parameter to program
@param: none
@type: n/a
"""
try:
return sys.argv[1]
except:
print ('Must enter file name as parameter')
exit()
def read_file(filename):
"""... | apache-2.0 |
agarbuno/deepdish | deepdish/tests/test_io.py | 1 | 8071 | from __future__ import division, print_function, absolute_import
import unittest
from tempfile import NamedTemporaryFile
import os
import numpy as np
import deepdish as dd
import pandas as pd
from contextlib import contextmanager
@contextmanager
def tmp_filename():
f = NamedTemporaryFile(delete=False)
yield f... | bsd-3-clause |
matteobachetti/MaLTPyNT | maltpynt/exposure.py | 1 | 11738 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Calculate the exposure correction for light curves.
Only works for data taken in specific data modes of NuSTAR, where all events
are telemetered.
"""
from __future__ import (absolute_import, unicode_literals, division,
print_fun... | bsd-3-clause |
mugizico/scikit-learn | examples/linear_model/plot_sgd_comparison.py | 167 | 1659 | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Author: Rob Zinkov <rob at zinkov dot com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot a... | bsd-3-clause |
jerryz123/viscm | viscm/bezierbuilder.py | 1 | 7253 | # coding=utf8
# BézierBuilder
#
# Copyright (c) 2013, Juan Luis Cano Rodríguez <juanlu001@gmail.com>
# 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 re... | mit |
Adai0808/scikit-learn | sklearn/grid_search.py | 32 | 36586 | """
The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters
of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# ... | bsd-3-clause |
andrewnc/scikit-learn | examples/applications/face_recognition.py | 191 | 5513 | """
===================================================
Faces recognition example using eigenfaces and SVMs
===================================================
The dataset used in this example is a preprocessed excerpt of the
"Labeled Faces in the Wild", aka LFW_:
http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2... | bsd-3-clause |
Unidata/MetPy | v0.12/_downloads/5d499b01a6d5ae71915e8f1e1c082361/Simple_Sounding.py | 7 | 2901 | # Copyright (c) 2015,2016,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
Simple Sounding
===============
Use MetPy as straightforward as possible to make a Skew-T LogP plot.
"""
import matplotlib.pyplot as plt
import numpy as np
import pan... | bsd-3-clause |
abhisg/scikit-learn | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
florian-wagner/gimli | python/pygimli/viewer/showmesh.py | 1 | 5139 | # -*- coding: utf-8 -*-
"""
Generic mesh visualization tools.
"""
try:
import pygimli as pg
from pygimli.mplviewer import drawMesh, drawModel, drawField
from pygimli.mplviewer import drawSensors, showLater
from pygimli.mplviewer import createColorbar, drawStreams
except ImportError:
raise E... | gpl-3.0 |
nrhine1/scikit-learn | sklearn/cross_validation.py | 10 | 62355 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
shafferm/SCNIC | SCNIC/module_analysis.py | 1 | 6156 | from scipy.cluster.hierarchy import complete
from scipy.spatial.distance import squareform
from skbio.tree import TreeNode
from itertools import combinations
import pandas as pd
import numpy as np
from biom.table import Table
from biom.util import biom_open
import os
import networkx as nx
from collections import defaul... | bsd-3-clause |
seckcoder/lang-learn | python/sklearn/sklearn/metrics/cluster/supervised.py | 1 | 26269 | """Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD Style.
from math import log
from scipy.misc import comb
fr... | unlicense |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/dask/dataframe/hyperloglog.py | 7 | 2515 | # -*- coding: utf-8 -*-
u"""Implementation of HyperLogLog
This implements the HyperLogLog algorithm for cardinality estimation, found
in
Philippe Flajolet, Éric Fusy, Olivier Gandouet and Frédéric Meunier.
"HyperLogLog: the analysis of a near-optimal cardinality estimation
algorithm". 2007 Confere... | gpl-3.0 |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/synthesizer/gui/results_menu/view_indgeo.py | 2 | 18123 | # PopGen 1.1 is A Synthetic Population Generator for Advanced
# Microsimulation Models of Travel Demand
# Copyright (C) 2009, Arizona State University
# See PopGen/License
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from coreplot import *
from file_me... | gpl-2.0 |
Frank-Wu/stratosphere-streaming | flink-streaming-connectors/src/test/resources/Performance/PerformanceTracker.py | 2 | 4050 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 30 15:40:17 2014
@author: gyfora
"""
import matplotlib.pyplot as plt
import pandas as pd
import os
import operator
linestyles = ['_', '-', '--', ':']
markers=['D','s', '|', '', 'x', '_', '^', ' ', 'd', 'h', '+', '*', ',', 'o', '.', '1', 'p', 'H', 'v', '>'];... | apache-2.0 |
YeoLab/anchor | anchor/bayesian.py | 1 | 10289 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.misc import logsumexp
from .names import NEAR_ZERO, NEAR_HALF, NEAR_ONE, BIMODAL, NULL_MODEL
from .model import ModalityModel
from .visualize import MODALITY_TO_CMAP, _ModelLoglikPlotter, MODALITY_ORDER
CHANGING_PARAMETERS = np.arange(2... | bsd-3-clause |
dhomeier/astropy | astropy/visualization/wcsaxes/tests/test_formatter_locator.py | 7 | 22451 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_almost_equal
from matplotlib import rc_context
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from astropy.units import UnitsError
from astropy.v... | bsd-3-clause |
adamgreenhall/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 |
RPGOne/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
ronojoy/BDA_py_demos | demos_pystan/pystan_demo.py | 19 | 12220 | """Bayesian Data Analysis, 3rd ed
PyStan demo
Demo for using Stan with Python interface PyStan.
"""
import numpy as np
import pystan
import matplotlib.pyplot as plt
# edit default plot settings (colours from colorbrewer2.org)
plt.rc('font', size=14)
plt.rc('lines', color='#377eb8', linewidth=2)
plt.rc('axes', color... | gpl-3.0 |
antgonza/qiita | qiita_db/metadata_template/test/test_prep_template.py | 1 | 84844 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
mattgiguere/scikit-learn | examples/linear_model/plot_lasso_model_selection.py | 311 | 5431 | """
===================================================
Lasso model selection: Cross-Validation / AIC / BIC
===================================================
Use the Akaike information criterion (AIC), the Bayes Information
criterion (BIC) and cross-validation to select an optimal value
of the regularization paramet... | bsd-3-clause |
subutai/nupic.research | projects/visual_recognition_grid_cells/visualise_GridCellNet_predictions.py | 3 | 5699 | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, 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 program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
cmaass/swimmertracking | parametergui.py | 1 | 62991 | #!/usr/bin/env python
#Author: rosencrantz@gmx.net
#License: GPL
import wx
import wx.lib.scrolledpanel as scp
import numpy as np
from PIL import Image
from matplotlib import pylab as pl
from matplotlib import cm
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg ... | gpl-2.0 |
nismod/smif | tests/data_layer/test_data_array.py | 2 | 17649 | """Test DataArray
"""
# pylint: disable=redefined-outer-name
import numpy
import pandas as pd
import xarray as xr
from numpy.testing import assert_array_equal
from pytest import fixture, raises
from smif.data_layer.data_array import DataArray, show_null
from smif.exception import SmifDataMismatchError
from smif.metadat... | mit |
lunactic/ocropy | OLD/lineproc.py | 15 | 6891 | ################################################################
### functions specific to text line processing
### (text line segmentation is in lineseg)
################################################################
from scipy import stats
from scipy.ndimage import interpolation,morphology,filters
from pylab impor... | apache-2.0 |
ghislainv/deforestprob | forestatrisk/data.py | 1 | 8624 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# author :Ghislain Vieilledent
# email :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com
# web :https://ecology.ghislainv.fr
# python_version :>=2.7
# license... | gpl-3.0 |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/IPython/lib/tests/test_latextools.py | 8 | 3877 | # encoding: utf-8
"""Tests for IPython.utils.path.py"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from unittest.mock import patch
except ImportError:
from mock import patch
import nose.tools as nt
from IPython.lib import latextools
from IPython... | artistic-2.0 |
depet/scikit-learn | sklearn/feature_extraction/tests/test_dict_vectorizer.py | 7 | 3089 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from nose.tools import assert_equal
from nose.tools import assert_true
from nose.tools import assert_false
from numpy.testing import assert_array_equal
from sklearn.feature_ext... | bsd-3-clause |
netcon-source/OpenClimateGIS | src/openclimategis/util/ncconv/experimental/OLD_experimental/in_memory.py | 7 | 12826 | import os
from netCDF4 import Dataset
import itertools
from shapely.geometry.multipoint import MultiPoint
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry.polygon import Polygon
from shapely.geometry.multipolygon import MultiPolygon
import copy
import datetime
from netcdftime.netcdftime import n... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.