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
liangz0707/scikit-learn
sklearn/ensemble/gradient_boosting.py
50
67625
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
bsd-3-clause
YihaoLu/statsmodels
statsmodels/datasets/template_data.py
31
1680
#! /usr/bin/env python """Name of dataset.""" __docformat__ = 'restructuredtext' COPYRIGHT = """E.g., This is public domain.""" TITLE = """Title of the dataset""" SOURCE = """ This section should provide a link to the original dataset if possible and attribution and correspondance information for the da...
bsd-3-clause
empeeu/numpy
numpy/fft/fftpack.py
72
45497
""" Discrete Fourier Transforms Routines in this module: fft(a, n=None, axis=-1) ifft(a, n=None, axis=-1) rfft(a, n=None, axis=-1) irfft(a, n=None, axis=-1) hfft(a, n=None, axis=-1) ihfft(a, n=None, axis=-1) fftn(a, s=None, axes=None) ifftn(a, s=None, axes=None) rfftn(a, s=None, axes=None) irfftn(a, s=None, axes=None...
bsd-3-clause
great-expectations/great_expectations
great_expectations/expectations/core/expect_column_most_common_value_to_be_in_set.py
1
7938
from typing import Dict, List, Optional, Union import numpy as np import pandas as pd from great_expectations.core.batch import Batch from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.execution_engine import ExecutionEngine, PandasExecutionEngine from great...
apache-2.0
HenschelLab/EcoDist
ecoDistSQL2.py
1
11893
""" Creates an ecodistribution plot for a sample (from the database!) similar to qiime barplots plus a second dimension: for each OTU, the distribution over ecosystems is color coded/visualized Moreover ecosystem distribution entropy for each OTU in the sample is calculated for each otu: create a stats of Ecosystem o...
gpl-3.0
FEniCS/mshr
demo/python/deathstar.py
1
1161
# Copyright (C) 2015 Anders Logg # # This file is part of mshr. # # mshr 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 your option) any later version. # # mshr is di...
gpl-3.0
ycaihua/scikit-learn
sklearn/decomposition/tests/test_fastica.py
30
7560
""" Test the fastica algorithm. """ import itertools import numpy as np from scipy import stats from nose.tools import assert_raises from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testi...
bsd-3-clause
mattgiguere/scikit-learn
examples/linear_model/plot_ols.py
45
1985
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
bsd-3-clause
jpmckinney/inventory
inventory/management/commands/report.py
2
19601
import json import sys from collections import defaultdict from optparse import make_option from urllib.parse import urlparse import ckanapi import pandas as pd import lxml from django.db.models import Count from . import InventoryCommand from inventory.models import Dataset, Distribution from inventory.scrapers impo...
mit
JeanKossaifi/scikit-learn
sklearn/linear_model/coordinate_descent.py
59
76336
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
VirusTotal/msticpy
tests/test_ioc_extractor.py
1
10024
import unittest import pandas as pd # Test code from msticpy.sectools.iocextract import IoCExtract TEST_CASES = { "ipv4_test": r"c:\one\path\or\another\myprocess -ip4:206.123.1.123", "ipv6_test": r"""c:\one\path\or\another\myprocess -ip6:(2001:0db8:85a3:0000:0000:8a2e:0370:7334, 2001:db8:85a3:0:0:8a2e:37...
mit
amaggi/bda
chapter_02/ex_12.py
1
2104
import numpy as np import matplotlib.pyplot as plt from scipy.stats import poisson, norm, uniform from scipy.integrate import trapz from am_bda import get_pdf_quantiles NPTS = 100 NSIM = 1000 year = np.arange(10)+1976 accid = np.array([24, 25, 31, 31, 22, 21, 26, 20, 16, 22]) deaths = np.array([734, 516, 754, 877, 81...
gpl-2.0
cwhanse/pvlib-python
pvlib/shading.py
3
6761
""" The ``shading`` module contains functions that model module shading and the associated effects on PV module output """ import numpy as np import pandas as pd from pvlib.tools import sind, cosd def masking_angle(surface_tilt, gcr, slant_height): """ The elevation angle below which diffuse irradiance is bl...
bsd-3-clause
Elendurwen/pyCreeper
python/pyCreeper/crGraphStyle.py
1
10232
INVALID_VALUE = -999999; from enum import Enum, unique from matplotlib import pyplot; import matplotlib; from . import crHelpers; @unique class LEGEND_POSITION(Enum): BEST = "best" UPPER_RIGHT = "upper right" UPPER_LEFT = "upper left" LOWER_LEFT = "lower left" LOWER_RIGHT = "lower right" RIGHT = "ri...
lgpl-3.0
ChrisThoung/fsic
fsictools.py
1
3353
# -*- coding: utf-8 -*- """ fsictools ========= Supporting tools for FSIC-based economic models. See the individual docstrings for dependencies additional to those of `fsic`. """ # Version number keeps track with the main `fsic` module from fsic import __version__ import re from typing import Any, Dict, Hashable, Lis...
mit
tokestermw/hillary-clinton-emails
scripts/outputCsvs.py
5
3577
import numpy as np import pandas as pd def normalize_address(raw_address): for c in ["'", ",", "°", "•", "`", '"', "‘", "-"]: raw_address = raw_address.replace(c, "") raw_address = raw_address.lower() if "<" in raw_address: prefix = raw_address[:raw_address.index("<")].strip() if ...
mit
mdw771/tomosim
rmt_register_noise.py
1
4435
# -*- coding: utf-8 -*- """ This script works for shirley sample. """ import numpy as np import glob import dxchange import os import matplotlib.pyplot as plt import scipy.interpolate import tomopy from scipy.interpolate import Rbf from mpl_toolkits.mplot3d.axes3d import Axes3D from matplotlib import cm import tomosai...
apache-2.0
openpathsampling/openpathsampling
openpathsampling/analysis/tis/core.py
3
15834
import collections import openpathsampling as paths from openpathsampling.netcdfplus import StorableNamedObject from openpathsampling.progress import SimpleProgress import pandas as pd import numpy as np def steps_to_weighted_trajectories(steps, ensembles): """Bare function to convert to the weighted trajs dictio...
mit
trankmichael/numpy
numpy/lib/twodim_base.py
83
26903
""" Basic functions for manipulating 2d arrays """ from __future__ import division, absolute_import, print_function from numpy.core.numeric import ( asanyarray, arange, zeros, greater_equal, multiply, ones, asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal, ) from numpy.core import...
bsd-3-clause
dsockwell/trading-with-python
lib/vixFutures.py
79
4157
# -*- coding: utf-8 -*- """ set of tools for working with VIX futures @author: Jev Kuznetsov Licence: GPL v2 """ import datetime as dt from pandas import * import os import urllib2 #from csvDatabase import HistDataCsv m_codes = dict(zip(range(1,13),['F','G','H','J','K','M','N','Q','U','V','X','Z'])) #m...
bsd-3-clause
KrishnaswamyLab/PHATE
Python/test/test.py
1
6950
#!/usr/bin/env python # author: Daniel Burkhardt <daniel.burkhardt@yale.edu> # (C) 2017 Krishnaswamy Lab GPLv2 # Generating random fractal tree via DLA from __future__ import print_function, division, absolute_import import matplotlib matplotlib.use("Agg") # noqa import scprep import nose2 import os import phate imp...
gpl-2.0
yuanagain/seniorthesis
venv/lib/python2.7/site-packages/matplotlib/tests/test_patches.py
7
9432
""" Tests specific to the patches module. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import numpy as np from numpy.testing import assert_array_equal from numpy.testing import assert_equal from numpy.testing impo...
mit
tuos/FlowAndCorrelations
healpy/tutorial/realDataC.py
1
1429
import healpy as hp import numpy as np import matplotlib.pyplot as plt from matplotlib import cm # Set the number of sources and the coordinates for the input nsources = int(2664001) nside = 8 npix = hp.nside2npix(nside) # Coordinates and the density field f #thetas = np.random.random(nsources) * np.pi #phis = np.ran...
mit
krisanselmo/osm_wpt
osm_wpt_on_gpx.py
1
16359
# -*- coding: utf-8 -*- """ Created on Mon Oct 17 15:28:58 2016 @author: christophe.anselmo@gmail.com TODO: - Add the possibility to query ways with overpass |--> Fix double wpt - Keep old WPT (partially functional) - Add x kilometers before ending Last 2 km Last ...
gpl-3.0
lpryszcz/bin
modifications2signatures.py
1
10514
#!/usr/bin/env python desc="""Generate RT signatures for modifications """ epilog="""Author: l.p.pryszcz+git@gmail.com Warsaw, 1/12/2017 """ import os, sys reload(sys) sys.setdefaultencoding('utf8') import re, subprocess from datetime import datetime from collections import Counter from modifications2rna import f...
gpl-3.0
kuntzer/SALSA-public
5_statistics_error.py
1
5532
''' 5-statistics-error.py ========================= AIM: Perform basic statistics on the data and gets the maximal stray light flux for one orbit INPUT: files: - <orbit_id>_misc/orbits.dat variables: see section PARAMETERS (below) OUTPUT: in <orbit_id>_misc/ : file one stat file in <orbit_id>_figures/ : error evo...
bsd-3-clause
mkliegl/custom-sklearn
docs/conf.py
1
11851
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Custom scikit-learn estimators and transformers documentation build configuration file, created by # sphinx-quickstart on Sat Apr 9 14:26:23 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible confi...
mit
probcomp/bdbcontrib
src/bql_utils.py
1
16314
# -*- coding: utf-8 -*- # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # 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/LICENS...
apache-2.0
sinhrks/scikit-learn
sklearn/covariance/robust_covariance.py
105
29653
""" 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
JimHokanson/mendeley_python
mendeley/db_interface.py
2
9843
<<<<<<< HEAD __all__ = ['db_available','add_to_db'] ======= import math >>>>>>> a454f3d2717b10f207860099d8466b8333988a38 # Third party imports import pandas # Local imports <<<<<<< HEAD from mendeley.optional import MissingModule from mendeley.optional import db #Optional Imports #---------------------------------...
mit
OptimusCrime/personal-website
posts/static/34/modx_issues.py
1
3331
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib.request from bs4 import BeautifulSoup import matplotlib.pyplot as plt import matplotlib.dates as mdates import datetime as dt import time import numpy as np import gzip import pickle CURRENTLY_OPEN = 588 MAX_ISSUES = 6500 PAGES = 211 FETCH = False BASE_UR...
mit
JohnOrlando/gnuradio-bitshark
gr-utils/src/python/plot_data.py
5
5834
# # Copyright 2007,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later versi...
gpl-3.0
JackKelly/neuralnilm_prototype
scripts/e427.py
2
6384
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
mmisamore/intro-data-science
chapter2/maxTemp.py
1
1394
import pandas import pandasql def max_temp_aggregate_by_fog(filename): ''' This function should run a SQL query on a dataframe of weather data. The SQL query should return two columns and two rows - whether it was foggy or not (0 or 1) and the max maxtempi for that fog value (i.e., the maximum max...
mit
idlead/scikit-learn
examples/tree/unveil_tree_structure.py
67
4824
""" ========================================= Understanding the decision tree structure ========================================= The decision tree structure can be analysed to gain further insight on the relation between the features and the target to predict. In this example, we show how to retrieve: - the binary t...
bsd-3-clause
Titan-C/scikit-learn
examples/cluster/plot_dict_face_patches.py
9
2747
""" Online learning of a dictionary of parts of faces ================================================== This example uses a large dataset of faces to learn a set of 20 x 20 images patches that constitute faces. From the programming standpoint, it is interesting because it shows how to use the online API of the sciki...
bsd-3-clause
maropu/spark
python/pyspark/pandas/tests/plot/test_frame_plot_matplotlib.py
14
18666
# # 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
PanDAWMS/panda-server
pandaserver/test/testEvgen.py
1
1834
import sys import time import uuid import pandaserver.userinterface.Client as Client from pandaserver.taskbuffer.JobSpec import JobSpec from pandaserver.taskbuffer.FileSpec import FileSpec if len(sys.argv)>1: site = sys.argv[1] else: site = None datasetName = 'panda.destDB.%s' % str(uuid.uuid4()) destName ...
apache-2.0
harshaneelhg/scikit-learn
examples/linear_model/plot_ard.py
248
2622
""" ================================================== Automatic Relevance Determination Regression (ARD) ================================================== Fit regression model with Bayesian Ridge Regression. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary l...
bsd-3-clause
aev3/trading-with-python
spreadApp/makeDist.py
77
1720
from distutils.core import setup import py2exe manifest_template = ''' <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="5.0.0.0" processorArchitecture="x86" name="%(prog)s" type="win32"...
bsd-3-clause
jorge2703/scikit-learn
examples/ensemble/plot_ensemble_oob.py
259
3265
""" ============================= OOB Errors for Random Forests ============================= The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where each new tree is fit from a bootstrap sample of the training observations :math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er...
bsd-3-clause
Nanguage/BioInfoCollections
HiC/virtual4C/stats_v4c.py
1
10478
import re from itertools import tee from os.path import join import os import time from concurrent.futures import ProcessPoolExecutor from itertools import repeat, tee from datetime import datetime from collections import namedtuple import numpy as np import click import pandas as pd import h5py from tqdm import tqdm ...
gpl-3.0
jzt5132/scikit-learn
examples/manifold/plot_lle_digits.py
59
8576
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
bsd-3-clause
fmfn/UnbalancedDataset
imblearn/under_sampling/_prototype_selection/_nearmiss.py
2
10215
"""Class to perform under-sampling based on nearmiss methods.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # Christos Aridas # License: MIT import warnings from collections import Counter import numpy as np from sklearn.utils import _safe_indexing from ..base import BaseUnderSampler from ...u...
mit
OpenANN/OpenANN
examples/sine/sine.py
5
1262
## \page Sine Sine # # \section DataSet Data Set # # In this example, a sine function will be approximated from noisy measurements. # This is an example for nonlinear regression. To run this example, you have # to install matplotlib. It is a plotting library for Python. # # \section Code # # \include "sine/sine.py" tr...
gpl-3.0
VariationalResearch/Polaron
fmquench.py
1
4969
from polrabi.quench import * import matplotlib import matplotlib.pyplot as plt from timeit import default_timer as timer import os from scipy.integrate import trapz from polrabi.staticfm import PCrit # # Initialization matplotlib.rcParams.update({'font.size': 12, 'text.usetex': True}) # mI = 1 # mB = 1 # n0 = 1 # g...
mit
ycasg/PyNLO
src/examples/fundamental_SSFM.py
2
3269
# -*- coding: utf-8 -*- """ Created on Mon Apr 21 13:29:08 2014 This file is part of pyNLO. pyNLO 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 your optio...
gpl-3.0
alivecor/tensorflow
tensorflow/contrib/timeseries/examples/lstm.py
17
9460
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
raghavrv/scikit-learn
examples/linear_model/plot_iris_logistic.py
119
1679
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <https://en.wikipedia.org/wiki/Iris_...
bsd-3-clause
nesterione/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
thilbern/scikit-learn
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
duncanmmacleod/gwpy
gwpy/frequencyseries/tests/test_frequencyseries.py
3
10897
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2014-2020) # # This file is part of GWpy. # # GWpy 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 your option)...
gpl-3.0
cle1109/scot
doc/source/conf.py
4
8800
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # SCoT documentation build configuration file, created by # sphinx-quickstart on Thu Jan 23 12:52:18 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 # autogen...
mit
Kirubaharan/hydrology
weather/evap_noyyal.py
2
2845
__author__ = 'kiruba' import numpy as np import matplotlib.pyplot as plt import pandas as pd import itertools import checkdam.evaplib as evap import checkdam.meteolib as met from Pysolar import solar import datetime noyyal_evap_file = "/home/kiruba/PycharmProjects/area_of_curve/hydrology/hydrology/weather/weather_evap...
gpl-3.0
e-koch/VLA_Lband
14B-088/Lines/OH_maser_figure.py
1
5676
''' Research note figure on the OH(1665) detection ''' from spectral_cube import SpectralCube, Projection from aplpy import FITSFigure from astropy.io import fits import pyregion from os.path import join as osjoin from astropy.wcs.utils import proj_plane_pixel_area import astropy.units as u import numpy as np import ...
mit
MartinSavc/scikit-learn
examples/linear_model/plot_logistic_path.py
349
1195
#!/usr/bin/env python """ ================================= Path with L1- Logistic Regression ================================= Computes path on IRIS dataset. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from datetime import datetime import numpy as np import...
bsd-3-clause
airanmehr/bio
Scripts/KyrgysHAPH/GenomeAFS.py
1
1365
''' Copyleft Feb 11, 2017 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com ''' import numpy as np; np.set_printoptions(linewidth=200, precision=5, suppress=True) import pandas as pd; pd.options.display.max_rows = 20; pd.options.display.expand_frame_repr = False import pylab as plt; imp...
mit
CDNoyes/EDL-Py
EntryGuidance/EntryPlots.py
1
2981
import pickle import time import numpy as np import pandas as pd import matplotlib.pyplot as plt import os from Planet import Planet def EntryPlots(tr, figsize=(10,6), fontsize=20, ticksize=16, savedir=None, fignum_offset=0, label=None, plot_kw={}, grid=True): """ Takes a dataframe and plots all the things one...
gpl-3.0
dssg/wikienergy
disaggregator/build/pandas/pandas/tests/test_rplot.py
4
11485
# -*- coding: utf-8 -*- from pandas.compat import range import pandas.tools.rplot as rplot import pandas.util.testing as tm from pandas import read_csv import os import nose def curpath(): pth, _ = os.path.split(os.path.abspath(__file__)) return pth def between(a, b, x): """Check if x is in the somewhe...
mit
jaredweiss/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/delaunay/triangulate.py
70
7732
import warnings try: set except NameError: from sets import Set as set import numpy as np from matplotlib._delaunay import delaunay from interpolate import LinearInterpolator, NNInterpolator __all__ = ['Triangulation', 'DuplicatePointWarning'] class DuplicatePointWarning(RuntimeWarning): """Duplicate p...
gpl-3.0
ch3ll0v3k/scikit-learn
sklearn/utils/tests/test_utils.py
215
8100
import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import pinv2 from itertools import chain from sklearn.utils.testing import (assert_equal, assert_raises, assert_true, assert_almost_equal, assert_array_equal, SkipTest, ...
bsd-3-clause
bert9bert/statsmodels
statsmodels/tools/tools.py
1
16985
''' Utility functions models code ''' from statsmodels.compat.python import reduce, lzip, lmap, asstr2, range, long import numpy as np import numpy.lib.recfunctions as nprf import numpy.linalg as L from scipy.linalg import svdvals import pandas as pd from statsmodels.datasets import webuse from statsmodels.tools.data ...
bsd-3-clause
gregvonkuster/tools-iuc
tools/heinz/heinz_scoring.py
21
3661
#!/usr/bin/env python """Calculate scores for Heinz. This script transform a p-value into a score: 1. Use alpha and lambda to calculate a threshold P-value. 2. Calculate a score based on each P-value by alpha and the threshold. For more details, please refer to the paper doi:10.1093/bioinformatics/btn161 Inp...
mit
eg-zhang/scikit-learn
examples/model_selection/plot_roc.py
96
4487
""" ======================================= 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
amsjavan/nazarkav
nazarkav/cleaning_old.py
1
1737
from bs4 import BeautifulSoup import hazm import pandas as pd class Cleaning(): def __init__(self, dataset_path=None, tag=False, spelling=False, marker=False, normalize=False): self.dataset_path = dataset_path sel...
mit
pedroig/Parkinsons-Disease-Digital-Biomarker
Features/splitSets.py
1
6324
import pandas as pd import numpy as np import utils from sklearn.model_selection import train_test_split def generateSetTables(augmentFraction=0.5, quickSplit=False): """ Generates all the tables used by the machine learning models, distributing the dataset in training, validation and test sets. Warni...
mit
grhawk/ASE
ase/test/fio/oi.py
2
2234
import sys import numpy as np from ase import Atoms from ase.io import write, read a = 5.0 d = 1.9 c = a / 2 atoms = Atoms('AuH', positions=[(c, c, 0), (c, c, d)], cell=(a, a, 2 * d), pbc=(0, 0, 1)) extra = np.array([ 2.3, 4.2 ]) atoms.set_array('extra', extra) atoms *= (1, 1...
gpl-2.0
DTUWindEnergy/FUSED-Wake
fusedwake/Plotting.py
1
2782
"""Plotting tools @moduleauthor:: Juan P. Murcia <jumu@dtu.dk> """ import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle from matplotlib.collections import PatchCollection def circles(x, y, s, c='b', vmin=None, vmax=None, **kwargs): """ Make a scatter of circles plot of x ...
mit
mmb90/dftintegrate
dftintegrate/fourier/converge.py
1
5132
""" Classes:: Converge -- A collection of functions that loop over the number of integration points, calling integratedata, and then recording and plotting the convergence rate of the rectangles to the convergence rate of Gaussian quadrature. """ import os import json import numpy as np import matplotlib...
mit
vortex-ape/scikit-learn
examples/model_selection/plot_confusion_matrix.py
13
3232
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
bsd-3-clause
anurag313/scikit-learn
sklearn/manifold/t_sne.py
48
20644
# Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de> # License: BSD 3 clause (C) 2014 # This is the standard t-SNE implementation. There are faster modifications of # the algorithm: # * Barnes-Hut-SNE: reduces the complexity of the gradient computation from # N^2 to N log N (http://arxiv.org/abs/1301....
bsd-3-clause
cpcloud/odo
odo/backends/tests/test_hdfs.py
9
9782
from __future__ import absolute_import, division, print_function import pytest import os pywebhdfs = pytest.importorskip('pywebhdfs') pyhive = pytest.importorskip('pyhive') host = os.environ.get('HDFS_TEST_HOST') pytestmark = pytest.mark.skipif(host is None, reason='No HDFS_TEST_HOST ...
bsd-3-clause
openego/eTraGo
doc/conf.py
1
12465
"""This file is part of eTraGO It is developed in the project open_eGo: https://openegoproject.wordpress.com eTraGo lives at github: https://github.com/openego/etrago/ The documentation is available on RTD: https://etrago.readthedocs.io""" __copyright__ = "Flensburg University of Applied Sciences, Europa-Universitä...
agpl-3.0
espenhgn/nest-simulator
doc/guides/spatial/user_manual_scripts/layers.py
17
11076
# -*- coding: utf-8 -*- # # layers.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, or # (a...
gpl-2.0
sstoma/CellProfiler
cellprofiler/modules/tests/test_saveimages.py
2
106636
"""test_saveimages - test the saveimages module CellProfiler is distributed under the GNU General Public License. See the accompanying file LICENSE for details. Copyright (c) 2003-2009 Massachusetts Institute of Technology Copyright (c) 2009-2015 Broad Institute All rights reserved. Please see the AUTHORS file for c...
gpl-2.0
vibhorag/scikit-learn
sklearn/neighbors/tests/test_approximate.py
71
18815
""" Testing for the approximate neighbor search using Locality Sensitive Hashing Forest module (sklearn.neighbors.LSHForest). """ # Author: Maheshakya Wijewardena, Joel Nothman import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_a...
bsd-3-clause
Jokiva/Computational-Physics
lecture 5/Problem 2/Problem 2.py
1
1732
#!/home/jzhong/.anaconda3/bin/python # import pacages import numpy as np import matplotlib.pyplot as plt # the equation to be solved f = lambda x: 4 * np.cos(x) - np.exp(x) # this function returns # the derivative of f at x=x0 # with step epsilon / 100 # def deri(f, x0, delta): # return (f(x0+delta) - f(x0)) / ...
gpl-3.0
fredhusser/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
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/matplotlib/backends/backend_cocoaagg.py
11
9980
""" backend_cocoaagg.py A native Cocoa backend via PyObjC in OSX. Author: Charles Moad (cmoad@users.sourceforge.net) Notes: - Requires PyObjC (currently testing v1.3.7) - The Tk backend works nicely on OSX. This code primarily serves as an example of embedding a matplotlib rendering context into a c...
mit
iancrossfield/aries_reduce
observing.py
1
17350
""" A main driver function is :func:`makeAnnualChart` """ import ephem import numpy as np from scipy import ndimage import pylab as py import pdb from tools import isstring def makeAnnualChart(obs, ra, dec, minElevation=30, twilight=12, oversamp=16, dt=0): """ Make pretty plots of target visibility during the...
mit
b-carter/numpy
numpy/lib/tests/test_type_check.py
7
13103
from __future__ import division, absolute_import, print_function import numpy as np from numpy.compat import long from numpy.testing import ( assert_, assert_equal, assert_array_equal, run_module_suite, assert_raises ) from numpy.lib.type_check import ( common_type, mintypecode, isreal, iscomplex, isposinf...
bsd-3-clause
anirudhjayaraman/scikit-learn
sklearn/mixture/tests/test_dpgmm.py
261
4490
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
bsd-3-clause
DonghoChoi/Exploration_Study
local/extract_query_from_field_search.py
2
5318
#!/usr/bin/python # Author: Dongho Choi import math import pandas as pd from math import log from sshtunnel import SSHTunnelForwarder # for SSH connection import pymysql.cursors # MySQL handling API import sys import datetime import time sys.path.append("./configs/") import server_config # (1) info2_server (2) explora...
gpl-3.0
paalge/scikit-image
doc/source/conf.py
1
12382
# -*- coding: utf-8 -*- # # skimage documentation build configuration file, created by # sphinx-quickstart on Sat Aug 22 13:00:30 2009. # # 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. # # All...
bsd-3-clause
rabrahm/ceres
pucheros/pucherosutils.py
1
10415
import sys import matplotlib matplotlib.use("Agg") base = '../' sys.path.append(base+"utils/GLOBALutils") import GLOBALutils import numpy as np import scipy from astropy.io import fits as pyfits import os import glob import tempfile import StringIO import pycurl from pylab import * def is_there(string, word): l=l...
mit
mwaskom/seaborn
seaborn/tests/test_categorical.py
2
113325
import itertools from functools import partial import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.colors import rgb2hex, to_rgb, to_rgba import pytest from pytest import approx import numpy.testing as npt from distutils.version import LooseVersion from nump...
bsd-3-clause
keguoh/queue-systems
extract_data.py
1
1043
import pyodbc as po import numpy as np import matplotlib.pyplot as plt DBfile = 'C:/Users/huangke.PHIBRED/Dropbox/Research/3RD PROJECT/HomeHospital/database/April2004/April2004.mdb' conn = po.connect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ='+DBfile) # Install https://www.microsoft.com/en-us/download/co...
apache-2.0
detrout/debian-statsmodels
statsmodels/discrete/tests/test_discrete.py
8
55883
""" Tests for discrete models Notes ----- DECIMAL_3 is used because it seems that there is a loss of precision in the Stata *.dta -> *.csv output, NOT the estimator for the Poisson tests. """ # pylint: disable-msg=E1101 from statsmodels.compat.python import range import os import numpy as np from numpy.testing import ...
bsd-3-clause
wallinm1/kaggle-loan-default
train.py
1
10162
import numpy as np import time from sklearn import linear_model from sklearn.externals import joblib from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import GradientBoostingRegressor from sklearn.cross_validation import ShuffleSplit from sklearn.svm import SVR from sklearn.metrics import f1...
mit
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/numpy/core/tests/test_multiarray.py
2
220131
from __future__ import division, absolute_import, print_function import collections import tempfile import sys import shutil import warnings import operator import io import itertools if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins from decimal import Decimal import numpy as...
gpl-2.0
orbitfold/tardis
tardis/io/model_reader.py
3
8790
#reading different model files import numpy as np from numpy import recfromtxt, genfromtxt import pandas as pd from astropy import units as u import logging # Adding logging support logger = logging.getLogger(__name__) from tardis.util import parse_quantity class ConfigurationError(Exception): pass def read_d...
bsd-3-clause
Titan-C/slaveparticles
examples/spins/plot_deg_2orb_fill.py
1
2126
# -*- coding: utf-8 -*- """ ========================================== Reconstructing a Coulomb occupation ladder ========================================== Filling of the 2 degenerate orbitals of an atom in function of the chemical potential """ from scipy.special import binom from scipy.optimize import fsolve from ...
gpl-3.0
bharcode/Kaggle
JobSalaryPrediction/features.py
6
1625
import numpy as np from sklearn.base import BaseEstimator from HTMLParser import HTMLParser class FeatureMapper: def __init__(self, features): self.features = features def fit(self, X, y=None): for feature_name, column_name, extractor in self.features: extractor.fit(X[column_name],...
gpl-2.0
bhargav/scikit-learn
benchmarks/bench_covertype.py
120
7381
""" =========================== Covertype dataset benchmark =========================== Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART (decision tree), RandomForest and Extra-Trees on the forest covertype dataset of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ...
bsd-3-clause
mitschabaude/nanopores
scripts/plot_forces_How/plot_drag.py
1
3257
from matplotlib import rc rc('font',**{'family':'serif','serif':['Palatino']}) rc('text', usetex=True) #import colormaps from matplotlib import cm from math import sqrt import matplotlib.pyplot as plt import matplotlib.path as mplPath import numpy as np from calculateforce import loadforces Fel_, Fdrag_ = loadforces() ...
mit
fe114/CCI_LAND
atsr.py
1
6351
#--------------------------------------------------------------------------------------------- # Name: Module containing ATSR file read functions # Functions: aerosol_file_info, aerosol_file_attributes, seasonal anomalies # History: # 07/27/17 MC: add ATSR filename reader module for aerosol files # 08/20/17 FE: ad...
gpl-3.0
rahul-c1/scikit-learn
sklearn/decomposition/tests/test_nmf.py
33
6189
import numpy as np from scipy import linalg from sklearn.decomposition import nmf from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import raises from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_gr...
bsd-3-clause
steffengraber/nest-simulator
pynest/examples/glif_psc_neuron.py
14
9617
# -*- coding: utf-8 -*- # # glif_psc_neuron.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
rcarmo/crab
utils.py
1
2482
import pandas as pd import numpy as np def split_data_points(data_points, n_train): # data_points: [(u1, i1, r1), (u2, i2, r2), ...] import random import copy _data_points = copy.deepcopy(data_points) # shuffle is an in-place operation random.shuffle(_data_points) train_data_points = _data_...
bsd-3-clause
pllim/astropy
astropy/conftest.py
6
5477
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This file contains pytest configuration settings that are astropy-specific (i.e. those that would not necessarily be shared by affiliated packages making use of astropy's test runner). """ import os import builtins import sys import tempfile import wa...
bsd-3-clause