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 |
|---|---|---|---|---|---|
vivekmishra1991/scikit-learn | sklearn/metrics/pairwise.py | 49 | 44088 | # -*- 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 |
mattloper/opendr | opendr/common.py | 1 | 17702 | #!/usr/bin/env python
"""
Author(s): Matthew Loper
See LICENCE.txt for licensing and contact information.
"""
import numpy as np
from copy import deepcopy
import scipy.sparse as sp
from .cvwrap import cv2
try:
from scipy.stats import nanmean as nanmean_impl
except:
from numpy import nanmean as nanmean_impl
... | mit |
DGrady/pandas | pandas/tests/io/parser/multithread.py | 28 | 2806 | # -*- coding: utf-8 -*-
"""
Tests multithreading behaviour for reading and
parsing files for each parser defined in parsers.py
"""
from __future__ import division
from multiprocessing.pool import ThreadPool
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import DataFrame
from pan... | bsd-3-clause |
alberthdev/pyradmon | pyradmon/data.py | 1 | 43712 | #!/usr/bin/env python
# PyRadmon - Python Radiance Monitoring Tool
# Copyright 2014 Albert Huang.
#
# 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/LICENS... | apache-2.0 |
poldrack/myconnectome | myconnectome/qa/qa_summary.py | 2 | 4284 | # -*- coding: utf-8 -*-
"""
assemble qa data for myconnectome data paper
"""
import os,glob
import pickle
import pandas as pd
import numpy
qadatadir='/Users/poldrack/Dropbox/data/selftracking/QA'
# process anat data
if 0:
anatdatafile=os.path.join(qadatadir,'anat_qa.pkl')
anatdata=pickle.load(open(ana... | mit |
cainiaocome/scikit-learn | examples/linear_model/plot_ols.py | 220 | 1940 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... | bsd-3-clause |
McIntyre-Lab/papers | nanni_maize_2021/scripts/correct_SQANTI_QC_GTF_gene_id_02avn.py | 1 | 4216 | #!/usr/bin/env python
import argparse
import pandas as pd
import numpy as np
import csv
import sqlite3
#import sys
def getOptions():
# Parse command line arguments
parser = argparse.ArgumentParser(description="Correct the gene_id values of the GTF output from SQANTI3 QC to match the gene_id value... | lgpl-3.0 |
tejasckulkarni/hydrology | area_function.py | 2 | 2587 | __author__ = 'kiruba'
##area of curve
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from spread import spread
# copy the code from http://code.activestate.com/recipes/577878-generate-equally-spaced-floats/ #
import itertools
from matplotlib import rc
##read csv
csv_file = '/media/kiruba/New... | gpl-3.0 |
mwv/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 |
Garrett-R/scikit-learn | sklearn/utils/tests/test_class_weight.py | 26 | 2001 | import numpy as np
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing impo... | bsd-3-clause |
iemejia/beam | sdks/python/apache_beam/runners/interactive/options/capture_limiters_test.py | 5 | 2277 | #
# 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 |
JsNoNo/scikit-learn | sklearn/decomposition/base.py | 313 | 5647 | """Principal Component Analysis Base Classes"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Kyle Kastner <kastnerkyle@gmail.com>
#
# Licen... | bsd-3-clause |
spatialmodel/inmap | website/build/InMAP/blog/2019-04-20-sr/sr_util.py | 1 | 4521 | # Ensure compatibility between python 2 and python 3
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import requests
import platform
import os
import stat
import tempfile
import json
import time
import subprocess
import geopandas as gp... | gpl-3.0 |
cmbclh/vnpy1.7 | build/lib/vnpy/DAO/index_demo.py | 2 | 3656 | ##-*-coding: utf-8;-*-##
#import common
import pandas as pd
from sqlalchemy import Column
from sqlalchemy import DECIMAL
from sqlalchemy import Integer
from sqlalchemy import String
if __name__=='__main__':
#创建数据库表
columns=[Column('date',String(8),primary_key=True),Column('code',String(8),nullable=False,prima... | mit |
corpusmusic/bb-cluster | kmean_cluster.py | 1 | 6478 | from __future__ import print_function, division, absolute_import, unicode_literals
import csv
import numpy as np
import os
import scipy as sp
from sklearn.cluster import KMeans
# For visualization
import itertools
from scipy.spatial import distance
import math
import matplotlib.pyplot as plt
# general parameters for... | gpl-3.0 |
eickenberg/scikit-learn | sklearn/ensemble/partial_dependence.py | 36 | 14909 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | bsd-3-clause |
jbkopecky/housebot | models/lassocv_model_selection.py | 1 | 3877 | from pipelines import ItemSelector
from pipelines import MyOneHotEncoder
from pipelines import FindReplace
from pipelines import ReplaceNaN
from utils import make_xy_data
from sklearn.preprocessing import Imputer
from sklearn.cross_validation import train_test_split
from sklearn.pipeline import FeatureUnion
from sklea... | mit |
kmather73/ggplot | ggplot/geoms/geom_dotplot.py | 12 | 3168 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import pandas as pd
import matplotlib.cbook as cbook
from .geom import geom
from ggplot.utils import is_string
from ggplot.utils import is_categorical
class geom_dotplot(geom):
DEFAULT_... | bsd-2-clause |
nvoron23/statsmodels | statsmodels/sandbox/tsa/example_arma.py | 27 | 11572 | '''trying to verify theoretical acf of arma
explicit functions for autocovariance functions of ARIMA(1,1), MA(1), MA(2)
plus 3 functions from nitime.utils
'''
from __future__ import print_function
from statsmodels.compat.python import range
import numpy as np
from numpy.testing import assert_array_almost_equal
impor... | bsd-3-clause |
shaileshr/ThinkStats2 | code/hypothesis.py | 75 | 10162 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import nsfg
import nsfg2
import first
import thinkstats2
import thinkplot
... | gpl-3.0 |
RPGOne/Skynet | scikit-learn-0.18.1/examples/neighbors/plot_species_kde.py | 39 | 4039 | """
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... | bsd-3-clause |
voutilad/courtlistener | cl/people_db/import_judges/populate_state_judges.py | 1 | 7233 | # -*- coding: utf-8 -*-
from datetime import date
import pandas as pd
from cl.corpus_importer.import_columbia.parse_opinions import \
get_state_court_object
from cl.people_db.import_judges.judge_utils import get_school, process_date, \
get_suffix
from cl.people_db.models import Person, Position, Education, \... | agpl-3.0 |
aam-at/tensorflow | tensorflow/lite/micro/kernels/vexriscv/utils/log_parser.py | 15 | 8798 | # Copyright 2020 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 |
srowen/spark | python/pyspark/pandas/data_type_ops/categorical_ops.py | 5 | 2506 | #
# 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 |
kdaily/synapseTutorials | python/tcga_survival_analysis.py | 2 | 4738 |
# coding: utf-8
# #Cancer Survival Prediction
# We will use data that is part of an open challenge to predict survival in cancer patients from within the Cancer Genome Atlas (TCGA). For details please see Yin Yin et al in Nature Biotechnology. Also please consider improving on the model to derive a better predictor... | gpl-2.0 |
vavuq/vavuq | VAVUQ.py | 1 | 57168 | #!/usr/bin/env python
"""
VAVUQ (Verification And Validation and Uncertainty Quantification) can
be used as a general purpose program for verification, validation, and
uncertainty quantification. The motivation for the creation of and
continued development of the program is to provide a cost effective and
easy way to... | gpl-3.0 |
AlexRobson/scikit-learn | examples/tree/plot_iris.py | 271 | 2186 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
LohithBlaze/scikit-learn | sklearn/tests/test_kernel_approximation.py | 244 | 7588 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.utils.testing import assert_less_equal
from ... | bsd-3-clause |
lazywei/scikit-learn | examples/cluster/plot_color_quantization.py | 297 | 3443 | # -*- coding: utf-8 -*-
"""
==================================
Color Quantization using K-Means
==================================
Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace
(China), reducing the number of colors required to show the image from 96,615
unique colors to 64, while pre... | bsd-3-clause |
dmnfarrell/mhcpredict | epitopepredict/utilities.py | 2 | 6016 | #!/usr/bin/env python
"""
Utilities for epitopepredict
Created March 2013
Copyright (C) Damien Farrell
"""
from __future__ import absolute_import, print_function
import os, math, csv, string
import shutil
import numpy as np
import pandas as pd
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from... | apache-2.0 |
Guokr1991/seaborn | seaborn/tests/test_utils.py | 4 | 8159 | """Tests for plotting utilities."""
import warnings
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from numpy.testing import assert_array_equal
import nose
import nose.tools as nt
from nose.tools import assert_equal, raises
from distutils.version import LooseVersion
pandas_has_categoricals = L... | bsd-3-clause |
maxplanck-ie/HiCExplorer | hicexplorer/test/general/test_hicCorrelate.py | 1 | 2635 | import warnings
warnings.simplefilter(action="ignore", category=RuntimeWarning)
warnings.simplefilter(action="ignore", category=PendingDeprecationWarning)
from hicexplorer import hicCorrelate
from tempfile import NamedTemporaryFile
import os
from matplotlib.testing.compare import compare_images
ROOT = os.path.join(os... | gpl-2.0 |
pprett/scikit-learn | sklearn/datasets/__init__.py | 61 | 3734 | """
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_breast_cancer
from .base import load_boston
from .base import load_diabetes
from .base import load_digi... | bsd-3-clause |
kmike/scikit-learn | sklearn/cluster/tests/test_affinity_propagation.py | 6 | 1959 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import (assert_equal, assert_array_equal,
assert_raises)
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagation_ import affinity_propagation... | bsd-3-clause |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/matplotlib/testing/decorators.py | 2 | 9102 | from matplotlib.testing.noseclasses import KnownFailureTest, \
KnownFailureDidNotFailTest, ImageComparisonFailure
import os, sys, shutil, new
import nose
import matplotlib
import matplotlib.tests
import matplotlib.units
from matplotlib import pyplot as plt
from matplotlib import ft2font
import numpy as np
from mat... | gpl-3.0 |
huobaowangxi/scikit-learn | sklearn/datasets/species_distributions.py | 198 | 7923 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | bsd-3-clause |
Barmaley-exe/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 226 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
TUM-LMF/fieldRNN | rnn_model.py | 1 | 12241 | import tensorflow as tf
from tensorflow.contrib import rnn as rnn_cell
import numpy as np
import io
from util.tf_utils import tf_confusion_metrics
import inspect
import util.eval as eval
class Model():
"""
Tensorflow Graph using Recurrent LSTM layers and fully connected softmax layer for field identification
... | mit |
sniemi/EuclidVisibleInstrument | ETC/fluxEstimates.py | 1 | 10971 | """
This file provides simple functions to calculate wavelength dependent effects.
The functions can also be used to estimate the Weak Lensing Channel ghosts as a function
of spectral type.
:requires: NumPy
:requires: matplotlib
:requires: pysynphot
:version: 0.1
:author: Sami-Matias Niemi
:contact: s.niemi@ucl.ac.... | bsd-2-clause |
google/wikiloop-analysis | cross-edits-analysis/engine.py | 1 | 12345 | '''
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | apache-2.0 |
russellgeoff/blog | RL/Combination allo and ego/egoalloBasic.py | 6 | 9327 | import numpy as np
import sys
import random
import cellular
import qlearn
startCell = None
class Cell(cellular.Cell):
def __init__(self):
self.cliff = False
self.goal = False
self.wall = False
def colour(self):
if self.cliff:
return 'red'
... | gpl-3.0 |
showa-yojyo/notebook | source/_sample/saha16/barnsley.py | 1 | 1432 | #!/usr/bin/env python
"""barnsley.py: Python からはじめる数学入門 pp. 175-177 改造版
Draw Barnsley's Fern
Usage:
barnsley.py [number of points]
"""
import random
import sys
import matplotlib.pyplot as plt
PROBABILITY = (0.85, 0.07, 0.07, 0.01)
def transformation1(p):
x, y = p
x1 = 0.85 * x + 0.04 * y
y1 = -0.04 *... | mit |
wlamond/scikit-learn | examples/cluster/plot_face_compress.py | 83 | 2198 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Vector Quantization Example
=========================================================
Face, a 1024 x 768 size image of a raccoon face,
is used here to illustrate how `k`-means is
used for vector quantization.
"""
... | bsd-3-clause |
miti0/mosquito | utils/walletlense.py | 1 | 6882 | import time
import numpy as np
import pandas as pd
import configargparse
from termcolor import colored
from backfill.candles import Candles
from exchanges.exchange import Exchange
from utils.postman import Postman
import telegram
class WalletLense:
"""
Lense: Returns actual wallet statistics with simple daily... | gpl-3.0 |
mrshu/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 1 | 12235 | import numpy as np
from numpy import linalg
from numpy.testing import assert_array_almost_equal, assert_almost_equal
from numpy.testing import assert_equal, assert_array_equal
from nose.tools import assert_raises
from nose.tools import assert_true
from scipy.sparse import csr_matrix
from scipy.spatial.distance import c... | bsd-3-clause |
nmayorov/scipy | scipy/fft/_basic.py | 4 | 62596 | from scipy._lib.uarray import generate_multimethod, Dispatchable
import numpy as np
def _x_replacer(args, kwargs, dispatchables):
"""
uarray argument replacer to replace the transform input array (``x``)
"""
if len(args) > 0:
return (dispatchables[0],) + args[1:], kwargs
kw = kwargs.copy()... | bsd-3-clause |
HopkinsIDD/EpiForecastStatMech | epi_forecast_stat_mech/evaluation/plot_predictions.py | 1 | 10761 | # Lint as: python3
"""Plot helpers for predictions from high_level.Estimator.
"""
from epi_forecast_stat_mech.evaluation.plot_constants import model_colors
from epi_forecast_stat_mech.evaluation.plot_constants import model_types
from matplotlib import pyplot as plt
import numpy as np
def plot_rollout_samples(predict... | gpl-3.0 |
Upward-Spiral-Science/team1 | code/image_scraping_jay.py | 1 | 7534 | # Image scraping (Jay Miller)
# REVISED VERSION
# older functions left below since some peoples notebooks
# might still be using them
import matplotlib.pyplot as plt
import numpy as np
import urllib2
from skimage import io
def bin_to_nparray(cx, cy, cz=55, res=1, overlay=False):
"""
Here's the updated function... | apache-2.0 |
ioana-delaney/spark | python/pyspark/sql/tests.py | 2 | 224488 | # -*- encoding: utf-8 -*-
#
# 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 ... | apache-2.0 |
Superchicken1/SambaFlow | python/traffic-prediction/src/models/NN_currentSituationWithWeather.py | 1 | 3831 | import tensorflow as tf
import numpy as np
import pandas as pd
import src.vector_gen.generateCurrentSituationWithWeather as vecX
import src.vector_gen.generate_VectorY as vecY
import src.misc.split_train_valid_notRandom as split
import src.misc.evaluation as evaluation
import src.misc.paths as paths
df_trajectories = ... | apache-2.0 |
shahankhatch/scikit-learn | examples/manifold/plot_compare_methods.py | 259 | 4031 | """
=========================================
Comparison of Manifold Learning methods
=========================================
An illustration of dimensionality reduction on the S-curve dataset
with various manifold learning methods.
For a discussion and comparison of these algorithms, see the
:ref:`manifold module... | bsd-3-clause |
Silmathoron/nest-simulator | pynest/examples/intrinsic_currents_subthreshold.py | 12 | 8348 | # -*- coding: utf-8 -*-
#
# intrinsic_currents_subthreshold.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | gpl-2.0 |
daniellima/cifar-10-image-recognition | src/examples/2-hist.py | 1 | 3731 | import cv2
import numpy as np
from matplotlib import pyplot as plt
import os
# retorna uma image com apenas um dos canais
def get_img_channel(img, channel):
img_copy = np.copy(img)
if channel == "r":
img_copy[:,:,1] = 0
img_copy[:,:,2] = 0
elif channel == "g":
img_copy[:,:,0] = 0
img_copy[:,:,2] = 0
el... | mit |
apdjustino/DRCOG_Urbansim | src/drcog/maps/data_frame_init.py | 1 | 1329 | __author__ = 'jmartinez'
import numpy as np, pandas as pd, os
from drcog.maps import dframe_explorer
import dframe_explorer
#
z2015 = pd.read_csv('//kennedy/CRS/Urban Sim/UrbanSim Final RTP data folder/data/drcog2/runs/zone_summary2015_091714071811.csv')
z2020 = pd.read_csv('//kennedy/CRS/Urban Sim/UrbanSim Final RTP... | agpl-3.0 |
AdaptivePELE/AdaptivePELE | AdaptivePELE/freeEnergies/checkDetailedBalance.py | 1 | 8192 | from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
import argparse
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from scipy import linalg
FOLDER = "discretized"
CLUSTER_CENTERS = "clusterCenters.dat"
TRAJECTORY_MATCHING_PATTERN = "*.disctraj"... | mit |
splotz90/urh | tests/PlotTests.py | 1 | 1882 | import copy
import unittest
import matplotlib.pyplot as plt
import numpy as np
from urh.signalprocessing.Modulator import Modulator
from urh.cythonext import signalFunctions
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
from urh.signalprocessing.Signal import Signal
from tests.utils_testing impor... | gpl-3.0 |
imaculate/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
jstoxrocky/statsmodels | statsmodels/datasets/sunspots/data.py | 25 | 2015 | """Yearly sunspots data 1700-2008"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This data is public domain."""
TITLE = __doc__
SOURCE = """
http://www.ngdc.noaa.gov/stp/solar/solarda3.html
The original dataset contains monthly data on sunspot activity in the file
./src/sunspots_yearly.dat. There... | bsd-3-clause |
mouadino/Shapely | docs/code/skew.py | 5 | 2513 | from matplotlib import pyplot
from shapely.wkt import loads as load_wkt
from shapely import affinity
from descartes.patch import PolygonPatch
from figures import SIZE, BLUE, GRAY
def add_origin(ax, geom, origin):
x, y = xy = affinity.interpret_origin(geom, origin, 2)
ax.plot(x, y, 'o', color=GRAY, zorder=1)
... | bsd-3-clause |
tomlof/scikit-learn | examples/tree/plot_iris.py | 86 | 1965 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
vortex-exoplanet/VIP | vip_hci/pca/pca_fullfr.py | 2 | 42541 | #! /usr/bin/env python
"""
Full-frame PCA algorithm for ADI, ADI+RDI and ADI+mSDI (IFS data) cubes.
"""
__author__ = 'Carlos Alberto Gomez Gonzalez'
__all__ = ['pca']
import numpy as np
from multiprocessing import cpu_count
from .svd import svd_wrapper, SVDecomposer
from .utils_pca import pca_incremental, pca_grid
f... | mit |
josecolella/PLD | bin/osx/treasurehunters.app/Contents/Resources/lib/python3.4/numpy/lib/function_base.py | 9 | 113795 | from __future__ import division, absolute_import, print_function
__docformat__ = "restructuredtext en"
__all__ = [
'select', 'piecewise', 'trim_zeros', 'copy', 'iterable', 'percentile',
'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',
'extract', 'place', 'vectorize', 'asarray_chkfinite', 'ave... | mit |
marcharper/python-ternary | ternary/heatmapping.py | 1 | 13802 | """
Various Heatmaps.
"""
import functools
import numpy as np
from matplotlib import pyplot as plt
from .helpers import unzip, normalize, simplex_iterator, permute_point, project_point
from .colormapping import get_cmap, colormapper, colorbar_hack
### Heatmap Triangulation Coordinates
## Triangular Heatmaps
def b... | mit |
amontefusco/gnuradio-amontefusco | gr-utils/src/python/gr_plot_iq.py | 5 | 7074 | #!/usr/bin/env python
#
# Copyright 2007,2008 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 opt... | gpl-3.0 |
balister/GNU-Radio | gr-utils/python/utils/plot_fft_base.py | 53 | 10449 | #!/usr/bin/env python
#
# Copyright 2007,2008,2011 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 |
olafhauk/mne-python | mne/decoding/tests/test_csp.py | 13 | 13483 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Romain Trachel <trachelr@gmail.com>
# Alexandre Barachant <alexandre.barachant@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import pytest
from numpy.testing... | bsd-3-clause |
loli/semisupervisedforests | sklearn/cluster/mean_shift_.py | 21 | 13948 | """Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | bsd-3-clause |
WmHHooper/aima-python | submissions/Gray/myKMeans.py | 1 | 3134 | from sklearn import preprocessing
from sklearn.preprocessing import StandardScaler
beaver_data = [
[1, 307, 930, 36.58, 0],
[2, 307, 940, 36.73, 0],
[3, 307, 950, 36.93, 0],
[4, 307, 1000, 37.15, 0],
[5, 307, 1010, 37.23, 0],
[6, 307, 1020, 37.24, 0],
[7, 307, 1030, 37.24, 0],
[8, ... | mit |
winklerand/pandas | pandas/tests/dtypes/test_missing.py | 2 | 14391 | # -*- coding: utf-8 -*-
import pytest
from warnings import catch_warnings
import numpy as np
from datetime import datetime
from pandas.util import testing as tm
import pandas as pd
from pandas.core import config as cf
from pandas.compat import u
from pandas._libs import missing as libmissing
from pandas._libs.tslib ... | bsd-3-clause |
ilayn/scipy | scipy/spatial/tests/test__plotutils.py | 18 | 1943 | import pytest
from numpy.testing import assert_, assert_array_equal, suppress_warnings
try:
import matplotlib
matplotlib.rcParams['backend'] = 'Agg'
import matplotlib.pyplot as plt
has_matplotlib = True
except Exception:
has_matplotlib = False
from scipy.spatial import \
delaunay_plot_2d, voro... | bsd-3-clause |
studywolf/blog | VREP/two_link_arm/vrep_twolink_controller.py | 1 | 9076 | '''
Copyright (C) 2016 Travis DeWolf
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 th... | gpl-3.0 |
walterreade/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 |
AnasGhrab/scikit-learn | sklearn/tests/test_dummy.py | 129 | 17774 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.base import clone
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.utils.testing import assert_almost_eq... | bsd-3-clause |
sumspr/scikit-learn | sklearn/linear_model/tests/test_randomized_l1.py | 214 | 4690 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.linear_model.randomized_l1 i... | bsd-3-clause |
SkRobo/Eurobot-2017 | old year/RESET-master/CommunicationWithRobot/localisation2.py | 2 | 9722 | # Monte Carlo Localisation
import prob_motion_model as pmm
#import hokuyo
import random
import numpy as np
import matplotlib.pyplot as plt
import time
import socket
import copy
import ttest
import math
from serial.tools import list_ports
import serialWrapper
import packetBuilder
import packetParser
import traceback
#... | mit |
nicolagritti/ACVU_scripts | source/beadsAnalysis.py | 1 | 2823 | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 1 10:31:00 2015
@author: kienle
"""
import numpy as np
import matplotlib.pyplot as plt
import pickle
from matplotlib import cm
from generalFunctions import *
from skimage import filters
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
def plotFluorescence( ... | gpl-3.0 |
mayblue9/scikit-learn | sklearn/cluster/bicluster.py | 211 | 19443 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... | bsd-3-clause |
ychfan/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 58 | 71789 | # 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 |
toastedcornflakes/scikit-learn | sklearn/utils/tests/test_murmurhash.py | 65 | 2838 | # Author: Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import numpy as np
from sklearn.externals.six import b, u
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from nose.tools import assert_equa... | bsd-3-clause |
JensWehner/votca-scripts | xtp/xtp_Molpol_pattern.py | 2 | 2265 | #!/usr/bin/env python
import sqlite3
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
import os.path
import numpy.linalg as lg
import argparse as ap
parser=ap.ArgumentParser(description="reads in pdb or gro file and creates a molpol pattern from it")
parser.add_argument(... | apache-2.0 |
lfairchild/PmagPy | dialogs/ErMagicBuilder.py | 1 | 19590 | #!/usr/bin/env pythonw
# pylint: disable=W0612,C0111,C0103,W0201,C0301,E265
#============================================================================================
# LOG HEADER:
#============================================================================================
import os
import sys
import pandas as p... | bsd-3-clause |
fabianp/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
fmilano/mitk | Modules/Biophotonics/python/iMC/scripts/ipcai2016/tasks_common.py | 6 | 5896 |
import os
import pickle
import numpy as np
import pandas as pd
import luigi
from sklearn.ensemble.forest import RandomForestRegressor
import matplotlib.pylab as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import tasks_mc
import commons
from msi.msi import Msi
from msi.io.nrrdwriter import NrrdWriter
... | bsd-3-clause |
kernc/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting.py | 43 | 39945 | """
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import warnings
import numpy as np
from itertools import product
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import coo_matrix
from sklearn import datasets
from sklearn.base import clo... | bsd-3-clause |
polypmer/obligarcy | obligarcy/control.py | 1 | 2958 | from .models import Submission, Contract, Deadline, UserProfile, Action
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
from .forms import UserForm, UserProfileForm
from .forms import ContractForm, SubForm
from django.utils import timezone
from datetime import datetime, t... | gpl-3.0 |
elliotchencv/cuda-convnet2 | shownet.py | 180 | 18206 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
Nschanche/AstroHackWeek2015 | inference/straightline_utils.py | 6 | 3687 | # numpy: numerical library
import numpy as np
# avoid broken installs by forcing Agg backend...
#import matplotlib
#matplotlib.use('Agg')
# pylab: matplotlib's matlab-like interface
import pylab as plt
# The data we will fit:
# x, y, sigma_y
data1 = np.array([[201,592,61],[244,401,25],[47,583,38],[287,402,15],[203,49... | gpl-2.0 |
RachitKansal/scikit-learn | sklearn/tests/test_grid_search.py | 53 | 28730 | """
Testing for grid search module (sklearn.grid_search)
"""
from collections import Iterable, Sized
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.externals.six.moves import xrange
from itertools import chain, product
import pickle
import sys
import numpy as np
import scipy.sparse as sp
... | bsd-3-clause |
rhiever/bokeh | examples/glyphs/anscombe.py | 39 | 2945 | from __future__ import print_function
import numpy as np
import pandas as pd
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle, Line
from bokeh.models import (
ColumnDataSource, Grid, GridPlot, LinearAxis, Plot, Range1d
)... | bsd-3-clause |
anguoyang/SMQTK | python/smqtk/indexing/naive_bayes.py | 1 | 9147 | """
LICENCE
-------
Copyright 2015 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
from . import Indexer
import cPickle
import os.path as osp
import numpy
from sklearn.naive... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow_LightGBM_Scipy_nightly/source/tensorflow/python/estimator/inputs/inputs.py | 94 | 1290 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
RDCEP/ggcmi | bin/plot.isi1/blmap.isi1.py | 1 | 9804 | #!/usr/bin/env python
# import modules
import matplotlib
from os.path import splitext
from shapefile import Reader
from itertools import product
import matplotlib.pyplot as plt
from optparse import OptionParser
from netCDF4 import Dataset as nc
from mpl_toolkits.basemap import Basemap
from matplotlib.collections impor... | agpl-3.0 |
smblance/ggplot | ggplot/scales/scale_facet.py | 13 | 10175 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
# TODO: This is fairly repetiive and can definitely be
# condensed into a lot less code, but it's working for now
import numpy as np
import matplotlib.pyplot as plt
from .utils import calc_axis_breaks_and_limi... | bsd-2-clause |
wavelets/zipline | tests/test_algorithm.py | 2 | 30066 | #
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/setup.py | 5 | 5812 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distutils.command.clean import clean as Clean
i... | bsd-3-clause |
PatrickOReilly/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py | 55 | 2723 | """
===================================================
Label Propagation digits: Demonstrating performance
===================================================
This example demonstrates the power of semisupervised learning by
training a Label Spreading model to classify handwritten digits
with sets of very few labels.... | bsd-3-clause |
joshbohde/scikit-learn | benchmarks/bench_plot_ward.py | 2 | 1150 | """
Bench the scikit's ward implement compared to scipy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import Ward
ward = Ward(n_clusters=15)
n_samples = np.logspace(.5, 3, 9)
n_features = np.logspace(1, 3.5, 7)
N_samples, N_features = np.meshgrid(n... | bsd-3-clause |
aewhatley/scikit-learn | examples/linear_model/plot_lasso_lars.py | 363 | 1080 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause |
after12am/summary | summary/topic/keygragh.py | 1 | 8491 | # -*- coding: utf-8 -*-
import re, os, sys
import networkx as nx
import nltk
from collections import defaultdict
from pprint import pprint
FETCH_FREQ_NUM = 30
FETCH_HIGH_KEY_NUM = 12
class Corpus(object):
PATH_STOPWORDS = 'corpus/en/stopwords.txt'
def __init__(self):
self.stopwords = self.r... | mit |
jhnnsnk/nest-simulator | extras/ConnPlotter/tcd_nest.py | 20 | 6959 | # -*- coding: utf-8 -*-
#
# tcd_nest.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# ... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.