repo_name
stringlengths
6
67
path
stringlengths
5
185
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
1.02k
962k
license
stringclasses
15 values
petosegan/scikit-learn
sklearn/decomposition/__init__.py
147
1421
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from .nmf import NMF, ProjectedGradientNMF from .pca import PCA, RandomizedPCA from .incrementa...
bsd-3-clause
2uller/LotF
App/Lib/site-packages/scipy/stats/kde.py
3
17459
#------------------------------------------------------------------------------- # # Define classes for (uni/multi)-variate kernel density estimation. # # Currently, only Gaussian kernels are implemented. # # Written by: Robert Kern # # Date: 2004-08-09 # # Modified: 2005-02-10 by Robert Kern. # Contr...
gpl-2.0
acbecker/BART
tests/test_bart_step.py
1
7134
__author__ = 'brandonkelly' import unittest import numpy as np from scipy import stats, integrate from tree import * import matplotlib.pyplot as plt from test_tree_parameters import build_test_data, SimpleBartStep class StepTestCase(unittest.TestCase): def setUp(self): nsamples = 1000 nfeatures =...
mit
verilog-to-routing/tatum
scripts/plot_level_scaling.py
3
4192
#!/usr/bin/env python import sys, argparse import csv import os import matplotlib.pyplot as plt import numpy as np def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("csv_file", default=None, help="CSV file with level runtimes") parser.add_argument("--scale_size", default=False, acti...
mit
RPGOne/Skynet
scikit-learn-0.18.1/examples/text/document_classification_20newsgroups.py
5
10515
""" ====================================================== Classification of text documents using sparse features ====================================================== This is an example showing how scikit-learn can be used to classify documents by topics using a bag-of-words approach. This example uses a scipy.spars...
bsd-3-clause
mayblue9/scikit-learn
sklearn/neighbors/nearest_centroid.py
199
7249
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..met...
bsd-3-clause
MrCodeYu/spark
python/pyspark/sql/context.py
3
22432
# # 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
henriquemiranda/yambo-py
tests/test_yambopy.py
2
1475
from __future__ import print_function # # Author: Henrique Pereira Coutada Miranda # Tests for yambopy # Si # import matplotlib import unittest import sys import os import shutil import argparse import subprocess import filecmp import shutil as sh from yambopy import * from qepy import * class TestYambopyGW(unittest.T...
bsd-3-clause
dennisss/sympy
sympy/plotting/tests/test_plot.py
17
8476
from sympy import (pi, sin, cos, Symbol, Integral, summation, sqrt, log, oo, LambertW, I, meijerg, exp_polar, Max) from sympy.plotting import (plot, plot_parametric, plot3d_parametric_line, plot3d, plot3d_parametric_surface) from sympy.plotting.plot import unset_show from ...
bsd-3-clause
thesuperzapper/tensorflow
tensorflow/examples/learn/iris.py
35
1654
# 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
albonthenet/uDPI
estimations/confusion_matrix/cm-kneighbor.py
1
2589
import pandas from sklearn.preprocessing import MinMaxScaler from sklearn import cross_validation from sklearn import preprocessing from sklearn.tree import DecisionTreeClassifier from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC,NuSVC,LinearSVC fr...
gpl-3.0
jakobworldpeace/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
simupy/simupy
examples/vanderpol.py
1
1274
import numpy as np import sympy as sp import matplotlib.pyplot as plt from simupy.systems.symbolic import DynamicalSystem, dynamicsymbols from simupy.block_diagram import BlockDiagram, DEFAULT_INTEGRATOR_OPTIONS from simupy.array import Array, r_ # This example simulates the Van der Pol oscillator. DEFAULT_INTEGRATOR...
bsd-2-clause
sytays/openanalysis
doc/conf.py
1
6136
# -*- coding: utf-8 -*- # # OpenAnalysis documentation build configuration file, created by # sphinx-quickstart on Wed Jul 19 12:44:16 2017. # # 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. ...
gpl-3.0
nmartensen/pandas
pandas/tests/frame/test_sorting.py
7
21261
# -*- coding: utf-8 -*- from __future__ import print_function import pytest import random import numpy as np import pandas as pd from pandas.compat import lrange from pandas import (DataFrame, Series, MultiIndex, Timestamp, date_range, NaT, IntervalIndex) from pandas.util.testing import assert_s...
bsd-3-clause
ltiao/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
3790
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
bsd-3-clause
Eric89GXL/mne-python
examples/decoding/plot_decoding_csp_timefreq.py
11
6452
""" ==================================================================== Decoding in time-frequency space using Common Spatial Patterns (CSP) ==================================================================== The time-frequency decomposition is estimated by iterating over raw data that has been band-passed at differ...
bsd-3-clause
divir94/News-Analytics
newsCollectionCopy.py
1
12990
import nltk, nltk.data, pickle, re import email as emailProcessor import time, imaplib from dateutil import parser import datetime import numpy as np #import ner import bsddb, string from nltk.stem import WordNetLemmatizer from sklearn import decomposition import matplotlib.pyplot as plt import subprocess, sys, random ...
apache-2.0
xhochy/arrow
dev/archery/setup.py
2
1819
#!/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 # "Li...
apache-2.0
arahuja/scikit-learn
sklearn/metrics/cluster/bicluster.py
25
2741
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
bsd-3-clause
vermouthmjl/scikit-learn
examples/exercises/plot_cv_digits.py
135
1223
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
bsd-3-clause
gerberlab/mitre
setup.py
1
2203
from setuptools import setup from setuptools.extension import Extension from setuptools.command.build_ext import build_ext import pkg_resources USE_CYTHON = False ext = '.pyx' if USE_CYTHON else '.c' extensions = [ Extension("efficient_likelihoods", ["mitre/efficient_likelihoods" + ext], ...
gpl-3.0
anilmuthineni/tensorflow
tensorflow/contrib/metrics/python/kernel_tests/histogram_ops_test.py
130
9577
# 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
iiSeymour/pandashells
pandashells/bin/p_example_data.py
8
2130
#! /usr/bin/env python # standard library imports import os import sys # noqa import argparse import textwrap import pandashells def main(): # create a dict of data-set names and corresponding files package_dir = os.path.dirname(os.path.realpath(pandashells.__file__)) sample_data_dir = os.path.realpath...
bsd-2-clause
hsiaoyi0504/scikit-learn
examples/applications/plot_model_complexity_influence.py
323
6372
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
Kongsea/tensorflow
tensorflow/examples/learn/iris_custom_model.py
43
3449
# 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
structrans/Canon
scripts/plotseq.py
1
2513
import os import logging import numpy as np import matplotlib.pyplot as plt import matplotlib def plot_seq(Z, step, colormap='gist_ncar', filename='untitled'): dir = os.path.dirname(os.path.abspath(__file__)) save_directory = os.path.join(dir, '{:s}.png'.format(filename)) x_step = step[0] y_step = ste...
mit
toastedcornflakes/scikit-learn
examples/text/hashing_vs_dict_vectorizer.py
93
3243
""" =========================================== FeatureHasher and DictVectorizer Comparison =========================================== Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. The example demonstrates syntax and speed only; it doesn't actually do anything useful with the e...
bsd-3-clause
nikitasingh981/scikit-learn
sklearn/svm/setup.py
83
3160
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('svm', parent_package, top_path) config.add_subpackage('tests') # Section L...
bsd-3-clause
zrhans/python
exemplos/Examples.lnk/bokeh/glyphs/colors.py
25
8920
from __future__ import print_function from math import pi import pandas as pd from bokeh.models import Plot, ColumnDataSource, FactorRange, CategoricalAxis, TapTool, HoverTool, OpenURL from bokeh.models.glyphs import Rect from bokeh.document import Document from bokeh.embed import file_html from bokeh.resources impor...
gpl-2.0
DGrady/pandas
pandas/tests/sparse/test_indexing.py
11
39909
# pylint: disable-msg=E1101,W0612 import pytest import numpy as np import pandas as pd import pandas.util.testing as tm class TestSparseSeriesIndexing(object): def setup_method(self, method): self.orig = pd.Series([1, np.nan, np.nan, 3, np.nan]) self.sparse = self.orig.to_sparse() def test_...
bsd-3-clause
ehocchen/trading-with-python
cookbook/reconstructVXX/reconstructVXX.py
77
3574
# -*- coding: utf-8 -*- """ Reconstructing VXX from futures data author: Jev Kuznetsov License : BSD """ from __future__ import division from pandas import * import numpy as np import os class Future(object): """ vix future class, used to keep data structures simple """ def __init__(self,serie...
bsd-3-clause
Mushirahmed/gnuradio
gr-input/python/qa_response.py
1
1255
import numpy from gnuradio import gr,gr_unittest from gnuradio import blocks from Response import Response import matplotlib.pyplot as plt class qa_response(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() def tearDown(self): self.tb = None def test_001_t(self): """ ...
gpl-3.0
zlatiadam/PyPortfolio
pyportfolio/statistics/robust_statistics.py
1
4330
# -*- coding: utf-8 -*- """ Created on Sun Nov 08 23:55:52 2015 @author: Zlati """ import numpy as np from sklearn.covariance import fast_mcd, ledoit_wolf, oas, empirical_covariance from statsmodels.robust.scale import huber from scipy.stats import kendalltau, spearmanr def hodges_lehmann_mean(x): """ Robus...
gpl-2.0
justincassidy/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
129
10192
import pickle import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dis...
bsd-3-clause
bgris/ODL_bgris
lib/python3.5/site-packages/matplotlib/docstring.py
23
3995
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib import cbook import sys import types class Substitution(object): """ A decorator to take a function's docstring and perform string substitution on it. This decorat...
gpl-3.0
rishikksh20/scikit-learn
sklearn/decomposition/tests/test_factor_analysis.py
112
3203
# Author: Christian Osendorfer <osendorf@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD3 import numpy as np from sklearn.utils.testing import assert_warns from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing im...
bsd-3-clause
jblackburne/scikit-learn
sklearn/metrics/cluster/supervised.py
11
33436
"""Utilities to evaluate the clustering performance of models. Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # Arnaud Fouchet ...
bsd-3-clause
philippjfr/bokeh
examples/models/file/colors.py
9
2059
from __future__ import print_function from math import pi import pandas as pd from bokeh.models import ( Plot, ColumnDataSource, FactorRange, CategoricalAxis, TapTool, HoverTool, OpenURL, CategoricalScale) from bokeh.models.glyphs import Rect from bokeh.colors import groups from bokeh.document import Document fro...
bsd-3-clause
unnikrishnankgs/va
venv/lib/python3.5/site-packages/matplotlib/tests/test_subplots.py
5
4766
from __future__ import (absolute_import, division, print_function, unicode_literals) import warnings import six from six.moves import xrange import numpy import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison, cleanup from nose.tools import assert_raises ...
bsd-2-clause
RayMick/scikit-learn
sklearn/datasets/__init__.py
176
3671
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
dwweiss/pmLib
src/tests/henonMap.py
1
3170
""" Copyright (c) 2016-18 by Dietmar W Weiss This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This softwar...
lgpl-3.0
pylayers/pylayers
pylayers/gis/examples/ex_osmparser.py
3
1883
from pylayers.util.project import * import pylayers.gis.osmparser as osm import matplotlib.pyplot as plt filename = datadir+'/osm/marne.osm' #filename = datadir+'/osm/poland.osm' #filename = datadir+'/osm/marne.osm' # coords,nodes,ways,relations= osm.osmparse(filename,typ='building',verbose=True) #bdg = osm.building...
mit
dvro/UnbalancedDataset
imblearn/ensemble/easy_ensemble.py
2
5455
"""Class to perform under-sampling using easy ensemble.""" from __future__ import print_function import numpy as np from sklearn.utils import check_random_state from ..base import BaseMulticlassSampler from ..under_sampling import RandomUnderSampler MAX_INT = np.iinfo(np.int32).max class EasyEnsemble(BaseMulticl...
mit
raghavrv/scikit-learn
benchmarks/bench_plot_svd.py
72
2914
"""Benchmarks of Singular Value Decomposition (Exact and Approximate) The data is mostly low rank but is a fat infinite tail. """ import gc from time import time import numpy as np from collections import defaultdict import six from scipy.linalg import svd from sklearn.utils.extmath import randomized_svd from sklear...
bsd-3-clause
nikitasingh981/scikit-learn
examples/model_selection/plot_roc.py
102
5056
""" ======================================= Receiver Operating Characteristic (ROC) ======================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality. ROC curves typically feature true positive rate on the Y axis, and false positive rate on the X a...
bsd-3-clause
peterwilletts24/Python-Scripts
Radiosonde_Data/weekly_cross_section.py
1
9413
#Monthly import matplotlib import matplotlib.pyplot as plt import matplotlib.mlab as ml import datetime from dateutil.relativedelta import relativedelta import re import numpy as np from math import sin, cos, atan2, radians, sqrt import scipy.interpolate import gc import pdb import imp imp.load_source('GenMe...
mit
nipunagarwala/cs224s_final_project
code/utils/dataAugmentation_filter.py
1
1502
import pickle import numpy as np from scipy.signal import butter, lfilter from dataAugmentation_additive import add_noise import matplotlib.pyplot as plt # Filters out 60 Hz noise def butter_bandstop_filter(data, lowcut, highcut, fs, order=2): def butter_bandstop(lowcut, highcut, fs, order=2): nyq = ...
mit
almarklein/scikit-image
doc/examples/plot_threshold_adaptive.py
5
1306
""" ===================== Adaptive Thresholding ===================== Thresholding is the simplest way to segment objects from a background. If that background is relatively uniform, then you can use a global threshold value to binarize the image by pixel-intensity. If there's large variation in the background intensi...
bsd-3-clause
smorante/continuous-goal-directed-actions
simulated-CGDA/generalization/generalization_old_test2.py
1
7027
from __future__ import division import itertools from sklearn import mixture, metrics from sklearn.cluster import DBSCAN from scipy import linalg from scipy.spatial import distance import pylab as pl import matplotlib as mpl from scipy.interpolate import Rbf, InterpolatedUnivariateSpline import csv import numpy as np...
mit
pelson/cartopy
lib/cartopy/io/ogc_clients.py
2
35545
# (C) British Crown Copyright 2014 - 2018, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
lgpl-3.0
javadba/Python-ELM
elm_notebook.py
9
6784
# -*- coding: utf-8 -*- # <nbformat>2</nbformat> # <codecell> # Demo python notebook for sklearn elm and random_hidden_layer modules # # Author: David C. Lambert [dcl -at- panix -dot- com] # Copyright(c) 2013 # License: Simple BSD # <codecell> from time import time from sklearn.cluster import k_means from elm impo...
bsd-3-clause
francescobaldi86/Ecos2015PaperExtension
Analyse/create_histograms.py
1
16110
import pandas as pd import matplotlib.mlab as mlab import matplotlib.pyplot as plt import os import unicodedata import re %pylab # This is for inline plotting project_path = os.path.realpath('.') project_path database_path = project_path + os.sep + 'Database' + os.sep graph_path = project_path + os.sep + 'Analyse' + ...
mit
jwkvam/plotlywrapper
doc/figures.py
1
1915
#!/usr/bin/env python # -*- coding: utf-8 -*- import plotlywrapper as pw import numpy as np import pandas as pd # from numpy import random as rng import random random.seed(0) # rng.seed(0) options = dict(output='file', plotlyjs=False, show_link=False) datas = 'range(1, 6)' data = eval(datas) data2s = 'range(2, 12...
mit
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/pandas/plotting/_misc.py
7
18199
# being a bit too dynamic # pylint: disable=E1101 from __future__ import division import numpy as np from pandas.util._decorators import deprecate_kwarg from pandas.core.dtypes.missing import notnull from pandas.compat import range, lrange, lmap, zip from pandas.io.formats.printing import pprint_thing from pandas.p...
mit
tjhei/burnman
setup.py
5
1333
from __future__ import absolute_import import re versionstuff = dict( re.findall("(.+) = '(.+)'\n", open('burnman/version.py').read())) metadata = dict(name='burnman', version=versionstuff['version'], description='a thermoelastic and thermodynamic toolkit for Earth and planetary sc...
gpl-2.0
holsety/tushare
tushare/internet/boxoffice.py
7
7205
# -*- coding:utf-8 -*- """ 电影票房 Created on 2015/12/24 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ import pandas as pd from tushare.stock import cons as ct from tushare.util import dateu as du try: from urllib.request import urlopen, Request except ImportError: from urllib2 import urlopen...
bsd-3-clause
MATH497project/MATH497-DiabeticRetinopathy
ICO.py
1
13492
import numpy as np import pandas as pd import re class Data: def __init__(self, filepath): table_names = {'all_encounter_data': 'all_encounter_data.pickle', 'demographics': 'demographics_Dan_20170304.pickle', 'encounters': 'encounters.pickle', ...
mit
MJuddBooth/pandas
pandas/tests/extension/base/groupby.py
2
2975
import pytest import pandas as pd import pandas.util.testing as tm from .base import BaseExtensionTests class BaseGroupbyTests(BaseExtensionTests): """Groupby-specific tests.""" def test_grouping_grouper(self, data_for_grouping): df = pd.DataFrame({ "A": ["B", "B", None, None, "A", "A",...
bsd-3-clause
kavvkon/enlopy
enlopy/generate.py
1
21354
# -*- coding: utf-8 -*- """ Methods that generate or adjusted energy related timeseries based on given assumptions/input """ from __future__ import absolute_import, division, print_function import numpy as np import pandas as pd import scipy.interpolate import scipy.linalg import scipy.stats from .utils import make_t...
bsd-3-clause
trycs/ozelot
examples/leonardo/leonardo/common/analysis.py
1
3069
"""Analysis output generation, common for all model/pipeline variants """ from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from os import path import io import jinja2 import numpy as np from matplotlib import pyplot as plt import seaborn from ozelot impo...
mit
kjung/scikit-learn
sklearn/tests/test_naive_bayes.py
32
17897
import pickle from io import BytesIO import numpy as np import scipy.sparse from sklearn.datasets import load_digits, load_iris from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert...
bsd-3-clause
frank-tancf/scikit-learn
sklearn/decomposition/base.py
313
5647
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Kyle Kastner <kastnerkyle@gmail.com> # # Licen...
bsd-3-clause
ic-hep/DIRAC
Core/Utilities/Graphs/GraphData.py
1
17342
######################################################################## # $HeadURL$ ######################################################################## """ GraphData encapsulates input data for the DIRAC Graphs plots The DIRAC Graphs package is derived from the GraphTool plotting package of the CMS/...
gpl-3.0
jblackburne/scikit-learn
sklearn/cluster/dbscan_.py
24
12278
# -*- coding: utf-8 -*- """ DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ # Author: Robert Layton <robertlayton@gmail.com> # Joel Nothman <joel.nothman@gmail.com> # Lars Buitinck # # License: BSD 3 clause import numpy as np from scipy import sparse from ..base import BaseEst...
bsd-3-clause
panoptes/environmental-analysis-system
scripts/plot_weather.py
3
33190
#!/usr/bin/env python3 import numpy as np import os import pandas as pd import sys import warnings import yaml from plotly import plotly from datetime import datetime as dt from datetime import timedelta as tdelta from astropy.table import Table from astropy.time import Time from astroplan import Observer from ast...
mit
heli522/scikit-learn
sklearn/linear_model/__init__.py
270
3096
""" The :mod:`sklearn.linear_model` module implements generalized linear models. It includes Ridge regression, Bayesian Regression, Lasso and Elastic Net estimators computed with Least Angle Regression and coordinate descent. It also implements Stochastic Gradient Descent related algorithms. """ # See http://scikit-le...
bsd-3-clause
pacificgilly1992/PGrainrate
Backups/PGRRpost/PGRRpost1.0.7.py
1
5483
############################################################################ # Project: The Lenard effect of preciptation at the RUAO, # Title: Ensemble processing of the PG, Time and Rain Rate data, # Author: James Gilmore, # Email: james.gilmore@pgr.reading.ac.uk. # Version: 1.0.7 # Date: 18/01/16 # Status: Operation...
gpl-3.0
s-t-e-a-l-t-h/Eclipsing-binaries-library
intersection/edge_intersection.py
1
4837
import matplotlib.pyplot as plt import numpy as np def edge_intersection_2d(pt1_xy, pt2_xy, pt3_xy, pt4_xy): # return: tuple # 0: intersection_status: # False: parallel # True: intersection # 1: segment intersection: # False: no inters...
gpl-3.0
gkunter/coquery
coquery/visualizer/boxplot.py
1
2037
# -*- coding: utf-8 -*- """ boxplot.py is part of Coquery. Copyright (c) 2017 Gero Kunter (gero.kunter@coquery.org) Coquery is released under the terms of the GNU General Public License (v3). For details, see the file LICENSE that you should have received along with Coquery. If not, see <http://www.gnu.org/licenses/>...
gpl-3.0
justincassidy/scikit-learn
sklearn/externals/joblib/__init__.py
86
4795
""" Joblib is a set of tools to provide **lightweight pipelining in Python**. In particular, joblib offers: 1. transparent disk-caching of the output values and lazy re-evaluation (memoize pattern) 2. easy simple parallel computing 3. logging and tracing of the execution Joblib is optimized to be **fast*...
bsd-3-clause
uglyboxer/linear_neuron
docs/source/conf.py
1
9436
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # mini_net documentation build configuration file, created by # sphinx-quickstart on Thu Oct 8 06:58:02 2015. # # 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 # a...
mit
ville-k/tensorflow
tensorflow/contrib/learn/python/learn/estimators/multioutput_test.py
136
1696
# 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
boland1992/SeisSuite
build/lib/ambient/spectrum/find_maxima.py
8
13563
# -*- coding: utf-8 -*- """ Created on Fri July 6 11:04:03 2015 @author: boland """ import os import datetime import numpy as np import multiprocessing as mp import matplotlib.pyplot as plt from scipy import signal from obspy import read from scipy.signal import argrelextrema from info_dataless import locs_from_dat...
gpl-3.0
zorroblue/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
21
26665
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from numpy.testing import run_module_suite from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from...
bsd-3-clause
boland1992/seissuite_iran
build/lib/ambient/ant/stack.py
8
12789
# -*- coding: utf-8 -*- """ Created on Tue Aug 11 12:17:56 2015 @author: boland The following script is being used in order to explore and develop python methods for phase-stacking, and phase-weighted stacking between two seismic waveforms. Input uses one file per station waveform. Needs a minimum of two channels to...
gpl-3.0
astropy/astropy
astropy/coordinates/tests/test_finite_difference_velocities.py
8
9762
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy.units import allclose as quantity_allclose from astropy import units as u from astropy import constants from astropy.time import Time from astropy.coordinates.builtin_frames import IC...
bsd-3-clause
gclenaghan/scikit-learn
sklearn/linear_model/tests/test_sgd.py
30
44274
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
vzg100/Post-Translational-Modification-Prediction
pred.py
1
25609
def warn(*args, **kwargs): #Mutes Sklearn warnings pass from sklearn.ensemble import RandomForestClassifier import pandas as pd from Bio.SeqUtils.ProtParam import ProteinAnalysis import random from random import randint import numpy as np from sklearn.neural_network import MLPClassifier from sklearn import svm from...
mit
ClimbsRocks/scikit-learn
sklearn/discriminant_analysis.py
13
28628
""" Linear Discriminant Analysis and Quadratic Discriminant Analysis """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .extern...
bsd-3-clause
apache/spark
python/pyspark/pandas/data_type_ops/num_ops.py
6
21133
# # 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
nikitasingh981/scikit-learn
doc/sphinxext/numpy_ext/docscrape_sphinx.py
408
8061
import re import inspect import textwrap import pydoc from .docscrape import NumpyDocString from .docscrape import FunctionDoc from .docscrape import ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots...
bsd-3-clause
inkenbrandt/ArcPy
Box_and_Whisker/BoxAndWhisker.py
2
5739
# -*- coding: utf-8 -*- """ Created on Tue Jun 24 09:44:39 2014 Box and Whisker http://matplotlib.org/examples/pylab_examples/boxplot_demo2.html http://matplotlib.org/examples/pylab_examples/boxplot_demo.html http://stackoverflow.com/questions/16592222/matplotlib-group-boxplots @author: paulinkenbrandt """ from pyl...
gpl-2.0
tosolveit/scikit-learn
sklearn/linear_model/ransac.py
191
14261
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement from ..utils.valid...
bsd-3-clause
strint/tensorflow
tensorflow/python/estimator/inputs/queues/feeding_functions.py
10
13502
# 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
sumspr/scikit-learn
sklearn/datasets/svmlight_format.py
114
15826
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
bsd-3-clause
murali-munna/scikit-learn
examples/calibration/plot_compare_calibration.py
241
5008
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
calico/basenji
bin/archive/basenji_map.py
1
10036
#!/usr/bin/env python # Copyright 2017 Calico 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 agr...
apache-2.0
rohit21122012/DCASE2013
runs/2016/dnn2016med_traps/traps32/src/dataset.py
55
78980
#!/usr/bin/env python # -*- coding: utf-8 -*- import locale import socket import tarfile import urllib2 import zipfile from sklearn.cross_validation import StratifiedShuffleSplit, KFold from files import * from general import * from ui import * class Dataset(object): """Dataset base class. The specific da...
mit
jereze/scikit-learn
sklearn/feature_extraction/hashing.py
183
6155
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
bsd-3-clause
plotly/plotly.py
packages/python/plotly/plotly/tests/test_optional/test_px/test_px.py
1
10577
import plotly.express as px import plotly.io as pio import numpy as np import pytest from itertools import permutations def test_scatter(): iris = px.data.iris() fig = px.scatter(iris, x="sepal_width", y="sepal_length") assert fig.data[0].type == "scatter" assert np.all(fig.data[0].x == iris.sepal_wid...
mit
lzyeasyboy/tushare
tushare/stock/reference.py
27
25190
# -*- coding:utf-8 -*- """ 投资参考数据接口 Created on 2015/03/21 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ from __future__ import division from tushare.stock import cons as ct from tushare.stock import ref_vars as rv from tushare.util import dateu as dt import pandas as pd import time i...
bsd-3-clause
Machyne/econ_comps
full_1984.py
1
6348
import os import numpy as np import pandas as pd from pandas.tools.plotting import scatter_matrix import pylab import statsmodels.formula.api as smf import statsmodels.stats.api as sms """ USAGE: python full_1984.py CREATES: results/1984/clean.csv results/1984/corr.txt results/1984/het_breushpagan.txt results/1984/o...
bsd-3-clause
beni55/networkx
examples/drawing/labels_and_colors.py
44
1330
#!/usr/bin/env python """ Draw a graph with matplotlib, color by degree. You must have matplotlib for this to work. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)""" import matplotlib.pyplot as plt import networkx as nx G=nx.cubical_graph() pos=nx.spring_layout(G) # positions for all nodes # nodes nx.draw...
bsd-3-clause
jonathanstrong/NAB
tests/integration/corpus_test.py
10
4895
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, 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...
agpl-3.0
saullocastro/pyNastran
pyNastran/op2/tables/oes_stressStrain/real/oes_springs.py
1
22438
from __future__ import (nested_scopes, generators, division, absolute_import, print_function, unicode_literals) from six import iteritems from six.moves import zip import numpy as np from numpy import zeros, array_equal from itertools import count from pyNastran.op2.tables.oes_stressStrain.real...
lgpl-3.0
MagicUmom/pattern_recognition_project
mysvm.py
1
2161
print(__doc__) # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # License: BSD 3 clause # Standard scientific Python imports import matplotlib.pyplot as plt # Import datasets, classifiers and performance metrics from sklearn import datasets, svm, metrics # The digits dataset digits = datasets.loa...
mit
jensengrouppsu/rapid
rapid/__main__.py
1
2598
#! /usr/bin/env python '''\ Spectral exchange can be run from the command line non-interactively by giving it a text-based input file and having it generate data from the input, or it can be run as an interactive GUI. Authors: Seth M. Morton, Lasse Jensen ''' from __future__ import print_function, division, absolute_...
mit
madscatt/zazzie
src/scripts/convergence_test.py
3
31326
# from __future__ import absolute_import # from __future__ import division # from __future__ import print_function # # from __future__ import unicode_literals """SASSIE: Copyright (C) 2011-2015 Joseph E. Curtis, Ph.D. This program is free software: you can redistribute it and/or modify it under the terms of the GNU G...
gpl-3.0
Adai0808/scikit-learn
sklearn/tests/test_common.py
127
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