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
gtrensch/nest-simulator
pynest/nest/raster_plot.py
15
9348
# -*- coding: utf-8 -*- # # raster_plot.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...
gpl-2.0
gagneurlab/concise
tests/devel_concise_quasi_X.py
2
1030
# test quasi X import sys import os sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../") from functions.tests import concise_load_data as ld from functions import concise from functions import get_data import pandas as pd import numpy as np from imp import reload from pprint import pprint pd.set_opt...
mit
sameeptandon/sail-car-log
process/ProjectMapOnVideoDense.py
1
5676
from Q50_config import * import sys, os from GPSReader import * from GPSTransforms import * from VideoReader import * from LidarTransforms import * from ColorMap import * from transformations import euler_matrix import numpy as np import cv2 from ArgParser import * from scipy.interpolate import griddata import matplotl...
bsd-2-clause
geodynamics/specfem1d
Fortran_version/plot_script_using_python.py
2
1288
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on Wed Jan 22 15:52:24 2014 Script to plot the seismograms generated by SPECFEM2D. The arguments must be correct paths to existing 2D seismogram files or an existing option (--hold, --grid) @author: Alexis Bottero (alexis.bottero@gmail.com) """ from __future__ i...
gpl-2.0
bikong2/scikit-learn
sklearn/tests/test_base.py
216
7045
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing impo...
bsd-3-clause
nlholdem/icodoom
ICO1/deep_feedback_learning_old/testImgProc.py
3
3766
#!/usr/bin/python3 import deep_feedback_learning import numpy as np import matplotlib.pyplot as plt import cv2 import sys import itertools from PIL import Image def buildFilters(): ksize = 35 sigma = 5. gamma = 1. theta_vals = np.linspace(0., np.pi, 4, endpoint=False) # lambd_vals = (3,7) # sigm...
gpl-3.0
equialgo/scikit-learn
examples/cluster/plot_agglomerative_clustering_metrics.py
402
4492
""" Agglomerative clustering with different metrics =============================================== Demonstrates the effect of different metrics on the hierarchical clustering. The example is engineered to show the effect of the choice of different metrics. It is applied to waveforms, which can be seen as high-dimens...
bsd-3-clause
pnedunuri/scikit-learn
sklearn/manifold/locally_linear.py
206
25061
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
mespe/SolRad
collection/compare_cimis_cfsr/compare_cimis_cfsr.py
1
2737
import pandas as pd import matplotlib.pyplot as plt from netCDF4 import Dataset import netCDF4 def load_CFSR_data(): my_example_nc_file = 'RES.nc' # latitude, longitude = (39.5, -122) fh = Dataset(my_example_nc_file, mode='r') print(fh.variables.keys()) print(help(fh.variables['time'...
mit
ProstoMaxim/incubator-airflow
tests/contrib/hooks/test_bigquery_hook.py
16
8098
# -*- 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
douglasbagnall/py_bh_tsne
test_radial.py
1
1367
#!/usr/bin/python import gzip, cPickle import numpy as np import matplotlib.pyplot as plt import sys from fasttsne import fast_tsne import random random.seed(1) def generate_angular_clusters(n, d, extra_d=10): data = [] classes = [] for i in range(n): scale = random.random() * 5 + 0.1 cent...
bsd-3-clause
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/ipykernel/inprocess/tests/test_kernel.py
8
2417
# Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import sys import unittest from ipykernel.inprocess.blocking import BlockingInProcessKernelClient from ipykernel.inprocess.manager import InProcessKernelManager from ipykernel.in...
apache-2.0
timmyshen/kaggle-titanic
python_script/myfirstforest.py
26
4081
""" Writing my first randomforest code. Author : AstroDave Date : 23rd September 2012 Revised: 15 April 2014 please see packages.python.org/milk/randomforests.html for more """ import pandas as pd import numpy as np import csv as csv from sklearn.ensemble import RandomForestClassifier # Data cleanup # TRAIN DATA tra...
mit
alexandrwang/6882project
strens/experiment.py
1
2946
import numpy as np class Experiment(object): """ An experiment matches up a task with an agent and handles their interactions. """ def __init__(self, task, agent): self.task = task self.agent = agent self.stepid = 0 def doInteractions(self, number=1): """ The default i...
mit
arokem/sklearn-forest-ci
examples/plot_mpg_svr.py
2
1964
""" ====================================== Plotting Bagging Regression Error Bars ====================================== This example demonstrates using `forestci` to calculate the error bars of the predictions of a :class:`sklearn.ensemble.BaggingRegressor` object. The data used here are a classical machine learning...
mit
wavelets/ThinkStats2
code/chap12ex_soln.py
68
4459
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import pandas import numpy as np import statsmodels.formula.api as smf import t...
gpl-3.0
bm2-lab/cage
src/core/seqfs/seqfeature_mtlas_selector.py
1
1888
from __future__ import division import numpy as np import pandas as pd from lxml import etree from collections import namedtuple from seqfeature_extractor import ExtractSeqFeature from src.core import ml Fr = namedtuple('Fr', ['fs', 'ups', 'dws']) def __SaveFeatureReport(fr, str_of_fesrep): f_fesrep = open(str_of...
mit
odwyer-lab/microbial-innovations
bin/merge_tax.py
2
1368
import sys import os import re from Bio import SeqIO import numpy import pandas in_file1 = sys.argv[1] in_file2 = sys.argv[2] out_file = sys.argv[3] # in_file1 = './data/LTPs123_unique.nr_v123.wang.taxonomy' # in_file2 = './data/LTPs123_unique.taxonomy' # out_file = './data/LTPs123.unique.full.taxonomy' tax1 = pandas...
gpl-3.0
matthiasdiener/spack
var/spack/repos/builtin/packages/paraview/package.py
4
8421
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Akshay0724/scikit-learn
sklearn/grid_search.py
16
40213
""" 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
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/tests/scalar/test_period.py
6
50302
import pytest import numpy as np from datetime import datetime, date, timedelta import pandas as pd import pandas.util.testing as tm import pandas.core.indexes.period as period from pandas.compat import text_type, iteritems from pandas.compat.numpy import np_datetime64_compat from pandas._libs import tslib, period a...
mit
AlexRobson/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
226
1384
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
hsiaoyi0504/scikit-learn
examples/mixture/plot_gmm_pdf.py
284
1528
""" ============================================= Density Estimation for a mixture of Gaussians ============================================= Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians with different centers and covariance matrices. """ import numpy as np import ma...
bsd-3-clause
mbalasso/mynumpy
numpy/fft/fftpack.py
9
39261
""" 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
michaelneuder/image_quality_analysis
bin/nets/wip/ssim_nets/ssim_net2.py
2
9518
#!/usr/bin/env python3 import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import tensorflow as tf import matplotlib as mpl import matplotlib.gridspec as gridspec import pandas as pd import numpy as np mpl.use('Agg') import time import matplotlib.pyplot as plt def convolve_inner_layers(x, W, b): ''' inner layers ...
mit
jskDr/jamespy
tflearn/linear_regression.py
7
2600
''' A linear regression learning algorithm example using TensorFlow library. Author: Aymeric Damien Project: https://github.com/aymericdamien/TensorFlow-Examples/ ''' import tensorflow as tf import numpy import matplotlib.pyplot as plt rng = numpy.random # Parameters learning_rate = 0.01 training_epochs = 2000 displ...
mit
lukeiwanski/tensorflow-opencl
tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
88
31139
# 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
rajathkumarmp/BinPy
BinPy/analog/sig_gen.py
4
22882
from BinPy import * import threading import math import time import sys class SignalGenerator(threading.Thread): """ Signal Generator Block ====================== Create a SignalGenerator object ( runs on a child thread ) used to generate an analog voltage signal of the desired type. The frequen...
bsd-3-clause
stefantkeller/VECSELsetup
eval/gen_functions.py
1
16307
#! /usr/bin/python2.7 # -*- coding: utf-8 -*- from os.path import exists import csv import re from itertools import izip as zip, count # izip for maximum efficiency: http://stackoverflow.com/questions/176918/finding-the-index-of-an-item-given-a-list-containing-it-in-python import numpy as np import matplotlib.pyplot ...
mit
akionakamura/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
365
6996
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
jyheo/pywsn
chart.py
1
1761
#!/usr/bin/python # -*- coding: utf-8 -*- from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt color_tuples = [(255,128,128), (255,160,128), (255,255,152), (152,255,152), (128,255,208), (128,255,255), (128,160,255), (128,128,255), (192,128,255), (255,128,255)] def colors_str(): ...
gpl-3.0
zorojean/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
actuaryzhang/spark
python/pyspark/sql/context.py
12
21873
# # 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
justincassidy/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
laurensstoop/HiSPARC-BONZ
egg/legacy/egg_saskia_v3.3.py
1
7620
# -*- coding: utf-8 -*- """ =================================== Created on Thu Mar 24 13:17:57 2016 @author: Laurens Stoop =================================== """ ################################## HEADER ################################## """ Import of Packages """ import sapphire # The HiSp...
gpl-3.0
anilmuthineni/tensorflow
tensorflow/contrib/learn/python/learn/estimators/_sklearn.py
153
6723
# 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
jniediek/combinato
tools/plot_thr_and_artifacts.py
1
4805
# -*- encoding: utf-8 -*- # JN 2015-05-11 # what do I want in this script? # * extraction thresholds in each region # (and regression line, or other measure of variability) # * rationale it's interesting to see whether highly variable channels are # in one macro # * firing rate stability for non-artifacts (correlated ...
mit
yavalvas/yav_com
build/matplotlib/examples/api/custom_projection_example.py
9
18246
from __future__ import unicode_literals import matplotlib from matplotlib.axes import Axes from matplotlib.patches import Circle from matplotlib.path import Path from matplotlib.ticker import NullLocator, Formatter, FixedLocator from matplotlib.transforms import Affine2D, BboxTransformTo, Transform from matplotlib.pro...
mit
alantian/polyglot
docs/conf.py
4
10864
#!/usr/bin/env python # -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # ...
gpl-3.0
jcouvy/convnet-nolearn
src/blog/net1.py
1
1958
# -------------------- Loading Data-set -------------------- import cPickle import pandas as pd import numpy as np # The competition datafiles are in the directory ../input # Read training and test data files train = pd.read_csv("../../input/train.csv") test = pd.read_csv("../../input/test.csv") train_images = trai...
mit
jjx02230808/project0223
sklearn/metrics/cluster/supervised.py
22
30444
"""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
kshedstrom/pyroms
examples/NWGOA3/Fetch_Pacific/get_pacific_v.py
1
5086
import matplotlib matplotlib.use('Agg') import numpy as np import netCDF4 from datetime import datetime import pyroms import pyroms_toolbox import sys year = int(sys.argv[1]) def create_HYCOM_file(name): global nc print 'Creating file %s' %name #create netCDF file nc = netCDF4.Dataset(name, 'w', fo...
bsd-3-clause
planetarymike/IDL-Colorbars
IDL_py_test/042_CB-Dark2.py
1
8651
from matplotlib.colors import LinearSegmentedColormap from numpy import nan, inf cm_data = [[0.105882, 0.619608, 0.466667], [0.12549, 0.611765, 0.454902], [0.14902, 0.607843, 0.443137], [0.168627, 0.6, 0.427451], [0.188235, 0.592157, 0.415686], [0.207843, 0.584314, 0.403922], [0.231373, 0.580392, 0.392157], [0.25098, 0...
gpl-2.0
rseubert/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
rsivapr/scikit-learn
examples/neighbors/plot_classification.py
8
1769
""" ================================ Nearest Neighbors Classification ================================ Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import pylab as pl from matplotlib.colors import ListedColormap from sklea...
bsd-3-clause
myinxd/agn-ae
utils/sample-class.py
1
2956
# Copyright (C) 2017 Zhixian MA <zxma_sjtu@qq.com> """ Rename samples of Best into the JHHMMSS.ss+/-DDMMSS.s style Reference ========= [1] math.modf http://www.runoob.com/python/func-number-modf.html """ import os import math import numpy as np import time import argparse import pickle def batch_class_csv(listp...
mit
amueller/advanced_training
mglearn/plot_improper_preprocessing.py
2
3016
import matplotlib.pyplot as plt def make_bracket(s, xy, textxy, width, ax): annotation = ax.annotate( s, xy, textxy, ha="center", va="center", size=20, arrowprops=dict(arrowstyle="-[", fc="w", ec="k", lw=2,), bbox=dict(boxstyle="square", fc="w")) annotation.arrow_patch....
bsd-2-clause
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/Contact/Static_Normal_Contact/Normal_Behviour/SoftContact_ElPPlShear/plot.py
6
1583
#!/usr/bin/python import h5py import matplotlib.pylab as plt import sys import numpy as np; ################ Node # 2 Displacement ############################# ####################################### ## Analytical Solution ####################################### finput = h5py.File('Analytical_Solution.feioutput') ...
cc0-1.0
sam81/pychoacoustics
tests/test_transformed_up_down_interleaved.py
1
3880
#! /usr/bin/env python # -*- coding: utf-8 -*- import numpy, os, sys, unittest import pandas as pd from test_utility_functions import* rootPath = "../../pychoacoustics_data/test_data/" class TestTransformedUpDown(unittest.TestCase): def testGeometric(self): resFileRoot = "res_geometric" removePre...
gpl-3.0
maxlit/powerindex
powerindex/powerindex.py
1
12803
import math import itertools as it class Party: def __init__(self,weight,name): self.weight=weight self.name=name def __eq__(self,other): if self.name==other.name: return True else: return False def __ne__(self,other): return not (self==other)...
mit
vighneshbirodkar/scikit-image
doc/examples/features_detection/plot_windowed_histogram.py
4
5150
""" ======================== Sliding window histogram ======================== Histogram matching can be used for object detection in images [1]_. This example extracts a single coin from the ``skimage.data.coins`` image and uses histogram matching to attempt to locate it within the original image. First, a box-shape...
bsd-3-clause
gfyoung/pandas
pandas/tests/scalar/timedelta/test_timedelta.py
2
19427
""" test the scalar Timedelta """ from datetime import timedelta import numpy as np import pytest from pandas._libs.tslibs import NaT, iNaT import pandas as pd from pandas import Timedelta, TimedeltaIndex, offsets, to_timedelta import pandas._testing as tm class TestTimedeltaUnaryOps: def test_unary_ops(self):...
bsd-3-clause
kaiserroll14/301finalproject
main/pandas/io/packers.py
9
23542
""" Msgpack serializer support for reading and writing pandas data structures to disk """ # portions of msgpack_numpy package, by Lev Givon were incorporated # into this module (and tests_packers.py) """ License ======= Copyright (c) 2013, Lev Givon. All rights reserved. Redistribution and use in source and binary ...
gpl-3.0
CompPhysics/MachineLearning
doc/src/SupportVMachines/Programs/cancer.py
2
1731
import matplotlib.pyplot as plt import numpy as np from sklearn.model_selection import train_test_split from sklearn.datasets import load_breast_cancer from sklearn.svm import SVC from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier # Load the data cancer = load_breast_...
cc0-1.0
sonnyhu/scikit-learn
sklearn/metrics/cluster/supervised.py
11
33436
"""Utilities to evaluate the clustering performance of models. Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # Arnaud Fouchet ...
bsd-3-clause
shenzebang/scikit-learn
examples/model_selection/plot_validation_curve.py
229
1823
""" ========================== Plotting Validation Curves ========================== In this plot you can see the training scores and validation scores of an SVM for different values of the kernel parameter gamma. For very low values of gamma, you can see that both the training score and the validation score are low. ...
bsd-3-clause
glouppe/scikit-learn
sklearn/feature_selection/tests/test_from_model.py
62
6762
import numpy as np import scipy.sparse as sp from nose.tools import assert_raises, assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.ut...
bsd-3-clause
anetasie/sherpa
sherpa/conftest.py
1
17067
# # Copyright (C) 2016, 2017, 2018, 2019, 2020 # Smithsonian Astrophysical Observatory # # # 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 ...
gpl-3.0
alexmojaki/blaze
blaze/compute/tests/test_hdfstore.py
14
1791
import pytest tables = pytest.importorskip('tables') from blaze.compute.hdfstore import * from blaze.utils import tmpfile from blaze import symbol, discover, compute import pandas as pd from datetime import datetime from odo import Chunks, resource, into import os try: f = pd.HDFStore('foo') except (RuntimeError...
bsd-3-clause
eubr-bigsea/tahiti
migrations/versions/54147db30380_fixing_some_sklearn_operations.py
1
8064
"""fixing some sklearn operations. Revision ID: 54147db30380 Revises: 29ecca388884 Create Date: 2020-01-23 12:51:44.638796 """ from alembic import context from alembic import op from sqlalchemy import String, Integer, Text from sqlalchemy.orm import sessionmaker from sqlalchemy.sql import table, column # revision i...
apache-2.0
vermouthmjl/scikit-learn
sklearn/cross_validation.py
4
67659
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause fro...
bsd-3-clause
blond-admin/BLonD
blond/toolbox/filters_and_fitting.py
2
7393
# coding: utf-8 # Copyright 2017 CERN. This software is distributed under the # terms of the GNU General Public Licence version 3 (GPL Version 3), # copied verbatim in the file LICENCE.md. # In applying this licence, CERN does not waive the privileges and immunities # granted to it by virtue of its status as an In...
gpl-3.0
klim-/pyplane
gui/App_PyPlane.py
1
21182
# -*- coding: utf-8 -*- # Copyright (C) 2013 # by Klemens Fritzsche, pyplane@leckstrom.de # # 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 # ...
gpl-3.0
SaganBolliger/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/dates.py
54
33991
#!/usr/bin/env python """ Matplotlib provides sophisticated date plotting capabilities, standing on the shoulders of python :mod:`datetime`, the add-on modules :mod:`pytz` and :mod:`dateutils`. :class:`datetime` objects are converted to floating point numbers which represent the number of days since 0001-01-01 UTC. T...
agpl-3.0
daniilsorokin/Web-Mining-Exercises
src/correlations.py
1
1064
''' Created on Jun 21, 2015 @author: Daniil Sorokin<sorokin@ukp.informatik.tu-darmstadt.de> ''' import argparse from vector_representation import read_vectors_from_csv from classfiers import NBClassifier import matplotlib.pyplot as plt import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser...
mit
kkk669/mxnet
python/mxnet/model.py
17
39894
# 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 u...
apache-2.0
PredictiveScienceLab/GPy
GPy/testing/likelihood_tests.py
8
35323
# Copyright (c) 2014, Alan Saul # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np import unittest import GPy from GPy.models import GradientChecker import functools import inspect from GPy.likelihoods import link_functions from functools import partial fixed_seed = 7 #np.seterr(divide='rai...
bsd-3-clause
bmassman/fake_news
fake_news/pipeline/build_df.py
1
1826
#!/usr/bin/env python3 """ Module to build dataframe of news articles from sqlite3 database. """ import os import re from urllib.parse import urlparse import sqlite3 from contextlib import closing from datetime import datetime from typing import Optional import pandas as pd DB_FILE_NAME = os.path.join('fake_news', 'ar...
mit
ssaeger/scikit-learn
benchmarks/bench_isolation_forest.py
40
3136
""" ========================================== IsolationForest benchmark ========================================== A test of IsolationForest on classical anomaly detection datasets. """ print(__doc__) from time import time import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import IsolationFore...
bsd-3-clause
mattjj/pyhawkes
experiments/harness.py
2
16840
""" Test harness for fitting the competing models. """ import time import cPickle import copy import os import gzip import numpy as np from collections import namedtuple from pybasicbayes.util.text import progprint_xrange # Use the Agg backend in running on a server without the DISPLAY variable if "DISPLAY" not in o...
mit
lokeshpancharia/BuildingMachineLearningSystemsWithPython
ch10/neighbors.py
21
1787
# 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 import numpy as np import mahotas as mh from glob import glob from features import texture, color_histogram from matplotlib import pyplot as plt from ...
mit
mmottahedi/neuralnilm_prototype
scripts/e507.py
2
6411
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, Bidirectiona...
mit
carrillo/scikit-learn
examples/ensemble/plot_adaboost_twoclass.py
347
3268
""" ================== Two-class AdaBoost ================== This example fits an AdaBoosted decision stump on a non-linearly separable classification dataset composed of two "Gaussian quantiles" clusters (see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision boundary and decision scores. The di...
bsd-3-clause
paulirish/dadi
dadi/__init__.py
10
1326
""" For examples of dadi's usage, see the examples directory in the source distribution. Documentation of all methods can be found in doc/api/index.html of the source distribution. """ import logging logging.basicConfig() import Demographics1D import Demographics2D import Inference import Integration import Misc impo...
bsd-3-clause
alexsavio/scikit-learn
sklearn/datasets/tests/test_base.py
13
8907
import os import shutil import tempfile import warnings import numpy from pickle import loads from pickle import dumps from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn.datasets im...
bsd-3-clause
meee1/pymavlink
examples/mavgraph.py
1
5880
#!/usr/bin/env python ''' graph a MAVLink log file Andrew Tridgell August 2011 ''' import sys, struct, time, os, datetime import math, re import pylab, pytz, matplotlib from math import * # allow import from the parent directory, where mavlink.py is sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__f...
lgpl-3.0
karstenw/nodebox-pyobjc
examples/Extended Application/sklearn/examples/covariance/plot_lw_vs_oas.py
1
3759
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotically optimal shrinkage parameter (minimizing a MSE criterion), yielding th...
mit
blancha/abcngspipelines
rnaseq/cuffdiff.py
1
3767
#!/usr/bin/env python3 # Version 1.1 # Author Alexis Blanchet-Cohen # Date: 09/06/2014 import argparse from collections import OrderedDict import glob import os import os.path import pandas import subprocess import util # Read the command line arguments. parser = argparse.ArgumentParser(description="Generates Cuffdi...
gpl-3.0
bond-/udacity-ml
src/numpy-pandas-tutorials/quiz-avg-bronze-medals.py
1
1951
from pandas import DataFrame, Series import numpy def avg_medal_count(): ''' Compute the average number of bronze medals earned by countries who earned at least one gold medal. Save this to a variable named avg_bronze_at_least_one_gold. You do not need to call the function in your code whe...
apache-2.0
icexelloss/spark
python/pyspark/worker.py
3
19219
# # 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
GuessWhoSamFoo/pandas
pandas/tests/io/test_packers.py
1
33322
import datetime from distutils.version import LooseVersion import glob import os from warnings import catch_warnings import numpy as np import pytest from pandas._libs.tslib import iNaT from pandas.compat import PY3, u from pandas.errors import PerformanceWarning import pandas from pandas import ( Categorical, D...
bsd-3-clause
cybernet14/scikit-learn
sklearn/linear_model/tests/test_coordinate_descent.py
114
25281
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing ...
bsd-3-clause
kazemakase/scikit-learn
examples/decomposition/plot_kernel_pca.py
353
2011
""" ========== Kernel PCA ========== This example shows that Kernel PCA is able to find a projection of the data that makes data linearly separable. """ print(__doc__) # Authors: Mathieu Blondel # Andreas Mueller # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt from sklearn.decomp...
bsd-3-clause
soulmachine/scikit-learn
sklearn/metrics/cluster/unsupervised.py
10
8104
""" Unsupervised evaluation metrics. """ # Authors: Robert Layton <robertlayton@gmail.com> # # License: BSD 3 clause import numpy as np from ...utils import check_random_state from ..pairwise import pairwise_distances def silhouette_score(X, labels, metric='euclidean', sample_size=None, random...
bsd-3-clause
glouppe/scikit-learn
sklearn/_build_utils/__init__.py
21
1125
""" Utilities useful during the build. """ # author: Andy Mueller, Gael Varoquaux # license: BSD from __future__ import division, print_function, absolute_import HASH_FILE = 'cythonize.dat' DEFAULT_ROOT = 'sklearn' # WindowsError is not defined on unix systems try: WindowsError except NameError: WindowsError...
bsd-3-clause
ubic135/odoo-design
addons/resource/faces/timescale.py
170
3902
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
ktaneishi/deepchem
contrib/dragonn/models.py
6
16267
from __future__ import absolute_import, division, print_function import matplotlib import numpy as np import os import subprocess import sys import tempfile matplotlib.use('pdf') import matplotlib.pyplot as plt from dragonn.metrics import ClassificationResult from keras.layers.core import (Activation, Dense, Dropout, F...
mit
pnedunuri/scikit-learn
examples/cluster/plot_lena_ward_segmentation.py
271
1998
""" =============================================================== A demo of structured Ward hierarchical clustering on Lena image =============================================================== Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order ...
bsd-3-clause
SamHames/scikit-image
skimage/viewer/tests/test_tools.py
1
6018
from collections import namedtuple import numpy as np from numpy.testing import assert_equal from numpy.testing.decorators import skipif from skimage import data from skimage.viewer import ImageViewer, viewer_available from skimage.viewer.canvastools import ( LineTool, ThickLineTool, RectangleTool, PaintTool) from...
bsd-3-clause
soulmachine/scikit-learn
sklearn/tests/test_base.py
19
6858
# Author: Gael Varoquaux # License: BSD 3 clause import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_equal from sklearn.utils.testing imp...
bsd-3-clause
brianlorenz/COSMOS_IMACS_Redshifts
PlotCodes/SED_Ratio.py
1
13733
#Finds the ratio between our observed spectra and the ULTRAVista ones so that we can flux calibrate the data #Usage: run SED_Ratio.py a6 to find the ratio for the a6 mask. import numpy as np import matplotlib.pyplot as plt from astropy.io import ascii import sys, os, string import pandas as pd from astropy...
mit
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tseries/tests/test_base.py
7
116023
from __future__ import print_function from datetime import datetime, timedelta import numpy as np import pandas as pd from pandas import (Series, Index, Int64Index, Timestamp, Period, DatetimeIndex, PeriodIndex, TimedeltaIndex, Timedelta, timedelta_range, date_range, Float64Index...
gpl-3.0
dandye/expedia
PythonBenchmark/data_io.py
3
1229
import csv from operator import itemgetter import os import json import pickle import pandas as pd def get_paths(): paths = json.loads(open("SETTINGS.json").read()) for key in paths: paths[key] = os.path.expandvars(paths[key]) return paths def read_train(): train_path = get_paths()["train_path...
bsd-3-clause
PrashntS/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
paris-saclay-cds/ramp-workflow
rampwf/utils/scoring.py
1
5037
# coding: utf-8 """ Scoring utilities """ import numpy as np import pandas as pd from .pretty_print import IS_COLOR_TERM from .pretty_print import print_warning def reorder_df_scores(df_scores, score_types): """Reorder scores according to the order in score_types. Parameters ---------- df_scores : p...
bsd-3-clause
nhuntwalker/astroML
book_figures/chapter5/fig_likelihood_gaussgauss.py
3
3082
""" Gaussian Distribution with Gaussian Errors ------------------------------------------ Figure 5.7 The logarithm of the posterior probability density function for :math:`\mu` and :math:`\sigma`, :math:`L_p(\mu,\sigma)`, for a Gaussian distribution with heteroscedastic Gaussian measurement errors (sampled uniformly f...
bsd-2-clause
huongttlan/statsmodels
statsmodels/tools/tests/test_tools.py
26
18818
""" Test functions for models.tools """ from statsmodels.compat.python import lrange, range import numpy as np from numpy.random import standard_normal from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_string_equal, TestCase) from nose.tools import (asse...
bsd-3-clause
sunyihuan326/DeltaLab
Andrew_NG_learning/class_one/week_three/syh_01.py
1
5963
# coding:utf-8 ''' Created on 2017/11/6 @author: sunyihuan ''' import numpy as np import matplotlib.pyplot as plt from class_one.week_three import testCases import sklearn import sklearn.datasets import sklearn.linear_model import class_one.week_three.testCases from class_one.week_three.planar_utils import plot_decisi...
mit
kdebrab/pandas
pandas/tests/extension/base/interface.py
2
2196
import numpy as np import pandas as pd from pandas.compat import StringIO from pandas.core.dtypes.common import is_extension_array_dtype from pandas.core.dtypes.dtypes import ExtensionDtype from .base import BaseExtensionTests class BaseInterfaceTests(BaseExtensionTests): """Tests that the basic interface is sa...
bsd-3-clause
ResByte/graph_slam
scripts/robot.py
1
1487
#!/usr/bin/env python import roslib import rospy import sys from geometry_msgs.msg import Twist import numpy as np from nav_msgs.msg import Odometry from tf.transformations import euler_from_quaternion import matplotlib.pyplot as plt from sensor_msgs.msg import PointCloud2 import sensor_msgs.point_cloud2 as pc2 imp...
gpl-2.0