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 |
|---|---|---|---|---|---|
alvarofierroclavero/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
DonBeo/scikit-learn | examples/cluster/plot_lena_segmentation.py | 271 | 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 |
architecture-building-systems/CityEnergyAnalyst | cea/inputlocator.py | 1 | 54028 | """
inputlocator.py - locate input files by name based on the reference folder structure.
"""
import os
import cea.schemas
import shutil
import tempfile
import time
__author__ = "Daren Thomas"
__copyright__ = "Copyright 2017, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Daren Thomas", "Jimeno A.... | mit |
ocefpaf/iris | lib/iris/tests/unit/quickplot/test_contour.py | 5 | 1533 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the `iris.quickplot.contour` function."""
# Import iris.tests first so that some things can be initialised b... | lgpl-3.0 |
466152112/scikit-learn | sklearn/datasets/species_distributions.py | 198 | 7923 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | bsd-3-clause |
kkozarev/mwacme | casa_commands_instructions/plot_max_spectra_calibrated.py | 1 | 12151 | import glob, os, sys,fnmatch
import matplotlib.pyplot as plt
from astropy.io import ascii
import numpy as np
def match_list_values(ls1,ls2):
#Return lists of the indices where the values in two lists match
#It will return only the first index of occurrence of repeating values in the lists
#Written by Kame... | gpl-2.0 |
stanleybak/hylaa | hylaa/check_trace.py | 1 | 9211 | '''
Generate concrete traces from counter-examples found by HyLAA.
The check() function performs a concrete simulation to find check close
a violation found by HyLAA is to an actual simulation.
Stanley Bak
December 2016
'''
import time
import math
import matplotlib.pyplot as plt
import numpy as np
from scipy.integ... | gpl-3.0 |
poryfly/scikit-learn | sklearn/utils/metaestimators.py | 283 | 2353 | """Utilities for meta-estimators"""
# Author: Joel Nothman
# Andreas Mueller
# Licence: BSD
from operator import attrgetter
from functools import update_wrapper
__all__ = ['if_delegate_has_method']
class _IffHasAttrDescriptor(object):
"""Implements a conditional property using the descriptor protocol.
... | bsd-3-clause |
mksachs/PyVC | pyvc/vcanalysis.py | 1 | 19802 | from pyvc import *
from pyvc import vcutils
from operator import itemgetter
import networkx as nx
from subprocess import call
import cPickle
import sys
import numpy as np
import matplotlib.pyplot as mplt
import itertools
from collections import deque
def cum_prob(sim_file, output_file=None, event_range=None, section_f... | mit |
alvarofierroclavero/scikit-learn | sklearn/manifold/isomap.py | 229 | 7169 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
BoltzmannBrain/nupic.research | projects/vehicle-control/agent/run_q.py | 12 | 5498 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
florian-f/sklearn | sklearn/neighbors/regression.py | 4 | 9154 | """Nearest Neighbor Regression"""
# 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>
#
# License: BSD, (C) INRIA, University... | bsd-3-clause |
nluedtke/brochat-bot | cogs/pubgcog.py | 1 | 22590 | import asyncio
import json
import math
import statistics as stats
import sys
import traceback
from json import JSONDecodeError
import matplotlib
import matplotlib.pyplot as plt
import requests
import common as c
import discord
from discord.ext import commands
from pubg_python import PUBG, Shard
from pubg_python.excep... | mit |
Eric89GXL/sphinx-gallery | examples/plot_0_sin.py | 1 | 3344 | # -*- coding: utf-8 -*-
"""
Introductory example - Plotting sin
===================================
This is a general example demonstrating a Matplotlib plot output, embedded
rST, the use of math notation and cross-linking to other examples. It would be
useful to compare the :download:`source Python file <plot_0_sin.p... | bsd-3-clause |
zblz/naima | src/naima/plot.py | 1 | 45097 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from functools import partial
import astropy.units as u
import numpy as np
from astropy import log
from emcee import autocorr
from .extern.interruptible_pool import InterruptiblePool as Pool
from .extern.validator import validate_array
from .utils import... | bsd-3-clause |
ilo10/scikit-learn | examples/cluster/plot_birch_vs_minibatchkmeans.py | 333 | 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 |
mdrumond/tensorflow | tensorflow/python/estimator/inputs/pandas_io_test.py | 89 | 8340 | # 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 |
soulmachine/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 4 | 31576 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
keiserlab/e3fp-paper | e3fp_paper/plotting/comparison.py | 1 | 5456 | """Methods for plotting fingerprint comparisons.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
import numpy as np
from scipy.optimize import curve_fit
import matplotlib
import seaborn as sns
from e3fp_paper.plotting.defaults import DefaultFonts
fonts = DefaultFonts()
def calculate_line(x, m=1., b=0.):
retu... | lgpl-3.0 |
conversationai/wikidetox | wikiconv/analysis/perspective_api_accuracy.py | 1 | 3020 | import json
import pandas as pd
import requests
import private
import sklearn
import logging
attributes = ['identity_hate', 'insult', 'obscene', 'threat']
def call_perspective_api(text):
path = ' https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=%s' % PERSPECTIVE_KEY
request = {
'co... | apache-2.0 |
liyu1990/sklearn | sklearn/linear_model/randomized_l1.py | 18 | 23449 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
Molecular-Image-Recognition/Molecular-Image-Recognition | code/line.py | 1 | 9547 |
import numpy as np
from skimage.transform import probabilistic_hough_line
from numba import jit,jitclass
import matplotlib.pyplot as plt
class Point(object):
def __init__(self, x, y):
self.x = float(x)
self.y = float(y)
def __repr__(self):
return '({0},{1})'.format(self.x,self... | mit |
ashhher3/scikit-learn | sklearn/decomposition/pca.py | 24 | 22932 | """ Principal Component Analysis
"""
# 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>
# Michael Eickenberg <michael.eickenberg@inria.fr>
#
# Lice... | bsd-3-clause |
googlearchive/rgc-models | response_model/python/population_subunits/coarse/fitting/data_utils_test.py | 1 | 4271 | # Copyright 2018 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, s... | apache-2.0 |
metan-ucw/ltp | testcases/realtime/tools/ftqviz.py | 5 | 4412 | #!/usr/bin/env python3
# Filename: ftqviz.py
# Author: Darren Hart <dvhltc@us.ibm.com>
# Description: Plot the time and frequency domain plots of a times and
# counts log file pair from the FTQ benchmark.
# Prerequisites: numpy, scipy, and pylab packages. For debian/ubuntu:
# ... | gpl-2.0 |
Eric89GXL/scikit-learn | sklearn/tests/test_kernel_approximation.py | 6 | 5945 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.metrics.pairwise import kernel_metrics
from sklearn.kernel_approximation import RBFSampler
from sklearn.kern... | bsd-3-clause |
camallen/aggregation | engine/agglomerative.py | 1 | 8173 | __author__ = 'ggdhines'
import clustering
import pandas as pd
import numpy as np
from scipy.spatial.distance import pdist,squareform
from scipy.cluster.hierarchy import linkage
import time
import abc
from scipy.stats import beta
import math
import numpy
import multiClickCorrect
import json
import random
def text_line... | apache-2.0 |
huard/scipy-work | scipy/io/examples/read_array_demo1.py | 2 | 1440 | #=========================================================================
# NAME: read_array_demo1
#
# DESCRIPTION: Examples to read 2 columns from a multicolumn ascii text
# file, skipping the first line of header. First example reads into
# 2 separate arrays. Second example reads into a single array. Data are
# then... | bsd-3-clause |
adykstra/mne-python | mne/parallel.py | 1 | 5905 | """Parallel util function."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: Simplified BSD
import logging
import os
from . import get_config
from .utils import logger, verbose, warn, ProgressBar
from .fixes import _get_args
if 'MNE_FORCE_SERIAL' in os.environ:
_force_serial... | bsd-3-clause |
niisan-tokyo/music_generator | src/stateful_use.py | 1 | 3220 | # -*- coding: utf-8 -*-
import wave
import struct
from scipy import fromstring, int16
import numpy as np
#from pylab import *
from keras.models import Sequential, load_model
from keras.layers import Dense, LSTM
#%matplotlib inline
wavfile = '/data/input/battle1.wav'
wr = wave.open(wavfile, "rb")
ch = wr.getnchannels()... | mit |
cerrno/neurokernel | docs/source/conf.py | 1 | 9766 | # -*- coding: utf-8 -*-
#
# Neurokernel documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 5 10:33:41 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | bsd-3-clause |
kieranrimmer/vec_hsqc | vec_hsqc/scripts/prediction_truncated_example.py | 1 | 1458 |
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
from numpy import newaxis, r_, c_, mat, e
from numpy.linalg import *
from vec_hsqc import pred_vec
import os
curdir = os.path.dirname( os.path.abspath( __file__ ) )
X = np.loadtxt( os.path.join( curdir, 'pr... | bsd-3-clause |
bgris/ODL_bgris | lib/python3.5/site-packages/matplotlib/backends/qt_editor/figureoptions.py | 10 | 8551 | # -*- coding: utf-8 -*-
#
# Copyright © 2009 Pierre Raybaut
# Licensed under the terms of the MIT License
# see the mpl licenses directory for a copy of the license
"""Module that provides a GUI-based editor for matplotlib's figure options"""
from __future__ import (absolute_import, division, print_function,
... | gpl-3.0 |
wtbarnes/solarnmf | solarnmf/solarnmf_plotting.py | 1 | 13813 | #solarnmf_plotting.py
#Will Barnes
#3 April 2015
import logging
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from scipy.ndimage.interpolation import r... | mit |
toobaz/pandas | pandas/core/arrays/categorical.py | 1 | 90463 | from shutil import get_terminal_size
import textwrap
from typing import Type, Union, cast
from warnings import warn
import numpy as np
from pandas._config import get_option
from pandas._libs import algos as libalgos, hashtable as htable, lib
from pandas.compat.numpy import function as nv
from pandas.util._decorators... | bsd-3-clause |
potash/scikit-learn | examples/feature_selection/plot_permutation_test_for_classification.py | 94 | 2264 | """
=================================================================
Test with permutations the significance of a classification score
=================================================================
In order to test if a classification score is significative a technique
in repeating the classification procedure aft... | bsd-3-clause |
pradyu1993/scikit-learn | sklearn/semi_supervised/label_propagation.py | 4 | 13783 | # coding=utf8
"""
Label propagation in the context of this module refers to a set of
semisupervised classification algorithms. In the high level, these algorithms
work by forming a fully-connected graph between all points given and solving
for the steady-state distribution of labels at each point.
These algorithms per... | bsd-3-clause |
huzq/scikit-learn | examples/neighbors/plot_kde_1d.py | 14 | 5535 | """
===================================
Simple 1D Kernel Density Estimation
===================================
This example uses the :class:`~sklearn.neighbors.KernelDensity` class to
demonstrate the principles of Kernel Density Estimation in one dimension.
The first plot shows one of the problems with using histogra... | bsd-3-clause |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/washtenaw/indicators/make_indicators.py | 2 | 9327 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
# script to produce a number of indicators
from opus_core.configurations.dataset_pool_configuration import DatasetPoolConfiguration
from opus_core.indicator_framework.core.source_data import So... | gpl-2.0 |
CforED/Machine-Learning | sklearn/linear_model/tests/test_perceptron.py | 378 | 1815 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_raises
from sklearn.utils import check_random_state
from sklearn.datasets import load_iris
from sklearn.linear_model import Pe... | bsd-3-clause |
alee156/clviz | clarityviz/connectivity.py | 1 | 5531 | from plotly.offline import download_plotlyjs, iplot
from plotly.graph_objs import *
from plotly import tools
import plotly
import numpy as np
from numpy import linalg as LA
from sklearn.manifold import spectral_embedding as se
import re
import matplotlib
import seaborn as sns
import networkx as nx
import math
from c... | apache-2.0 |
yask123/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 47 | 8566 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from scipy.sparse import csc_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_array_almost... | bsd-3-clause |
voxlol/scikit-learn | sklearn/tests/test_multiclass.py | 72 | 24581 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing ... | bsd-3-clause |
MMKrell/pyspace | docs/conf.py | 2 | 23551 | # -*- coding: utf-8 -*-
#
# aBRI documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 30 13:24:06 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable... | gpl-3.0 |
hypergravity/bopy | bopy/imagetools/image.py | 1 | 5749 | # -*- coding: utf-8 -*-
"""
@author: cham
Created on Fri Aug 14 15:24:20 2015
"""
# import aplpy
# from astropy.table import Table
# from astropy.coordinates import Galactic, SkyCoord
from astropy.wcs import WCS
from astropy.io import fits
from reproject import reproject_from_healpix, reproject_interp, reproject_to_he... | bsd-3-clause |
robinlombaert/ComboCode | cc/statistics/ChemStats.py | 2 | 7697 | # -*- coding: utf-8 -*-
"""
Examination of the Chemistry analysis routine output.
Author: M. Van de Sande
"""
import os
import scipy
from scipy import argmin,ones
from scipy import array
from scipy import sum
import operator
import types
import numpy as np
import cc.path
from cc.tools.io import DataIO
#from cc.mod... | gpl-3.0 |
belltailjp/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 182 | 1743 | """
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | bsd-3-clause |
Stonelinks/jsbsim | tests/TestTurboProp.py | 4 | 3032 | # TestTurboProp.py
#
# Regression tests for the turboprop engine model.
#
# Copyright (c) 2016 Bertrand Coconnier
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the Licens... | lgpl-2.1 |
JaviMerino/trappy | trappy/devfreq_power.py | 2 | 2302 | # Copyright 2015-2016 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 |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/matplotlib/bezier.py | 10 | 15695 | """
A module providing some utility functions regarding bezier path manipulation.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
from matplotlib.path import Path
from operator import xor
import warnings
class NonInters... | gpl-2.0 |
xavierwu/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 230 | 4762 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
MohammedWasim/scikit-learn | sklearn/covariance/robust_covariance.py | 198 | 29735 | """
Robust location and covariance estimators.
Here are implemented estimators that are resistant to outliers.
"""
# Author: Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
from scipy import linalg
from scipy.stats import chi2
from . import empir... | bsd-3-clause |
mattsmart/biomodels | celltypes/singlecell/singlecell_fields.py | 1 | 12759 | from matplotlib import pyplot as plt
import numpy as np
import os
from random import random
from analysis_basin_plotting import plot_overlap_grid
from singlecell_constants import BETA, EXT_FIELD_STRENGTH, RUNS_FOLDER, MEMS_MEHTA, MEMS_SCMCA, FIELD_PROTOCOL, MEMORIESDIR
from singlecell_functions import hamiltonian
from... | mit |
aabadie/scikit-learn | examples/covariance/plot_covariance_estimation.py | 99 | 5074 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... | bsd-3-clause |
Clyde-fare/scikit-learn | sklearn/utils/tests/test_testing.py | 144 | 4121 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... | bsd-3-clause |
blancha/abcngspipelines | utils/bedtools_coverage.py | 2 | 3688 | #!/usr/bin/env python3
# Version 1.1
# Author Alexis Blanchet-Cohen
# Date: 09/06/2014
import argparse
import glob
import os
import os.path
import pandas
import subprocess
import util
# Read the command line arguments.
parser = argparse.ArgumentParser(description="Generates bedtools coverage scripts.")
parser.add_ar... | gpl-3.0 |
ioshchepkov/SHTOOLS | examples/python/ClassInterface/WindowExample.py | 1 | 1515 | #!/usr/bin/env python
"""
This script tests the python class interface
"""
from __future__ import absolute_import, division, print_function
# standard imports:
import os
import sys
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
sys.path.append(os.path.join(os.path.dirname(__file__), "..... | bsd-3-clause |
adykstra/mne-python | mne/io/fieldtrip/tests/test_fieldtrip.py | 2 | 9035 | # -*- coding: UTF-8 -*-
# Authors: Thomas Hartmann <thomas.hartmann@th-ht.de>
# Dirk Gütlin <dirk.guetlin@stud.sbg.ac.at>
#
# License: BSD (3-clause)
import mne
import os.path
import pytest
import copy
import itertools
import numpy as np
from mne.datasets import testing
from mne.io.fieldtrip.utils import NOIN... | bsd-3-clause |
tribhuvanesh/vpa | vispr/tools/dataset/generate_dataset_stats.py | 1 | 2719 | #!/usr/bin/python
"""Generate Dataset statistics.
Given a file containing a list of annotation paths, generate:
a. general statistics Table 1
b. data for Figure 2
"""
import json
import time
import pickle
import sys
import csv
import argparse
import os
import os.path as osp
import shutil
from collections import d... | apache-2.0 |
rishikksh20/scikit-learn | examples/model_selection/plot_underfitting_overfitting.py | 41 | 2672 | """
============================
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 |
cl4rke/scikit-learn | sklearn/tests/test_qda.py | 155 | 3481 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ignore_war... | bsd-3-clause |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/tests/series/test_apply.py | 7 | 12719 | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import numpy as np
import pandas as pd
from pandas import (Index, Series, DataFrame, isnull)
from pandas.compat import lrange
from pandas import compat
from pandas.util.testing import assert_series_equal
import pandas.util.testing as tm
from .common import TestData
... | mit |
shnizzedy/FOuLARD | data/eyetracking-lit-search/reformat_csv.py | 1 | 4884 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
reformat_csv.py
Script to format csv lit search into JSON objects for D3-process-map springform
visualization (https://github.com/nylen/d3-process-map).
Authors:
- Michael Fleischmann, 2017 (michael.fleischmann@childmind.org)
– Jon Clucas, 2017 (jon.clucas@ch... | mit |
jjx02230808/project0223 | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
ashhher3/scikit-learn | sklearn/qda.py | 3 | 7608 | """
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 |
mjsax/performance | automation/plot.py | 6 | 2246 | import numpy as np
import matplotlib.pyplot as plt
import sys
filename = sys.argv[1]
data = np.loadtxt(filename,delimiter=',',skiprows=1,usecols=(1,2,3,4,5,6,7)).T
label = np.loadtxt(filename,delimiter=',',skiprows=1,usecols=(0,),dtype=str)
fig, ax = plt.subplots(3,2, sharex=True)
ax[0][0].plot(data[0], "ro-", labe... | apache-2.0 |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/matplotlib/colors.py | 2 | 44186 | """
A module for converting numbers or color arguments to *RGB* or *RGBA*
*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the
range 0-1.
This module includes functions and classes for color specification
conversions, and for mapping numbers to colors in a 1-D array of
colors called a colormap. Color... | gpl-3.0 |
perryrothjohnson/artifact-database | support/scripts/csv_to_xlsx.py | 1 | 3035 | #!/usr/bin/env python
import os
import glob
import csv
import pandas as pd
from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill
from openpyxl.utils.dataframe import dataframe_to_rows
from shutil import copy
# go to directory with CSV file of exported artifacts
os.chdir('/var/www/html/support/de... | gpl-3.0 |
lyndsysimon/osf.io | scripts/annotate_rsvps.py | 60 | 2256 | """Utilities for annotating workshop RSVP data.
Example ::
import pandas as pd
from scripts import annotate_rsvps
frame = pd.read_csv('workshop.csv')
annotated = annotate_rsvps.process(frame)
annotated.to_csv('workshop-annotated.csv')
"""
import re
import logging
from dateutil.parser import par... | apache-2.0 |
scikit-optimize/scikit-optimize.github.io | dev/_downloads/93a88000cf87942c55fd039a68ca7e84/partial-dependence-plot-with-categorical.py | 3 | 3730 | """
=================================================
Partial Dependence Plots with categorical values
=================================================
Sigurd Carlsen Feb 2019
Holger Nahrstaedt 2020
.. currentmodule:: skopt
Plot objective now supports optional use of partial dependence as well as
different methods... | bsd-3-clause |
ryfeus/lambda-packs | LightGBM_sklearn_scipy_numpy/source/scipy/interpolate/_bsplines.py | 10 | 32889 | from __future__ import division, print_function, absolute_import
import functools
import operator
import numpy as np
from scipy.linalg import (get_lapack_funcs, LinAlgError,
cholesky_banded, cho_solve_banded)
from . import _bspl
from . import _fitpack_impl
from . import _fitpack as _dierckx
... | mit |
jzbontar/orange-tree | Orange/evaluation/scoring.py | 1 | 3260 | import numpy as np
import sklearn.metrics as skl_metrics
from Orange.data import DiscreteVariable
class Score:
separate_folds = False
is_scalar = True
def __new__(cls, results=None, **kwargs):
self = super().__new__(cls)
if results is not None:
self.__init__()
retu... | gpl-3.0 |
flo-compbio/gopca | gopca/util.py | 1 | 8459 | # Copyright (c) 2015, 2016 Florian Wagner
#
# This file is part of GO-PCA.
#
# GO-PCA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License, Version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be use... | gpl-3.0 |
zaxtax/scikit-learn | sklearn/svm/tests/test_bounds.py | 280 | 2541 | import nose
from nose.tools import assert_equal, assert_true
from sklearn.utils.testing import clean_warning_registry
import warnings
import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression... | bsd-3-clause |
jzbontar/orange-tree | Orange/classification/logistic_regression.py | 1 | 3768 | import numpy
from scipy import sparse
import sklearn.linear_model as skl_linear_model
import Orange.data.preprocess
from Orange.classification import SklLearner, SklModel
__all__ = ["LogisticRegressionLearner"]
def _np_replace_nan(A, value=0.0):
"""
Replace NaN values in a numpy array `A` with `value`.
... | gpl-3.0 |
alexvanboxel/airflow | docs/conf.py | 33 | 8957 | # -*- coding: utf-8 -*-
#
# Airflow documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 9 20:50:01 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | apache-2.0 |
mehdidc/scikit-learn | examples/ensemble/plot_adaboost_multiclass.py | 354 | 4124 | """
=====================================
Multi-class AdaBoosted Decision Trees
=====================================
This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can
improve prediction accuracy on a multi-class problem. The classification
dataset is constructed by taking a ten-dimensional ... | bsd-3-clause |
pravsripad/jumeg | jumeg/glassbrain.py | 3 | 8626 | #!/usr/bin/env python
# The glassbrain class copied from The NeuroImaging Analysis Framework (NAF) repositories
# The code is covered under GNU GPL v2.
# Usage example.
'''
brain = ConnecBrain("fsaverage", "lh", "inflated")
coords = np.array([[-27., 23., 48.],
[-41.,-60., 29.],
[-64., -20., -9.],
... | bsd-3-clause |
acbecker/EXOQ | python/modelGp.py | 1 | 4894 | import MySQLdb
import sys
import numpy as np
import matplotlib.pyplot as plt
from george import kernels
import george
import emcee
import triangle
db = MySQLdb.connect(host='tddb.astro.washington.edu', user='tddb', passwd='tddb', db='Kepler')
cursor = db.cursor()
def getKeplerData(kid):
print "# Reading Dat... | mit |
lazywei/scikit-learn | examples/cluster/plot_affinity_propagation.py | 349 | 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 |
mitschabaude/nanopores | nanopores/tools/colormaps.py | 28 | 50518 | # New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
# and (in the case of viridis) Eric Firing.
#
# This file and the colormaps in it are released under the CC0 license /
# public domain dedication. We would appreciate credit if you use or
# redistribute these colormaps, but do not impose any legal r... | mit |
KennyCandy/HAR | _module45/CCCC_32_32.py | 2 | 18036 | # Note that the dataset must be already downloaded for this script to work, do:
# $ cd data/
# $ python download_dataset.py
# quoc_trinh
import tensorflow as tf
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import metrics
import os
import sys
import datetime
# get current... | mit |
scholi/pySPM | pySPM/utils/geometry.py | 1 | 2852 | class Point:
def __init__(self, xy, y=None):
if y is None:
assert type(xy) in [list, tuple]
assert len(xy)==2
self.x = xy[0]
self.y = xy[1]
else:
self.x = xy
self.y = y
def __add__(self, other):
assert i... | apache-2.0 |
nhmc/xastropy | xastropy/casbah/igm_spec.py | 5 | 1756 | """
#;+
#; NAME:
#; casbah.igm_spec
#; Version 1.0
#;
#; PURPOSE:
#; Module for analyzing, plotting, etc IGM Spectra for CASBAH
#; Not much done yet (nothing really)
#; 13-Jan-2015 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_... | bsd-3-clause |
effigies/mne-python | mne/viz/topomap.py | 1 | 41404 | """Functions to plot M/EEG data e.g. topographies
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com... | bsd-3-clause |
rgrandin/MechanicsTools | truss/truss_solver.py | 1 | 22478 | #
# -*- coding: utf-8 -*-
#
# Python-Based Truss Solver
# =============================================================
#
# Author: Robert Grandin
#
# Date: Fall 2007 (Creation of original Fortran solution in AerE 361)
# October 2011 (Python implementation)
# November 2014 (Clean-u... | bsd-3-clause |
mrgloom/h2o-3 | h2o-docs/src/api/data-science-example-1/example-native-pandas-scikit.py | 22 | 2796 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from pandas import Series, DataFrame
import pandas as pd
import numpy as np
import sklearn
from sklearn.ensemble import GradientBoostingClassifier
from sklearn import preprocessing
# <codecell>
air_raw = DataFrame.from_csv("allyears_tiny.csv", index_c... | apache-2.0 |
jasoncorso/kittipy | kitti/raw.py | 1 | 5516 | import os
import numpy as np
from kitti.data import get_drive_dir, get_inds
def get_video_dir(drive, color=False, right=False, **kwargs):
drive_dir = get_drive_dir(drive, **kwargs)
image_dir = 'image_%02d' % (0 + (1 if right else 0) + (2 if color else 0))
return os.path.join(drive_dir, image_dir, 'data'... | mit |
Akshay0724/scikit-learn | examples/plot_digits_pipe.py | 65 | 1652 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... | bsd-3-clause |
ClimbsRocks/scikit-learn | sklearn/datasets/mldata.py | 8 | 7848 | """Automatically download MLdata datasets."""
# Copyright (c) 2011 Pietro Berkes
# License: BSD 3 clause
import os
from os.path import join, exists
import re
import numbers
try:
# Python 2
from urllib2 import HTTPError
from urllib2 import quote
from urllib2 import urlopen
except ImportError:
# Pyt... | bsd-3-clause |
Arafatk/sympy | sympy/plotting/plot_implicit.py | 83 | 14400 | """Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... | bsd-3-clause |
brodoll/sms-tools | lectures/07-Sinusoidal-plus-residual-model/plots-code/hprModelAnal-flute.py | 21 | 2771 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, hanning, triang, blackmanharris, resample
import math
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import utilFunctions as UF
import ... | agpl-3.0 |
bassio/omicexperiment | omicexperiment/dataframe.py | 1 | 8368 | import numpy as np
import pandas as pd
import hashlib
from pathlib import Path
from biom import parse_table
from biom import Table as BiomTable
from omicexperiment.util import parse_fasta, parse_fastq
def load_biom(biom_filepath):
with open(biom_filepath) as f:
t = parse_table(f)
return t
def is_bio... | bsd-3-clause |
ssundarraj/music_genre_classifier | features/tempo.py | 1 | 3756 | import wave
import array
import math
import time
import argparse
import sys
import numpy
import pywt
from scipy import signal
import pdb
import matplotlib.pyplot as plt
def read_wav(filename):
# open file, get metadata for audio
try:
wf = wave.open(filename, 'rb')
except IOError, e:
print... | mit |
mayblue9/bokeh | examples/interactions/interactive_bubble/data.py | 49 | 1265 | import numpy as np
from bokeh.palettes import Spectral6
def process_data():
from bokeh.sampledata.gapminder import fertility, life_expectancy, population, regions
# Make the column names ints not strings for handling
columns = list(fertility.columns)
years = list(range(int(columns[0]), int(columns[-... | bsd-3-clause |
adocherty/polymode | Polymode/Image.py | 5 | 12492 | # _*_ coding=utf-8 _*_
#
#---------------------------------------------------------------------------------
#Copyright © 2009 Andrew Docherty
#
#This program is part of Polymode.
#Polymode is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the ... | gpl-3.0 |
YerevaNN/mimic3-benchmarks | mimic3models/length_of_stay/logistic/main.py | 1 | 4769 | from __future__ import absolute_import
from __future__ import print_function
from sklearn.preprocessing import Imputer, StandardScaler
from sklearn.linear_model import LinearRegression
from mimic3benchmark.readers import LengthOfStayReader
from mimic3models import common_utils
from mimic3models.metrics import print_me... | mit |
arjoly/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 294 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
pprett/scikit-learn | examples/applications/wikipedia_principal_eigenvector.py | 50 | 7817 | """
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | bsd-3-clause |
zzcclp/spark | python/pyspark/pandas/spark/accessors.py | 11 | 42801 | #
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.