repo_name stringlengths 6 103 | path stringlengths 5 191 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 986 970k | license stringclasses 15
values |
|---|---|---|---|---|---|
ningchi/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py | 220 | 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 |
xZise/pywikibot-core | pywikibot/data/wikistats.py | 7 | 6133 | # -*- coding: utf-8 -*-
"""Objects representing WikiStats API."""
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
from __future__ import unicode_literals
import sys
from io import BytesIO, StringIO
import pywikibot
if sys.version_info[0] > 2:
import csv
else:
try:
i... | mit |
Akshay0724/scikit-learn | sklearn/svm/tests/test_sparse.py | 63 | 13366 | import numpy as np
from scipy import sparse
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classification, load_digits, make_blobs
from sklearn.svm.tests import te... | bsd-3-clause |
axbaretto/beam | sdks/python/apache_beam/dataframe/frames.py | 1 | 188958 | #
# 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 |
thientu/scikit-learn | sklearn/utils/extmath.py | 70 | 21951 | """
Extended math utilities.
"""
# Authors: Gael Varoquaux
# Alexandre Gramfort
# Alexandre T. Passos
# Olivier Grisel
# Lars Buitinck
# Stefan van der Walt
# Kyle Kastner
# License: BSD 3 clause
from __future__ import division
from functools import partial
import ... | bsd-3-clause |
thientu/scikit-learn | examples/decomposition/plot_ica_blind_source_separation.py | 346 | 2228 | """
=====================================
Blind source separation using FastICA
=====================================
An example of estimating sources from noisy data.
:ref:`ICA` is used to estimate sources given noisy measurements.
Imagine 3 instruments playing simultaneously and 3 microphones
recording the mixed si... | bsd-3-clause |
jmargeta/scikit-learn | sklearn/qda.py | 4 | 7465 | """
Quadratic Discriminant Analysis
"""
# Author: Matthieu Perrot <matthieu.perrot@gmail.com>
#
# License: BSD Style.
import warnings
import numpy as np
from .base import BaseEstimator, ClassifierMixin
from .externals.six.moves import xrange
from .utils.fixes import unique
from .utils import check_arrays, array2d
... | bsd-3-clause |
Fireblend/scikit-learn | sklearn/datasets/california_housing.py | 197 | 3877 | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... | bsd-3-clause |
thientu/scikit-learn | sklearn/linear_model/tests/test_randomized_l1.py | 213 | 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 |
ningchi/scikit-learn | examples/model_selection/plot_precision_recall.py | 248 | 6150 | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
In information retrieval, precision is a measure of result relevancy, while
recall is a measure of how many truly relevant results are returned. A high
area under the curve represents both ... | bsd-3-clause |
jmargeta/scikit-learn | sklearn/utils/arpack.py | 4 | 64317 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
Fireblend/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py | 266 | 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 |
Fireblend/scikit-learn | sklearn/ensemble/tests/test_weight_boosting.py | 22 | 16769 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal, assert_true
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/calibration.py | 7 | 20258 | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
from __future__ impo... | bsd-3-clause |
thientu/scikit-learn | sklearn/decomposition/dict_learning.py | 104 | 44632 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... | bsd-3-clause |
thientu/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 233 | 9928 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
ningchi/scikit-learn | sklearn/preprocessing/tests/test_imputation.py | 212 | 11911 | 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.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.preprocessing.imputa... | bsd-3-clause |
DistrictDataLabs/yellowbrick | yellowbrick/features/pcoords.py | 1 | 19712 | # yellowbrick.features.pcoords
# Implementations of parallel coordinates for feature analysis.
#
# Author: Benjamin Bengfort
# Author: @thekylesaurus
# Created: Mon Oct 03 21:46:06 2016 -0400
#
# Copyright (C) 2016 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: pcoords.py [0f4b236] benjam... | apache-2.0 |
thientu/scikit-learn | sklearn/utils/validation.py | 30 | 24618 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals i... | bsd-3-clause |
thientu/scikit-learn | sklearn/manifold/tests/test_t_sne.py | 53 | 21055 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.neighbors import BallTree
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
fr... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/utils/tests/test_class_weight.py | 8 | 9531 | import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_blobs
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testin... | bsd-3-clause |
illfelder/libcloud | libcloud/test/compute/test_joyent.py | 12 | 5425 | # 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 use ... | apache-2.0 |
kaiping/incubator-singa | examples/autograd/xceptionnet.py | 1 | 6488 | from singa import autograd
from singa import tensor
from singa import device
from singa import opt
import numpy as np
from tqdm import trange
# the code is modified from
# https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/xception.py
__all__ = ['xception']
class Block(autogra... | apache-2.0 |
Akshay0724/scikit-learn | examples/gaussian_process/plot_gpr_co2.py | 126 | 5705 | """
========================================================
Gaussian process regression (GPR) on Mauna Loa CO2 data.
========================================================
This example is based on Section 5.4.3 of "Gaussian Processes for Machine
Learning" [RW2006]. It illustrates an example of complex kernel engine... | bsd-3-clause |
woobe/h2o | py/testdir_hosts/test_parse_summary_manyfiles_s3n_fvec.py | 2 | 3291 | import unittest, time, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_glm, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
# assume we're at 0xdata wi... | apache-2.0 |
dronefly/dronefly.github.io | flask/lib/python2.7/site-packages/sqlalchemy/ext/hybrid.py | 19 | 27989 | # ext/hybrid.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Define attributes on ORM-mapped classes that have "hybrid" behavior.
"hybrid" mean... | apache-2.0 |
MaestroGraph/sparse-hyper | tests/test_tensors.py | 1 | 1612 | import _context
import unittest
import torch
from torch.autograd import Variable
#import sparse.layers.densities
import tensors, time
def sample(nindices=2*256+2*8, size=(256, 256), var=1.0):
assert len(size) == 2
indices = (torch.rand(nindices, 2) * torch.tensor(size)[None, :].float()).long()
values =... | mit |
Fireblend/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 129 | 6059 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_gr... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/datasets/tests/test_base.py | 16 | 9390 | import os
import shutil
import tempfile
import warnings
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.datasets im... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/neural_network/tests/test_mlp.py | 28 | 22183 | """
Testing for Multi-layer Perceptron module (sklearn.neural_network)
"""
# Author: Issam H. Laradji
# License: BSD 3 clause
import sys
import warnings
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_equal
from sklearn.datasets import load_digits, load_boston, load_iris
from sklearn... | bsd-3-clause |
jmargeta/scikit-learn | examples/exercises/plot_cv_digits.py | 4 | 1097 | """
=============================================
Cross-validation on Digits Dataset Exercise
=============================================
This exercise is used in the :ref:`cv_generators_tut` part of the
:ref:`model_selection_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
fr... | bsd-3-clause |
palimadra/namebench | nb_third_party/dns/rdtypes/ANY/CNAME.py | 248 | 1092 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
google/lasr | dataloader/vidbase.py | 1 | 9268 | # Copyright 2021 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 in writin... | apache-2.0 |
thientu/scikit-learn | sklearn/preprocessing/tests/test_function_transformer.py | 175 | 2169 | from nose.tools import assert_equal
import numpy as np
from sklearn.preprocessing import FunctionTransformer
def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X):
def _func(X, *args, **kwargs):
args_store.append(X)
args_store.extend(args)
kwargs_store.update(kwargs)
... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/utils/tests/test_sparsefuncs.py | 77 | 17611 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import (assert_array_almost_equal,
assert_array_equal,
assert_equal)
from numpy.random import RandomState
from sklearn.datasets import make_classification
from sklearn.utils.s... | bsd-3-clause |
graingert/luigi | test/contrib/bigquery_test.py | 15 | 4045 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Twitter 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 ... | apache-2.0 |
ningchi/scikit-learn | examples/cluster/plot_birch_vs_minibatchkmeans.py | 330 | 3694 | """
=================================
Compare BIRCH and MiniBatchKMeans
=================================
This example compares the timing of Birch (with and without the global
clustering step) and MiniBatchKMeans on a synthetic dataset having
100,000 samples and 2 features generated using make_blobs.
If ``n_clusters... | bsd-3-clause |
DerThorsten/boring_spaghetti | exp/patch_W_nice_res.py | 1 | 4478 | import vigra
import opengm
import numpy
import matplotlib.pyplot as plt
img = vigra.readImage('/home/tbeier/datasets/BSR/BSDS500/data/images/train/56028.jpg')
img = vigra.readImage('/home/tbeier/datasets/BSR/BSDS500/data/images/train/118035.jpg')
img = vigra.resize(img, (200, 100))
grad = vigra.filters.gaussianGradient... | mit |
s40523127/2017springwcm_hw | plugin/liquid_tags/notebook.py | 235 | 10551 | """
Notebook Tag
------------
This is a liquid-style tag to include a static html rendering of an IPython
notebook in a blog post.
Syntax
------
{% notebook filename.ipynb [ cells[start:end] ]%}
The file should be specified relative to the ``notebooks`` subdirectory of the
content directory. Optionally, this subdire... | agpl-3.0 |
ningchi/scikit-learn | sklearn/cluster/spectral.py | 18 | 18027 | # -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import check_rand... | bsd-3-clause |
s40523224/2016fallcp_hw | plugin/liquid_tags/notebook.py | 235 | 10551 | """
Notebook Tag
------------
This is a liquid-style tag to include a static html rendering of an IPython
notebook in a blog post.
Syntax
------
{% notebook filename.ipynb [ cells[start:end] ]%}
The file should be specified relative to the ``notebooks`` subdirectory of the
content directory. Optionally, this subdire... | agpl-3.0 |
jmargeta/scikit-learn | sklearn/utils/graph.py | 2 | 6115 | """
Graph utilities and algorithms
Graphs are represented with their adjacency matrices, preferably using
sparse matrices.
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD
import numpy ... | bsd-3-clause |
austinvernsonger/metagoofil | hachoir_parser/image/iptc.py | 94 | 4291 | """
IPTC metadata parser (can be found in a JPEG picture for example)
Sources:
- Image-MetaData Perl module:
http://www.annocpan.org/~BETTELLI/Image-MetaData-JPEG-0.15/...
...lib/Image/MetaData/JPEG/TagLists.pod
- IPTC tag name and description:
http://peccatte.karefil.com/software/IPTCTableau.pdf
Author: Victor... | gpl-2.0 |
Akshay0724/scikit-learn | examples/cluster/plot_affinity_propagation.py | 346 | 2304 | """
=================================================
Demo of affinity propagation clustering algorithm
=================================================
Reference:
Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages
Between Data Points", Science Feb. 2007
"""
print(__doc__)
from sklearn.cluster impor... | bsd-3-clause |
thientu/scikit-learn | examples/cluster/plot_affinity_propagation.py | 346 | 2304 | """
=================================================
Demo of affinity propagation clustering algorithm
=================================================
Reference:
Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages
Between Data Points", Science Feb. 2007
"""
print(__doc__)
from sklearn.cluster impor... | bsd-3-clause |
deepmind/arnheim | arnheim_3/main.py | 1 | 21849 | """Arnheim 3 - Collage Creator
Piotr Mirowski, Dylan Banarse, Mateusz Malinowski, Yotam Doron, Oriol Vinyals,
Simon Osindero, Chrisantha Fernando
DeepMind, 2021-2022
Copyright 2021 DeepMind Technologies Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complia... | apache-2.0 |
ronaldahmed/labor-market-demand-analysis | shallow parsing models/utils_new.py | 1 | 31706 | import nltk
import os,sys
import pdb, ipdb
import pickle
import numpy as np
from sklearn.cross_validation import train_test_split
from nltk.corpus.reader.util import concat
from sequences.label_dictionary import *
from sequences.sequence import *
from sequences.sequence_list import *
from os.path import dirname
import... | mit |
Laurawly/tvm-1 | python/tvm/contrib/torch/pytorch_tvm.py | 2 | 9247 | #!/usr/bin/env python
# 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
# "L... | apache-2.0 |
thientu/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 272 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
Fireblend/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 272 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
atavory/ibex | ibex/_base.py | 1 | 16011 | from __future__ import absolute_import
import string
import collections
import functools
import itertools
import os
import threading
import pandas as pd
from sklearn import base
from sklearn import pipeline
from sklearn.externals import joblib
try:
from sklearn.exceptions import NotFittedError
except ImportError... | bsd-3-clause |
jmargeta/scikit-learn | examples/svm/plot_oneclass.py | 4 | 2214 | """
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
classifying new data as similar or different to the train... | bsd-3-clause |
Neui/MCEdit-Unified | renderer.py | 1 | 120925 | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | isc |
jmargeta/scikit-learn | sklearn/neighbors/tests/test_neighbors.py | 3 | 21670 | import warnings
from nose.tools import assert_equal, assert_true
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from numpy.testing import assert_raises
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix... | bsd-3-clause |
Fireblend/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 212 | 3359 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/linear_model/tests/test_ridge.py | 13 | 26703 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from itertools import product
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn... | bsd-3-clause |
scr4t/rep | rep/estimators/utils.py | 3 | 5406 | from __future__ import division, print_function, absolute_import
import numpy
import pandas
import warnings
from scipy.special import expit, logit
from sklearn.base import BaseEstimator, TransformerMixin, clone
from sklearn.utils.validation import column_or_1d
from ..utils import check_sample_weight, get_columns_in_d... | apache-2.0 |
woobe/h2o | R/tests/autoGen/genJson.py | 11 | 2762 | ##
# Depends on smalldata.csv
# Creates a json, that is a list of datasets
# Datasets have PATHS, NAMES, NUMCOLS, NUMROWS, TYPES, RANGE, IGNORED, TARGET
##
import os, sys, time, csv, string
sys.path.extend(['.','..'])
import h2o_cmd, h2o, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_rf, h2o_jobs
from pprint imp... | apache-2.0 |
Neuroglycerin/neukrill-net-work | calculate_normalisation_stats.py | 1 | 3804 | #!/usr/bin/env python
##############################################
## Script to calculate the statistics (mean ##
## and variance) required to apply ##
## normalisation to a dataset using online ##
## augmentations. ##
##############################################
import numpy as... | mit |
Akshay0724/scikit-learn | examples/bicluster/bicluster_newsgroups.py | 140 | 7183 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
RecipeML/Recipe | recipe/preprocessors/polynomial_features.py | 1 | 1403 | # -*- coding: utf-8 -*-
"""
Copyright 2016 Walter José and Alex de Sá
This file is part of the RECIPE Algorithm.
The RECIPE 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 (a... | gpl-3.0 |
DerThorsten/boring_spaghetti | exp/patch_W.py | 1 | 4499 | import vigra
import opengm
import numpy
import matplotlib.pyplot as plt
img = vigra.readImage('/home/tbeier/datasets/BSR/BSDS500/data/images/train/56028.jpg')
img = vigra.readImage('/home/tbeier/datasets/BSR/BSDS500/data/images/val/69020.jpg')
img = img[::1, ::1,:]
grad = vigra.filters.gaussianGradientMagnitude(vigra.c... | mit |
LinuxCNC/linuxcnc | src/emc/usr_intf/stepconf/build_HAL.py | 1 | 46200 | #!/usr/bin/env python3
#
# This is stepconf, a graphical configuration editor for LinuxCNC
# Copyright 2007 Jeff Epler <jepler@unpythonic.net>
# stepconf 1.1 revamped by Chris Morley 2014
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-2.0 |
Akshay0724/scikit-learn | sklearn/cluster/__init__.py | 359 | 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 |
Fireblend/scikit-learn | sklearn/cluster/__init__.py | 359 | 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 |
kabrapratik28/DeepVideos | model/model_seq2seq.py | 1 | 22968 | # TensorFlow Model !
import os
import shutil
import numpy as np
import tensorflow as tf
tf.reset_default_graph()
from cell import ConvLSTMCell
import sys
module_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")
if module_path not in sys.path:
sys.path.append(module_path)
from datasets.batch_ge... | apache-2.0 |
Fireblend/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 253 | 2639 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import num... | bsd-3-clause |
ningchi/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 296 | 1770 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
woobe/h2o | bench/BMscripts/glmBench.py | 11 | 9671 | #GLM bench
import os, sys, time, csv, socket, string
sys.path.append('../py/')
sys.path.extend(['.','..'])
import h2o_cmd, h2o, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_rf, h2o_jobs
csv_header = ('h2o_build','nMachines','nJVMs','Xmx/JVM','dataset','nTrainRows','nTestRows','nCols','trainParseWallTime','nfol... | apache-2.0 |
google/mipnerf | eval.py | 1 | 5618 | # Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
jmargeta/scikit-learn | sklearn/metrics/tests/test_metrics.py | 2 | 40101 | from __future__ import division
import warnings
import numpy as np
from sklearn import datasets
from sklearn import svm
from sklearn.preprocessing import LabelBinarizer
from sklearn.datasets import make_multilabel_classification
from sklearn.utils import check_random_state, shuffle
from sklearn.utils.multiclass impo... | bsd-3-clause |
ningchi/scikit-learn | sklearn/linear_model/omp.py | 11 | 29952 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from distutils.version import LooseVersion
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorM... | bsd-3-clause |
ningchi/scikit-learn | doc/sphinxext/gen_rst.py | 141 | 40026 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
Fireblend/scikit-learn | doc/sphinxext/gen_rst.py | 141 | 40026 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
robotblake/pdsm | src/pdsm/cli.py | 1 | 3860 | import logging
import time
from typing import Optional # noqa: F401
from typing import Text # noqa: F401
import click
from .dataset import Dataset
from .dataset import get_datasets
from .dataset import get_versions
from .glue import Table
from .utils import ensure_trailing_slash
from .utils import underscore
l... | mit |
jmargeta/scikit-learn | examples/plot_multilabel.py | 4 | 4168 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD
"""
=========================
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 ~ Poisson... | bsd-3-clause |
ningchi/scikit-learn | sklearn/qda.py | 21 | 7639 | """
Quadratic Discriminant Analysis
"""
# Author: Matthieu Perrot <matthieu.perrot@gmail.com>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import BaseEstimator, ClassifierMixin
from .externals.six.moves import xrange
from .utils import check_array, check_X_y
from .utils.validation import ... | bsd-3-clause |
jmargeta/scikit-learn | examples/applications/svm_gui.py | 4 | 11159 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | bsd-3-clause |
laszlocsomor/tensorflow | tensorflow/contrib/data/__init__.py | 2 | 3032 | # 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... | apache-2.0 |
wellflat/cat-fancier | classifier/bin/train_model.py | 1 | 6415 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import argparse
import csv
import os
import sys
import numpy as np
from sklearn.datasets import load_svmlight_file
from sklearn.svm import SVC, LinearSVC
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.... | mit |
radiocosmology/draco | draco/analysis/beamform.py | 1 | 49275 | """Beamform visibilities to the location of known sources."""
from typing import Tuple
import healpy
import numpy as np
import scipy.interpolate
from skyfield.api import Star, Angle
from caput import config
from caput import time as ctime
from cora.util import units
from ..core import task, containers, io
from ..ut... | mit |
jmargeta/scikit-learn | sklearn/linear_model/bayes.py | 4 | 15486 | """
Various bayesian regression
"""
from __future__ import print_function
# Authors: V. Michel, F. Pedregosa, A. Gramfort
# License: BSD 3 clause
from math import log
import numpy as np
from scipy import linalg
from .base import LinearModel
from ..base import RegressorMixin
from ..utils.extmath import fast_logdet, p... | bsd-3-clause |
thientu/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 292 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
Akshay0724/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py | 98 | 2017 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
thientu/scikit-learn | examples/bicluster/plot_spectral_coclustering.py | 274 | 1736 | """
==============================================
A demo of the Spectral Co-Clustering algorithm
==============================================
This example demonstrates how to generate a dataset and bicluster it
using the the Spectral Co-Clustering algorithm.
The dataset is generated using the ``make_biclusters`` f... | bsd-3-clause |
ningchi/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 11 | 15904 | from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import ass... | bsd-3-clause |
Akshay0724/scikit-learn | examples/mixture/plot_gmm_selection.py | 91 | 3310 | """
================================
Gaussian Mixture Model Selection
================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in the ... | bsd-3-clause |
google/lasr | third_party/softras/soft_renderer/renderer.py | 1 | 4366 |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy
import soft_renderer as sr
class Renderer(nn.Module):
def __init__(self, image_size=256, background_color=[0,0,0], near=1, far=100,
anti_aliasing=True, fill_back=True, eps=1e-6,
camera... | apache-2.0 |
ningchi/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 360 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
DistrictDataLabs/yellowbrick | tests/test_datasets/test_path.py | 1 | 6133 | # tests.test_datasets.test_paths
# Tests for the dataset path utilities
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Jul 26 14:28:14 2018 -0400
#
# ID: test_path.py [7082742] benjamin@bengfort.com $
"""
Tests for the dataset path utilities
"""
#################################################... | apache-2.0 |
springcoil/VideoGameAPI | VideoGAMEApi.py | 1 | 16315 | from __future__ import print_function
import argparse
import datetime
import logging
import os
import matplotlib.pyplot as plt
import numpy as np
import requests
import tablib
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
#Let's add in some of seaborn to this for better graphics
sns.... | mit |
Akshay0724/scikit-learn | examples/linear_model/plot_sgd_iris.py | 57 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
Akshay0724/scikit-learn | sklearn/linear_model/logistic.py | 13 | 67587 | """
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
imp... | bsd-3-clause |
thientu/scikit-learn | sklearn/ensemble/__init__.py | 216 | 1307 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | bsd-3-clause |
thientu/scikit-learn | examples/linear_model/plot_omp.py | 379 | 2263 | """
===========================
Orthogonal Matching Pursuit
===========================
Using orthogonal matching pursuit for recovering a sparse signal from a noisy
measurement encoded with a dictionary
"""
print(__doc__)
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import OrthogonalM... | bsd-3-clause |
laszlocsomor/tensorflow | tensorflow/examples/learn/mnist.py | 9 | 4816 | # 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 |
kracwarlock/neon | neon/transforms/cost.py | 9 | 3882 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | apache-2.0 |
Fireblend/scikit-learn | sklearn/linear_model/stochastic_gradient.py | 129 | 50966 | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import scipy.sparse as sp
from abc import ABCMeta, abstractmethod
from ... | bsd-3-clause |
Akshay0724/scikit-learn | examples/svm/plot_separating_hyperplane_unbalanced.py | 326 | 1850 | """
=================================================
SVM: Separating hyperplane for unbalanced classes
=================================================
Find the optimal separating hyperplane using an SVC for classes that
are unbalanced.
We first find the separating plane with a plain SVC and then plot
(dashed) the ... | bsd-3-clause |
ningchi/scikit-learn | sklearn/ensemble/voting_classifier.py | 6 | 7907 | """
Soft Voting/Majority Rule classifier.
This module contains a Soft Voting/Majority Rule classifier for
classification estimators.
"""
# Authors: Sebastian Raschka <se.raschka@gmail.com>,
# Gilles Louppe <g.louppe@gmail.com>
#
# Licence: BSD 3 clause
import numpy as np
from ..base import BaseEstimator
f... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.