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 |
|---|---|---|---|---|---|
rafwiewiora/msmbuilder | msmbuilder/tests/test_preprocessing.py | 6 | 8042 | import numpy as np
from numpy.testing.decorators import skipif
try:
from sklearn.preprocessing import (FunctionTransformer as
FunctionTransformerR)
from msmbuilder.preprocessing import FunctionTransformer
HAVE_FT = True
except:
HAVE_FT = False
try:
from sklea... | lgpl-2.1 |
equialgo/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 112 | 3203 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
IniterWorker/epitech-stats-notes | gui/gui.py | 1 | 1264 | import tkinter as tk
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from config import Configure
matplotlib.use("TkAgg")
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
... | mit |
bcantarel/bcantarel.github.io | bicf_nanocourses/courses/python_1/check_versions.py | 1 | 2240 | #!/usr/bin/env python3
'''Check if course required python version and packages are installed.'''
# 2018-01-30 David.Trudgian@UTSouthwestern.edu
# Quick and dirty script to check for course-required
# python version and packages.
import logging
import sys
logger = logging.getLogger("check_versions")
logger.setLevel(... | gpl-3.0 |
shikhardb/scikit-learn | examples/cluster/plot_lena_segmentation.py | 271 | 2444 | """
=========================================
Segmenting the picture of Lena in regions
=========================================
This example uses :ref:`spectral_clustering` on a graph created from
voxel-to-voxel difference on an image to break this image into multiple
partly-homogeneous regions.
This procedure (spe... | bsd-3-clause |
euri10/zipline | tests/risk/answer_key.py | 39 | 11989 | #
# Copyright 2014 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 wr... | apache-2.0 |
kcrandall/Kaggle_Mercedes_Manufacturing | spark/experiements/reza/get_type_lists.py | 6 | 1232 | def get_type_lists(frame, rejects=['Id', 'ID','id'],frame_type='h2o'):
"""Creates lists of numeric and categorical variables.
:param frame: The frame from which to determine types.
:param rejects: Variable names not to be included in returned lists.
:param frame_type: The type of frame being used. Acc... | mit |
nok/sklearn-porter | examples/estimator/classifier/RandomForestClassifier/js/basics_embedded.pct.py | 1 | 1213 | # %% [markdown]
# # sklearn-porter
#
# Repository: [https://github.com/nok/sklearn-porter](https://github.com/nok/sklearn-porter)
#
# ## RandomForestClassifier
#
# Documentation: [sklearn.ensemble.RandomForestClassifier](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html)
# %... | mit |
luchko/latticegraph_designer | latticegraph_designer/app/main.py | 1 | 19862 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2017, Ivan Luchko and Project Contributors
Licensed under the terms of the MIT License
https://github.com/luchko/latticegraph_designer
This module contains the definition of the app MainWindow.
class MainWindow(QMainWindow, Ui_MainWindow):
... | mit |
wwf5067/statsmodels | statsmodels/stats/anova.py | 25 | 13433 | from statsmodels.compat.python import lrange, lmap
import numpy as np
from scipy import stats
from pandas import DataFrame, Index
from statsmodels.formula.formulatools import (_remove_intercept_patsy,
_has_intercept, _intercept_idx)
def _get_covariance(model, robust):
if robust ... | bsd-3-clause |
hitszxp/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | 19 | 2844 | """
Testing for mean shift clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.cluster import MeanShift
from sklearn.clu... | bsd-3-clause |
aewallin/allantools | examples/ieee1139_randomwalk_fm.py | 2 | 3783 | import allantools
import allantools.noise as noise
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
import math
# ieee1139-table for random walk (Brownian) FM
# produces synthetic dataset with given PSD and compares against
# the predicted S_y, S_fi, S_x, and ADEV given in the table
# AW 20... | lgpl-3.0 |
gimli-org/gimli | doc/tutorials/dev/plot_XX_mod_fd_stokes-2d.py | 1 | 4526 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import pygimli as pg
# from solverFVM import (solveFiniteVolume,
# createFVPostProzessMesh, diffusionConvectionKernel()
def buildUpB(b, rho, dt, u, v, dx, dy):
b[1:-1, 1:-1] = rho*(1/dt*((u[2:... | apache-2.0 |
MuhammedHasan/metabolitics | metabolitics/preprocessing/metabolitics_transformer.py | 1 | 1184 | from joblib import Parallel, delayed
from sklearn.base import TransformerMixin
from metabolitics.analysis import MetaboliticsAnalysis
class MetaboliticsTransformer(TransformerMixin):
"""Performs metabolitics analysis and
convert metabolitic value into reaction min-max values."""
def __init__(self, netw... | gpl-3.0 |
rahulremanan/python_tutorial | Machine_Vision/01_Transfer_Learning/src/transfer_learning.py | 1 | 65186 | # !/usr/bin/python3.6
# -*- coding: utf-8 -*-
# Transfer learning using Keras and Tensorflow.
# Written by Rahul Remanan and MOAD (https://www.moad.computer) machine vision team.
# For more information contact: info@moad.computer
# License: MIT open source license
# Repository: https://github.com/rahulremanan/python_tu... | mit |
gclenaghan/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 |
clawpack/adjoint | paper2_examples/acoustics_2d_ex3/generate_tolplots.py | 1 | 7318 | from numpy import *
from matplotlib.pyplot import *
from pylab import *
# Setting up local variables
tols = ['1e-0','6e-1','3e-1',
'1e-1','6e-2','3e-2',
'1e-2','6e-3','3e-3',
'1e-3','6e-4','3e-4',
'1e-4','6e-5','3e-5',
'1e-5']
## ---------------------------------
## Setting up ... | bsd-2-clause |
Sentient07/scikit-learn | examples/mixture/plot_gmm_covariances.py | 89 | 4724 | """
===============
GMM covariances
===============
Demonstration of several covariances types for Gaussian mixture models.
See :ref:`gmm` for more information on the estimator.
Although GMM are often used for clustering, we can compare the obtained
clusters with the actual classes from the dataset. We initialize th... | bsd-3-clause |
hrichstein/phys_50733 | rh_project/two_body.py | 1 | 5689 | # Restricted Three-Body Problem
import numpy as np
import matplotlib.pyplot as plt
# from scipy.constants import G
# Setting plotting parameters
from matplotlib import rc,rcParams
rc('text', usetex=True)
rc('axes', linewidth=2)
rc('font', weight='bold')
rc('font', **{'family': 'serif', 'serif':['Computer Modern']})
... | mit |
pair-code/lit | lit_nlp/examples/coref/datasets/winogender.py | 2 | 6390 | """Coreference version of the Winogender dataset.
Each instance has two edges, one between the pronoun and the occupation and one
between the pronoun and the participant. The pronoun is always span1.
There are 120 templates in the Winogender set, 60 coreferent with the
occupation, and 60 coreferent with the participa... | apache-2.0 |
syhw/speech_embeddings | vq.py | 2 | 1899 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------
# file: vq.py
# date: Fri May 02 12:10 2014
# author:
# Maarten Versteegh
# github.com/mwv
# maartenversteegh AT gmail DOT com
#
# Licensed under GPLv3
# ------------------------------------
"""vq:
"""
from __future__ import division
i... | mit |
hollabaq86/haikuna-matata | env/lib/python2.7/site-packages/numpy/core/function_base.py | 23 | 6891 | from __future__ import division, absolute_import, print_function
__all__ = ['logspace', 'linspace']
from . import numeric as _nx
from .numeric import result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
"""
Return evenly... | mit |
eryueniaobp/contest | Tianchi_License/fusai_hand.py | 1 | 4384 | # encoding=utf-8
import pandas as pd
import numpy as np
import datetime
import matplotlib.pyplot as plt
def fore_holidays():
"""
节后第二天 标注出来;方便直接处理.
:param df:
:return:
"""
fd = 'fd'
spring = 'spring'
qingming = 'qingming'
laodong = 'laodong'
duanwu = 'duanwu'
zhongqiu ... | apache-2.0 |
dhruv13J/scikit-learn | examples/feature_stacker.py | 246 | 1906 | """
=================================================
Concatenating multiple feature extraction methods
=================================================
In many real-world examples, there are many ways to extract features from a
dataset. Often it is beneficial to combine several methods to obtain good
performance. Th... | bsd-3-clause |
geodynamics/burnman | examples/example_layer.py | 2 | 6460 | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
example_layer
----------------
This example script is building on example_beginner.py.
In this case we use the... | gpl-2.0 |
LiZoRN/lizorn.github.io | talks/nbzj-impress/code/txt/PacificRimSpider.py | 3 | 42651 | # _*_ coding: utf-8 _*_
__author__ = 'lizorn'
__date__ = '2018/4/5 19:56'
from urllib import request
from urllib.error import URLError, HTTPError
from bs4 import BeautifulSoup as bs
import re
import jieba # 分词包
import pandas as pd
import numpy #numpy计算包
import matplotlib.pyplot as plt
import matplotlib
from wordcl... | mit |
jesseerdmann/audiobonsai | weekly_sampler.py | 2 | 8309 | from audiobonsai import wsgi, settings
from datetime import datetime
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
import pandas as pd
from pprint import pprint
from sausage_grinder.models import Artist, ReleaseSet
from spotify_helper.models import SpotifyUser
from spotipy imp... | apache-2.0 |
Windy-Ground/scikit-learn | benchmarks/bench_covertype.py | 120 | 7381 | """
===========================
Covertype dataset benchmark
===========================
Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART
(decision tree), RandomForest and Extra-Trees on the forest covertype dataset
of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ... | bsd-3-clause |
eepalms/gem5-newcache | util/stats/output.py | 90 | 7981 | # Copyright (c) 2005-2006 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | bsd-3-clause |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/io/parser/test_network.py | 4 | 8535 | # -*- coding: utf-8 -*-
"""
Tests parsers ability to read and parse non-local files
and hence require a network connection to be read.
"""
import os
import pytest
import moto
import pandas.util.testing as tm
from pandas import DataFrame
from pandas.io.parsers import read_csv, read_table
from pandas.compat import Byt... | apache-2.0 |
marcoviero/simstack | run_simstack_cmd_line.py | 1 | 10390 | #!/usr/bin/env python
# Standard modules
import pdb
import os
import os.path
import sys
import shutil
import time
import logging
import importlib
import numpy as np
import pandas as pd
import cPickle as pickle
from astropy.wcs import WCS
# Modules within this package
import parameters
from skymaps import Skymaps
from... | mit |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/tests/test_resample.py | 3 | 126730 | # pylint: disable=E1101
from warnings import catch_warnings
from datetime import datetime, timedelta
from functools import partial
import pytest
import numpy as np
import pandas as pd
import pandas.tseries.offsets as offsets
import pandas.util.testing as tm
from pandas import (Series, DataFrame, Panel, Index, isnull... | agpl-3.0 |
mrshu/scikit-learn | examples/svm/plot_svm_regression.py | 5 | 1430 | """
===================================================================
Support Vector Regression (SVR) using linear and non-linear kernels
===================================================================
Toy example of 1D regression using linear, polynominial and RBF
kernels.
"""
print __doc__
##################... | bsd-3-clause |
zorroblue/scikit-learn | sklearn/cluster/tests/test_affinity_propagation.py | 15 | 5780 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.exceptions import ConvergenceWarning
from sklearn.utils.testing import (
assert_equal, assert_false, assert_true, assert_array_equal, assert_raises,
assert_warns, assert_warns_message, assert_no_warnings)
from sklearn.cluster.affinity_pr... | bsd-3-clause |
waynenilsen/statsmodels | examples/python/formulas.py | 33 | 4968 |
## Formulas: Fitting models using R-style formulas
# Since version 0.5.0, ``statsmodels`` allows users to fit statistical models using R-style formulas. Internally, ``statsmodels`` uses the [patsy](http://patsy.readthedocs.org/) package to convert formulas and data to the matrices that are used in model fitting. The ... | bsd-3-clause |
volpino/Yeps-EURAC | tools/plotting/plotter.py | 4 | 2247 | #!/usr/bin/env python
# python histogram input_file output_file column bins
import sys, os
import matplotlib; matplotlib.use('Agg')
from pylab import *
assert sys.version_info[:2] >= ( 2, 4 )
def stop_err(msg):
sys.stderr.write(msg)
sys.exit()
if __name__ == '__main__':
# parse the arguments
... | mit |
mengxn/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_input_test.py | 72 | 12865 | # 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 |
kernc/scikit-learn | sklearn/tests/test_base.py | 45 | 7049 | # 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 |
mdesco/dipy | doc/examples/snr_in_cc.py | 1 | 6475 | """
=============================================
SNR estimation for Diffusion-Weighted Images
=============================================
Computing the Signal-to-Noise-Ratio (SNR) of DW images is still an open question,
as SNR depends on the white matter structure of interest as well as
the gradient direction corr... | bsd-3-clause |
sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/parse/dependencygraph.py | 5 | 31002 | # Natural Language Toolkit: Dependency Grammars
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Jason Narad <jason.narad@gmail.com>
# Steven Bird <stevenbird1@gmail.com> (modifications)
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
"""
Tools for reading and writing dependency tree... | mit |
untom/scikit-learn | sklearn/ensemble/gradient_boosting.py | 126 | 65552 | """Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | bsd-3-clause |
akhil22/deepmatching_1.2_c- | viz.py | 4 | 3145 | import sys
from PIL import Image
from numpy import *
from matplotlib.pyplot import *
def show_correspondences( img0, img1, corr ):
assert corr.shape[-1]==6
corr = corr[corr[:,4]>0,:]
# make beautiful colors
center = corr[:,[1,0]].mean(axis=0) # array(img0.shape[:2])/2 #
corr[:,5] = arctan2(*(... | gpl-3.0 |
google-code-export/currentcostgui | currentcostlivedata.py | 9 | 35520 | # -*- coding: utf-8 -*-
#
# CurrentCost GUI
#
# Copyright (C) 2008 Dale Lane
#
# 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
# (a... | gpl-3.0 |
ffyu/Kaggle-Taxi-Travel-Time-Prediction | Submission.py | 1 | 43470 | # Model 1 - Scalable Random Forest
import re
import numpy as np
import pandas as pd
import sqlite3
from pandas.io import sql
from datetime import datetime
# global variable to indicate the folder for all input / output files
FOLDER = './data/'
# Convert [lon,lat] string to list
def lonlat_convert(lonlat):
lon... | mit |
eldar/pose-tensorflow | test_multiperson.py | 1 | 4667 | import argparse
import logging
import os
import numpy as np
import scipy.io
import scipy.ndimage
import json
from json import encoder
encoder.FLOAT_REPR = lambda o: format(o, '.2f')
from util.config import load_config
from dataset.factory import create as create_dataset
from dataset.pose_dataset import Batch
from uti... | lgpl-3.0 |
jakobworldpeace/scikit-learn | benchmarks/bench_saga.py | 45 | 8474 | """Author: Arthur Mensch
Benchmarks of sklearn SAGA vs lightning SAGA vs Liblinear. Shows the gain
in using multinomial logistic regression in term of learning time.
"""
import json
import time
from os.path import expanduser
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import fetch_rcv1, ... | bsd-3-clause |
project-rig/network_tester | examples/bursting.py | 1 | 4718 | """In this example we attempt to discover the behaviour of the network when the
burstiness of the traffic is varied."""
import sys
import random
from network_tester import Experiment
e = Experiment(sys.argv[1])
###############################################################################
# Network description
###... | gpl-2.0 |
sgould/fun_and_games | gs_fetch.py | 1 | 3983 | #!/usr/bin/env python
#
# Script to fetch Google Scholar pages from a CSV list of Google Scholar IDs and plot citations by grouping. Expects
# CSV data in the form of:
# <name>, <grouping>, <scholarID>
#
# For example:
# Stephen Gould, D, YvdzeM8AAAAJ
#
import os
import csv
import re
import numpy as np
import urllib... | mit |
jwlawson/tensorflow | tensorflow/contrib/losses/python/metric_learning/metric_loss_ops_test.py | 41 | 20535 | # 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 |
cavestruz/L500analysis | plotting/profiles/T_Vcirc_evolution/Ttot_Vcirc_evolution/plot_Ttot_Vcirc_r200m.py | 1 | 2845 | from L500analysis.data_io.get_cluster_data import GetClusterData
from L500analysis.utils.utils import aexp2redshift
from L500analysis.plotting.tools.figure_formatting import *
from L500analysis.plotting.profiles.tools.profiles_percentile \
import *
from L500analysis.utils.constants import rbins
from derived_field_f... | mit |
ThomasMiconi/htmresearch | htmresearch/frameworks/layers/continuous_location_object_machine.py | 10 | 12521 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 progra... | agpl-3.0 |
ppries/tensorflow | tensorflow/examples/learn/text_classification.py | 1 | 4925 | # 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 |
wxxth/MDPLA | exact_mdp/route_planning.py | 2 | 3138 | import matplotlib.pyplot as plt
from exact_mdp.mdp import *
import time
def init_mdp():
state = [State('Home'),
State('x2'),
State('Work')]
miu = {'miu1': (state[0], REL, PiecewisePolynomial([P([1])], [1 / 6, 1 / 6])), # miu1
'miu2': (state[2], ABS, PiecewisePolynomial([P(... | apache-2.0 |
ctensmeyer/pagenet | train.py | 1 | 8707 | #!/usr/bin/python
import os
import sys
import collections
import argparse
import numpy as np
import matplotlib
matplotlib.use("AGG")
import matplotlib.pyplot as plt
import caffe
import cv2
import random
def safe_mkdir(_dir):
try:
os.makedirs(_dir)
except:
pass
def dump_debug(out_dir, data, dump_images=False... | bsd-3-clause |
koobonil/Boss2D | Boss2D/addon/webrtc-jumpingyang001_for_boss/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_optimize.py | 3 | 6534 | #!/usr/bin/env python
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | mit |
hitszxp/scikit-learn | sklearn/utils/__init__.py | 7 | 13252 | """
The :mod:`sklearn.utils` module includes various utilities.
"""
from collections import Sequence
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array,
assert_all_finite, warn_if_not_float,
... | bsd-3-clause |
RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/utils/tests/test_class_weight.py | 26 | 2001 | import numpy as np
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing impo... | bsd-3-clause |
pnedunuri/scikit-learn | examples/feature_stacker.py | 246 | 1906 | """
=================================================
Concatenating multiple feature extraction methods
=================================================
In many real-world examples, there are many ways to extract features from a
dataset. Often it is beneficial to combine several methods to obtain good
performance. Th... | bsd-3-clause |
dgwakeman/mne-python | mne/report.py | 1 | 60245 | """Generate html report from MNE database
"""
# Authors: Alex Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Mainak Jas <mainak@neuro.hut.fi>
# Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
import fnmatch
import re
import codecs
import time
from... | bsd-3-clause |
aolindahl/aolPyModules | tof.py | 1 | 31988 | #from setupEnvironment import *
import numpy as np
from configuration import loadConfiguration, load_configuration_dict
import time
import wiener
from scipy.sparse import coo_matrix
import sys
import simplepsana
import aolUtil
_useWavelet = True
if _useWavelet:
try:
from wavelet_filter import wavelet_filt... | gpl-2.0 |
ltiao/scikit-learn | sklearn/cluster/tests/test_affinity_propagation.py | 341 | 2620 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagatio... | bsd-3-clause |
pv/scikit-learn | sklearn/ensemble/forest.py | 176 | 62555 | """Forest of trees-based ensemble methods
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls the ... | bsd-3-clause |
NicovincX2/Python-3.5 | Problèmes divers/probleme_du_chien.py | 1 | 1908 | # -*- coding: utf-8 -*-
import os
"""
Résolution de l'exercice du chien C qui course son maître M qui fait son
jogging à une vitesse v0 suivant vex en le visant à une vitesse v suivant le
vecteur vect(CM)/CM.
L'idée est de pouvoir faire varier les différents paramètres, notamment le
rapport de vitesse, pour voir... | gpl-3.0 |
ueser/FIDDLE | _deprecated/TORCHmodels/dataPrep/data4predictionYAC.py | 2 | 8510 | #!/usr/bin/env python
import os
import sys
sys.path.append('/Users/umut/Projects/genome/python/lib')
import genome.db
from optparse import OptionParser
import h5py
import pandas as pd
import numpy as np
################################################################################
# data4predictionYAC.py
#
# Make a... | gpl-3.0 |
dingocuster/scikit-learn | sklearn/tests/test_naive_bayes.py | 70 | 17509 | 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 |
RPGOne/Skynet | scikit-learn-0.18.1/sklearn/manifold/isomap.py | 50 | 7515 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
suyashbire1/pyhton_scripts_mom6 | plot_eb_transport.py | 1 | 1522 | import sys
import readParams_moreoptions as rdp1
import matplotlib.pyplot as plt
from mom_plot import m6plot
import numpy as np
from netCDF4 import MFDataset as mfdset, Dataset as dset
import time
import pyximport
pyximport.install()
from getvaratzc import getvaratzc
def plot_eb_transport(geofil,vgeofil,fil,xstart,xen... | gpl-3.0 |
dhhagan/opcsim | opcsim/metrics.py | 1 | 2962 | """Contains the scoring algorithms used in the model.
"""
import numpy as np
import pandas as pd
from .models import OPC
from .utils import k_kohler, ri_eff
from .mie import cscat
def compute_bin_assessment(opc, refr, kappa, rh_values=[0., 35., 95.]):
"""Assess the ability of an OPC to assign particles to their ... | mit |
ch3ll0v3k/scikit-learn | sklearn/feature_extraction/tests/test_dict_vectorizer.py | 276 | 3790 | # Authors: Lars Buitinck <L.J.Buitinck@uva.nl>
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from sklearn.utils.testing import (assert_equal, assert_in,
... | bsd-3-clause |
thirdwing/mxnet | example/speech_recognition/stt_utils.py | 44 | 5892 | # 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 |
bartslinger/paparazzi | sw/tools/calibration/calibration_utils.py | 27 | 12769 |
# Copyright (C) 2010 Antoine Drouin
#
# This file is part of Paparazzi.
#
# Paparazzi 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, or (at your option)
# any later version.
#
# Paparazzi ... | gpl-2.0 |
miloharper/neural-network-animation | matplotlib/image.py | 10 | 49749 | """
The image module supports basic image loading, rescaling and display
operations.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import warnings
import numpy as np
from matplotlib import rcParams
import matplotlib.artist as m... | mit |
m-rossi/matplotlib2tikz | test/test_legend_best_location.py | 1 | 2236 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig, ax = plt.subplots(3, 3, sharex="col", sharey="row")
axes = [ax[i][j] for i in range(len(ax)) for j in range(len(ax[i]))]
t = np.arange(0.0, 2.0 * np.pi, 0.4)
# Legend best location is "upper right"... | mit |
pyrocko/pyrocko | src/gui/snuffling.py | 1 | 56563 | # http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
'''
Snuffling infrastructure
This module provides the base class :py:class:`Snuffling` for user-defined
snufflings and some utilities for their handling.
'''
from __future__ import absolute_import
import os
im... | gpl-3.0 |
mhue/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 134 | 7452 | """
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected in... | bsd-3-clause |
Datawheel/datausa-site | mobilitycovid19.py | 2 | 4125 | import pandas as pd
import os
stateToFips = {"AL": "04000US01", "AK": "04000US02", "AZ": "04000US04", "AR": "04000US05", "CA": "04000US06",
"CO": "04000US08", "CT": "04000US09", "DE": "04000US10", "DC": "04000US11", "FL": "04000US12",
"GA": "04000US13", "HI": "04000US15", "ID": "0... | mit |
averagehat/biopandas | tests/testbiopandas.py | 2 | 4473 | import mock
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import unittest
#from bioframes import bioframes as bf
from bioframes import sequenceframes
import sys
import pandas as pd
from pandas.util.testing import assert_series_equal, assert_frame_equal, assert_index_equal
from numpy.testing import assert_... | gpl-2.0 |
M-R-Houghton/euroscipy_2015 | bokeh/bokeh/charts/builder/tests/test_scatter_builder.py | 33 | 2895 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | mit |
andrewchenshx/vnpy | vnpy/app/cta_strategy/backtesting.py | 1 | 37272 | from collections import defaultdict
from datetime import date, datetime, timedelta
from typing import Callable
from itertools import product
from functools import lru_cache
from time import time
import multiprocessing
import random
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from pandas im... | mit |
466152112/scikit-learn | sklearn/naive_bayes.py | 128 | 28358 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... | bsd-3-clause |
lhoang29/vowpal_wabbit | python/tests/test_sklearn_vw.py | 1 | 5425 | from collections import namedtuple
import numpy as np
import pytest
from vowpalwabbit.sklearn_vw import VW, VWClassifier, VWRegressor, tovw
from sklearn import datasets
from sklearn.exceptions import NotFittedError
from scipy.sparse import csr_matrix
"""
Test utilities to support integration of Vowpal Wabbit and sci... | bsd-3-clause |
dronir/EM | python/gather.py | 1 | 10232 | import Scientific.IO.NetCDF as nc
import numpy as np
import sys
import math
import pylab as pl
import matplotlib.colors as colors
from numpy import floor, sqrt, sin, cos, arccos, arctan2, pi
class gth_hemisphere:
"""Class implementing the gathering hemisphere."""
def __init__(self, resTheta=1, nThetaI=1, nDataL... | gpl-3.0 |
xavierwu/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 159 | 7852 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
xflows/tf_core | tf_core/nltoolkit/lib/classification.py | 1 | 8140 | #!/usr/bin/env python
# from nltk.classify.megam import config_megam, call_megam
#from nltk.classify.weka import WekaClassifier, config_weka
from datetime import time
from nltk import ELEProbDist
from nltk.classify.naivebayes import NaiveBayesClassifier
from nltk.classify.positivenaivebayes import PositiveNaiveBayesCl... | mit |
Wafflespeanut/servo | tests/heartbeats/process_logs.py | 139 | 16143 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
from os import path
... | mpl-2.0 |
eor/STARDUST | scripts/sd_plot/sd_plot.py | 1 | 6960 | #!/usr/bin/python
# -*- coding: utf-8 -*-
def multi_plot(inputFiles, outFile, xLimits, ylimits, logT=False, logFractions=False, legends=[], showLegend=True, ncolsLegend=4, doColor=True, colors=None, ls=None):
import numpy as np
import matplotlib.pyplot as plt
import math
# enable these if ... | gpl-3.0 |
lol/BCI-BO-old | plot_iii3b_old.py | 1 | 4787 | import numpy as np
import matplotlib.pyplot as plt
import math
from pylab import figure
from my_plotter import *
import os
import sys
sys.path.append('./BCI_Framework')
import Main
import Single_Job_runner as SJR
import os
import re
if __name__ == '__main__':
bciciv1 = Main.Main('BCI_Framework','BCICIII3b... | gpl-3.0 |
ybroze/trading-with-python | cookbook/workingWithDatesAndTime.py | 77 | 1551 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 16 17:45:02 2011
@author: jev
"""
import time
import datetime as dt
from pandas import *
from pandas.core import datetools
# basic functions
print 'Epoch start: %s' % time.asctime(time.gmtime(0))
print 'Seconds from epoch: %.2f' % time.time()
t... | bsd-3-clause |
ngoix/OCRF | doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py | 16 | 2249 | """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 |
zhenv5/scikit-learn | examples/linear_model/plot_ols.py | 220 | 1940 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... | bsd-3-clause |
HIPS/optofit | optofit/test/data_utilities.py | 1 | 4524 | import pickle
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gamma
from optofit.models.hyperparameters import hypers
from optofit.models.model import point_parameter_model, DataSequence
from optofit.neuron.channels import *
from optofit.observation.observable import NewDirectCompartmen... | gpl-2.0 |
cpcloud/bokeh | bokeh/mpl_helpers.py | 3 | 5357 | "Helpers function for mpl module."
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENCE.txt, distributed with this software.
#-----... | bsd-3-clause |
fengzhyuan/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
WarrenWeckesser/scikits-image | skimage/viewer/viewers/core.py | 33 | 13265 | """
ImageViewer class for viewing and interacting with images.
"""
import numpy as np
from ... import io, img_as_float
from ...util.dtype import dtype_range
from ...exposure import rescale_intensity
from ..qt import QtWidgets, Qt, Signal
from ..widgets import Slider
from ..utils import (dialogs, init_qtapp, figimage, ... | bsd-3-clause |
sinhrks/pyopendata | pyopendata/tests/test_worldbank.py | 1 | 5911 | # pylint: disable-msg=E1101,W0613,W0603
from pyopendata import WorldBankStore, WorldBankResource
import numpy as np
import pandas as pd
from pandas.compat import range
import pandas.util.testing as tm
class TestWorldBankTestSite(tm.TestCase):
def setUp(self):
self.store = WorldBankStore()
def test... | bsd-2-clause |
masfaraud/volmdlr | scripts/primitives/sweep.py | 1 | 1656 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 11 15:16:33 2018
@author: steven
"""
import volmdlr as vm
import volmdlr.primitives3d as primitives3d
import volmdlr.wires as wires
import numpy as npy
import random
import matplotlib.pyplot as plt
p1 = vm.Point3D(0, 0, 0)
p2 = vm.Point3D(-0.150, 0... | gpl-3.0 |
cloudera/ibis | ibis/backends/tests/base.py | 1 | 11462 | import abc
import inspect
from pathlib import Path
from typing import Any, Callable, Mapping, Optional
import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.backends.base_sqlalchemy.compiler as comp
import ibis.expr.types as ir
# TODO: Merge into BackendTest, #2564... | apache-2.0 |
abgoswam/data-science-from-scratch | code-python3/nearest_neighbors.py | 4 | 7323 | from collections import Counter
from linear_algebra import distance
from statistics import mean
import math, random
import matplotlib.pyplot as plt
def raw_majority_vote(labels):
votes = Counter(labels)
winner, _ = votes.most_common(1)[0]
return winner
def majority_vote(labels):
"""assumes that labels... | unlicense |
CKehl/pylearn2 | pylearn2/cross_validation/tests/test_cross_validation.py | 49 | 6767 | """
Tests for cross-validation module.
"""
import os
import tempfile
from pylearn2.config import yaml_parse
from pylearn2.testing.skip import skip_if_no_sklearn
def test_train_cv():
"""Test TrainCV class."""
skip_if_no_sklearn()
handle, layer0_filename = tempfile.mkstemp()
handle, layer1_filename = t... | bsd-3-clause |
manashmndl/Data-Science-45min-Intros | support-vector-machines-101/svm-example.py | 26 | 2219 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__="Josh Montague"
__license__="MIT License"
import sys
import pandas as pd
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.svm import SVC
import matplotlib.pyplot as plt
try:
import seaborn as sns
except ImportError as e:
sys.stde... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.