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
aayushidwivedi01/spark-tk
regression-tests/sparktkregtests/testcases/graph/graph_clustering_coefficient_test.py
13
2059
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
rajat1994/scikit-learn
examples/model_selection/plot_underfitting_overfitting.py
230
2649
""" ============================ Underfitting vs. Overfitting ============================ This example demonstrates the problems of underfitting and overfitting and how we can use linear regression with polynomial features to approximate nonlinear functions. The plot shows the function that we want to approximate, wh...
bsd-3-clause
DSLituiev/scikit-learn
examples/ensemble/plot_bias_variance.py
357
7324
""" ============================================================ Single estimator versus bagging: bias-variance decomposition ============================================================ This example illustrates and compares the bias-variance decomposition of the expected mean squared error of a single estimator again...
bsd-3-clause
ningchi/scikit-learn
examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py
252
3490
#!/usr/bin/python # -*- coding: utf-8 -*- """ ============================================================================== Gaussian Processes classification example: exploiting the probabilistic output ============================================================================== A two-dimensional regression exerci...
bsd-3-clause
maciekswat/dolfin_1.3.0
bench/plot.py
4
8210
#!/usr/bin/env python """ This script parses logs/bench.log and create plots for each case with the timings function of time (date plot). It also creates a web page index.html for easy viewing of the generated plots. """ # Copyright (C) 2010 Johannes Ring # # This file is part of DOLFIN. # # DOLFIN is free software: ...
gpl-3.0
mpharrigan/msmbuilder
Tutorial/PlotDihedrals.py
2
2998
#!/usr/bin/env python # This file is part of MSMBuilder. # # Copyright 2011 Stanford University # # MSMBuilder 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 # (at your opt...
gpl-2.0
haripradhan/MissionPlanner
Lib/site-packages/numpy/lib/recfunctions.py
58
34495
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ import sys import itertools import numpy as np import numpy.ma as ma from numpy import ndarray, recarray from nump...
gpl-3.0
chanceraine/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qtagg.py
73
4972
""" Render to qt from agg """ from __future__ import division import os, sys import matplotlib from matplotlib import verbose from matplotlib.figure import Figure from backend_agg import FigureCanvasAgg from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\ show, draw_if_interactive, backend_version, \ ...
agpl-3.0
rseubert/scikit-learn
sklearn/neighbors/tests/test_ball_tree.py
30
9727
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.dist_metrics impo...
bsd-3-clause
liangjg/openmc
tests/regression_tests/filter_energyfun/test.py
8
1854
import openmc import pytest from tests.testing_harness import PyAPITestHarness @pytest.fixture def model(): model = openmc.model.Model() m = openmc.Material() m.set_density('g/cm3', 10.0) m.add_nuclide('Am241', 1.0) model.materials.append(m) s = openmc.Sphere(r=100.0, boundary_type='vacuum'...
mit
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pandas/tests/tslibs/test_parsing.py
2
6119
""" Tests for Timestamp parsing, aimed at pandas/_libs/tslibs/parsing.pyx """ from datetime import datetime from dateutil.parser import parse import numpy as np import pytest from pandas._libs.tslibs import parsing from pandas._libs.tslibs.parsing import parse_time_string import pandas.util._test_decorators as td fr...
apache-2.0
endolith/scikit-image
doc/examples/segmentation/plot_peak_local_max.py
6
1443
""" ==================== Finding local maxima ==================== The ``peak_local_max`` function returns the coordinates of local peaks (maxima) in an image. A maximum filter is used for finding local maxima. This operation dilates the original image and merges neighboring local maxima closer than the size of the di...
bsd-3-clause
ilo10/scikit-learn
sklearn/grid_search.py
103
36232
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
bsd-3-clause
jerkern/pyParticleEst
test/manual/paramest/standard_nonlin_model_psaem.py
1
9189
import numpy import math import pyparticleest.utils.kalman as kalman import pyparticleest.interfaces as interfaces import pyparticleest.paramest.paramest as param_est import pyparticleest.paramest.interfaces as pestint import matplotlib.pyplot as plt import scipy.optimize def generate_dataset(steps, P0, Q, R): x ...
lgpl-3.0
natasasdj/OpenWPM
analysis/13_nonregularties.py
1
1067
import sqlite3 import pandas as pd from shutil import copyfile import os data_dir = '/home/nsarafij/project/data/' out_dir = '/home/nsarafij/project/OpenWPM/analysis/nonregular/0-pixel_images/' db = '/home/nsarafij/project/OpenWPM/analysis/results/images.sqlite' conn= sqlite3.connect(db) query = 'SELECT * FROM Images...
gpl-3.0
xubenben/scikit-learn
sklearn/svm/tests/test_sparse.py
32
12988
from nose.tools import assert_raises, assert_true, assert_false import numpy as np from scipy import sparse from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classif...
bsd-3-clause
dch312/scipy
scipy/special/add_newdocs.py
8
70142
# Docstrings for generated ufuncs # # The syntax is designed to look like the function add_newdoc is being # called from numpy.lib, but in this file add_newdoc puts the # docstrings in a dictionary. This dictionary is used in # generate_ufuncs.py to generate the docstrings for the ufuncs in # scipy.special at the C lev...
bsd-3-clause
jostep/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
liberatorqjw/scikit-learn
examples/model_selection/plot_roc_crossval.py
247
3253
""" ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cross-validation. ROC curv...
bsd-3-clause
bhermanmit/openmc
openmc/universe.py
1
18631
from __future__ import division from copy import copy from collections import OrderedDict, Iterable from numbers import Integral, Real import random import sys from six import string_types import numpy as np import openmc import openmc.checkvalue as cv from openmc.plots import _SVG_COLORS # A static variable for au...
mit
open-mmlab/mmdetection
tools/analysis_tools/analyze_logs.py
1
6252
import argparse import json from collections import defaultdict import matplotlib.pyplot as plt import numpy as np import seaborn as sns def cal_train_time(log_dicts, args): for i, log_dict in enumerate(log_dicts): print(f'{"-" * 5}Analyze train time of {args.json_logs[i]}{"-" * 5}') all_times = ...
apache-2.0
gpengzhi/gpengzhi.github.io
markdown_generator/publications.py
197
3887
# coding: utf-8 # # Publications markdown generator for academicpages # # Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_g...
mit
miramzz/sentiment
student_sentiment/skeleton.py
1
5194
import sys, os import numpy as np from operator import itemgetter as ig from sklearn.linear_model import LogisticRegression as LR import random vocab = [] #the features used in the classifier pos_dir = "/Users/muazzezmira/projects/sentiment/sentiment/student_sentiment/pos/" neg_dir = "/Users/muazzezmira/projects/senti...
mit
larsoner/mne-python
mne/viz/_3d.py
2
137424
# -*- coding: utf-8 -*- """Functions to make 3D plots with M/EEG data.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Mainak Jas <maina...
bsd-3-clause
robert-digit/superset
superset/connectors/sqla/models.py
2
25725
from datetime import datetime import logging import sqlparse from past.builtins import basestring import pandas as pd from sqlalchemy import ( Column, Integer, String, ForeignKey, Text, Boolean, DateTime, ) import sqlalchemy as sa from sqlalchemy import asc, and_, desc, select from sqlalchemy.ext.compiler imp...
apache-2.0
ldirer/scikit-learn
examples/manifold/plot_compare_methods.py
52
3878
""" ========================================= Comparison of Manifold Learning methods ========================================= An illustration of dimensionality reduction on the S-curve dataset with various manifold learning methods. For a discussion and comparison of these algorithms, see the :ref:`manifold module...
bsd-3-clause
herilalaina/scikit-learn
sklearn/utils/extmath.py
20
24891
""" Extended math utilities. """ # Authors: Gael Varoquaux # Alexandre Gramfort # Alexandre T. Passos # Olivier Grisel # Lars Buitinck # Stefan van der Walt # Kyle Kastner # Giorgio Patrini # License: BSD 3 clause from __future__ import division import war...
bsd-3-clause
bzero/statsmodels
examples/python/regression_plots.py
33
9585
## Regression Plots from __future__ import print_function from statsmodels.compat import lzip import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import ols ### Duncan's Prestige Dataset #### Load the Data # We can use a utility function...
bsd-3-clause
ngoix/OCRF
examples/cluster/plot_cluster_iris.py
350
2593
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= K-means Clustering ========================================================= The plots display firstly what a K-means algorithm would yield using three clusters. It is then shown what the effect of a bad initializa...
bsd-3-clause
snnn/tensorflow
tensorflow/contrib/gan/python/estimator/python/stargan_estimator_test.py
13
12094
# 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
RomainBrault/scikit-learn
examples/gaussian_process/plot_gpc.py
103
3927
""" ==================================================================== Probabilistic predictions with Gaussian process classification (GPC) ==================================================================== This example illustrates the predicted probability of GPC for an RBF kernel with different choices of the hy...
bsd-3-clause
rajat1994/scikit-learn
benchmarks/bench_plot_svd.py
325
2899
"""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 from scipy.linalg import svd from sklearn.utils.extmath import randomized_svd from sklearn.datasets.s...
bsd-3-clause
raghavrv/scikit-learn
examples/ensemble/plot_forest_importances_faces.py
403
1519
""" ================================================= Pixel importances with a parallel forest of trees ================================================= This example shows the use of forests of trees to evaluate the importance of the pixels in an image classification task (faces). The hotter the pixel, the more impor...
bsd-3-clause
amolkahat/pandas
pandas/tests/tseries/offsets/test_offsets.py
1
131392
from distutils.version import LooseVersion from datetime import date, datetime, timedelta import pytest import pytz from pandas.compat import range from pandas import compat import numpy as np from pandas.compat.numpy import np_datetime64_compat from pandas.core.series import Series from pandas._libs.tslibs import ...
bsd-3-clause
mvpossum/machine-learning
tp2/plot_2d_dataset.py
2
1362
#! /usr/bin/env python #Read arguments from sys import argv if len(argv)!=2: print("Usage: {} <dataset_name>".format(argv[0])) exit(1) PREFIX=argv[1] #Read data import csv DATA_FILE=PREFIX x,y,clase=[],[],[] with open(DATA_FILE,'r') as f: reader = csv.reader(f) for row in reader: if '\t' in r...
mit
pnedunuri/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
Martinfx/yodaqa
data/ml/forest_graphviz.py
3
5896
""" This module defines export functions for decision trees and forests. """ # Based on the export_graphviz module. # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satraji...
apache-2.0
Neurita/darwin
darwin/features.py
1
7893
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ #Authors: # Alexandre Manhaes Savio <alexsavio@gmail.com> # Darya Chyzhyk <darya.chyzhyk@gmail.com> # Borja Ayerdi <ayerdi.borja@gmail.com> # Grupo de Inteligencia Computational <www.ehu.es/ccwintco> # # BSD 3-Claus...
bsd-3-clause
Eric89GXL/scikit-learn
examples/ensemble/plot_gradient_boosting_regression.py
8
2490
""" ============================ Gradient Boosting regression ============================ Demonstrate Gradient Boosting on the boston housing dataset. This example fits a Gradient Boosting model with least squares loss and 500 regression trees of depth 4. """ print(__doc__) # Author: Peter Prettenhofer <peter.prett...
bsd-3-clause
rosswhitfield/mantid
qt/python/mantidqt/widgets/sliceviewer/lineplots.py
3
14766
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
warmspringwinds/scikit-image
doc/examples/plot_ssim.py
15
2238
""" =========================== Structural similarity index =========================== When comparing images, the mean squared error (MSE)--while simple to implement--is not highly indicative of perceived similarity. Structural similarity aims to address this shortcoming by taking texture into account [1]_, [2]_. T...
bsd-3-clause
QuLogic/burnman
examples/example_premite_isothermal.py
1
3877
# BurnMan - a lower mantle toolkit # Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S. # Released under GPL v2 or later. """ This example is under construction. requires: teaches: """ import os, sys, numpy as np, matplotlib.pyplot as plt #hack to allow scripts to be placed in subdirec...
gpl-2.0
ottogroup/dstoolbox
dstoolbox/transformers/tests/test_slicing.py
1
6971
"""Tests for transformers.slicing.py.""" import numpy as np import pandas as pd from pandas.testing import assert_frame_equal import pytest class TestItemSelector: @pytest.fixture def item_selector_cls(self): from dstoolbox.transformers import ItemSelector return ItemSelector @pytest.fix...
apache-2.0
ConeyLiu/spark
python/pyspark/testing/sqlutils.py
9
7813
# # 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
smile4life/uwaterloo-igem-2015
models/tridimensional/data_kleinstiver/cas9_mutants_stats.py
8
9578
""" Gathering statistics on the Cas9 mutants that were able to bind alternative PAMs TODO: - mutations which always co-occur (regionally? or by AA class?) - mutations which co-occur between NGA and NGC PAMs - mutations which differ between NGA and NGC PAMs """ import operator import numpy as np import matplotlib.pyplo...
mit
raincoatrun/basemap
examples/barb_demo.py
4
2853
from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt # read in data. file = open('fcover.dat','r') ul=[];vl=[];pl=[] nlons=73; nlats=73 dellat = 2.5; dellon = 5. for line in file.readlines(): l = line.replace('\n','').split() ul.append(float(l[0])) vl.append(float(l[1]))...
gpl-2.0
vantares/trading-with-python
cookbook/reconstructVXX/downloadVixFutures.py
77
3012
#------------------------------------------------------------------------------- # Name: download CBOE futures # Purpose: get VIX futures data from CBOE, process data to a single file # # # Created: 15-10-2011 # Copyright: (c) Jev Kuznetsov 2011 # Licence: BSD #-----------------------------...
bsd-3-clause
Dapid/numpy
numpy/doc/creation.py
118
5507
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
bsd-3-clause
aborovin/trading-with-python
cookbook/reconstructVXX/downloadVixFutures.py
77
3012
#------------------------------------------------------------------------------- # Name: download CBOE futures # Purpose: get VIX futures data from CBOE, process data to a single file # # # Created: 15-10-2011 # Copyright: (c) Jev Kuznetsov 2011 # Licence: BSD #-----------------------------...
bsd-3-clause
miloharper/neural-network-animation
matplotlib/testing/jpl_units/UnitDblFormatter.py
23
1485
#=========================================================================== # # UnitDblFormatter # #=========================================================================== """UnitDblFormatter module containing class UnitDblFormatter.""" #==========================================================================...
mit
cybernet14/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
403
2011
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spectral Biclustering algorithm. The data is generated with the ``make_checkerboard`...
bsd-3-clause
almarklein/bokeh
bokeh/models/sources.py
1
7168
from __future__ import absolute_import from ..plot_object import PlotObject from ..properties import HasProps from ..properties import Any, Int, String, Instance, List, Dict, Either class DataSource(PlotObject): """ A base class for data source types. ``DataSource`` is not generally useful to instantiate on i...
bsd-3-clause
keflavich/agpy
radex/plot_grids.py
6
11182
#!/Library/Frameworks/Python.framework/Versions/Current/bin/python from pylab import * import pyfits import numpy from agpy import readcol,asinh_norm import matplotlib import sys """ Two procedures: plot_radex is for contour plotting a subset of a radex cube gridcube is to turn a parameter cube into a .fits d...
mit
henridwyer/scikit-learn
examples/decomposition/plot_incremental_pca.py
244
1878
""" =============== Incremental PCA =============== Incremental principal component analysis (IPCA) is typically used as a replacement for principal component analysis (PCA) when the dataset to be decomposed is too large to fit in memory. IPCA builds a low-rank approximation for the input data using an amount of memo...
bsd-3-clause
mattwthompson/mdtraj
mdtraj/formats/pdb/pdbfile.py
2
29740
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Peter Eastman, Robert McGibbon # Contributors: Carlos Hernande...
lgpl-2.1
rubikloud/scikit-learn
sklearn/metrics/cluster/__init__.py
312
1322
""" The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for cluster analysis results. There are two forms of evaluation: - supervised, which uses a ground truth class values for each sample. - unsupervised, which does not and measures the 'quality' of the model itself. """ from .supervised import ...
bsd-3-clause
Shuailong/CCGSupertagging
code/utils.py
1
1914
#!/usr/bin/env python # encoding: utf-8 """ utils.py Created by Shuailong on 2017-02-14. """ from __future__ import print_function from __future__ import division from keras.metrics import categorical_accuracy from sklearn.model_selection import KFold def extract_features(X): ''' X: [[word11, word12, ...]...
mit
mdegis/machine-learning
tools/feature_format.py
25
4390
#!/usr/bin/python """ A general tool for converting data from the dictionary format to an (n x k) python list that's ready for training an sklearn algorithm n--no. of key-value pairs in dictonary k--no. of features being extracted dictionary keys are names of persons in dataset dictiona...
gpl-3.0
jmetzen/scikit-learn
sklearn/ensemble/weight_boosting.py
23
40739
"""Weight Boosting This module contains weight boosting estimators for both classification and regression. The module structure is the following: - The ``BaseWeightBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regression and classification only differ from each ot...
bsd-3-clause
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/pandas/tools/plotting.py
2
116811
# being a bit too dynamic # pylint: disable=E1101 import datetime import warnings import re from math import ceil from collections import namedtuple from contextlib import contextmanager from distutils.version import LooseVersion import numpy as np from pandas.util.decorators import cache_readonly, deprecate_kwarg im...
gpl-2.0
toobaz/pandas
pandas/core/arrays/sparse.py
1
71362
""" SparseArray data structure """ from collections import abc import numbers import operator import re from typing import Any, Callable import warnings import numpy as np from pandas._libs import index as libindex, lib import pandas._libs.sparse as splib from pandas._libs.sparse import BlockIndex, IntIndex, SparseIn...
bsd-3-clause
zaxtax/scikit-learn
sklearn/utils/random.py
37
10511
# Author: Hamzeh Alsalhi <ha258@cornell.edu> # # License: BSD 3 clause from __future__ import division import numpy as np import scipy.sparse as sp import operator import array from sklearn.utils import check_random_state from sklearn.utils.fixes import astype from ._random import sample_without_replacement __all__ =...
bsd-3-clause
sanuj/shogun
examples/undocumented/python_modular/graphical/regression_lars.py
26
3327
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from modshogun import RegressionLabels, RealFeatures from modshogun import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression from modshogun import MeanSquaredError # we compare LASSO with ordinary least-squares (OLE) # in the idea...
gpl-3.0
rosswhitfield/mantid
qt/applications/workbench/workbench/plotting/figureinteraction.py
3
37878
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
johannes-scharlach/pod-control
src/script.py
1
25080
from __future__ import division, print_function import math import numpy as np from scipy import linalg from matplotlib.pyplot import plot, subplot, legend, figure import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d import example2sys as e2s import analysis def optionPricingScript(): N = 1000 ...
mit
cbertinato/pandas
pandas/tests/io/json/test_ujson.py
1
36474
try: import json except ImportError: import simplejson as json import calendar import datetime import decimal import locale import math import re import time import dateutil import numpy as np import pytest import pytz import pandas._libs.json as ujson from pandas._libs.tslib import Timestamp import pandas.co...
bsd-3-clause
bmmalone/as-auto-sklearn
as_asl/as_asl_command_line_utils.py
1
5873
### # This module contains helpers to ensure consistency across the command line # parameters for the Algorithm Selection auto-sklearn wrapper project. ### import misc.math_utils as math_utils import numpy as np ### # C ### def add_config(parser): """ Add the (required) config parameter to the parser """...
mit
pavelchristof/gomoku-ai
tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py
92
4535
# 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
dallascard/guac
core/personas/cluster_input_vectors.py
1
1752
from optparse import OptionParser import os from sklearn.cluster import KMeans from ..util import dirs from ..util import file_handling as fh def main(): usage = "%prog project input_vector_file" parser = OptionParser(usage=usage) parser.add_option('-n', dest='n_clusters', default=5000, ...
apache-2.0
yanlend/scikit-learn
examples/applications/topics_extraction_with_nmf_lda.py
18
3768
""" ======================================================================================= Topic extraction with Non-negative Matrix Factorization and Latent Dirichlet Allocation ======================================================================================= This is an example of applying Non-negative Matrix ...
bsd-3-clause
cogeorg/econlib
networkx/drawing/nx_pylab.py
22
27761
""" ********** Matplotlib ********** Draw networks with matplotlib. See Also -------- matplotlib: http://matplotlib.sourceforge.net/ pygraphviz: http://networkx.lanl.gov/pygraphviz/ """ # Copyright (C) 2004-2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Sw...
gpl-3.0
maxalbert/blaze
blaze/__init__.py
13
2475
from __future__ import absolute_import, division, print_function try: import h5py # if we import h5py after tables we segfault except ImportError: pass from pandas import DataFrame from odo import odo, convert, append, resource, drop from odo.backends.csv import CSV from odo.backends.json import JSON, JSONLi...
bsd-3-clause
jaytlennon/Emergence
tools/DiversityTools/macroecotools/test_macroecotools.py
12
4915
"""Test suite for macroecotools""" from pandas import Series, DataFrame from numpy import array, array_equal from macroecotools import * comp_data = DataFrame({'site': [1, 1, 2, 3, 3, 3, 4], 'year': [1, 2, 1, 1, 1, 2, 2], 'genus': ['a', 'a', 'a', 'a', 'a', 'd', 'f'], ...
mit
NixaSoftware/CVis
venv/lib/python2.7/site-packages/pandas/tests/sparse/test_combine_concat.py
15
13923
# pylint: disable-msg=E1101,W0612 import numpy as np import pandas as pd import pandas.util.testing as tm class TestSparseSeriesConcat(object): def test_concat(self): val1 = np.array([1, 2, np.nan, np.nan, 0, np.nan]) val2 = np.array([3, np.nan, 4, 0, 0]) for kind in ['integer', 'block'...
apache-2.0
pandalibin/backtrader-cn
tests/test_datas_tushare.py
1
3551
import unittest import unittest.mock as um import datetime as dt import pandas as pd import backtradercn.datas.tushare as bdt from backtradercn.settings import settings as conf from backtradercn.libs import models class TsHisDataTestCase(unittest.TestCase): def test_run(self): self._test_download_delta_d...
gpl-3.0
wazeerzulfikar/scikit-learn
examples/linear_model/plot_ridge_coeffs.py
157
2785
""" ============================================================== Plot Ridge coefficients as a function of the L2 regularization ============================================================== .. currentmodule:: sklearn.linear_model :class:`Ridge` Regression is the estimator used in this example. Each color in the le...
bsd-3-clause
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/models/lfads/plot_lfads.py
2
8146
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
bsd-2-clause
decvalts/landlab
setup.py
1
3267
#! /usr/bin/env python from ez_setup import use_setuptools # uncomented for dev build use_setuptools() # uncommented for dev build from setuptools import setup, find_packages, Extension from setuptools.command.install import install from setuptools.command.develop import develop from distutils.core import setup # ne...
mit
cauchycui/scikit-learn
sklearn/manifold/tests/test_isomap.py
226
3941
from itertools import product import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from sklearn import datasets from sklearn import manifold from sklearn import neighbors from sklearn import pipeline from sklearn import preprocessing from sklearn.utils.testing import assert_less ...
bsd-3-clause
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/numpy/lib/function_base.py
19
164441
from __future__ import division, absolute_import, print_function import collections import operator import re import sys import warnings import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d, transpose from numpy.core.numeric import ( ones, zeros, arange, conc...
gpl-3.0
steve855/F_UNCLE
F_UNCLE/Models/Isentrope.py
1
22644
#!/usr/bin/pyton """ Isentrope Abstract class for an isentrope Authors ------- - Stephen Andrews (SA) - Andrew M. Fraser (AMF) Revisions --------- 0 -> Initial class creation (03-16-2016) ToDo ---- None """ from __future__ import absolute_import from __future__ import division from __future__ import print_fun...
gpl-2.0
mhallett/MeDaReDa
demos/demo1/plotccys.py
1
2727
# plot10ccy.py ''' Plot the ccy rates, and the product ''' import pandas as pd import matplotlib.pyplot as plt import matplotlib.animation as animation import datetime import medareda_lib def get_conn(): return medareda_lib.get_conn() # select count from vPrice connpg = get_conn() curpg = connpg.cursor() cu...
mit
wesleyktatum/Nanowire_Measurements
NaRWHAL/knn_method.py
1
1138
import numpy as np import math import matplotlib.pyplot as plt wire_image = np.loadtxt('100-0_72_NW-003') #side = np.linspace(1,len(wire_image),len(wire_image)) side = np.linspace(1, 40, 40) x, y = np.meshgrid(side, side) plt.figure(1) plt.contourf(x, y, wire_image[321:361, 321:361], cmap='bwr') plt.colorbar() plt.sho...
gpl-3.0
Rossonero/bmlswp
ch01/gen_webstats.py
23
1289
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License # This script generates web traffic data for our hypothetical # web startup "MLASS" in chapter 01 impo...
mit
mlyundin/scikit-learn
examples/linear_model/plot_lasso_lars.py
363
1080
#!/usr/bin/env python """ ===================== Lasso path using LARS ===================== Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes dataset. Each color represents a different feature of the coefficient vector, and this is displayed as a function of the regulariza...
bsd-3-clause
vamsirajendra/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/contour.py
69
42063
""" These are classes to support contour plotting and labelling for the axes class """ from __future__ import division import warnings import matplotlib as mpl import numpy as np from numpy import ma import matplotlib._cntr as _cntr import matplotlib.path as path import matplotlib.ticker as ticker import matplotlib.cm...
agpl-3.0
njhenry/batch_geocode
batch_geocode.py
1
10145
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on Fri Mar 17 10:37:07 2017 @author: nathenry This module includes a series of functions that allow for automated geocoding using the Google Maps, OpenStreetMaps, and GeoNames APIs. You can edit the paths within this program, or else call it from the comm...
gpl-3.0
meduz/scikit-learn
sklearn/linear_model/sag.py
18
11273
"""Solvers for Ridge and LogisticRegression using SAG algorithm""" # Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # # License: BSD 3 clause import numpy as np import warnings from ..exceptions import ConvergenceWarning from ..utils import check_array from ..utils.extmath import row_norms from .base import ...
bsd-3-clause
Vimos/scikit-learn
sklearn/decomposition/nmf.py
4
45047
""" Non-negative matrix factorization """ # Author: Vlad Niculae # Lars Buitinck # Mathieu Blondel <mathieu@mblondel.org> # Tom Dupre la Tour # License: BSD 3 clause from __future__ import division, print_function from math import sqrt import warnings import numbers import time import numpy ...
bsd-3-clause
flavour/ifrc_qa
tests/travis/generate_requirements_file.py
32
1088
#!/usr/bin/python # usage - python generate_requirements.py [folder where the file should be generated] [list of requirements file] # example - python tests/travis/generate_requirements_file.py tests/travis requirements.txt optional_requirements.txt from sys import argv # numpy - preinstalled # matplotlib, lxml - ins...
mit
giltis/xray-vision
xray_vision/messenger/mpl/__init__.py
6
5498
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
bsd-3-clause
mattilyra/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
jeffersonfparil/GTWAS_POOL_RADseq_SIM
BACKUP_SCRIPTS_20170930/plotROC.py
1
3345
#!/usr/bin/env python import os, subprocess, sys, math import pandas import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from collections import Counter from sklearn import metrics # #for testing: # workDIR = "/mnt/SIMULATED/test/DNA/" # GWAS_OUT = "GWAlpha_${rep}-${npool}POOLS-$...
gpl-3.0
jselsing/XSGRB_reduction_scrips
py/XSHcomb_1D.py
2
1578
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function import glob import numpy as np import matplotlib.pyplot as pl from util import * def main(): data_dir = "/Users/jselsing/Work/work_rawDATA/XSGRB/" object_name = data_dir + "GRB121229A/" arms = ["UVB", "VIS", "...
gpl-3.0
r-mart/scikit-learn
examples/classification/plot_lda_qda.py
78
5046
""" ==================================================================== Linear and Quadratic Discriminant Analysis with confidence ellipsoid ==================================================================== Plot the confidence ellipsoids of each class and decision boundary """ print(__doc__) from scipy import lin...
bsd-3-clause
mattpitkin/scotchcorner
scotchcorner.py
2
38545
from __future__ import print_function, division __version__ = "0.2.1" __author__ = "Matthew Pitkin (matthew.pitkin@glasgow.ac.uk)" __copyright__ = "Copyright 2016 Matthew Pitkin, Ben Farr and Will Farr" import numpy as np import pandas as pd import scipy.stats as ss import math import matplotlib as mpl from matplotl...
mit
Jimmy-Morzaria/scikit-learn
sklearn/calibration.py
3
18615
"""Calibration of predicted probabilities.""" # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Balazs Kegl <balazs.kegl@gmail.com> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Mathieu Blondel <mathieu@mblondel.org> # # License: BSD 3 clause from __future__ impo...
bsd-3-clause
Agent007/deepchem
deepchem/splits/splitters.py
1
34827
""" Contains an abstract base class that supports chemically aware data splits. """ from __future__ import division from __future__ import unicode_literals import random __author__ = "Bharath Ramsundar, Aneesh Pappu " __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import tempfile import nu...
mit
aflaxman/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
30
8448
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from tempfile import mkdtemp import shutil import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises...
bsd-3-clause
ferdinandvwyk/gs2_analysis
films.py
2
16388
import os import sys import gc # Third Party import numpy as np from netCDF4 import Dataset import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import seaborn as sns import pyfilm as pf plt.rcParams.update({'figure.autolayout': True}) mpl.rcPa...
gpl-2.0