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
ilo10/scikit-learn
examples/neighbors/plot_regression.py
349
1402
""" ============================ Nearest Neighbors regression ============================ Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpolation of the target using both barycenter and constant weights. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@...
bsd-3-clause
mfjb/scikit-learn
examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py
227
5170
""" ================================================= Hyper-parameters of Approximate Nearest Neighbors ================================================= This example demonstrates the behaviour of the accuracy of the nearest neighbor queries of Locality Sensitive Hashing Forest as the number of candidates and the numb...
bsd-3-clause
zuku1985/scikit-learn
sklearn/utils/tests/test_metaestimators.py
86
2304
from sklearn.utils.testing import assert_true, assert_false from sklearn.utils.metaestimators import if_delegate_has_method class Prefix(object): def func(self): pass class MockMetaEstimator(object): """This is a mock meta estimator""" a_prefix = Prefix() @if_delegate_has_method(delegate="a...
bsd-3-clause
snario/geopandas
geopandas/base.py
6
17504
from warnings import warn from shapely.geometry import MultiPoint, MultiLineString, MultiPolygon from shapely.geometry.base import BaseGeometry from shapely.ops import cascaded_union, unary_union import shapely.affinity as affinity import numpy as np import pandas as pd from pandas import Series, DataFrame, MultiInde...
bsd-3-clause
adamgonzalez/analysis
RfromZB_highres.py
1
6153
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ @author: adamg """ import matplotlib.pyplot as plt import numpy as np import matplotlib from scipy.stats import gaussian_kde import random import time import os matplotlib.rcParams.update({'font.size': 18}) matplotlib.rcParams['axes.linewidth'] = 1 #set the value glo...
mit
pravsripad/mne-python
mne/tests/test_import_nesting.py
8
1372
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import sys from mne.utils import run_subprocess run_script = """ import sys import mne out = set() # check scipy (Numba imports it to check the version) ok_scipy_submodules = set(['scipy', 'numpy', # these appear in old scipy ...
bsd-3-clause
RPGOne/Skynet
scikit-learn-0.18.1/examples/cluster/plot_kmeans_silhouette_analysis.py
83
5888
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
bsd-3-clause
cb01/lxy
scripts/optimizationviz.py
1
1387
import numpy as np import numpy.random import matplotlib.pyplot as plt import sys import click # Visualize a dotplot to compare two orderings of a list # e.g. python scripts/scaffplot.py --inferred data/test/scaffolding.inferred.txt --actual data/test/scaffolding.key.txt --outpath data/test/test2.png @click.command()...
bsd-3-clause
vitaliykomarov/NEUCOGAR
nest/noradrenaline/nest-2.10.0/topology/examples/test_3d_gauss.py
13
2641
# -*- coding: utf-8 -*- # # test_3d_gauss.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, ...
gpl-2.0
rsteed11/GAT
gat/core/sna/sna.py
1
36487
import tempfile import matplotlib.pyplot as plt import networkx as nx import numpy as np from networkx.algorithms import bipartite as bi from networkx.algorithms import centrality from itertools import product from collections import defaultdict, namedtuple import pandas as pd import datetime from gat.core.sna import ...
mit
eclee25/flu-SDI-exploratory-age
scripts/OR_seasonseverity.py
1
2365
#!/usr/bin/python ############################################## ###Python template ###Author: Elizabeth Lee ###Date: 7/25/13 ###Function: Draw OR by season severity plots where season severity is defined as attack rate per 100,000 in acute care or inpatient facilities in flu peak weeks ###Import data: SQL_export/OR_...
mit
annehutter/grid-model
analysis_tools/size_distribution_neutral.py
1
5060
import sys import os import numpy as np import matplotlib as m m.use('Agg') import matplotlib.pyplot as plt from matplotlib.colors import LogNorm from statistics import * import read_parameterfile as rp import read_fields as rf def round_down(num): if num < 0: return -np.ceil(abs(num)) else: r...
gpl-2.0
great-expectations/great_expectations
tests/execution_engine/test_pandas_execution_engine.py
1
26181
import datetime import os import random from pathlib import Path from typing import List import boto3 import pandas as pd import pytest from botocore.errorfactory import ClientError from moto import mock_s3 import great_expectations.exceptions.exceptions as ge_exceptions from great_expectations.core.batch import Batc...
apache-2.0
akleber/fronius-json-tools
logdata-data2csv.py
1
3241
""" Work-in-progress!!! Reads the logdata-data json files generated by the Fronius Push Service. Extracts some data and writes it to a excel compatible csv file. Also generates a graph from some data. """ import json import csv import collections import matplotlib.pyplot as plt from pprint import pprint def to_tim...
mit
jungla/ICOM-fluidity-toolbox
2D/U/plot_W_v_avg.py
1
2883
from memory_profiler import memory_usage from matplotlib.colors import LinearSegmentedColormap import os, sys import gc import fio, myfun import vtktools import numpy as np import matplotlib as mpl mpl.use('ps') import matplotlib.pyplot as plt gc.enable() ## READ archive (too many points... somehow) # args: name, day...
gpl-2.0
aetilley/scikit-learn
sklearn/linear_model/tests/test_theil_sen.py
234
9928
""" Testing for Theil-Sen module (sklearn.linear_model.theil_sen) """ # Author: Florian Wilhelm <florian.wilhelm@gmail.com> # License: BSD 3 clause from __future__ import division, print_function, absolute_import import os import sys from contextlib import contextmanager import numpy as np from numpy.testing import ...
bsd-3-clause
danielvdende/incubator-airflow
airflow/contrib/plugins/metastore_browser/main.py
16
6015
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
Solid-Mechanics/matplotlib-4-abaqus
matplotlib/backend_bases.py
3
106958
""" Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a matplotlib backend :class:`RendererBase` An abstract base class to handle drawing/rendering operations. :class:`FigureCanvasBase` The abstraction layer that separates the :class:`matplotlib.fi...
mit
canast02/microsoft-malware-classification-challenge
solution4b5.py
1
3910
import os from csv import writer from sklearn import cross_validation from sklearn.ensemble import ExtraTreesClassifier, RandomForestClassifier from sklearn.neighbors import KNeighborsClassifier import six import utilities # Decide read/write mode based on python version read_mode, write_mode = ('r', 'w') if six.P...
apache-2.0
NelisVerhoef/scikit-learn
sklearn/covariance/tests/test_covariance.py
69
11116
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
SSJohns/osf.io
scripts/analytics/utils.py
16
2605
# -*- coding: utf-8 -*- import os import unicodecsv as csv from bson import ObjectId import matplotlib.pyplot as plt import matplotlib.dates as mdates import requests from website import util from website import settings as website_settings def oid_to_datetime(oid): return ObjectId(oid).generation_time def ...
apache-2.0
acorg/dark-matter
dark/proteins.py
1
44260
from __future__ import print_function, division import os from collections import defaultdict, Counter import numpy as np from os.path import dirname, exists, join from operator import itemgetter import re from six.moves.urllib.parse import quote from textwrap import fill from dark.dimension import dimensionalIterato...
mit
dieterich-lab/rp-bp
rpbp/analysis/rpbp_predictions/create_rpbp_predictions_report.py
1
32174
#! /usr/bin/env python3 import argparse import itertools import logging import os import shlex import sys import yaml import pbio.misc.latex as latex import pbio.misc.logging_utils as logging_utils import pbio.misc.parallel as parallel import pbio.misc.shell_utils as shell_utils import pbio.misc.slurm as slurm import...
mit
BiRG/Omics-Dashboard
omics/omics_dashboard/dashboards/nmr_metabolomics/collection_editor/model.py
1
7721
import os import dash_bootstrap_components as dbc import dash_html_components as html from flask_login import current_user from flask import url_for import pandas as pd from dashboards.dashboard_model import DashboardModel from data_tools.db_models import collection_analysis_membership, db, Analysis from data_tools.w...
mit
Jimmy-Morzaria/scikit-learn
examples/ensemble/plot_adaboost_twoclass.py
347
3268
""" ================== Two-class AdaBoost ================== This example fits an AdaBoosted decision stump on a non-linearly separable classification dataset composed of two "Gaussian quantiles" clusters (see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision boundary and decision scores. The di...
bsd-3-clause
caslei/TfModels
slim/ExampleVGG.py
1
14684
#http://lib.csdn.net/article/machinelearning/39582 #https://github.com/warmspringwinds/tensorflow_notes/blob/master/image_segmentation_conditional_random_fields.ipynb from __future__ import division import os, time import sys import tensorflow as tf #import skimage.io as io import numpy as np from matplotlib import py...
apache-2.0
waynenilsen/statsmodels
statsmodels/sandbox/nonparametric/kde2.py
34
3158
# -*- coding: utf-8 -*- from __future__ import print_function from statsmodels.compat.python import lzip, zip import numpy as np from . import kernels #TODO: should this be a function? class KDE(object): """ Kernel Density Estimator Parameters ---------- x : array-like N-dimensional array...
bsd-3-clause
pratapvardhan/scikit-learn
sklearn/metrics/ranking.py
17
27697
"""Metrics to assess performance on classification task given scores 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....
bsd-3-clause
goodfeli/pylearn2
pylearn2/train_extensions/plots.py
34
9617
""" Plot monitoring extensions while training. """ __authors__ = "Laurent Dinh" __copyright__ = "Copyright 2014, Universite de Montreal" __credits__ = ["Laurent Dinh"] __license__ = "3-clause BSD" __maintainer__ = "Laurent Dinh" __email__ = "dinhlaur@iro" import logging import os import os.path import stat import num...
bsd-3-clause
kdmurray91/scikit-bio
skbio/diversity/alpha/tests/test_faith_pd.py
2
8645
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
xuanyuanking/spark
python/pyspark/pandas/data_type_ops/categorical_ops.py
5
2506
# # 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
meduz/scikit-learn
examples/svm/plot_svm_regression.py
120
1520
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
bsd-3-clause
mrshu/scikit-learn
sklearn/tests/test_grid_search.py
2
8915
""" Testing for grid search module (sklearn.grid_search) """ from cStringIO import StringIO import sys import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing ...
bsd-3-clause
zodiacnan/Masterarbeit
moduls/results/excelwrite.py
1
3091
# -*- coding: utf-8 -*- """ Created on Tue Aug 15 12:55:07 2017 @author: DINGNAN """ #write the excel table of Ld-Lq identifikation import os os.chdir('C:\\Users\\DINGNAN\\Desktop\\machines\\res\\') import xlwt import numpy as np import matplotlib from datetime import date,datetime import pandas as pd import math Nb...
gpl-3.0
Eric89GXL/mne-python
tutorials/raw/plot_40_visualize_raw.py
4
8569
# -*- coding: utf-8 -*- """ .. _tut-visualize-raw: Built-in plotting methods for Raw objects ========================================= This tutorial shows how to plot continuous data as a time series, how to plot the spectral density of continuous data, and how to plot the sensor locations and projectors stored in `~...
bsd-3-clause
antkillerfarm/antkillerfarm_crazy
python/ml/tc/tc0209.py
1
6167
#!/usr/bin/python # -*- coding: utf-8 -*- import MySQLdb import numpy as np from datetime import datetime import matplotlib.pyplot as plt class statistics_info: def __init__(self): self.num = 0 self.sum = 0.0 self.weeks = [] self.user_sum = [0 for i in range(7)] class week_info: ...
gpl-3.0
chugunovyar/factoryForBuild
env/lib/python2.7/site-packages/matplotlib/backends/backend_wxagg.py
10
5840
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import matplotlib from matplotlib.figure import Figure from .backend_agg import FigureCanvasAgg from . import wx_compat as wxc from . import backend_wx from .backend_wx import (FigureManagerWx, Fi...
gpl-3.0
ishay2b/tensorflow
tensorflow/examples/learn/text_classification_character_cnn.py
29
5666
# 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
pkonarzewski/data-processors
tests/test_dateutils.py
1
4085
# -- coding: utf-8 -*- import unittest from pandas import DataFrame, Series, NaT from datetime import datetime, date import pandas.util.testing as pdtest from processors import dateutils as dtu class TestDateTimeParse(unittest.TestCase): def test_unify_cases_df(self): # floor datetime series df ...
mit
florian-f/sklearn
examples/plot_johnson_lindenstrauss_bound.py
4
7402
""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected in...
bsd-3-clause
orangeYao/twiOpinion
mainLearning.py
1
2006
#!/usr/bin/env python #copied from zhiyao@combo: /home/zhiyao/FYPstart/largeTestData #only library in sklearnClassify included currently import functions import sklearnClassify import pandas as pd import random import datetime numberForTraining = 4000 numberForTesting = 400 numberUsedAll = numberForTraining + numberFo...
mit
rallured/PyXFocus
examples/axro/stressCompensation.py
1
3389
import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import griddata import pdb,os,pyfits import utilities.imaging.fitting as fit import traces.sources as sources import traces.transformations as tran import traces.surfaces as surf import traces.analyses as anal #Get distortion coefficients os.chd...
mit
wlamond/scikit-learn
sklearn/model_selection/_search.py
4
49846
""" The :mod:`sklearn.model_selection._search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function from __future__ import division # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas...
bsd-3-clause
VirusTotal/msticpy
msticpy/nbtools/security_event.py
1
3507
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Module ...
mit
av8ramit/tensorflow
tensorflow/contrib/factorization/python/ops/kmeans_test.py
12
20083
# 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
marinkaz/orange3
Orange/widgets/visualize/owscatterplot.py
2
24824
from bisect import bisect_left import sys import numpy as np from PyQt4.QtCore import QSize, Qt, QTimer from PyQt4 import QtGui from PyQt4.QtGui import QApplication, QTableView, QStandardItemModel, \ QStandardItem from sklearn.neighbors import NearestNeighbors from sklearn.metrics import r2_score import Orange fr...
bsd-2-clause
patmarion/director
src/python/scripts/logReporter.py
5
4906
import os import sys import time import lcm import numpy as np import matplotlib.pyplot as plt import datetime as dt from director import lcmspy as spy import scipy.signal as sig def sizeof_fmt(num, suffix='B'): for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']: if abs(num) < 1024.0: return "...
bsd-3-clause
nmayorov/scikit-learn
sklearn/model_selection/tests/test_search.py
20
30855
"""Test the search module""" from collections import Iterable, Sized from sklearn.externals.six.moves import cStringIO as StringIO from sklearn.externals.six.moves import xrange from itertools import chain, product import pickle import sys import numpy as np import scipy.sparse as sp from sklearn.utils.fixes import ...
bsd-3-clause
mraspaud/dask
dask/dataframe/io/sql.py
2
5272
import numpy as np import pandas as pd import six from ... import delayed from .io import from_delayed def read_sql_table(table, uri, index_col, divisions=None, npartitions=None, limits=None, columns=None, bytes_per_chunk=256 * 2**20, **kwargs): """ Create dataframe from...
bsd-3-clause
ycaihua/scikit-learn
benchmarks/bench_glmnet.py
297
3848
""" To run this, you'll need to have installed. * glmnet-python * scikit-learn (of course) Does two benchmarks First, we fix a training set and increase the number of samples. Then we plot the computation time as function of the number of samples. In the second benchmark, we increase the number of dimensions of...
bsd-3-clause
louisLouL/pair_trading
capstone_env/lib/python3.6/site-packages/matplotlib/tests/test_style.py
2
5014
from __future__ import (absolute_import, division, print_function, unicode_literals) import os import shutil import tempfile import warnings from collections import OrderedDict from contextlib import contextmanager import pytest import matplotlib as mpl from matplotlib import style from matpl...
mit
jorik041/scikit-learn
benchmarks/bench_random_projections.py
397
8900
""" =========================== Random projection benchmark =========================== Benchmarks for random projections. """ from __future__ import division from __future__ import print_function import gc import sys import optparse from datetime import datetime import collections import numpy as np import scipy.s...
bsd-3-clause
yask123/scikit-learn
sklearn/decomposition/pca.py
192
23117
""" 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
romainx/panorama
panorama/chart_factory.py
1
4286
# -*- coding: utf-8 -*- from __future__ import unicode_literals from functools import partial from pandas import Series, DataFrame # !! Import required to instantiate charts, do not remove from nvd3 import * import numpy # A dict used for chart configuration. # DEFAULT settings can be overwritten and/or completed by...
mit
futurulus/scipy
scipy/signal/signaltools.py
5
88094
# Author: Travis Oliphant # 1999 -- 2002 from __future__ import division, print_function, absolute_import import warnings import threading from . import sigtools from scipy._lib.six import callable from scipy._lib._version import NumpyVersion from scipy import fftpack, linalg from numpy import (allclose, angle, aran...
bsd-3-clause
saurv4u/Deep-Learning-for-Content-Retrieval
Code/clustering.py
1
2507
import matplotlib.pyplot as plt import numpy from sklearn.cluster import DBSCAN from sklearn.cluster import AgglomerativeClustering from sklearn.cluster import KMeans from cluster import HierarchicalClustering from sklearn import metrics from sklearn.preprocessing import StandardScaler from sklearn.metrics import pairw...
mit
zaxtax/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
365
6996
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
mahak/spark
python/pyspark/pandas/tests/plot/test_series_plot_plotly.py
14
8485
# # 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
Mecanon/morphing_wing
experimental/sma_database/convert_transformation_temperatures.py
1
4418
# -*- coding: utf-8 -*- """ Created on Fri Jul 15 16:39:31 2016 @author: Eduardo Tancredo & Pedro Leal """ import math import numpy as np #import matplotlib.pyplot as plt n_1 = 0.1919 n_2 = 0.1823 n_3 = 0.1623 n_4 = 0.2188 Ms_list = np.array([ 68.74, 75.71, 82.33, 84.77, 88.27]) Mf_list = np.array([ 57.74, 65.39, 7...
mit
Martin09/E-BeamPatterns
111 Wafers - 1.2cm Triangles/111A Nanowires/v1.3/gdsCAD_v045/core.py
4
74577
# -*- coding: utf-8 -*- """ The primary geometry elements, layout and organization classes. The objects found here are intended to correspond directly to elements found in the GDSII specification. The fundamental gdsCAD object is the Layout, which contains all the information to be sent to the mask shop. A Layout can...
gpl-3.0
cactusbin/nyt
matplotlib/lib/matplotlib/pyplot.py
4
114926
# Note: The first part of this file can be modified in place, but the latter # part is autogenerated by the boilerplate.py script. """ Provides a MATLAB-like plotting framework. :mod:`~matplotlib.pylab` combines pyplot with numpy into a single namespace. This is convenient for interactive work, but for programming it ...
unlicense
Garrett-R/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
alorenzo175/pvlib-python
pvlib/iotools/surfrad.py
1
7027
""" Import functions for NOAA SURFRAD Data. """ import io from urllib.request import urlopen, Request import pandas as pd import numpy as np SURFRAD_COLUMNS = [ 'year', 'jday', 'month', 'day', 'hour', 'minute', 'dt', 'zen', 'dw_solar', 'dw_solar_flag', 'uw_solar', 'uw_solar_flag', 'direct_n', 'direct_n_fla...
bsd-3-clause
amueller/astro_hackweek
plots/plot_rbf_svm_parameters.py
15
2061
import matplotlib.pyplot as plt import numpy as np from sklearn.svm import SVC from sklearn.datasets import make_blobs from sklearn.externals.joblib import Memory from .plot_2d_separator import plot_2d_separator def make_handcrafted_dataset(): # a carefully hand-designed dataset lol X, y = make_blobs(centers=2...
bsd-2-clause
idlead/scikit-learn
sklearn/metrics/tests/test_classification.py
20
50188
from __future__ import division, print_function import numpy as np from scipy import linalg from functools import partial from itertools import product import warnings from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import la...
bsd-3-clause
ozsolarwind/siren
flexiplot.py
1
46585
#!/usr/bin/python3 # # Copyright (C) 2020-2021 Sustainable Energy Now Inc., Angus King # # flexiplot.py - This file is possibly part of SIREN. # # SIREN is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundati...
agpl-3.0
Ziqi-Li/bknqgis
pandas/pandas/core/reshape/merge.py
1
56841
""" SQL-style merge routines """ import copy import warnings import string import numpy as np from pandas.compat import range, lzip, zip, map, filter import pandas.compat as compat from pandas import (Categorical, Series, DataFrame, Index, MultiIndex, Timedelta) from pandas.core.frame import _mer...
gpl-2.0
gregcaporaso/scikit-bio
skbio/diversity/tests/test_util.py
4
10265
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
carpyncho/feets
feets/datasets/ogle3.py
1
9206
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2017 Juan Cabral # 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 withou...
mit
spallavolu/scikit-learn
sklearn/neighbors/regression.py
100
11017
"""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> # Multi-output support by Arna...
bsd-3-clause
carrillo/scikit-learn
sklearn/decomposition/pca.py
192
23117
""" 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
credp/lisa
external/workload-automation/wa/utils/misc.py
3
25178
# Copyright 2013-2018 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
hugobowne/scikit-learn
sklearn/linear_model/tests/test_theil_sen.py
58
9948
""" Testing for Theil-Sen module (sklearn.linear_model.theil_sen) """ # Author: Florian Wilhelm <florian.wilhelm@gmail.com> # License: BSD 3 clause from __future__ import division, print_function, absolute_import import os import sys from contextlib import contextmanager import numpy as np from numpy.testing import ...
bsd-3-clause
rs2/pandas
pandas/tests/plotting/test_boxplot_method.py
2
18166
import itertools import string import numpy as np from numpy import random import pytest import pandas.util._test_decorators as td from pandas import DataFrame, MultiIndex, Series, date_range, timedelta_range import pandas._testing as tm from pandas.tests.plotting.common import TestPlotBase, _check_plot_works impor...
bsd-3-clause
ericpre/hyperspy
hyperspy/drawing/_widgets/range.py
2
22610
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
gpl-3.0
ewulczyn/talk_page_abuse
src/analysis/load_utils.py
1
3146
import os import pandas as pd import re def load_diffs(keep_diff = False): nick_map = { 'talk_diff_no_admin_sample.tsv': 'sample', 'talk_diff_no_admin_2015.tsv': '2015', 'all_blocked_user.tsv': 'blocked', 'd_annotated.tsv': 'annotated', } base = '../../data/samples/' ...
apache-2.0
leeamen/eva
2017/tfidf.py
1
3251
# coding:utf-8 import jieba import jieba.posseg as pseg import os import sys from sklearn import feature_extraction from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import CountVectorizer from sklearn.ensemble import GradientBoostingClassifier import nump...
apache-2.0
kevin-intel/scikit-learn
examples/linear_model/plot_multi_task_lasso_support.py
77
2319
#!/usr/bin/env python """ ============================================= Joint feature selection with multi-task Lasso ============================================= The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected features to be the same across tasks. This example simulates...
bsd-3-clause
kernc/scikit-learn
sklearn/utils/tests/test_validation.py
56
18600
"""Tests for input validation functions""" import warnings from tempfile import NamedTemporaryFile from itertools import product import numpy as np from numpy.testing import assert_array_equal import scipy.sparse as sp from nose.tools import assert_raises, assert_true, assert_false, assert_equal from sklearn.utils....
bsd-3-clause
iandriver/RNA-sequence-tools
FPKM_Parsing/filter_outliers.py
2
13254
import os import fnmatch import pickle as pickle import numpy as np import pandas as pd from collections import OrderedDict import matplotlib.pyplot as plt #This section will take fpkm matrix input and make pandas dataframe #path to fpkm file (usually cuffnorm output) path_to_file = '/Volumes/Drobo/hisat2_chapmanh-hu...
mit
anirudhjayaraman/scikit-learn
sklearn/utils/tests/test_murmurhash.py
261
2836
# Author: Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import numpy as np from sklearn.externals.six import b, u from sklearn.utils.murmurhash import murmurhash3_32 from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal from nose.tools import assert_equa...
bsd-3-clause
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/event_handling/lasso_demo.py
3
2508
""" Show how to use a lasso to select a set of points and get the indices of the selected points. A callback is used to change the color of the selected points This is currently a proof-of-concept implementation (though it is usable as is). There will be some refinement of the API and the inside polygon detection ro...
gpl-2.0
wangmiao1981/spark
python/pyspark/pandas/extensions.py
11
12362
# # 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
wlamond/scikit-learn
sklearn/utils/tests/test_testing.py
29
7316
import warnings import unittest import sys from sklearn.utils.testing import ( assert_raises, assert_less, assert_greater, assert_less_equal, assert_greater_equal, assert_warns, assert_no_warnings, assert_equal, set_random_state, assert_raise_message, ignore_warnings) from ...
bsd-3-clause
ARudiuk/mne-python
examples/decoding/plot_decoding_spatio_temporal_source.py
5
5963
""" ========================== Decoding source space data ========================== Decoding, a.k.a MVPA or supervised machine learning applied to MEG data in source space on the left cortical surface. Here f-test feature selection is employed to confine the classification to the potentially relevant features. The cl...
bsd-3-clause
HeraclesHX/scikit-learn
sklearn/cluster/mean_shift_.py
106
14056
"""Mean shift clustering algorithm. Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to elim...
bsd-3-clause
LohithBlaze/scikit-learn
benchmarks/bench_plot_omp_lars.py
266
4447
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle regression (:ref:`least_angle_regression`) The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function import gc import sys from time import time import numpy as np from sklearn.linear_model impo...
bsd-3-clause
RobertABT/heightmap
build/matplotlib/examples/api/sankey_demo_rankine.py
7
3810
"""Demonstrate the Sankey class with a practicle example of a Rankine power cycle. """ import numpy as np import matplotlib.pyplot as plt from matplotlib.sankey import Sankey fig = plt.figure(figsize=(8, 9)) ax = fig.add_subplot(1, 1, 1, xticks=[], yticks=[], title="Rankine Power Cycle: Example 8...
mit
Horta/limix
limix/_data/_conform.py
1
10152
from __future__ import unicode_literals from collections import Counter from .._bits.dask import array_shape_reveal from .._bits.xarray import set_coord from .._bits.deco import return_none_if_none from ._dataarray import fix_dim_hint, rename_dims from ._data import is_data_name, is_short_data_name, to_data_name, get...
apache-2.0
gpetretto/pymatgen
pymatgen/vis/tests/test_plotters.py
7
1629
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import unittest import json from monty.json import MontyDecoder import numpy as np import matplotlib matplotlib.use("pdf") from pymatgen.util.testing import PymatgenTest from pymatgen.analysis.xas.s...
mit
bdestombe/flopy-1
flopy/utils/util_list.py
1
38930
""" util_list module. Contains the mflist class. This classes encapsulates modflow-style list inputs away from the individual packages. The end-user should not need to instantiate this class directly. some more info """ from __future__ import division, print_function import os import warnings i...
bsd-3-clause
sk2/ank_le
AutoNetkit/plotting/plot.py
1
11321
# -*- coding: utf-8 -*- """ Plotting """ __author__ = "\n".join(['Simon Knight']) # Copyright (C) 2009-2011 by Simon Knight, Hung Nguyen __all__ = ['plot', 'plot_graph', 'plot_paths'] import networkx as nx import AutoNetkit as ank import logging import os import pprint try: import matplotlib.cm as cm impor...
bsd-3-clause
trungnt13/scikit-learn
examples/neighbors/plot_regression.py
349
1402
""" ============================ Nearest Neighbors regression ============================ Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpolation of the target using both barycenter and constant weights. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@...
bsd-3-clause
henrykironde/scikit-learn
sklearn/covariance/tests/test_robust_covariance.py
213
3359
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
bsd-3-clause
malcolmw/SeismicPython
seispy/pandas/io/schema.py
3
2734
import os import pandas as pd import pickle import pkg_resources def get_schema(schema, ext=False): schema_file = pkg_resources.resource_filename("seispy", os.path.join("data", "schemas", ...
gpl-3.0
krzychb/rtd-test-bed
tools/tiny-test-fw/Utility/LineChart.py
1
1742
# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD # # 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
mne-tools/mne-tools.github.io
0.16/_downloads/ftclient_rt_compute_psd.py
18
2442
""" ============================================================== Compute real-time power spectrum density with FieldTrip client ============================================================== Please refer to `ftclient_rt_average.py` for instructions on how to get the FieldTrip connector working in MNE-Python. This e...
bsd-3-clause
jklenzing/pysat
pysat/instruments/icon_fuv.py
2
8464
# -*- coding: utf-8 -*- """Supports the Far Ultraviolet (FUV) imager onboard the Ionospheric CONnection Explorer (ICON) satellite. Accesses local data in netCDF format. Parameters ---------- platform : string 'icon' name : string 'fuv' tag : string None supported Warnings -------- - The cleaning paramete...
bsd-3-clause
bensondaled/pyfluo
pyfluo/sandbox/series_pd.py
1
6211
# External imports import pandas as pd, numpy as np, matplotlib.pyplot as pl from matplotlib.collections import LineCollection from matplotlib.colors import ListedColormap, BoundaryNorm import warnings # Internal imports from .config import * class Series(pd.DataFrame): """Series object """ _metadata = [...
bsd-2-clause
humdings/zipline
zipline/utils/cache.py
1
10994
""" Caching utilities for zipline """ from collections import MutableMapping import errno import os import pickle from distutils import dir_util from shutil import rmtree, move from tempfile import mkdtemp, NamedTemporaryFile import pandas as pd from .context_tricks import nop_context from .paths import ensure_direct...
apache-2.0