repo_name
stringlengths
6
103
path
stringlengths
4
209
copies
stringclasses
325 values
size
stringlengths
4
7
content
stringlengths
838
1.04M
license
stringclasses
15 values
CCI-Tools/cate-core
cate/ops/utility.py
1
12435
# The MIT License (MIT) # Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including wi...
mit
marionleborgne/nupic.research
htmresearch/support/junit_testing.py
9
8727
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
agpl-3.0
lilleswing/deepchem
examples/uv/UV_datasets.py
8
4703
""" UV dataset loader. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import shutil import time import numpy as np import deepchem as dc from uv_features import uv_descriptors def remove_missing_entries(dataset): """Remove missing entries...
mit
Athemis/lot
lot.py
1
43683
#!/usr/bin/env python try: import libtcodpy as libtcod except ImportError: raise ImportError('----- libtcod.py could not be loaded. -----') import math import textwrap import shelve try: import numpy as np except ImportError: raise ImportError('----- NumPy must be installed. -----') # actual size of ...
mit
fx2003/tensorflow-study
TensorFlow实战/models/attention_ocr/python/data_provider_test.py
18
2448
# 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 applicab...
mit
eadgarchen/tensorflow
tensorflow/python/keras/datasets/reuters/__init__.py
71
1061
# 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
TinghuiWang/pyActLearn
examples/CASAS_Single_Test/b1_sda_raw.py
1
8304
import os import pickle import logging import argparse import numpy as np import tensorflow as tf from datetime import datetime from pyActLearn.CASAS.data import CASASData from pyActLearn.CASAS.fuel import CASASFuel from pyActLearn.learning.nn.sda import SDA from pyActLearn.performance.record import LearningResult from...
bsd-3-clause
jdanbrown/pydatalab
datalab/bigquery/_dataset.py
6
8970
# Copyright 2015 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 agreed ...
apache-2.0
elkingtonmcb/h2o-2
py/testdir_hosts/test_parse_summary_zip_s3n_fvec.py
9
2393
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, 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): h2o.init(1) @classmethod ...
apache-2.0
mlperf/training_results_v0.5
v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/data_generators/translate_encs.py
3
3661
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
apache-2.0
fx2003/tensorflow-study
TensorFlow实战/models/inception/inception/image_processing.py
14
20499
# Copyright 2016 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 a...
mit
Lawrence-Liu/crab
scikits/crab/recommenders/knn/neighborhood_strategies.py
10
4860
""" Strategies for users selection to be a possible candidate to be member of a user neighborhood. Please check the base.BaseUserNeighborhoodStrategy before implement your own strategy. """ # Author: Marcel Caraciolo <marcel@muricoca.com> # # License: BSD Style. from base import BaseUserNeighborhoodStrategy import ...
bsd-3-clause
marionleborgne/nupic.research
projects/imbu/engine/fluent_api.py
11
6161
# ---------------------------------------------------------------------- # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or...
agpl-3.0
Diyago/Machine-Learning-scripts
DEEP LEARNING/segmentation/Kaggle TGS Salt Identification Challenge/v2/modules/functions.py
1
10930
import torch.autograd as autograd import torch.cuda.comm as comm from torch.autograd.function import once_differentiable from . import _ext # Activation names ACT_LEAKY_RELU = "leaky_relu" ACT_ELU = "elu" ACT_NONE = "none" def _check(fn, *args, **kwargs): success = fn(*args, **kwargs) if not success: ...
apache-2.0
shijx12/DeepSim
deepSimGAN/util.py
1
8623
from lib.datasets.factory import get_imdb import numpy as np import tensorflow as tf import cv2 import random import cfg class DataFetcher: def __init__(self, imdb_name, resize=True): imdb = get_imdb(imdb_name) # Ignore the background class!!! So ['gt_classes'] must minus 1. self.classes = ...
mit
lilleswing/deepchem
contrib/one_shot_models/multitask_regressor.py
5
8197
""" Implements a multitask graph-convolutional regression. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "Han Altae-Tran and Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import warnings imp...
mit
luo66/scikit-learn
sklearn/ensemble/tests/test_voting_classifier.py
140
6926
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestCl...
bsd-3-clause
LohithBlaze/scikit-learn
sklearn/metrics/regression.py
174
16953
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
bsd-3-clause
luo66/scikit-learn
examples/manifold/plot_manifold_sphere.py
257
5101
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================= Manifold Learning methods on a severed sphere ============================================= An application of the different :ref:`manifold` techniques on a spherical data-set. Here one can see the use of dimensionality reducti...
bsd-3-clause
jzt5132/scikit-learn
examples/cluster/plot_lena_segmentation.py
269
2444
""" ========================================= Segmenting the picture of Lena in regions ========================================= This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogeneous regions. This procedure (spe...
bsd-3-clause
mlperf/training_results_v0.5
v0.5.0/google/cloud_v3.8/gnmt-tpuv3-8/code/gnmt/model/t2t/tensor2tensor/bin/t2t_datagen.py
3
11111
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
apache-2.0
tomsilver/nupic
examples/opf/experiments/multistep/simple_3_enc/description.py
17
1788
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
mlflow/mlflow
mlflow/prophet.py
1
13361
""" The ``mlflow.prophet`` module provides an API for logging and loading Prophet models. This module exports univariate Prophet models in the following flavors: Prophet (native) format This is the main flavor that can be accessed with Prophet APIs. :py:mod:`mlflow.pyfunc` Produced for use by generic pyfunc-ba...
apache-2.0
elkingtonmcb/h2o-2
py/testdir_ec2_only/test_KMeans_allstate_s3n_thru_hdfs.py
9
2172
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_kmeans, 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 ...
apache-2.0
LohithBlaze/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
84
8565
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises...
bsd-3-clause
fx2003/tensorflow-study
TensorFlow实战/models/lfads/synth_data/synthetic_data_utils.py
3
10613
# Copyright 2017 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 a...
mit
luo66/scikit-learn
sklearn/feature_extraction/tests/test_feature_hasher.py
256
2861
from __future__ import unicode_literals import numpy as np from sklearn.feature_extraction import FeatureHasher from nose.tools import assert_raises, assert_true from numpy.testing import assert_array_equal, assert_equal def test_feature_hasher_dicts(): h = FeatureHasher(n_features=16) assert_equal("dict",...
bsd-3-clause
LohithBlaze/scikit-learn
sklearn/linear_model/tests/test_coordinate_descent.py
39
23697
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing ...
bsd-3-clause
MohammedWasim/scikit-learn
sklearn/datasets/tests/test_base.py
204
5878
import os import shutil import tempfile import warnings import nose import numpy from pickle import loads from pickle import dumps from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn...
bsd-3-clause
glouppe/scikit-learn
examples/model_selection/plot_underfitting_overfitting.py
51
2668
""" ============================ Underfitting vs. Overfitting ============================ This example demonstrates the problems of underfitting and overfitting and how we can use linear regression with polynomial features to approximate nonlinear functions. The plot shows the function that we want to approximate, wh...
bsd-3-clause
elkingtonmcb/h2o-2
py/testdir_0xdata_only/test_hdfs_cdh5_fvec.py
9
4072
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e import getpass class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): # assum...
apache-2.0
lilleswing/deepchem
contrib/one_shot_models/support_classifier.py
6
14629
""" Train support-based models. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import warnings import numpy as np import tensorflow as tf import sys import time from deepchem.models import Model from deepchem.data import pad_batch from deepchem.data im...
mit
luo66/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
257
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
shyamalschandra/seastar
configure.py
19
26249
#!/usr/bin/python3 # # This file is open source software, licensed to you under the terms # of the Apache License, Version 2.0 (the "License"). See the NOTICE file # distributed with this work for additional information regarding copyright # ownership. You may not use this file except in compliance with the License. ...
apache-2.0
mlflow/mlflow
examples/shap/multiclass_classification.py
1
1051
import os import numpy as np from sklearn.datasets import load_iris from sklearn.ensemble import RandomForestClassifier import shap import mlflow from mlflow.tracking import MlflowClient from mlflow.artifacts import download_artifacts # prepare training data X, y = load_iris(return_X_y=True, as_frame=True) # trai...
apache-2.0
elkingtonmcb/h2o-2
py/testdir_single_jvm/test_ddply_plot.py
8
9513
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_gbm, h2o_jobs as h2j, h2o_import import h2o_exec as h2e, h2o_util import math print "Copy a version of this to a two cloud test. different failure mode" DO_PLOT = True COL = 1 PHR...
apache-2.0
etalab/dactylo
dactylo/controllers/websockets.py
1
3223
# -*- coding: utf-8 -*- # Dactylo -- A datasets activity streams logger # By: Emmanuel Raviart <emmanuel@raviart.com> # # Copyright (C) 2013 Etalab # http://github.com/etalab/dactylo # # This file is part of Dactylo. # # Dactylo is free software; you can redistribute it and/or modify # it under the terms of the GNU A...
agpl-3.0
manipopopo/tensorflow
tensorflow/contrib/learn/python/learn/preprocessing/categorical.py
40
4795
# 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
lukeiwanski/tensorflow
tensorflow/examples/tutorials/layers/cnn_mnist.py
42
5711
# 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
diekhans/ga4gh-server
scripts/prepare_compliance_data.py
4
6553
""" A script that takes the compliance dataset (the released version of which is at https://github.com/ga4gh/compliance/tree/master/test-data) and turns it into a directory bundle of binary and JSON files suitable for use by the reference server. """ from __future__ import division from __future__ import print_function...
apache-2.0
elkingtonmcb/h2o-2
py/testdir_multi_jvm/test_GLM2_covtype_exec.py
9
2344
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(3,java_heap_GB=4) @classmethod ...
apache-2.0
glouppe/scikit-learn
examples/plot_kernel_ridge_regression.py
14
6227
""" ============================================= Comparison of kernel ridge regression and SVR ============================================= Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel trick, i.e., they learn a linear function in the space induced by the respective k...
bsd-3-clause
chetan51/nupic
examples/opf/experiments/missing_record/make_datasets.py
9
4817
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
gpl-3.0
kylerbrown/scikit-learn
sklearn/cluster/tests/test_dbscan.py
113
11393
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance 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 im...
bsd-3-clause
olt/mapproxy
mapproxy/config/loader.py
1
80871
# This file is part of the MapProxy project. # Copyright (C) 2010-2016 Omniscale <http://omniscale.de> # # 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/LI...
apache-2.0
xyguo/scikit-learn
sklearn/decomposition/base.py
310
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
google/uncertainty-baselines
experimental/language_structure/vrnn/linear_vae_cell.py
1
24349
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines Authors. # # 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 ap...
apache-2.0
kylerbrown/scikit-learn
benchmarks/bench_mnist.py
153
6006
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
dsquareindia/scikit-learn
examples/cluster/plot_face_ward_segmentation.py
70
2460
""" ========================================================================= A demo of structured Ward hierarchical clustering on a raccoon face image ========================================================================= Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is s...
bsd-3-clause
dsquareindia/scikit-learn
sklearn/utils/__init__.py
13
13265
""" The :mod:`sklearn.utils` module includes various utilities. """ from collections import Sequence import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, assert_all_finite, ...
bsd-3-clause
yavuzovski/playground
machine learning/Udacity/ud120-projects/choose_your_own/your_algorithm.py
1
2434
#!/usr/bin/python from time import time import matplotlib.pyplot as plt from prep_terrain_data import makeTerrainData from class_vis import prettyPicture features_train, labels_train, features_test, labels_test = makeTerrainData() ### the training data (features_train, labels_train) have both "fast" and "slow" ### p...
gpl-3.0
xyguo/scikit-learn
examples/applications/plot_out_of_core_classification.py
31
13829
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
bsd-3-clause
xyguo/scikit-learn
examples/cluster/plot_cluster_iris.py
347
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
dsquareindia/scikit-learn
sklearn/ensemble/forest.py
8
67993
"""Forest of trees-based ensemble methods Those methods include random forests and extremely randomized trees. The module structure is the following: - The ``BaseForest`` base class implements a common ``fit`` method for all the estimators in the module. The ``fit`` method of the base ``Forest`` class calls the ...
bsd-3-clause
ChanChiChoi/scikit-learn
examples/applications/svm_gui.py
285
11161
""" ========== 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
fredhusser/scikit-learn
sklearn/metrics/cluster/unsupervised.py
228
8281
""" Unsupervised evaluation metrics. """ # Authors: Robert Layton <robertlayton@gmail.com> # # License: BSD 3 clause import numpy as np from ...utils import check_random_state from ..pairwise import pairwise_distances def silhouette_score(X, labels, metric='euclidean', sample_size=None, random...
bsd-3-clause
fredhusser/scikit-learn
sklearn/__check_build/__init__.py
342
1671
""" Module to give helpful messages to the user that did not compile the scikit properly. """ import os INPLACE_MSG = """ It appears that you are importing a local scikit-learn source tree. For this, you need to have an inplace install. Maybe you are in the source directory and you need to try from another location.""...
bsd-3-clause
ishanic/scikit-learn
sklearn/metrics/cluster/unsupervised.py
228
8281
""" Unsupervised evaluation metrics. """ # Authors: Robert Layton <robertlayton@gmail.com> # # License: BSD 3 clause import numpy as np from ...utils import check_random_state from ..pairwise import pairwise_distances def silhouette_score(X, labels, metric='euclidean', sample_size=None, random...
bsd-3-clause
ChanChiChoi/scikit-learn
examples/ensemble/plot_voting_decision_regions.py
228
2386
""" ================================================== Plot the decision boundaries of a VotingClassifier ================================================== Plot the decision boundaries of a `VotingClassifier` for two features of the Iris dataset. Plot the class probabilities of the first sample in a toy dataset pred...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/tests/test_common.py
126
7665
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
bsd-3-clause
andrewnc/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
228
19795
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
ishanic/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
228
19795
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause from tempfile import mkdtemp import shutil from functools import partial import numpy as np from scipy import sparse from...
bsd-3-clause
ashhher3/pylearn2
pylearn2/datasets/hdf5_deprecated.py
30
13414
""" Objects for datasets serialized in HDF5 format (.h5). """ __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "3-clause BSD" try: import h5py except ImportError: h5py = None import numpy as np from theano.compat.six.moves import xrange import warnings from py...
bsd-3-clause
zxsted/scipy
scipy/stats/mstats_basic.py
18
82304
""" An extension of scipy.stats.stats to support masked arrays """ # Original author (2007): Pierre GF Gerard-Marchant # TODO : f_value_wilks_lambda looks botched... what are dfnum & dfden for ? # TODO : ttest_rel looks botched: what are x1,x2,v1,v2 for ? # TODO : reimplement ksonesamp from __future__ import divisi...
bsd-3-clause
ChanChiChoi/scikit-learn
examples/svm/plot_svm_scale_c.py
222
5375
""" ============================================== Scaling the regularization parameter for SVCs ============================================== The following example illustrates the effect of scaling the regularization parameter when using :ref:`svm` for :ref:`classification <svm_classification>`. For SVC classificati...
bsd-3-clause
google/uncertainty-baselines
experimental/cifar10_resnet20/main.py
1
5433
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines Authors. # # 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 ap...
apache-2.0
fredhusser/scikit-learn
sklearn/utils/tests/test_sparsefuncs.py
156
13799
import numpy as np import scipy.sparse as sp from scipy import linalg from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.datasets import make_classification from sklearn.utils.sparsefuncs import (mean_variance_axis, inplace_column_scale, ...
bsd-3-clause
icoderaven/slytherin_dagger
src/linear_predictor.py
1
4306
#!/usr/bin/env python import math import numpy as np import scipy import scipy.linalg as la import os from sklearn import linear_model class LinearPredictor: def __init__(self): self.m_w = 0 self.m_mean_x = 0 self.m_mean_y = 0 self.m_std_x = 1 # -------------------------...
bsd-3-clause
mythsmith/veusz
veusz/plugins/field.py
1
14590
# Copyright (C) 2010 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 2 of the License, or # ...
gpl-2.0
ChanChiChoi/scikit-learn
examples/decomposition/plot_sparse_coding.py
246
3846
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
bsd-3-clause
kylerbrown/scikit-learn
sklearn/metrics/metrics.py
232
1262
import warnings warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in " "0.18. Please import from sklearn.metrics", DeprecationWarning) from .ranking import auc from .ranking import average_precision_score from .ranking import label_ranking_average_precision_score fro...
bsd-3-clause
golharam/rgtools
scripts/galaxy/api/load_data_with_metadata.py
1
3466
#!/usr/bin/env python """ This script scans a directory for files with companion '.json' files, then loads the data from the file, and attaches the .json contents using the 'extended_metadata' system in the library Sample call: python load_data_with_metadata.py <api_key> <api_url> /data/folder "API Imports" NOTE: ...
lgpl-3.0
google/uncertainty-baselines
baselines/jft/active_learning.py
1
32769
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines Authors. # # 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 ap...
apache-2.0
xyguo/scikit-learn
sklearn/tree/export.py
14
16020
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
bsd-3-clause
xyguo/scikit-learn
sklearn/utils/tests/test_multiclass.py
33
13405
from __future__ import division import numpy as np import scipy.sparse as sp from itertools import product from sklearn.externals.six.moves import xrange from sklearn.externals.six import iteritems from scipy.sparse import issparse from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sp...
bsd-3-clause
google/uncertainty-baselines
uncertainty_baselines/datasets/toxic_comments_test.py
1
7250
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines Authors. # # 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 ap...
apache-2.0
ishanic/scikit-learn
examples/ensemble/plot_gradient_boosting_quantile.py
385
2114
""" ===================================================== Prediction Intervals for Gradient Boosting Regression ===================================================== This example shows how quantile regression can be used to create prediction intervals. """ import numpy as np import matplotlib.pyplot as plt from skle...
bsd-3-clause
xyguo/scikit-learn
examples/applications/topics_extraction_with_nmf_lda.py
37
3869
""" ======================================================================================= Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation ======================================================================================= This is an example of applying Non-negative Matrix ...
bsd-3-clause
MichaelChatzidakis/Mn_Classifier_CNNs
test_digitized_spectra.py
1
4604
import glob from keras.models import load_model import pandas as pd import numpy as np from matplotlib import pyplot as plt import glob import os import sys from train_crossval import load_data from sklearn.model_selection import StratifiedKFold from keras.utils import np_utils def main(argv): data_path = '/home/m...
mit
ChanChiChoi/scikit-learn
examples/ensemble/plot_ensemble_oob.py
257
3265
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bsd-3-clause
rigdenlab/conkit
conkit/misc/tests/test___init__.py
1
4394
"""Testing facility for conkit.misc.__init__""" __author__ = "Felix Simkovic" __date__ = "10 Jan 2018" import unittest from conkit.misc import * from sklearn.svm import SVC from sklearn.preprocessing import StandardScaler class TestMiscInit(unittest.TestCase): def test_load_validation_model_1(self): cl...
bsd-3-clause
swethasubramanian/LungCancerDetection
src/models/predict_model.py
2
6291
""" A script to predict nodules using conv net model and for analysis of results """ import tflearn from cnn_model import CNNModel import tensorflow as tf import pickle import pandas as pd import numpy as np import h5py from sklearn.metrics import roc_curve, auc, confusion_matrix import itertools import matplotli...
mit
zachmayer/gensim
gensim/corpora/sharded_corpus.py
63
35097
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Original author: Jan Hajic jr. # Copyright (C) 2015 Radim Rehurek and gensim team. # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module implements a corpus class that stores its data in separate files called "shards". This is a com...
lgpl-2.1
fredhusser/scikit-learn
sklearn/tests/test_metaestimators.py
225
4954
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.pipeline import Pipeline...
bsd-3-clause
Averroes/statsmodels
statsmodels/formula/tests/test_formula.py
29
4647
from statsmodels.compat.python import iteritems, StringIO import warnings from statsmodels.formula.api import ols from statsmodels.formula.formulatools import make_hypotheses_matrices from statsmodels.tools import add_constant from statsmodels.datasets.longley import load, load_pandas import numpy.testing as npt from...
bsd-3-clause
elkingtonmcb/scikit-learn
sklearn/decomposition/tests/test_kernel_pca.py
154
8058
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import (assert_array_almost_equal, assert_less, assert_equal, assert_not_equal, assert_raises) from sklearn.decomposition import PCA, KernelPCA from sklearn.datasets import mak...
bsd-3-clause
scalyr/scalyr-agent-2
scalyr_agent/third_party/pymysql/tests/test_SSCursor.py
2
3766
import sys try: from pymysql.tests import base import pymysql.cursors from pymysql.constants import CLIENT except Exception: # For local testing from top-level directory, without installing sys.path.append('../pymysql') from pymysql.tests import base import pymysql.cursors from pymysql....
apache-2.0
jaor/python
bigml/api_handlers/modelhandler.py
2
6695
# -*- coding: utf-8 -*- #pylint: disable=abstract-method # # Copyright 2014-2022 BigML # # 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 # # U...
apache-2.0
raghavrv/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
79
1234
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
elkingtonmcb/scikit-learn
doc/tutorial/text_analytics/skeletons/exercise_02_sentiment.py
255
2406
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
bsd-3-clause
frank-tancf/scikit-learn
sklearn/datasets/tests/test_kddcup99.py
57
1336
"""Test kddcup99 loader. Only 'percent10' mode is tested, as the full data is too big to use in unit-testing. The test is skipped if the data wasn't previously fetched and saved to scikit-learn data folder. """ import errno from sklearn.datasets import fetch_kddcup99 from sklearn.utils.testing import assert_equal, S...
bsd-3-clause
ecobost/pipeline
python/pipeline/temperature.py
5
5751
import datajoint as dj from pipeline import experiment from commons import lab from datajoint.jobs import key_hash import os import numpy as np from .utils import h5, signal from .exceptions import PipelineException from . import notify schema = dj.schema('pipeline_temperature') @schema class Temperature(dj.Import...
lgpl-3.0
FCH808/FCH808.github.io
Intro to Machine Learning/ud120-projects/pca/eigenfaces.py
5
4980
""" =================================================== Faces recognition example using eigenfaces and SVMs =================================================== The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", aka LFW_: http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (2...
mit
andrewcmyers/tensorflow
tensorflow/contrib/keras/python/keras/datasets/cifar.py
84
1542
# Copyright 2015 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
yonglehou/scikit-learn
examples/mixture/plot_gmm_selection.py
247
3223
""" ================================= 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 th...
bsd-3-clause
yonglehou/scikit-learn
sklearn/mixture/tests/test_gmm.py
199
17427
import unittest import copy import sys from nose.tools import assert_true import numpy as np from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_raises) from scipy import stats from sklearn import mixture from sklearn.datasets.samples_generator import make_spd_ma...
bsd-3-clause
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/scipy/stats/stats.py
7
186886
# Copyright 2002 Gary Strangman. All rights reserved # Copyright 2002-2016 The SciPy Developers # # The original code from Gary Strangman was heavily adapted for # use in SciPy by Travis Oliphant. The original code came with the # following disclaimer: # # This software is provided "as-is". There are no expressed or...
mit
Leminen/project_template_deeplearning
src/models/logreg_example.py
1
7774
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 10 16:43:52 2017 @author: leminen """ import os import tensorflow as tf import matplotlib.pyplot as plt import datetime import argparse import shlex import src.utils as utils import src.data.util_data as util_data def hparams_parser_train(hparams...
mit
nightjean/Deep-Learning
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_benchmark_test.py
82
8976
# 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
deniszgonjanin/ckanext-bcgov
ckanext/bcgov/logic/action.py
2
28743
# Copyright 2015, Province of British Columbia # License: https://github.com/bcgov/ckanext-bcgov/blob/master/license import ckan.plugins.toolkit as toolkit import logging import datetime import sqlalchemy import ckan.logic as logic import ckan.plugins as plugins import smtplib from time import time import ckan.lib...
agpl-3.0