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 |
|---|---|---|---|---|---|
tkaitchuck/nupic | external/linux64/lib/python2.6/site-packages/matplotlib/mathtext.py | 69 | 101723 | r"""
:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
TeX math syntax and drawing them to a matplotlib backend.
For a tutorial of its usage see :ref:`mathtext-tutorial`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _p... | gpl-3.0 |
arahuja/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
arizona-phonological-imaging-lab/Autotrace | matlab-version/image_diversity.py | 3 | 12800 | #!/usr/bin/env python
'''
image_diversity.py
Written by Jeff Berry on Dec 21 2010
purpose:
This script measures the distance from average for each image in the
input set, and copies the specified number of highest scoring images
to a new folder called 'diverse'. If ROI_config.txt is present in the
sa... | mit |
mauriziofilippone/deep_gp_random_features | code/dgp_rff.py | 1 | 21153 | ## Copyright 2016 Kurt Cutajar, Edwin V. Bonilla, Pietro Michiardi, Maurizio Filippone
##
## 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... | apache-2.0 |
kthyng/octant | octant/sandbox/googleearth.py | 4 | 8875 | #!/usr/bin/env python
# encoding: utf-8
"""
geo_anim.py
Created by Rob Hetland on 2008-01-14.
Copyright (c) 2008 Texas A&M Univsersity. All rights reserved.
"""
import matplotlib
matplotlib.use('Agg')
from numpy import *
from matplotlib.pyplot import *
import pylab
import zipfile
import octant
import os
kml_preambl... | bsd-3-clause |
PanDAWMS/panda-bigmon-core-old | core/common/models.py | 1 | 139296 | # Create your models here.
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# Feel free to rename the models, but don't rename db_table values or field names.
#
#... | apache-2.0 |
tapomayukh/projects_in_python | classification/Classification_with_kNN/Single_Contact_Classification/Scaled_Features/best_kNN_PCA/objects/test11_cross_validate_objects_1200ms_scaled_method_ii.py | 1 | 4916 |
# Principal Component Analysis Code :
from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud
from pylab import *
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import ro... | mit |
dblalock/flock | python/algo/ff.py | 1 | 6136 | #!/usr/env/python
import numpy as np
import scipy.signal as sig
import matplotlib.pyplot as plt
from ..datasets import synthetic as synth
from ..utils.arrays import zNormalizeRows
def tryTriangle():
l = 3
n = 100
m = 60
startIdx = 25
nIters = 30
# X = synth.randconst((l,n))
X = synth.randwalk((l,n))
for i i... | mit |
cainiaocome/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py | 221 | 5517 | """
Testing for the gradient boosting loss functions and initial estimators.
"""
import numpy as np
from numpy.testing import assert_array_equal
from numpy.testing import assert_almost_equal
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.utils import check_random_state
from ... | bsd-3-clause |
salotz/mast | mastic/interactions/hydrogen_bond.py | 1 | 16821 | """The HydrogenBond module defines the HydrogenBondType and
HydrogenBondInx for explicit hydrogens.
"""
import itertools as it
from collections import namedtuple, defaultdict
import numpy as np
import numpy.linalg as la
from scipy.spatial.distance import cdist
#import pandas as pd
import mastic.config.interactions a... | mit |
kcompher/BuildingMachineLearningSystemsWithPython | ch07/boston_cv10_penalized.py | 3 | 1386 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from __future__ import print_function
from sklearn.cross_validation import KFold
from sklearn.linear_mo... | mit |
kou/arrow | python/pyarrow/tests/test_feather.py | 4 | 22981 | # 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 u... | apache-2.0 |
Ziqi-Li/bknqgis | pandas/pandas/tests/groupby/test_bin_groupby.py | 8 | 4948 | # -*- coding: utf-8 -*-
import pytest
from numpy import nan
import numpy as np
from pandas.core.dtypes.common import _ensure_int64
from pandas import Index, isna
from pandas.util.testing import assert_almost_equal
import pandas.util.testing as tm
from pandas._libs import lib, groupby
def test_series_grouper():
... | gpl-2.0 |
DonBeo/scikit-learn | sklearn/neighbors/classification.py | 18 | 13871 | """Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by ... | bsd-3-clause |
jmschrei/scikit-learn | sklearn/tests/test_learning_curve.py | 59 | 10869 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
utiasSTARS/pykitti | demos/demo_raw_cv2.py | 1 | 2160 | """Example of pykitti.raw usage with OpenCV."""
import cv2
import numpy as np
import matplotlib.pyplot as plt
import pykitti
__author__ = "Lee Clement"
__email__ = "lee.clement@robotics.utias.utoronto.ca"
# Change this to the directory where you store KITTI data
basedir = '/Users/leeclement/Desktop/KITTI/raw'
# Spe... | mit |
pombo-lab/gamtools | lib/gamtools/segregation.py | 1 | 8499 | """
The segregation module
======================
The primary output of a GAM experiment is a segregation table. The segregation
module contains functions for reading segregation tables and for extracting
specific subsets of a segregation table.
.. _NPs:
Nuclear profiles
----------------
In a GAM experiment, thin ... | apache-2.0 |
FrankLeeX/PiNN_Caffe2 | hemt_qv_example.py | 1 | 1760 | from ac_qv_api import ACQVModel, plot_iv, predict_qs
import pinn.parser as parser
import pinn.preproc as preproc
import pinn.exporter as exporter
import pinn.deembed as deembed
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
data_arrays = deembed.dee... | mit |
GrimRanger/GeneticAlgorithm | helps/deap/deap-master/examples/es/cma_plotting.py | 12 | 4326 | # This file is part of DEAP.
#
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DEAP is distributed ... | mit |
raghavrv/scikit-learn | examples/text/document_classification_20newsgroups.py | 9 | 10825 | """
======================================================
Classification of text documents using sparse features
======================================================
This is an example showing how scikit-learn can be used to classify documents
by topics using a bag-of-words approach. This example uses a scipy.spars... | bsd-3-clause |
Djabbz/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
sonnyhu/scikit-learn | sklearn/utils/tests/test_estimator_checks.py | 69 | 3894 | import scipy.sparse as sp
import numpy as np
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.testing import assert_raises_regex, assert_true
from sklearn.utils.estimator_checks import check_estimator
from sklearn.utils.... | bsd-3-clause |
QuLogic/iris | lib/iris/tests/test_pandas.py | 3 | 19194 | # (C) British Crown Copyright 2013 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
mikeengland/fireant | fireant/widgets/base.py | 2 | 4156 | import pandas as pd
from typing import FrozenSet, List, Optional, Union
from fireant.dataset.fields import Field
from fireant.dataset.operations import Operation, _BaseOperation
from fireant.dataset.references import Reference
from fireant.exceptions import DataSetException
from fireant.reference_helpers import (
... | apache-2.0 |
GlobalEcologyLab/SARDM | Test/SampleGeneratorTest.py | 1 | 24992 | # Tool library module
from SampleGenerator import SampleGenerator
# Python extension module NumPy (requires extension installation)
import numpy as np
# Test sample number
sample_number = 10
sample_generator = SampleGenerator()
# Test 1: Latin Hypercube
print 'Test 1: Latin Hypercube multipliers\n'
# a) Uniform d... | gpl-3.0 |
thushear/MLInAction | sklearn/dimred/plot_pca_vs_lda.py | 1 | 1330 | print(__doc__)
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.decomposition import PCA
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
iris = datasets.load_iris()
X = iris.data
y = iris.target
target_names = iris.target_names
print(X)
print('=' * 10)
print(y)
print('=... | apache-2.0 |
guziy/basemap | examples/make_inset.py | 2 | 1136 | from __future__ import (absolute_import, division, print_function)
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
# Set up the primary map
fig = plt.figure()
ax = fig.add_subplot(111)
bmap =\
... | gpl-2.0 |
mjstealey/exposures-api | sample-data/cmaq-netcdf/create_cmaq_csv.py | 2 | 1654 | # application to read CMAQ netCDF file and create
# desired CSV file, suitable for loading into DB
import numpy as np
import pandas as pd
import xarray as xr
import datetime
import yaml
# get file path configs
fd = open("./create_cmaq_csv_config.yml")
config = yaml.safe_load(fd)
fd.close()
cmaq2011 = config['cmaq201... | mit |
weleen/mxnet | example/ssd/dataset/pycocotools/coco.py | 29 | 19564 | # 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 u... | apache-2.0 |
OshynSong/scikit-learn | examples/plot_multioutput_face_completion.py | 330 | 3019 | """
==============================================
Face completion with a multi-output estimators
==============================================
This example shows the use of multi-output estimator to complete images.
The goal is to predict the lower half of a face given its upper half.
The first column of images sho... | bsd-3-clause |
XianliangJ/collections | Sprout-Verus/verus/tools/plot.py | 1 | 2452 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import matplotlib as mtp
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("client_file", help="e.g. client_60001.out")
parser.add_argument("server_file", help="Receiver.out")
parser.add_argument("-o", "--output", help="output direct... | gpl-3.0 |
altairpearl/scikit-learn | sklearn/tests/test_random_projection.py | 141 | 14040 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
ktavabi/mnefun | mnefun/bin/_acq_qa.py | 3 | 8497 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Monitor acquisition paths for new files and generate reports for them.
"""
import argparse
from datetime import datetime
import glob
import logging
import os
import os.path as op
import time
import traceback
import numpy as np
import mne
logger = logging.getLogger('... | bsd-3-clause |
code-sauce/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator.py | 4 | 53699 | # 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 |
zorojean/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
eteq/bokeh | examples/app/stock_applet/stock_app_simple.py | 43 | 12408 | """
This file demonstrates a bokeh applet, which can either be viewed
directly on a bokeh-server, or embedded into a flask application.
See the README.md file in this directory for instructions on running.
"""
import logging
logging.basicConfig(level=logging.DEBUG)
from os import listdir
from os.path import dirname,... | bsd-3-clause |
massmutual/scikit-learn | examples/ensemble/plot_feature_transformation.py | 1 | 4400 | """
===============================================
Feature transformations with ensembles of trees
===============================================
Transform your features into a higher dimensional, sparse space. Then
train a linear model on these features.
First fit an ensemble of trees (totally random trees, a rand... | bsd-3-clause |
leifdenby/numpy | doc/source/conf.py | 63 | 9811 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
import sys, os, re
# Check Sphinx version
import sphinx
if sphinx.__version__ < "1.0.1":
raise RuntimeError("Sphinx 1.0.1 or newer required")
needs_sphinx = '1.0'
# ----------------------------------------------------------... | bsd-3-clause |
megastupidmonkey/CSE5429TensorFlow | TF_CNN.py | 1 | 11482 | #special Thanks to Hvass-Labs on github for providing an excellent tutorial and code
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
import time
from datetime import timedelta
import math
from tensorflow.python.saved_model import builder as saved_m... | gpl-3.0 |
huobaowangxi/scikit-learn | examples/plot_multilabel.py | 87 | 4279 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
MJuddBooth/pandas | pandas/core/base.py | 1 | 49638 | """
Base and utility classes for pandas objects.
"""
from collections import OrderedDict
import textwrap
import warnings
import numpy as np
import pandas._libs.lib as lib
import pandas.compat as compat
from pandas.compat import PYPY, builtins, map, range
from pandas.compat.numpy import function as nv
from pandas.erro... | bsd-3-clause |
vybstat/scikit-learn | sklearn/metrics/tests/test_score_objects.py | 138 | 14048 | import pickle
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regexp
from sklearn.utils.testing import assert_true
from sklearn.utils.testing im... | bsd-3-clause |
abhisg/scikit-learn | sklearn/neighbors/tests/test_ball_tree.py | 159 | 10196 | import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dis... | bsd-3-clause |
trungnt13/scikit-learn | examples/text/mlcomp_sparse_document_classification.py | 292 | 4498 | """
========================================================
Classification of text documents: using a MLComp dataset
========================================================
This is an example showing how the scikit-learn can be used to classify
documents by topics using a bag-of-words approach. This example uses
a s... | bsd-3-clause |
sehoonha/optskills | optskills/observer/plot_values.py | 1 | 8627 | import numpy as np
import scipy.stats.mstats
import matplotlib.pyplot as plt
class Experiment(object):
def __init__(self):
self.evals = []
self.values = []
def add_point(self, e, v):
self.evals += [e]
self.values += [v]
def num_evals(self):
return max(self.evals)
... | mit |
ep1cman/workload-automation | setup.py | 1 | 3410 | # Copyright 2013-2015 ARM Limited
#
# 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 w... | apache-2.0 |
Pirolf/Cabot | categorize.py | 1 | 2623 | import numpy as np
import scimath as sm
import matplotlib.pyplot as plt
import json
import yaml
import sys
import os
# Make sure that caffe is on the python path:
configStream = open("FluffyHaiiro.yaml", "r")
config = yaml.load(configStream)
caffe_root = config.get(':caffe_root_path')
sys.path.insert(0, caffe_root +... | mit |
dallascard/guac | core/rnn/common.py | 1 | 11930 | import os
import codecs
import gensim
import numpy as np
import pandas as pd
from theano import tensor as T
import extract_ngram_tokens_for_rnn
from ..preprocessing import label_reader
from ..preprocessing import data_splitting as ds
from ..experiment import evaluation
from ..util import defines
from ..util import fi... | apache-2.0 |
petuum/public | app/lda/scripts/analyze.py | 1 | 1476 | from __future__ import print_function
import numpy as np
import sys
import pandas as pd
phi_path = '/users/wdai/bosen/app/lda/output/lda.S0.M4.T32/lda_out.phi'
num_topics = 100
num_words = 52210
top_k = 10
dict_path = '/users/wdai/bosen/app/lda/datasets/words_freq.tsv'
topk_file = '/users/wdai/bosen/app/lda/output/top... | bsd-3-clause |
jlegendary/scikit-learn | sklearn/neighbors/approximate.py | 128 | 22351 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
fding/llama | analyze_shortest_path.py | 1 | 4896 | import argparse
import math
import re
import numpy as np
import matplotlib.pyplot as plt
class Experiment(object):
def __init__(self, commit, params):
self.commit = commit
self.outputs = []
class Results(dict):
def __init__(self, *args, **kwargs):
super(Results, self).__init__(*args, *... | bsd-3-clause |
tmhm/scikit-learn | examples/preprocessing/plot_function_transformer.py | 161 | 1949 | """
=========================================================
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 |
pelson/numpy | doc/sphinxext/docscrape_sphinx.py | 154 | 7759 | import re, inspect, textwrap, pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('use_plots', False)
NumpyDocString.__init__(self, docstring, config=config)
... | bsd-3-clause |
wilsonkichoi/zipline | zipline/utils/data.py | 11 | 12760 | #
# Copyright 2013 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 |
credp/lisa | lisa/analysis/rta.py | 2 | 39318 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019, Arm Limited and contributors.
#
# 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
#
# ... | apache-2.0 |
shikhar413/openmc | examples/pincell_depletion/restart_depletion.py | 6 | 3265 | import openmc
import openmc.deplete
import matplotlib.pyplot as plt
###############################################################################
# Load previous simulation results
###############################################################################
# Load geometry from statepoint
st... | mit |
duncanmmacleod/gwsumm | gwsumm/plot/sei.py | 1 | 6093 | # coding=utf-8
# Copyright (C) Duncan Macleod (2013)
#
# This file is part of GWSumm
#
# GWSumm 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 ... | gpl-3.0 |
jjx02230808/project0223 | examples/ensemble/plot_partial_dependence.py | 8 | 4455 | """
========================
Partial Dependence Plots
========================
Partial dependence plots show the dependence between the target function [1]_
and a set of 'target' features, marginalizing over the
values of all other features (the complement features). Due to the limits
of human perception the size of t... | bsd-3-clause |
murrayrm/python-control | examples/type2_type3.py | 3 | 1677 | # type2_type3.py - demonstration for type2 versus type3 control comparing
# tracking and disturbance rejection for two proposed controllers
# Gunnar Ristroph, 15 January 2010
import os
import matplotlib.pyplot as plt # Grab MATLAB plotting functions
from control.matlab import * # MATLAB-like functions
from scip... | bsd-3-clause |
yunfeilu/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn'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 AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
JosmanPS/scikit-learn | examples/cluster/plot_cluster_iris.py | 350 | 2593 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
ephes/scikit-learn | examples/decomposition/plot_image_denoising.py | 181 | 5819 | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of the Lena image using firstly online :ref:`DictionaryLearning` and
various transform methods.
The dictionary is fitted o... | bsd-3-clause |
fabioticconi/scikit-learn | examples/plot_isotonic_regression.py | 303 | 1767 | """
===================
Isotonic Regression
===================
An illustration of the isotonic regression on generated data. The
isotonic regression finds a non-decreasing approximation of a function
while minimizing the mean squared error on the training data. The benefit
of such a model is that it does not assume a... | bsd-3-clause |
kkozarev/mwacme | src/multi_time_clean.py | 2 | 3791 | # script to run clean on a large number of time slices for a given spectral
# channel.
#
# Divya 17Apr13
# TO DO
# Figure out how to skip over flagged time stamps in an automated manner
import matplotlib.pyplot as plt
import numpy as np
import os
import time
def define_TIMES(MSNAME,TIME_STEP):
#returns a list of ti... | gpl-2.0 |
DonBeo/scikit-learn | examples/datasets/plot_iris_dataset.py | 283 | 1928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... | bsd-3-clause |
magnusnissel/reddit-nba-corpus | generate_lists.py | 1 | 26135 | import os
import glob
import collections
import re
import argparse
import datetime
import numpy as np
import pandas as pd
from scipy.stats import chisqprob
from lxml import etree
try:
from config import DIR, YEARS, SUBREDDITS
except ImportError as e:
print(e)
print("Please make sure to (copy &) rename 'sa... | gpl-3.0 |
SuFizz/RL-project | Old/RL/Assignment 1 - EE10B041/Epsilon Greedy/epsilon_greedy_1000.py | 1 | 2916 | from __future__ import division
import random
from matplotlib.pyplot import *
t = open("testbed.out",'r');
r = t.readlines()
t.close()
arms = 1000
for i in range(len(r)):
r[i] = r[i].split()
for g in range(arms):
r[i][g] = float(r[i][g])
step_rewards = []
rewards = []
rew = []
def train(line,action_selected,N... | gpl-3.0 |
poryfly/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 |
radinformatics/whatisit | whatisit/apps/tagtrout/views.py | 1 | 10410 | from notifications.signals import notify
from whatisit.apps.tagtrout.forms import (
DocForm,
DocsCollectionForm,
)
from whatisit.apps.tagtrout.models import (
Doc,
DocsCollection
)
# STOPPED HERE - update these functions, then upload
from whatisit.apps.tagtrout.utils import (
get_doc,
get_do... | mit |
ElDeveloper/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 |
bollu/sandhi | modules/gr36/gr-filter/examples/fft_filter_ccc.py | 13 | 3498 | #!/usr/bin/env python
from gnuradio import gr, filter
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
except... | gpl-3.0 |
fedspendingtransparency/data-act-broker-backend | dataactcore/scripts/load_historical_certified_flex_field.py | 1 | 7810 | import csv
import boto3
import datetime
import logging
import tempfile
import pandas as pd
from pandas import isnull
from sqlalchemy import func
from dataactcore.config import CONFIG_BROKER
from dataactcore.interfaces.db import GlobalDB
from dataactcore.logging import configure_logging
from dataactcore.models.jobMode... | cc0-1.0 |
Orochimarufan/youtube-dl | youtube_dl/extractor/wsj.py | 30 | 4694 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
unified_strdate,
)
class WSJIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
https?://video-api\.wsj\.com/api-vid... | unlicense |
devanshdalal/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 42 | 27323 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
arkadoel/AprendiendoPython | pandas/pruebasExcel/__init__.py | 1 | 2155 | from acciones import Acciones
from Escrituras import EscribirExcel
from _datetime import datetime
__author__ = 'arkadoel'
__date__ = '2015-jun-16'
RUTA_EXCEL = '/media/DATOS/PROYECTOS/2015/excelGrande.xlsx'
def getHora():
horas = datetime.now().hour
minutos = datetime.now().minute
segundos = datetime.no... | gpl-3.0 |
henrykironde/scikit-learn | sklearn/grid_search.py | 103 | 36232 | """
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 |
hoytak/SFrame | oss_src/unity/python/sframe/test/test_sframe.py | 5 | 134915 | '''
Copyright (C) 2016 Turi
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
# from nose import with_setup
from ..data_structures.sframe import SFrame
from ..data_structures.sarray import SArray
from ..data_structures.image imp... | bsd-3-clause |
dsm054/pandas | pandas/tests/sparse/frame/test_to_from_scipy.py | 4 | 6250 | import pytest
import numpy as np
from pandas.util import testing as tm
from pandas import SparseDataFrame, SparseSeries
from pandas.core.sparse.api import SparseDtype
from distutils.version import LooseVersion
from pandas.core.dtypes.common import (
is_bool_dtype,
)
scipy = pytest.importorskip('scipy')
ignore_matr... | bsd-3-clause |
ChanChiChoi/scikit-learn | examples/linear_model/plot_polynomial_interpolation.py | 251 | 1895 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... | bsd-3-clause |
bhargav/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 |
DangoMelon0701/PyRemote-Sensing | AERONET data/read_aeronet.py | 1 | 1593 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 27 06:30:24 2017
@author: Rolando Renee Badaracco Meza
"""
import pandas as pd
import os
#function from http://blog.rtwilson.com/reading-aeronet-data-in-pandas-a-simple-helper-function/
def read_aeronet(filename):
"""Read a given AERONET AOT data file, and return i... | mit |
jaidevd/scikit-learn | sklearn/model_selection/tests/test_split.py | 12 | 47658 | """Test the split module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from scipy import stats
from scipy.misc import comb
from itertools import combinations
from itertools import combinations_with_replacement
from sklearn.utils.testi... | bsd-3-clause |
pompiduskus/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 387 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause |
jamesmishra/nlp-playground | nlp_playground/scripts/newsgroups_lda.py | 1 | 1276 | """Run LDA on newsgroups dataset."""
import logging
import click
from gensim.models.ldamulticore import LdaMulticore as LDA
from nlp_playground.data import newsgroups
from nlp_playground.lib.gensim.corpora import \
corpus_from_documents_sklearn as corpus_from_documents
from nlp_playground.lib.gensim.lda import pr... | mit |
pbrady/sympy | doc/ext/docscrape_sphinx.py | 52 | 7983 | import re
import inspect
import textwrap
import pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('use_plots', False)
NumpyDocString.__init__(self, docstring, ... | bsd-3-clause |
cjermain/numpy | numpy/fft/fftpack.py | 72 | 45497 | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1)
ifft(a, n=None, axis=-1)
rfft(a, n=None, axis=-1)
irfft(a, n=None, axis=-1)
hfft(a, n=None, axis=-1)
ihfft(a, n=None, axis=-1)
fftn(a, s=None, axes=None)
ifftn(a, s=None, axes=None)
rfftn(a, s=None, axes=None)
irfftn(a, s=None, axes=None... | bsd-3-clause |
tectronics/dicom-sr-qi | inquiries/modality_usage.py | 2 | 6552 | from srqi.core import inquiry, my_utils
def get_period_sum(period, val_func, event_types = ()):
"""
Parameters:
period : a list of Events
val_func : a function that takes an Event and returns the value of
the event to be summed. For example `lambda x:x.Dose_RP` would be
... | bsd-2-clause |
themrmax/scikit-learn | sklearn/datasets/tests/test_mldata.py | 384 | 5221 | """Test functionality of mldata fetching utilities."""
import os
import shutil
import tempfile
import scipy as sp
from sklearn import datasets
from sklearn.datasets import mldata_filename, fetch_mldata
from sklearn.utils.testing import assert_in
from sklearn.utils.testing import assert_not_in
from sklearn.utils.test... | bsd-3-clause |
giruenf/GRIPy | classes/ui/track_label.py | 1 | 27332 | from collections import OrderedDict
import numpy as np
import wx
from matplotlib.axes import Axes
from matplotlib.figure import Figure
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.lines import Line2D
from matplotlib.ticker import NullLocator
from app import log
from ... | apache-2.0 |
AleNriG/sims | delta_layer_restore/delta_layer.py | 1 | 4242 | ''' Восстановление распределения дельта-слоя без влияния перемешанного слоя '''
import csv
import sys
import matplotlib.pyplot as plt
import numpy
import scipy
from scipy.special import erf
def read_data(file_path):
grid, data = [], []
with open(file_path) as file:
for line in csv.reader(file):
... | mit |
MediffRobotics/DeepRobotics | DeepLearnMaterials/tutorials/Reinforcement_learning_TUT/7_Policy_gradient/RL_brain.py | 1 | 7441 | """
This part of code is the reinforcement learning brain, which is a brain of the agent.
All decisions are made in here.
View more on 莫烦Python: https://morvanzhou.github.io/tutorials/
"""
import numpy as np
import pandas as pd
import tensorflow as tf
np.random.seed(1)
tf.set_random_seed(1)
class PolicyGradient:
... | gpl-3.0 |
lucashtnguyen/swmmtoolbox | setup.py | 1 | 1889 | from setuptools import setup
import os
import sys
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py upload_docs')
sys.exit()
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
version = open("VERSION").... | bsd-3-clause |
shivsurya/UCI_concretedata | Code/l1_regularization.py | 1 | 2499 | #code by Shiv Surya
#performs regression with l1-regularization
#import necessary packages
import csv
from matplotlib import pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.linear_model import Lasso
from sklearn.cross_validation import KFold
from sklearn.decomposition import PC... | mit |
matteobachetti/MaLTPyNT | setup.py | 1 | 4271 | #!/usr/bin/env python
"""Setup script."""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import ah_bootstrap # NOQA
from setuptools import setup
# A dirty hack to get around some early import/configurations ambiguities
if sys.version_info[0] >= 3:
import builtin... | bsd-3-clause |
mit-probabilistic-computing-project/crosscat | scripts/mi_tests/test_mutual_information_vs_correlation.py | 2 | 3471 | #
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# Lead Developers: Dan Lovell and Jay Baxter
# Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka
# Research Leads: Vikash Mansinghka, Patrick Shafto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may... | apache-2.0 |
CELMA-project/CELMA | celma/pickleTweaks/blobs/PDFBlobTweakDens.py | 1 | 1614 | #!/usr/bin/env python
"""
Tweaks the density PDF obtained from the blob runner.
"""
import pickle
import matplotlib.pylab as plt
import numpy as np
import os, sys
# If we add to sys.path, then it must be an absolute path
commonDir = os.path.abspath("./../../../common")
# Sys path is a list of system paths
sys.path.a... | lgpl-3.0 |
phobson/gisutils | gisutils/tests/test_algo.py | 2 | 1937 | from shapely import geometry
import pandas
import geopandas
import numpy
from affine import Affine
from gisutils import algo
import numpy.testing as nptest
import pandas.util.testing as pdtest
def test_average_slope():
_lines = [
geometry.LineString(coordinates=[(0, 5), (10, 5)]),
geometry.LineS... | bsd-3-clause |
wronk/mne-python | mne/tests/test_label.py | 1 | 31035 | import os
import os.path as op
import shutil
import glob
import warnings
import sys
import numpy as np
from scipy import sparse
from numpy.testing import assert_array_equal, assert_array_almost_equal
from nose.tools import assert_equal, assert_true, assert_false, assert_raises
from mne.datasets import testing
from m... | bsd-3-clause |
tawsifkhan/scikit-learn | examples/cluster/plot_digits_linkage.py | 369 | 2959 | """
=============================================================================
Various Agglomerative Clustering on a 2D embedding of digits
=============================================================================
An illustration of various linkage option for agglomerative clustering on
a 2D embedding of the di... | bsd-3-clause |
Ecogenomics/GroopM | groopm/binManager.py | 1 | 68425 | #!/usr/bin/env python
###############################################################################
# #
# binManager.py #
# ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.