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 |
|---|---|---|---|---|---|
jtcorbett/tribrain | classify.py | 1 | 4418 | #!/usr/local/bin/python
import os
import pickle
import numpy as np
from PIL import Image
from random import shuffle
from pybrain.tools.shortcuts import buildNetwork
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers import BackpropTrainer
import matplotlib.pyplot as plt
from skimage.fea... | mit |
dblalock/bolt | experiments/python/debias_scratch.py | 1 | 3567 | #!/bin/env python
import numpy as np
import matplotlib.pyplot as plt
def main():
UNDEFINED = 7
M = 40000
# M = 500
# M = 2
# K = 16
# C = 64
try_Cs = np.array([2, 4, 8, 16, 32, 64, 128])
try_Us = np.array([2, 4, 8, 16, 32, 64, 128])
biases = np.zeros((try_Cs.size, try_Us.size))... | mpl-2.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/scipy/cluster/vq.py | 10 | 23926 | """
====================================================================
K-means clustering and vector quantization (:mod:`scipy.cluster.vq`)
====================================================================
Provides routines for k-means clustering, generating code books
from k-means models, and quantizing vectors ... | mit |
M-R-Houghton/euroscipy_2015 | stats/examples/plot_iris_analysis.py | 2 | 1402 | """
Analysis of Iris petal and sepal sizes
=======================================
Ilustrate an analysis on a real dataset:
- Visualizing the data to formulate intuitions
- Fitting of a linear model
- Hypothesis test of the effect of a categorical variable in the presence
of a continuous confound
"""
import matplo... | mit |
DeadlyApps/SDTIG_Machine-Learning-Examples | iris_prediction.py | 1 | 1612 | __author__ = "Chris Lucian"
# numpy is a data shaping and loading module
import numpy as np
# sklearn is a library of machne learning algorithms
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import metrics
from sklearn.svm import SVC
# Load the data from the CSV
data = np.genfromtxt('iris.tx... | mit |
fabioticconi/scikit-learn | examples/neural_networks/plot_mlp_alpha.py | 58 | 4088 | """
================================================
Varying regularization in Multi-layer Perceptron
================================================
A comparison of different values for regularization parameter 'alpha' on
synthetic datasets. The plot shows that different alphas yield different
decision functions.
A... | bsd-3-clause |
amoshyc/tthl-code | train_vgg19.py | 1 | 1254 | import json
from pathlib import Path
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
set_session(tf.Session(config=config))
from keras.models import Sequential, Model
from keras.pr... | apache-2.0 |
steveklabnik/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 |
aosingh/Regularization | LassoRegularization/Performance.py | 1 | 3025 | import numpy as np
from sklearn import linear_model
from LassoRegression import LassoRegression
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_regression
# Define synthetic data-set constants. Change this to experiment with different data sets
NUM_OF_SAMPLES = 2000
NUM_OF_FEATURES... | mit |
biolink/ontobio | ontobio/assocmodel.py | 1 | 17363 | """Simple association model
The core class here is AssociationSet, a holder for a set of
associations between entities such as genes and ontology
classes. AssociationSets can also be throught of as subsuming
traditional 'gene sets'
The model is deliberately simple, and does not seek to represent
metadata about the as... | bsd-3-clause |
GaZ3ll3/scikit-image | skimage/viewer/tests/test_tools.py | 19 | 5681 | 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, has_qt
from skimage.viewer.canvastools import (
LineTool, ThickLineTool, RectangleTool, PaintTool)
from skimage.v... | bsd-3-clause |
jeffknupp/arrow | python/testing/parquet_interop.py | 6 | 1734 | # 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 |
aflaxman/scikit-learn | sklearn/utils/tests/test_utils.py | 27 | 9605 | from itertools import chain, product
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import pinv2
from scipy.sparse.csgraph import laplacian
from sklearn.utils.testing import (assert_equal, assert_raises, assert_true,
assert_almost_equal, assert_array_... | bsd-3-clause |
manazhao/tf_recsys | tensorflow/examples/learn/iris.py | 29 | 2313 | # 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 |
rahul-c1/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | 34 | 2573 | import unittest
import nose
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less
from .test_gmm import GMMTester
np.seterr(all='warn')
def test_class_weights():
# ... | bsd-3-clause |
usc-isi-i2/dig3-extractions | initClassifiers.py | 1 | 2366 | import json
import codecs
import re
from jsonpath_rw import parse, jsonpath
import os
from digExtractionsClassifier import dig_extractions_classifier
import digExtractionsClassifier.utility.functions as utility_functions
from sklearn.externals import joblib
class ProcessClassifier():
""" Class to process the classi... | apache-2.0 |
tody411/InverseToon | inversetoon/core/light_estimation/light_estimation_voting.py | 1 | 3601 |
import numpy as np
import matplotlib.pyplot as plt
from inversetoon.np.norm import normalizeVector, normalizeVectors, normVectors
from inversetoon.core.light_estimation.light_estimation_common import testToon
from inversetoon.core.pixel_sampling import PixelSampling
from inversetoon.core.lumo import lumoNormal
def ... | mit |
pianomania/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 41 | 12562 | # Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from array import array
from collections import Mapping
from operator import itemgetter
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator, TransformerMixin
from ..externals import six
from ..ext... | bsd-3-clause |
RTHMaK/RPGOne | Documents/skflow-master/skflow/io/data_feeder.py | 2 | 15754 | """Implementations of different data feeders to provide data for TF trainer."""
# Copyright 2015-present Scikit Flow 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 Li... | apache-2.0 |
hpi-xnor/BMXNet | smd_hpi/examples/binary_mnist/mnist_cnn.py | 1 | 3131 | import numpy as np
import os
import urllib
import gzip
import struct
import argparse
import matplotlib.pyplot as plt
from train_val import train as mnist_train
from train_val import val as mnist_val
from train_val import classify as mnist_classify
from train_val import train_binary as mnist_train_binary
def download_... | apache-2.0 |
jwlawson/tensorflow | tensorflow/python/client/notebook.py | 109 | 4791 | # Copyright 2015 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 |
kirangonella/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 |
stscieisenhamer/glue | glue/utils/array.py | 1 | 4429 | from __future__ import absolute_import, division, print_function
import numpy as np
from numpy.lib.stride_tricks import as_strided
import pandas as pd
from glue.external.six import string_types
__all__ = ['unique', 'shape_to_string', 'view_shape', 'stack_view',
'coerce_numeric', 'check_sorted', 'broadca... | bsd-3-clause |
suiyuan2009/tensorflow | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | 13 | 9596 | # Copyright 2015 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 |
shenzebang/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 |
weidnem/IntroPython2016 | students/psbriant/final_project/test_clean_data.py | 2 | 2002 | """
Name: Paul Briant
Date: 12/11/16
Class: Introduction to Python
Assignment: Final Project
Description:
Tests for Final Project
"""
import clean_data as cd
import matplotlib.pyplot as plt
import pandas
import pytest
def get_data():
"""
Retrieve data from csv file to test.
"""
data = pandas.read_cs... | unlicense |
BiaDarkia/scikit-learn | examples/linear_model/plot_sgd_iris.py | 64 | 2208 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
mhvk/astropy | examples/io/split-jpeg-to-fits.py | 8 | 2647 | # -*- coding: utf-8 -*-
"""
=====================================================
Convert a 3-color image (JPG) to separate FITS images
=====================================================
This example opens an RGB JPEG image and writes out each channel as a separate
FITS (image) file.
This example uses `pillow <htt... | bsd-3-clause |
ishanic/scikit-learn | sklearn/utils/tests/test_validation.py | 133 | 18339 | """Tests for input validation functions"""
import warnings
from tempfile import NamedTemporaryFile
from itertools import product
import numpy as np
from numpy.testing import assert_array_equal
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true, assert_false, assert_equal
from sklearn.utils.... | bsd-3-clause |
thunderhoser/GewitterGefahr | gewittergefahr/plotting/probability_plotting.py | 1 | 4480 | """Plotting methods for probability."""
import numpy
import matplotlib.colors
from gewittergefahr.gg_utils import grids
from gewittergefahr.gg_utils import error_checking
def get_default_colour_map():
"""Returns default colour map for probability.
N = number of colours
:return: colour_map_object: Insta... | mit |
jankoslavic/numpy | numpy/doc/creation.py | 118 | 5507 | """
==============
Array Creation
==============
Introduction
============
There are 5 general mechanisms for creating arrays:
1) Conversion from other Python structures (e.g., lists, tuples)
2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros,
etc.)
3) Reading arrays from disk, either from... | bsd-3-clause |
yavalvas/yav_com | build/matplotlib/doc/mpl_examples/pylab_examples/eventcollection_demo.py | 7 | 1442 | #!/usr/bin/env python
# -*- Coding:utf-8 -*-
'''Plot two curves, then use EventCollections to mark the locations of the x
and y data points on the respective axes for each curve'''
import matplotlib.pyplot as plt
from matplotlib.collections import EventCollection
import numpy as np
# create random data
np.random.seed... | mit |
glemaitre/UnbalancedDataset | imblearn/metrics/tests/test_score_objects.py | 2 | 5899 | """Test for score"""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import sklearn
from sklearn.datasets import make_blobs
from sklearn.metrics import make_scorer
from sklearn.svm import LinearSVC
from sklearn.utils.testing import assert_allclose
from imblearn.metric... | mit |
yorzh86/Step1 | scripts/plotE.py | 1 | 3566 | #!/usr/bin/env python
#todo: smoothing lines, dash line where we calculate things,
# mirroring for plot2, and calculate conductivity.
import pylab as pl
from scipy.signal import savgol_filter
from matplotlib import style
def readE(fn):
t, ts, ke1, ke2 = pl.loadtxt(fn,unpack=True,skiprows=2)
return t,ts,abs(ke... | gpl-2.0 |
platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/generated/scipy-signal-fftconvolve-1.py | 1 | 1225 | # Autocorrelation of white noise is an impulse. (This is at least 100 times
# as fast as `convolve`.)
from scipy import signal
sig = np.random.randn(1000)
autocorr = signal.fftconvolve(sig, sig[::-1], mode='full')
import matplotlib.pyplot as plt
fig, (ax_orig, ax_mag) = plt.subplots(2, 1)
ax_orig.plot(sig)
ax_orig.s... | gpl-2.0 |
ketjow4/NOV | Lib/site-packages/numpy/core/code_generators/ufunc_docstrings.py | 57 | 85797 | # Docstrings for generated ufuncs
docdict = {}
def get(name):
return docdict.get(name)
def add_newdoc(place, name, doc):
docdict['.'.join((place, name))] = doc
add_newdoc('numpy.core.umath', 'absolute',
"""
Calculate the absolute value element-wise.
Parameters
----------
x : array_like... | gpl-3.0 |
walterreade/scikit-learn | examples/svm/plot_separating_hyperplane.py | 294 | 1273 | """
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machine classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impor... | bsd-3-clause |
duane-edgington/stoqs | stoqs/stoqs/views/app.py | 3 | 9373 | __author__ = 'Mike McCann'
__copyright__ = '2011'
__license__ = 'GPL v3'
__contact__ = 'mccann at mbari.org'
__doc__ = '''
Support functions fo the stoqsquery web app. Most of these will override methods
of classes in views/__init__.py to obtain specialized functionality for use by the
query view and REST AP... | gpl-3.0 |
weiHelloWorld/accelerated_sampling_with_autoencoder | MD_simulation_on_alanine_dipeptide/current_work/src/autoencoders.py | 1 | 84642 | from tf_load import *
from config import *
from molecule_spec_sutils import * # import molecule specific unitity code
from coordinates_data_files_list import *
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from keras.models import Sequential, Model, load_model
from keras.optimizers import *
... | mit |
ZenDevelopmentSystems/scikit-learn | sklearn/manifold/tests/test_isomap.py | 226 | 3941 | from itertools import product
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from sklearn import datasets
from sklearn import manifold
from sklearn import neighbors
from sklearn import pipeline
from sklearn import preprocessing
from sklearn.utils.testing import assert_less
... | bsd-3-clause |
eLBati/odoo | 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 |
qsnake/numpy | doc/sphinxext/plot_directive.py | 65 | 20399 | """
A special directive for generating a matplotlib plot.
.. warning::
This is a hacked version of plot_directive.py from Matplotlib.
It's very much subject to change!
Usage
-----
Can be used like this::
.. plot:: examples/example.py
.. plot::
import matplotlib.pyplot as plt
plt.plot... | bsd-3-clause |
barbagroup/cuIBM | external/snake-0.3/snake/convergence.py | 2 | 11784 | """
Implementation of the functions related to grid-convergence study.
"""
import os
import numpy
from matplotlib import pyplot
from .field import Field
def plot_grid_convergence(simulations, exact,
mask=None,
field_names=None,
norms=Non... | mit |
tbenthompson/okada_wrapper | test_okada.py | 1 | 3706 | from okada_wrapper import dc3d0wrapper, dc3dwrapper
from numpy import linspace, zeros, log
from matplotlib.pyplot import contourf, contour,\
xlabel, ylabel, title, colorbar, show, savefig
import matplotlib
import time
matplotlib.rcParams['font.family'] = 'serif'
matplotlib.rcParams['font.serif'] = ['Computer Modern... | mit |
yebrahim/pydatalab | solutionbox/ml_workbench/test_tensorflow/test_analyze.py | 2 | 23581 | from __future__ import absolute_import
from __future__ import print_function
import json
import os
import shutil
import subprocess
import sys
import tempfile
import uuid
import unittest
import pandas as pd
import six
from tensorflow.python.lib.io import file_io
import google.datalab as dl
import google.datalab.bigqu... | apache-2.0 |
SanPen/GridCal | src/GridCal/Engine/Devices/external_grid.py | 1 | 6396 | # This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | gpl-3.0 |
brunston/stellarpyl | tools.py | 3 | 15686 | # -*- coding: utf-8 -*-
"""
stellarPYL - python stellar spectra processing software
Copyright (c) 2016 Brunston Poon
@file: tools
This program comes with absolutely no warranty.
"""
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
#required for plotIntensityWLambda2
from mpl_toolkits.axes_... | gpl-3.0 |
tclose/PyPe9 | setup.py | 1 | 2752 | #!/usr/bin/env python
import os
import sys
from setuptools import find_packages # @UnresolvedImport
from distutils.core import setup
# Generate the package data
package_name = 'pype9'
package_dir = os.path.join(os.path.dirname(__file__), package_name)
package_data = []
prefix_len = len(package_dir) + 1
for path, dir... | mit |
IndraVikas/scikit-learn | examples/covariance/plot_sparse_cov.py | 300 | 5078 | """
======================================
Sparse inverse covariance estimation
======================================
Using the GraphLasso estimator to learn a covariance and sparse precision
from a small number of samples.
To estimate a probabilistic model (e.g. a Gaussian model), estimating the
precision matrix, t... | bsd-3-clause |
newville/scikit-image | doc/examples/plot_denoise.py | 17 | 2078 | """
====================
Denoising a picture
====================
In this example, we denoise a noisy version of the picture of the astronaut
Eileen Collins using the total variation and bilateral denoising filter.
These algorithms typically produce "posterized" images with flat domains
separated by sharp edges. It i... | bsd-3-clause |
priseborough/InertialNav | code/plot_attitude.py | 6 | 2118 | #!/bin/python
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import numpy as np
import math
data = np.genfromtxt('EulDataOut.txt', delimiter=' ', skip_header=1,
skip_footer=1, names=['time', 'roll', 'roll_onb', 'pitch', 'pitch_onb', 'yaw', 'yaw_onb', 'empty1', 'empty2'])
gda... | bsd-3-clause |
dangall/Kaggle-MobileODT-Cancer-Screening | modules/path_munging.py | 1 | 4547 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 27 11:26:31 2017
@author: daniele
"""
import os
import pandas as pd
import numpy as np
def all_image_paths(folderpath):
"""
Returns a list of filenames containing 'jpg'. The returned list has
sublists with filenames, where each sublis... | mit |
hehongliang/tensorflow | tensorflow/contrib/learn/python/learn/estimators/__init__.py | 39 | 12688 | # 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 |
IntelLabs/hpat | examples/series/series_copy.py | 1 | 1730 | # *****************************************************************************
# Copyright (c) 2020, Intel Corporation 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 sou... | bsd-2-clause |
Nyker510/scikit-learn | sklearn/ensemble/__init__.py | 217 | 1307 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | bsd-3-clause |
stscieisenhamer/glue | glue/qglue.py | 4 | 5190 | """
Utility function to load a variety of python objects into glue
"""
# Note: this is imported with Glue. We want
# to minimize imports so that utilities like glue-deps
# can run on systems with missing dependencies
from __future__ import absolute_import, division, print_function
import sys
from contextlib import c... | bsd-3-clause |
pkruskal/scikit-learn | examples/cluster/plot_kmeans_silhouette_analysis.py | 242 | 5885 | """
===============================================================================
Selecting the number of clusters with silhouette analysis on KMeans clustering
===============================================================================
Silhouette analysis can be used to study the separation distance between the... | bsd-3-clause |
ghorn/casadi | docs/examples/python/implicit_runge-kutta.py | 2 | 5148 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | lgpl-3.0 |
icdishb/scikit-learn | examples/model_selection/randomized_search.py | 57 | 3208 | """
=========================================================================
Comparing randomized search and grid search for hyperparameter estimation
=========================================================================
Compare randomized search and grid search for optimizing hyperparameters of a
random forest.
... | bsd-3-clause |
ABcDexter/python-weka-wrapper | python/weka/plot/dataset.py | 2 | 7421 | # 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 your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-3.0 |
JingJunYin/tensorflow | tensorflow/contrib/learn/python/learn/estimators/kmeans.py | 15 | 10904 | # 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 |
ubaumgar/OKR | gui/run.py | 1 | 5364 | #!/usr/bin/env python
import datetime
import sys
import wx
import wx.lib.inspection
import wx.lib.mixins.inspection
from okr.config import Config
from okr.exporter import export_excel_for_klipfolio
from okr.importer import import_excel_sheet
import matplotlib
matplotlib.use('WXAgg')
from okr.visualize import visuali... | bsd-2-clause |
demianw/dipy | doc/examples/reconst_shore_metrics.py | 13 | 3275 | """
===========================
Calculate SHORE scalar maps
===========================
We show how to calculate two SHORE-based scalar maps: return to origin
probability (rtop) [Descoteaux2011]_ and mean square displacement (msd)
[Wu2007]_, [Wu2008]_ on your data. SHORE can be used with any multiple b-value
dataset l... | bsd-3-clause |
bzero/statsmodels | statsmodels/tsa/x13.py | 19 | 23305 | """
Run x12/x13-arima specs in a subprocess from Python and curry results back
into python.
Notes
-----
Many of the functions are called x12. However, they are also intended to work
for x13. If this is not the case, it's a bug.
"""
from __future__ import print_function
import os
import subprocess
import tempfile
impor... | bsd-3-clause |
lkishline/expyfun | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 62 | 7703 | import re, inspect, textwrap, pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config={}):
self.use_plots = config.get('use_plots', False)
NumpyDocString.__init__(self, docstring, config=config)
... | bsd-3-clause |
raghavrv/scikit-learn | sklearn/__check_build/__init__.py | 345 | 1671 | """ Module to give helpful messages to the user that did not
compile the scikit properly.
"""
import os
INPLACE_MSG = """
It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.""... | bsd-3-clause |
homeslike/OpticalTweezer | scripts/p0.9_at0.1/vCOMhist.py | 28 | 1192 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import sys
# import vCOMdata.dat as array
# folder="../output/runs/170123_2033/"
folder="../output/runs/"+str(sys.argv[1])
# when = str(sys.argv[1])
for i in range(0,len(sys.argv)):
print(str(i) + ": "+ str(sys.argv[i]))
# data = np.... | mit |
allenlavoie/tensorflow | tensorflow/python/estimator/inputs/queues/feeding_queue_runner_test.py | 116 | 5164 | # 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 |
UltronAI/Deep-Learning | Pattern-Recognition/hw2-Feature-Selection/skfeature/function/wrapper/svm_backward.py | 1 | 1775 | import numpy as np
from sklearn.svm import SVC
from sklearn.model_selection import KFold
from sklearn.metrics import accuracy_score
def svm_backward(X, y, n_selected_features):
"""
This function implements the backward feature selection algorithm based on SVM
Input
-----
X: {numpy arr... | mit |
mikofski/pvlib-python | pvlib/tests/iotools/test_solrad.py | 1 | 5036 | import pandas as pd
from conftest import assert_frame_equal
import numpy as np
from numpy import nan
import pytest
from pvlib.iotools import solrad
from conftest import DATA_DIR
testfile = DATA_DIR / 'abq19056.dat'
testfile_mad = DATA_DIR / 'msn19056.dat'
columns = [
'year', 'julian_day', 'month', 'day', 'hou... | bsd-3-clause |
teonlamont/mne-python | tutorials/plot_visualize_epochs.py | 10 | 5143 | """
.. _tut_viz_epochs:
Visualize Epochs data
=====================
"""
# sphinx_gallery_thumbnail_number = 7
import os.path as op
import mne
data_path = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample')
raw = mne.io.read_raw_fif(
op.join(data_path, 'sample_audvis_raw.fif'), preload=True)
raw.load_data... | bsd-3-clause |
sarahgrogan/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 98 | 20870 | from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.cross_validation import train_test_split
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing impor... | bsd-3-clause |
0x0all/scikit-learn | sklearn/linear_model/tests/test_ridge.py | 2 | 22917 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
Gluttton/PslRK | Tools/Modeling/bpsk_convolutinal_code_animate.py | 1 | 2866 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
class BPSK (object):
def __init__ (self, ax):
self.sample_rate = 5e3
self.code = "+++---+++-------+++-+++--++-+++-++-+-+-++-++-++-+--"
self.bit_width = 5e-3
self.t... | mit |
pypot/scikit-learn | examples/ensemble/plot_gradient_boosting_regularization.py | 355 | 2843 | """
================================
Gradient Boosting regularization
================================
Illustration of the effect of different regularization strategies
for Gradient Boosting. The example is taken from Hastie et al 2009.
The loss function used is binomial deviance. Regularization via
shrinkage (``lear... | bsd-3-clause |
leal26/AeroPy | examples/2D/flight_conditions/convergence_study.py | 2 | 4724 | import pickle
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import interpolate
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances_argmin_min
import aeropy.xfoil_module as xf
from aeropy.aero_module import Reynolds
from aeropy.geom... | mit |
mlyundin/scikit-learn | sklearn/datasets/tests/test_mldata.py | 384 | 5221 | """Test functionality of mldata fetching utilities."""
import os
import shutil
import tempfile
import scipy as sp
from sklearn import datasets
from sklearn.datasets import mldata_filename, fetch_mldata
from sklearn.utils.testing import assert_in
from sklearn.utils.testing import assert_not_in
from sklearn.utils.test... | bsd-3-clause |
JakeCowton/titanic | src/classifiers.py | 1 | 10175 | import numpy as np
from sklearn.ensemble import RandomForestClassifier
from utils import write_results, get_training_data,\
get_evaluation_data, get_testing_data,\
get_all_training_data, normalise_data
from evaluation import EvaluationMetrics
from slp import create_slp
from nn_manage... | mit |
aflaxman/scikit-learn | benchmarks/bench_20newsgroups.py | 377 | 3555 | from __future__ import print_function, division
from time import time
import argparse
import numpy as np
from sklearn.dummy import DummyClassifier
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.metrics import accuracy_score
from sklearn.utils.validation import check_array
from sklearn.ensemb... | bsd-3-clause |
iLampard/alphaware | alphaware/metrics/return_metrics.py | 1 | 7004 | # -*- coding: utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
from argcheck import (expect_types,
optional,
preprocess)
from ..enums import (FreqType,
FactorType,
OutputDataFormat)
from ..utils import (ensure_cumul_retu... | apache-2.0 |
jhnnsnk/nest-simulator | pynest/examples/gap_junctions_two_neurons.py | 12 | 2950 | # -*- coding: utf-8 -*-
#
# gap_junctions_two_neurons.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 t... | gpl-2.0 |
rahul-c1/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
kaichogami/scikit-learn | sklearn/datasets/__init__.py | 72 | 3807 | """
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_diabetes
from .base import load_digits
from .base import load_files
from .base import load_iris
from .... | bsd-3-clause |
Jimmy-Morzaria/scikit-learn | sklearn/cluster/setup.py | 263 | 1449 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = ... | bsd-3-clause |
3manuek/scikit-learn | sklearn/tests/test_random_projection.py | 142 | 14033 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
Evolving-AI-Lab/innovation-engine | caffe/python/detect.py | 23 | 5743 | #!/usr/bin/env python
"""
detector.py is an out-of-the-box windowed detector
callable from the command line.
By default it configures and runs the Caffe reference ImageNet model.
Note that this model was trained for image classification and not detection,
and finetuning for detection can be expected to improve results... | mit |
ray-project/ray | python/ray/tune/schedulers/pb2_utils.py | 1 | 5923 | import numpy as np
from scipy.optimize import minimize
import GPy
from GPy.kern import Kern
from GPy.core import Param
from sklearn.metrics import pairwise_distances
from sklearn.metrics.pairwise import euclidean_distances
class TV_SquaredExp(Kern):
""" Time varying squared exponential kernel.
For more i... | apache-2.0 |
YinongLong/scikit-learn | sklearn/datasets/tests/test_kddcup99.py | 59 | 1336 | """Test kddcup99 loader. Only 'percent10' mode is tested, as the full data
is too big to use in unit-testing.
The test is skipped if the data wasn't previously fetched and saved to
scikit-learn data folder.
"""
import errno
from sklearn.datasets import fetch_kddcup99
from sklearn.utils.testing import assert_equal, S... | bsd-3-clause |
questrail/siganalysis | siganalysis.py | 1 | 18048 | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2016 The siganalysis developers. All rights reserved.
# Project site: https://github.com/questrail/siganalysis
# Use of this source code is governed by a MIT-style license that
# can be found in the LICENSE.txt file for the project.
"""Provide Python routines for signal anal... | mit |
quantopian/empyrical | empyrical/perf_attrib.py | 1 | 5834 | from collections import OrderedDict
import pandas as pd
def perf_attrib(returns,
positions,
factor_returns,
factor_loadings):
"""
Attributes the performance of a returns stream to a set of risk factors.
Performance attribution determines how much each risk ... | apache-2.0 |
saketkc/statsmodels | statsmodels/formula/formulatools.py | 32 | 3846 | from statsmodels.compat.python import iterkeys
import statsmodels.tools.data as data_util
from patsy import dmatrices, NAAction
import numpy as np
# if users want to pass in a different formula framework, they can
# add their handler here. how to do it interactively?
# this is a mutable object, so editing it should s... | bsd-3-clause |
mlyundin/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
hlin117/statsmodels | statsmodels/tsa/vector_ar/tests/test_var.py | 23 | 18346 | """
Test VAR Model
"""
from __future__ import print_function
# pylint: disable=W0612,W0231
from statsmodels.compat.python import (iteritems, StringIO, lrange, BytesIO,
range)
from nose.tools import assert_raises
import nose
import os
import sys
import numpy as np
import statsmod... | bsd-3-clause |
jjhelmus/scipy | scipy/stats/morestats.py | 6 | 95788 | from __future__ import division, print_function, absolute_import
import math
import warnings
from collections import namedtuple
import numpy as np
from numpy import (isscalar, r_, log, around, unique, asarray,
zeros, arange, sort, amin, amax, any, atleast_1d,
sqrt, ceil, floor, a... | bsd-3-clause |
shahankhatch/scikit-learn | sklearn/linear_model/passive_aggressive.py | 97 | 10879 | # Authors: Rob Zinkov, Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from .stochastic_gradient import BaseSGDRegressor
from .stochastic_gradient import DEFAULT_EPSILON
class PassiveAggressiveClassifier(BaseSGDClassifier):
"""Passive Aggressive Classifier
Read mor... | bsd-3-clause |
gregerhardt/sfdata_wrangler | sfdata_wrangler/qtpandas.py | 2 | 4281 | '''
Easy integration of DataFrame into pyqt framework
@author: Jev Kuznetsov
adapted from pandas.sandbox.qtpandas,
modified by Gregory D. Erhardt for SFCTA
'''
from qtpy.QtCore import QAbstractTableModel, Qt, QModelIndex
from qtpy.QtWidgets import QApplication, QDialog, QVBoxLayout, QTableView, QWidget
QVariant = l... | gpl-3.0 |
wasade/qiime | qiime/stats.py | 1 | 91757 | #!/usr/bin/env python
from __future__ import division
__author__ = "Michael Dwan"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["Jai Ram Rideout", "Michael Dwan", "Logan Knecht",
"Damien Coy", "Levi McCracken", "Andrew Cochran",
"Jose Carlos Clemente Litran", "Greg Ca... | gpl-2.0 |
aflaxman/scikit-learn | sklearn/neighbors/tests/test_ball_tree.py | 26 | 10379 | import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dis... | bsd-3-clause |
vlas-sokolov/pyspeckit | pyspeckit/wrappers/fitnh3.py | 1 | 14315 | """
NH3 fitter wrapper
==================
Wrapper to fit ammonia spectra. Generates a reasonable guess at the position
and velocity using a gaussian fit
Example use:
.. code:: python
import pyspeckit
sp11 = pyspeckit.Spectrum('spec.nh3_11.dat', errorcol=999)
sp22 = pyspeckit.Spectrum('spec.nh3_22.dat',... | mit |
schwarty/nignore | viz_utils.py | 1 | 4589 | import matplotlib
matplotlib.use('Agg')
import numpy as np
import pylab as pl
import nibabel as nb
# Utilities for colormaps
from matplotlib import cm as _cm
from matplotlib import colors as _colors
from scipy.stats import scoreatpercentile
from sklearn.preprocessing import StandardScaler
from nilearn.image.image im... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.