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
jamesmcm/luigi
examples/pyspark_wc.py
17
3388
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/pandas/core/common.py
7
15175
""" Misc tools for implementing data structures """ import sys import warnings from datetime import datetime, timedelta from functools import partial import numpy as np import pandas.lib as lib import pandas.tslib as tslib from pandas import compat from pandas.compat import long, zip, iteritems from pandas.core.confi...
apache-2.0
nomadcube/scikit-learn
examples/hetero_feature_union.py
288
6236
""" ============================================= Feature Union with Heterogeneous Data Sources ============================================= Datasets can often contain components of that require different feature extraction and processing pipelines. This scenario might occur when: 1. Your dataset consists of hetero...
bsd-3-clause
alphaBenj/zipline
tests/data/test_resample.py
1
34189
# Copyright 2016 Quantopian, Inc. # # 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 writ...
apache-2.0
davidthaler/arboretum
arboretum/datasets/load_data.py
1
2875
''' Load functions for datasets that load and split data, ensuring correct dtype for arboretum (ndarray of float), and splitting larger datasets into train/test folds. author: David Thaler date: September 2017 ''' import numpy as np import pandas as pd import os DATA_DIR = os.path.join(os.path.split(__file__)[0], 'da...
mit
PythonProgramming/Support-Vector-Machines---Basics-and-Fundamental-Investing-Project
p12.py
1
8235
import pandas as pd import os import time from datetime import datetime import re from time import mktime import matplotlib import matplotlib.pyplot as plt from matplotlib import style style.use("dark_background") # path = "X:/Backups/intraQuarter" # for Windows with X files :) # if git clone'ed then use relative path...
mit
0asa/sparklingpandas
sparklingpandas/test/sparklingpandastestcase.py
1
3828
# # 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
hsuantien/scikit-learn
examples/decomposition/plot_pca_3d.py
354
2432
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Principal components analysis (PCA) ========================================================= These figures aid in illustrating how a point cloud can be very flat in one direction--which is where PCA comes in to ch...
bsd-3-clause
Gamecredits-Universe/Gamecredits-electrum-client
plugins/__init__.py
1
4157
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
gpl-3.0
subutai/nupic.research
projects/continuous_learning/correlation_experiment.py
3
12568
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2020, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
tosolveit/scikit-learn
sklearn/metrics/ranking.py
44
25479
"""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
robclewley/compneuro
phaseplane.py
1
189488
""" Phase plane utilities. Some 2011 functionality has not yet been updated to use the plotter phase plane plotting manager. IMPORTANT NOTE DURING DEVELOPMENT: For now, many operations with nullclines assume that they are NOT multi-valued as a function of their variables, and that they are monotonic only...
bsd-3-clause
deo1/deo1
KaggleKkboxChurn/xgbhelpers.py
2
2936
import pandas as pd def get_params(algorithm, ptype, ver): import params as p if algorithm == 'xgb': if ptype == 'start': if ver == 1: param = p.Xgbparams1() if ver == 2: param = p.Xgbparams2() if ver == 3: param = p.Xgbparams3() if ver == 4: param = p.X...
mit
rvraghav93/scikit-learn
examples/cluster/plot_kmeans_stability_low_dim_dense.py
338
4324
""" ============================================================ Empirical evaluation of the impact of k-means initialization ============================================================ Evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the relative stan...
bsd-3-clause
bhargavasana/activitysim
activitysim/defaults/tables/size_terms.py
1
1805
import os import orca import pandas as pd def size_term(land_use, destination_choice_coeffs): """ This method takes the land use data and multiplies various columns of the land use data by coefficients from the spec table in order to yield a size term (a linear combination of land use variables). ...
agpl-3.0
altairpearl/scikit-learn
examples/applications/plot_stock_market.py
76
8522
""" ======================================= Visualizing the stock market structure ======================================= This example employs several unsupervised learning techniques to extract the stock market structure from variations in historical quotes. The quantity that we use is the daily variation in quote ...
bsd-3-clause
varunkothamachu/seldon-server
external/predictor/python/seldon/pipeline/pipelines.py
5
11288
import seldon.fileutil as fu import json from sklearn.externals import joblib import os.path import logging import shutil import unicodecsv class Feature_transform(object): """Base feature transformation class with method defaults """ def __init__(self): self.pos = 0 self.input_feature = "...
apache-2.0
iamApalive/private
bin/sensor.py
1
1640
!/usr/bin/python import pandas as pd import pandas_profiling import numpy as np #Initializing PySpark from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContext from sklearn.linear_model import LinearRegression,LogisticRegression class sensor: def __init__(self,file=False,json=False): ...
apache-2.0
aakhundov/tf-attend-infer-repeat
embeddings.py
1
7241
import os import math import shutil import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data from tensorflow.contrib.tensorboard.plugins import projector from air.air_model import AIRModel from demo.model_wrapper import ModelWrapper from mu...
mit
shyamalschandra/scikit-learn
sklearn/preprocessing/data.py
9
67092
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Eric Martin <eric@ericmart.in> # Giorgio Patrini <giorgio.patrini@anu.edu.au> # Lic...
bsd-3-clause
wasade/networkx
examples/drawing/chess_masters.py
54
5146
#!/usr/bin/env python """ An example of the MultiDiGraph clas The function chess_pgn_graph reads a collection of chess matches stored in the specified PGN file (PGN ="Portable Game Notation") Here the (compressed) default file --- chess_masters_WCC.pgn.bz2 --- contains all 685 World Chess Championship matches from...
bsd-3-clause
andrew-lundgren/detchar
cbc_dq/snr_variance.py
1
1252
#! /usr/bin/env python from gwpy.timeseries import TimeSeries from numpy import * import sys ifo = sys.argv[1] chan = ifo + ":GDS-CALIB_STRAIN" st = int(sys.argv[2]) dur = 2048 fmin, fmax = 30., 1024. chunk, step = 64, 16 fftlen, overlap = 16, 8 data = TimeSeries.fetch(chan, st, st+dur, verbose=True) srate = data.s...
gpl-3.0
shyamalschandra/scikit-learn
examples/plot_kernel_ridge_regression.py
39
6259
""" ============================================= Comparison of kernel ridge regression and SVR ============================================= Both kernel ridge regression (KRR) and SVR learn a non-linear function by employing the kernel trick, i.e., they learn a linear function in the space induced by the respective k...
bsd-3-clause
JSLBen/KnowledgeTracing
reference_py/tf_RNN.py
1
15676
# tensorflow version: 1.0.0 import numpy as np import tensorflow as tf from numpy.random import permutation as perm import pandas as pd class tf_RNN(object): """ RNN classifier with LSTM cells with tensorflow """ def __init__(self, num_features, ...
mit
glwagner/py2Periodic
py2Periodic/physics/twoDimTurbulence_fftbuildEx.py
1
8847
import numpy as np import numexpr as ne import time as timeTools import matplotlib.pyplot as plt from ..doublyPeriodic import doublyPeriodicModel from numpy import pi class model(doublyPeriodicModel): def __init__(self, name = None, # Grid parameters nx = 128, ny = None, Lx = 2.0*pi, Ly ...
mit
marcdata/pynba-tfo
tfo_story_figures_v2.py
1
15216
# TFO Story Figures # # Go ahead and collect subset of figures, for displaying main points of results, analysis. # This has some more annotation and formatting to it. So it's meant to be run # after all the data has been cycled thru, calculations made, etc. Offsets, etc # will be dependent on the values. # Imp...
gpl-2.0
newemailjdm/scipy
doc/source/tutorial/examples/newton_krylov_preconditioning.py
99
2489
import numpy as np from scipy.optimize import root from scipy.sparse import spdiags, kron from scipy.sparse.linalg import spilu, LinearOperator from numpy import cosh, zeros_like, mgrid, zeros, eye # parameters nx, ny = 75, 75 hx, hy = 1./(nx-1), 1./(ny-1) P_left, P_right = 0, 0 P_top, P_bottom = 1, 0 def get_precon...
bsd-3-clause
sssundar/Drone
simulator/plant.py
1
20549
import sys import numpy as np from scipy.integrate import odeint from quaternions import * from matplotlib import pyplot as plt from animate import * # See Quad notes from 7/31/2018-8/13/2018 for derivations. class Plant(object): # # @brief Initializes a horizontal quad oriented with the Earth's magnetic #...
gpl-3.0
mayblue9/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
alsrgv/tensorflow
tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py
46
13101
# 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
poryfly/scikit-learn
examples/model_selection/plot_confusion_matrix.py
244
2496
""" ================ 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
IshankGulati/scikit-learn
examples/tree/plot_tree_regression.py
95
1516
""" =================================================================== Decision Tree Regression =================================================================== A 1D regression with decision tree. The :ref:`decision trees <tree>` is used to fit a sine curve with addition noisy observation. As a result, it learns ...
bsd-3-clause
evan-magnusson/dynamic
Data/Calibration/Firm_Calibration_Python/data/soi/processing/pull_soi_proprietorship.py
4
8182
''' SOI Proprietorship Tax Data (pull_soi_proprietorship.py): ------------------------------------------------------------------------------- Last updated: 6/29/2015. This module creates functions for pulling the proprietorship soi tax data into NAICS trees. ''' # Packages: import os.path import numpy as np import pan...
mit
yyjiang/scikit-learn
sklearn/linear_model/tests/test_sgd.py
129
43401
import pickle import unittest import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing ...
bsd-3-clause
MohammedWasim/scikit-learn
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
jaidevd/scikit-learn
examples/calibration/plot_calibration.py
66
4795
""" ====================================== Probability calibration of classifiers ====================================== When performing classification you often want to predict not only the class label, but also the associated probability. This probability gives you some kind of confidence on the prediction. However,...
bsd-3-clause
jriehl/numba
numba/tests/pdlike_usecase.py
3
8766
""" Implementation of a minimal Pandas-like API. """ import numpy as np from numba import types, cgutils from numba.datamodel import models from numba.extending import ( typeof_impl, type_callable, register_model, lower_builtin, box, unbox, NativeValue, overload, overload_attribute, overload_method, make_...
bsd-2-clause
trangnm58/idrec
IdRecDemo/idocr/recognition/model_handler.py
1
4401
from __future__ import division, print_function, unicode_literals import sys from os import listdir import numpy as np from keras.models import model_from_json from sklearn.metrics import f1_score, classification_report, confusion_matrix from sklearn.model_selection import KFold, train_test_split sys.path.insert(0, "....
mit
r-kamath/zeppelin
python/src/main/resources/python/mpl_config.py
41
3653
# 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 use ...
apache-2.0
petosegan/scikit-learn
sklearn/feature_extraction/image.py
263
17600
""" The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to extract features from images. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Olivier Grisel # Vlad Niculae # License: BSD 3 clause fro...
bsd-3-clause
wazaahhh/pgames
python_prototype/abm.py
1
25488
#from matplotlib import use, get_backend #if 'Agg' != get_backend().title(): # use('Agg') import sys import numpy as np #import pylab as pl from random import choice,randrange, shuffle import time from datetime import datetime import json import boto global bucketName bucketName = "property_game" def S3connectBuc...
mit
xiaoxiamii/scikit-learn
sklearn/datasets/species_distributions.py
198
7923
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
jwplayer/jwalk
setup.py
1
2598
# -*- coding: utf-8 -*- """Distutils setup file, used to install or test 'jwalk'.""" from __future__ import print_function import sys import textwrap import pkg_resources from setuptools import setup, find_packages, Extension with open('README.rst') as f: readme = f.read() def is_installed(requirement): try...
apache-2.0
luo66/scikit-learn
examples/calibration/plot_calibration_curve.py
225
5903
""" ============================== Probability Calibration curves ============================== When performing classification one often wants to predict not only the class label, but also the associated probability. This probability gives some kind of confidence on the prediction. This example demonstrates how to di...
bsd-3-clause
Ziqi-Li/bknqgis
pandas/pandas/tests/indexing/test_partial.py
5
20611
""" test setting *parts* of objects both positionally and label based TOD: these should be split among the indexer tests """ import pytest from warnings import catch_warnings import numpy as np import pandas as pd from pandas import Series, DataFrame, Panel, Index, date_range from pandas.util import testing as tm ...
gpl-2.0
cweinschenk/cweinschenk
Map_Plotting/NIST_Studies/lodd_map.py
1
2521
# -*- coding: utf-8 -*- from __future__ import unicode_literals import numpy as np import pandas as pd from bokeh.util.browser import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.models.glyphs import Circle from bokeh.plotting import figure, show, output_file from bokeh.models i...
mit
Windy-Ground/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
83
17276
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true from sklearn.utils.testing import assert_raises...
bsd-3-clause
btabibian/scikit-learn
sklearn/model_selection/tests/test_validation.py
7
42247
"""Test the validation module""" from __future__ import division import sys import warnings import tempfile import os from time import sleep import numpy as np from scipy.sparse import coo_matrix, csr_matrix from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.uti...
bsd-3-clause
iproduct/course-social-robotics
11-dnn-keras/venv/Lib/site-packages/pandas/tests/indexes/multi/test_duplicates.py
3
10245
from itertools import product import numpy as np import pytest from pandas._libs import hashtable from pandas import DatetimeIndex, MultiIndex import pandas._testing as tm @pytest.mark.parametrize("names", [None, ["first", "second"]]) def test_unique(names): mi = MultiIndex.from_arrays([[1, 2, 1, 2], [1, 1, 1,...
gpl-2.0
cogeorg/BlackRhino
networkx/convert.py
3
13008
"""Functions to convert NetworkX graphs to and from other formats. The preferred way of converting data to a NetworkX graph is through the graph constuctor. The constructor calls the to_networkx_graph() function which attempts to guess the input type and convert it automatically. Examples -------- Create a graph wit...
gpl-3.0
shahankhatch/scikit-learn
examples/text/hashing_vs_dict_vectorizer.py
284
3265
""" =========================================== FeatureHasher and DictVectorizer Comparison =========================================== Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. The example demonstrates syntax and speed only; it doesn't actually do anything useful with the e...
bsd-3-clause
atantet/transferPlasim
statistics/plotCCF.py
1
3878
import os import numpy as np from scipy import stats import matplotlib.pyplot as plt import atmath # Define the observable srcDir = '../runPlasim/postprocessor/indices/' # SRng = np.array([1260, 1360, 1380, 1400, 1415, 1425, 1430, 1433, # 1263, 1265, 1270, 1280, 1300, 1330, 1360, 1435]) # restartStat...
gpl-2.0
glennq/scikit-learn
sklearn/mixture/tests/test_gaussian_mixture.py
26
40216
# Author: Wei Xue <xuewei4d@gmail.com> # Thierry Guillemot <thierry.guillemot.work@gmail.com> # License: BSD 3 clauseimport warnings import sys import warnings import numpy as np from scipy import stats, linalg from sklearn.covariance import EmpiricalCovariance from sklearn.datasets.samples_generator import...
bsd-3-clause
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/doc/sphinxext/gen_rst.py
2
38923
""" Example generation for the scikit learn Generate the rst files for the examples by iterating over the python example files. Files that generate images should start with 'plot' """ from __future__ import division, print_function from time import time import ast import os import re import shutil import traceback i...
bsd-3-clause
hanfang/glmnet_python
test/example_gaussian.py
1
3451
# Import relevant modules and setup for calling glmnet import sys sys.path.append('../test') sys.path.append('../lib') import scipy import importlib import matplotlib.pyplot as plt import glmnet import glmnetPlot import glmnetPrint import glmnetCoef import glmnetPredict import cvglmnet import cvglmnetCoef import c...
gpl-2.0
aclapes/simpledarwintree
simpledarwintree.py
1
51564
from scipy.io import loadmat from os import listdir,makedirs,remove from os.path import isfile,join,splitext,exists,basename import numpy as np from sklearn import preprocessing, svm, multiclass, metrics, cross_validation import itertools from joblib import delayed, Parallel import cPickle import sys import random impo...
gpl-2.0
awlange/brainsparks
tests/particle333_test.py
1
15864
""" Script entry point """ from src.calrissian.particle333_network import Particle333Network from src.calrissian.layers.particle333 import Particle333 from src.calrissian.optimizers.particle333_sgd import Particle333SGD from multiprocessing import Pool import numpy as np import time import pandas as pd import pickle ...
mit
xyguo/scikit-learn
sklearn/utils/graph.py
289
6239
""" Graph utilities and algorithms Graphs are represented with their adjacency matrices, preferably using sparse matrices. """ # Authors: Aric Hagberg <hagberg@lanl.gov> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Jake Vanderplas <vanderplas@astro.washington.edu> # License: BSD 3 clause impo...
bsd-3-clause
johnmgregoire/JCAPdatavis
echem_stacked_tern4.py
1
51062
import matplotlib.cm as cm import numpy import pylab import h5py, operator, copy, os, csv, sys from echem_plate_fcns import * from echem_plate_math import * PyCodePath=os.path.split(os.path.split(os.path.realpath(__file__))[0])[0] sys.path.append(os.path.join(PyCodePath,'ternaryplot')) from myternaryutility import Ter...
bsd-3-clause
procoder317/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
228
11221
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
bsd-3-clause
trankmichael/scikit-learn
sklearn/linear_model/tests/test_logistic.py
105
26588
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.util...
bsd-3-clause
jakevdp/scipy
scipy/signal/fir_filter_design.py
17
36232
# -*- coding: utf-8 -*- """Functions for FIR filter design.""" from __future__ import division, print_function, absolute_import from math import ceil, log import warnings import numpy as np from numpy.fft import irfft, fft, ifft from scipy.special import sinc from scipy.linalg import toeplitz, hankel, pinv from scipy...
bsd-3-clause
yipenggao/moose
modules/tensor_mechanics/test/tests/capped_mohr_coulomb/small_deform_23_24.py
4
1686
#!/usr/bin/env python import os import sys import numpy as np import matplotlib.pyplot as plt def expected(fn): f = open(fn, "r") data = sorted([map(float, line.strip().split(",")[3:6]) for line in f.readlines()[1:]]) data = [[d[0], d[1], d[2]] for d in data if d[0] >= d[1] and d[1] >= d[2]] mean = [(...
lgpl-2.1
MatthieuBizien/scikit-learn
sklearn/base.py
11
18381
"""Base classes for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import copy import warnings import numpy as np from scipy import sparse from .externals import six from .utils.fixes import signature from .utils.deprecation import deprecated from .exceptions impo...
bsd-3-clause
mayblue9/scikit-learn
setup.py
76
9370
#! /usr/bin/env python # # Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # License: 3-clause BSD descr = """A set of python modules for machine learning and data mining""" import sys import os import shutil from distutils.command.clean ...
bsd-3-clause
charanpald/wallhack
wallhack/viroscopy/model/ProcessResults.py
1
17156
import numpy import logging import sys import multiprocessing import os from apgl.graph.GraphStatistics import GraphStatistics from sandbox.util.PathDefaults import PathDefaults from sandbox.util.Util import Util from sandbox.util.Latex import Latex from sandbox.util.FileLock import FileLock from sandbox.predictor...
gpl-3.0
AlexRobson/scikit-learn
examples/applications/plot_out_of_core_classification.py
255
13919
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
bsd-3-clause
fernandezcuesta/t4Monitor
test/unit_tests/test_dftools.py
2
11466
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ *t4mon* - T4 monitoring **test functions** for df_tools.py """ from __future__ import absolute_import import tempfile import unittest import numpy as np import pandas as pd import pytest from t4mon import df_tools, collector from pandas.util.testing import assert_fra...
mit
crichardson17/starburst_atlas
Low_resolution_sims/DustFree_LowRes/Padova_cont_subsolar_.2/UV1.py
33
7340
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
djgagne/scikit-learn
examples/ensemble/plot_feature_transformation.py
67
4285
""" =============================================== Feature transformations with ensembles of trees =============================================== Transform your features into a higher dimensional, sparse space. Then train a linear model on these features. First fit an ensemble of trees (totally random trees, a rand...
bsd-3-clause
dominikwille/comp
sheet4/a2.py
1
3143
#!/usr/local/bin/python # -*- coding: utf-8 -*- # # @author Dominik Wille # @author Stefan Pojtinger # @tutor Alexander Schlaich # @sheet 4 # # Bitte die plots zum testen einkommentieren. from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt #4.2 def phi(x, y): return x**4 - x...
bsd-2-clause
Jimmy-Morzaria/scikit-learn
examples/plot_kernel_approximation.py
262
8004
""" ================================================== Explicit feature map approximation for RBF kernels ================================================== An example illustrating the approximation of the feature map of an RBF kernel. .. currentmodule:: sklearn.kernel_approximation It shows how to use :class:`RBFSa...
bsd-3-clause
zorojean/scikit-learn
examples/neighbors/plot_kde_1d.py
347
5100
""" =================================== Simple 1D Kernel Density Estimation =================================== This example uses the :class:`sklearn.neighbors.KernelDensity` class to demonstrate the principles of Kernel Density Estimation in one dimension. The first plot shows one of the problems with using histogram...
bsd-3-clause
hainm/scikit-learn
examples/ensemble/plot_partial_dependence.py
249
4456
""" ======================== Partial Dependence Plots ======================== Partial dependence plots show the dependence between the target function [1]_ and a set of 'target' features, marginalizing over the values of all other features (the complement features). Due to the limits of human perception the size of t...
bsd-3-clause
jaeilepp/mne-python
examples/decoding/plot_linear_model_patterns.py
2
4328
# -*- coding: utf-8 -*- """ =============================================================== Linear classifier on sensor data with plot patterns and filters =============================================================== Decoding, a.k.a MVPA or supervised machine learning applied to MEG and EEG data in sensor space. Fi...
bsd-3-clause
griffinfoster/pulsar-polarization-sims
scripts/plotLineValVsTint.py
1
5743
#!/usr/bin/env python """ """ import os,sys import numpy as np import matplotlib #matplotlib.use('Agg') import pylab as p import cPickle as pkl from scipy import interpolate matplotlib.rc('xtick',labelsize=25) matplotlib.rc('ytick',labelsize=25) modeTitle=['Total Intensity','Invariant Interval','Matrix Template Ma...
mit
vijaysbhat/incubator-airflow
airflow/hooks/presto_hook.py
22
3617
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
mattsmart/biomodels
transcriptome_clustering/pitchfork_paramvary.py
1
12624
import matplotlib.pyplot as plt import numpy as np import os import time from inference import solve_true_covariance_from_true_J from pitchfork_langevin import jacobian_pitchfork, steadystate_pitchfork, langevin_dynamics from settings import DEFAULT_PARAMS, PARAMS_ID, FOLDER_OUTPUT, TIMESTEP, INIT_COND, NUM_TRAJ, NUM_...
mit
azjps/bokeh
bokeh/charts/builder.py
1
27190
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Builder class, a minimal prototype class to build more chart types on top of it. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Contin...
bsd-3-clause
yugangzhang/scikit-beam
doc/sphinxext/plot_generator.py
9
10081
""" Sphinx plugin to run example scripts and create a gallery page. Taken from seaborn project, which is turn was lightly modified from the mpld3 project. """ from __future__ import division import os import os.path as op import re import glob import token import tokenize import shutil import json import matplotlib ...
bsd-3-clause
arrabito/DIRAC
Core/Utilities/Graphs/LineGraph.py
5
4402
######################################################################## # $HeadURL$ ######################################################################## """ LineGraph represents line graphs both simple and stacked. It includes also cumulative graph functionality. The DIRAC Graphs package is derived from ...
gpl-3.0
awanke/bokeh
bokeh/models/sources.py
7
11155
from __future__ import absolute_import from ..plot_object import PlotObject from ..properties import HasProps from ..properties import Any, Int, String, Instance, List, Dict, Either, Bool, Enum from ..validation.errors import COLUMN_LENGTHS from .. import validation from ..util.serialization import transform_column_so...
bsd-3-clause
ChanChiChoi/scikit-learn
sklearn/utils/arpack.py
265
64837
""" This contains a copy of the future version of scipy.sparse.linalg.eigen.arpack.eigsh It's an upgraded wrapper of the ARPACK library which allows the use of shift-invert mode for symmetric matrices. Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ #...
bsd-3-clause
great-expectations/great_expectations
great_expectations/expectations/core/expect_column_values_to_be_dateutil_parseable.py
1
5471
from datetime import datetime from typing import Dict, List, Optional, Union import dateutil import numpy as np import pandas as pd from dateutil.parser import parse from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.execution_engine import ( ExecutionEn...
apache-2.0
shenzebang/scikit-learn
examples/calibration/plot_calibration_curve.py
225
5903
""" ============================== Probability Calibration curves ============================== When performing classification one often wants to predict not only the class label, but also the associated probability. This probability gives some kind of confidence on the prediction. This example demonstrates how to di...
bsd-3-clause
Mushirahmed/gnuradio
gr-utils/src/python/plot_data.py
17
5768
# # Copyright 2007,2008,2011 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 ve...
gpl-3.0
ThyrixYang/LearningNotes
MOOC/stanford_cnn_cs231n/assignment1/cs231n/classifiers/neural_net.py
1
10866
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from past.builtins import xrange class TwoLayerNet(object): """ A two-layer fully-connected neural network. The net has an input dimension of N, a hidden layer dimension of H, and performs classification over C classes. W...
gpl-3.0
bikong2/scikit-learn
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
Kate-Willett/HadISDH_Build
IndirectPHA_JAN2015.py
1
67348
#!/usr/local/sci/bin/python # PYTHON3 # # Author: Kate Willett # Created: 11 October 2013 # Last update: 5 February 2018 # Location: /data/local/hadkw/HADCRUH2/UPDATE2015/PROGS/HADISDH_BUILD/ # GitHub: https://github.com/Kate-Willett/HadISDH_Build # ----------------------- # CODE PURPOSE AND OUTPUT # -----------...
cc0-1.0
mikofski/pvlib-python
pvlib/tests/test_modelchain.py
1
83306
import sys import numpy as np import pandas as pd from pvlib import iam, modelchain, pvsystem, temperature, inverter from pvlib.modelchain import ModelChain from pvlib.pvsystem import PVSystem from pvlib.tracking import SingleAxisTracker from pvlib.location import Location from pvlib._deprecation import pvlibDeprecat...
bsd-3-clause
fenderglass/Nano-Align
plotting/mixture.py
1
2698
#!/usr/bin/env python2.7 #(c) 2015-2016 by Authors #This file is a part of Nano-Align program. #Released under the BSD license (see LICENSE file) """ Plots blockade frequency distributions of multiple datasets """ from __future__ import print_function import sys import os import numpy as np import matplotlib.pyplot...
bsd-2-clause
siutanwong/scikit-learn
sklearn/metrics/cluster/supervised.py
207
27395
"""Utilities to evaluate the clustering performance of models Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # License: BSD 3 clause fr...
bsd-3-clause
vermouthmjl/scikit-learn
examples/applications/plot_prediction_latency.py
85
11395
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
bsd-3-clause
JT5D/scikit-learn
doc/conf.py
3
7503
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
bsd-3-clause
vivekmishra1991/scikit-learn
examples/datasets/plot_random_dataset.py
348
2254
""" ============================================== Plot randomly generated classification dataset ============================================== Plot several randomly generated 2D classification datasets. This example illustrates the :func:`datasets.make_classification` :func:`datasets.make_blobs` and :func:`datasets....
bsd-3-clause
mattjj/pyhawkes
data/chalearn/preprocess.py
2
8562
""" Preprocess the fluorescence traces to get a spike train matrix. Based on the ChaLearn Connectomics challenge starter kit by Bisakha Ray, Javier Orlandi and Olav Stetter. I tried to clean it up since it didn't make use of numpy functions and it was woefully lacking in useful comments. """ import os import sys import...
mit
pf4d/wood_pyrolysis
diblasi/helper.py
1
9753
from colored import fg, attr from pylab import * from fenics import * from ufl import indexed from matplotlib import colors, ticker from matplotlib.ticker import LogFormatter, ScalarFormatter from mpl_toolkits.axes_grid1 import ma...
gpl-3.0
magne-max/zipline-ja
tests/calendars/test_cfe_calendar.py
1
1497
from unittest import TestCase import pandas as pd from .test_trading_calendar import ExchangeCalendarTestBase from zipline.utils.calendars.exchange_calendar_cfe import CFEExchangeCalendar class CFECalendarTestCase(ExchangeCalendarTestBase, TestCase): answer_key_filename = "cfe" calendar_class = CFEExchangeCa...
apache-2.0
smartscheduling/scikit-learn-categorical-tree
sklearn/tests/test_naive_bayes.py
142
17496
import pickle from io import BytesIO import numpy as np import scipy.sparse from sklearn.datasets import load_digits, load_iris from sklearn.cross_validation import cross_val_score, train_test_split from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_almost_equal from sklearn.utils.te...
bsd-3-clause
crisbarros/trading-with-python
lib/extra.py
77
2540
''' Created on Apr 28, 2013 Copyright: Jev Kuznetsov License: BSD ''' from __future__ import print_function import sys import urllib import os import xlrd # module for excel file reading import pandas as pd class ProgressBar: def __init__(self, iterations): self.iterations = iterations ...
bsd-3-clause