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 |
|---|---|---|---|---|---|
KaroDievas/car-sound-classification-with-keras | TrainModel.py | 1 | 2424 | from keras.preprocessing.image import ImageDataGenerator
from Models.KerasModel import KerasModel
from keras.callbacks import ModelCheckpoint
import matplotlib.pyplot as plt
import tensorflow as tf
from keras import backend as K
K.set_image_dim_ordering('th')
config = tf.ConfigProto()
config.gpu_options.allow_growth =... | mit |
fyffyt/scikit-learn | examples/datasets/plot_random_multilabel_dataset.py | 278 | 3402 | """
==============================================
Plot randomly generated multilabel dataset
==============================================
This illustrates the `datasets.make_multilabel_classification` dataset
generator. Each sample consists of counts of two features (up to 50 in
total), which are differently distri... | bsd-3-clause |
pythonvietnam/scikit-learn | benchmarks/bench_plot_nmf.py | 206 | 5890 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... | bsd-3-clause |
addgene/research | toolkit/serotypes.py | 1 | 4712 | from __future__ import division
import click
import os
import logging
from collections import namedtuple
from datetime import date
from pandas import DataFrame
from parameters import Serotypes_Parameters as params
from utils import read_fastq_file, get_fastq_files, setup_dirs
L = logging.getLogger(__name__)
#### Co... | gpl-3.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/scipy/cluster/tests/test_hierarchy.py | 9 | 41551 | #
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this... | mit |
wdurhamh/statsmodels | statsmodels/tsa/statespace/tests/test_sarimax.py | 8 | 65069 | """
Tests for SARIMAX models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
import warnings
from statsmodels.tsa.statespace import sarimax, tools
from statsmodels.tsa import arima_model as arima
from .r... | bsd-3-clause |
lbishal/scikit-learn | examples/linear_model/plot_ard.py | 18 | 2827 | """
==================================================
Automatic Relevance Determination Regression (ARD)
==================================================
Fit regression model with Bayesian Ridge Regression.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary l... | bsd-3-clause |
Garygunn94/wavenet | kerasRNNexample.py | 1 | 2023 | import pandas as pd
from random import random
from scikits.audiolab import wavread, wavwrite
from numpy import abs, max
# Load in the stereo file
#flow = (list(range(1,10,1)) + list(range(10,1,-1)))*100
#pdata = pd.DataFrame({"a":flow, "b":flow})
#pdata.b = pdata.b.shift(9)
#data = pdata.iloc[10:] * random() # some... | mit |
jzt5132/scikit-learn | examples/linear_model/plot_lasso_lars.py | 363 | 1080 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause |
abhisg/scikit-learn | benchmarks/bench_glmnet.py | 297 | 3848 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... | bsd-3-clause |
ccasotto/rmtk | tests/vulnerability/tests_TO_BE_CHANGED/NDP/test_IDA_postprocess.py | 4 | 1424 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 17 15:43:50 2015
@author: chiaracasotto
"""
import numpy as np
import csv
import os
from rmtk.vulnerability.NDP.IDA_postprocess import IDA_postprocess
import pandas as pd
# INPUTS
cd = os.getcwd()
input1 = cd+'/inputs/IMval.csv'
input2 = cd+'/inputs/EDPval.csv'
input3 ... | agpl-3.0 |
garyfeng/pybrain | examples/rl/valuebased/nfq.py | 25 | 1973 | from __future__ import print_function
#!/usr/bin/env python
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.environments.cartpole import CartPoleEnvironment, DiscreteBalanceTask, CartPoleRenderer
from pybrain.rl.agents import LearningAgent
from pybrain.rl.experiments import EpisodicExperiment
fr... | bsd-3-clause |
ishanic/scikit-learn | sklearn/cross_decomposition/cca_.py | 209 | 3150 | from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Read more in the :ref:`User Guide <cross_decomposition>`.
Parameters
----------
n_components : int, (default 2).
numb... | bsd-3-clause |
Xilinx/PYNQ | setup.py | 4 | 16451 | # Copyright (c) 2016, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | bsd-3-clause |
pllim/ginga | ginga/rv/plugins/LineProfile.py | 3 | 24066 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
A plugin to graph the pixel values along a straight line bisecting a cube.
**Plugin Type: Local**
``LineProfile`` is a local plugin, which means it is associated with a
channel. An instance can be opened f... | bsd-3-clause |
asgeran/MIMPy | examples/rir_audio.py | 1 | 2492 | """ Computes the response from one point to another in a room. Load a .wav
file, convolves it with the response and saves the result.
The default settings of the script corresponds to a large reverberant space
like a church or similar. Try playing around with the parameters!
Beware that you have to supply a .wav file... | gpl-2.0 |
pyrocko/pyrocko | src/gui/snufflings/ampspec.py | 1 | 4950 | # http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from ..snuffling import Snuffling, Param, Switch
import numpy as num
from matplotlib import cm
def window(freqs, fc, b):
if fc == 0.:
w = num.zeros(len(freqs)... | gpl-3.0 |
CentreForCorpusResearch/clic | clic/kwicgrouper.py | 2 | 10445 | # -*- coding: utf-8 -*-
'''
A module to look for patterns in concordances.
'''
import copy
import nltk
import pandas as pd
import re
from string import punctuation
def clean_text(text):
'''
Clean a text so that it can be used in a concordance. This includes:
- all text to lowercase
- deleting... | mit |
thilbern/scikit-learn | examples/decomposition/plot_ica_blind_source_separation.py | 349 | 2228 | """
=====================================
Blind source separation using FastICA
=====================================
An example of estimating sources from noisy data.
:ref:`ICA` is used to estimate sources given noisy measurements.
Imagine 3 instruments playing simultaneously and 3 microphones
recording the mixed si... | bsd-3-clause |
evidation-health/bokeh | examples/glyphs/anscombe.py | 39 | 2945 | from __future__ import print_function
import numpy as np
import pandas as pd
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle, Line
from bokeh.models import (
ColumnDataSource, Grid, GridPlot, LinearAxis, Plot, Range1d
)... | bsd-3-clause |
xuanyuanking/spark | python/pyspark/sql/functions.py | 14 | 161861 | #
# 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 |
Nyker510/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py | 254 | 2795 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
savkov/BootstrapSplit | src/bootstrapsplit.py | 1 | 20581 | # Copyright (c) 2015, Aleksandar Savkov
# 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 list of conditions a... | bsd-3-clause |
hsiaoyi0504/scikit-learn | examples/linear_model/plot_sgd_loss_functions.py | 249 | 1095 | """
==========================
SGD: convex loss functions
==========================
A plot that compares the various convex loss functions supported by
:class:`sklearn.linear_model.SGDClassifier` .
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def modified_huber_loss(y_true, y_pred):
z ... | bsd-3-clause |
appapantula/scikit-learn | sklearn/metrics/metrics.py | 233 | 1262 | import warnings
warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in "
"0.18. Please import from sklearn.metrics",
DeprecationWarning)
from .ranking import auc
from .ranking import average_precision_score
from .ranking import label_ranking_average_precision_score
fro... | bsd-3-clause |
nhejazi/scikit-learn | sklearn/grid_search.py | 24 | 40365 | """
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 |
rstebbing/shards | visualise_progress.py | 1 | 5053 | ##########################################
# File: visualise_progress.py #
# Copyright Richard Stebbing 2014. #
# Distributed under the MIT License. #
# (See accompany file LICENSE or copy at #
# http://opensource.org/licenses/MIT) #
##########################################
# Imports
import a... | mit |
johnowhitaker/bobibabber | sklearn/grid_search.py | 1 | 28836 | """
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>
# ... | mit |
gokhanettin/driverless-rccar | station/deeprccar/plot_test.py | 1 | 1636 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
parser = argparse.ArgumentParser()
parser.add_argument("csv_file")
parser.add_argument("--y_axis", choices=["steering", "speed"],
default="steering",
... | gpl-3.0 |
vybstat/scikit-learn | sklearn/neighbors/tests/test_ball_tree.py | 159 | 10196 | 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 |
GoogleCloudPlatform/mlops-on-gcp | workshops/kfp-caip-sklearn/lab-02-kfp-pipeline/exercises/pipeline/helper_components.py | 12 | 2846 | # Copyright 2019 Google LLC
#
# 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, ... | apache-2.0 |
stkubr/zipline | zipline/history/history_container.py | 2 | 33934 | #
# 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 |
DynamicGravitySystems/DGP | dgp/lib/trajectory_ingestor.py | 1 | 5101 | # coding=utf-8
"""
trajectory_ingestor.py
Library for trajectory data import functions
"""
import numpy as np
import pandas as pd
from pandas.tseries.offsets import Milli
from .time_utils import leap_seconds, convert_gps_time, datenum_to_datetime
TRAJECTORY_INTERP_FIELDS = {'lat', 'long', 'ell_ht'}
def import_tr... | apache-2.0 |
mdjurfeldt/nest-simulator | examples/nest/Potjans_2014/spike_analysis.py | 15 | 6288 | # -*- coding: utf-8 -*-
#
# spike_analysis.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,... | gpl-2.0 |
vivekmishra1991/scikit-learn | sklearn/tests/test_kernel_ridge.py | 342 | 3027 | import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge
from sklearn.kernel_ridge import KernelRidge
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils.testing import ignore_warnings
from sklearn.utils.testing import assert... | bsd-3-clause |
spallavolu/scikit-learn | sklearn/cluster/tests/test_bicluster.py | 226 | 9457 | """Testing for Spectral Biclustering methods"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.grid_search import ParameterGrid
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from... | bsd-3-clause |
Jiangshangmin/mpld3 | mpld3/test_plots/test_mouse_events.py | 19 | 1320 | """Plot to test mouse events"""
import matplotlib.pyplot as plt
import numpy as np
import mpld3, mpld3.plugins as plugins
class ClickInfo(plugins.PluginBase):
"""Plugin for getting info on click"""
JAVASCRIPT = """
mpld3.register_plugin("clickinfo", ClickInfo);
ClickInfo.prototype = Object.create(mpl... | bsd-3-clause |
jmetzen/scikit-learn | examples/linear_model/plot_theilsen.py | 100 | 3846 | """
====================
Theil-Sen Regression
====================
Computes a Theil-Sen Regression on a synthetic dataset.
See :ref:`theil_sen_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the Theil-Sen
estimator is robust against outliers. It has a breakd... | bsd-3-clause |
ndingwall/scikit-learn | examples/svm/plot_separating_hyperplane.py | 45 | 1308 | """
=========================================
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 |
davidgbe/scikit-learn | sklearn/neural_network/tests/test_rbm.py | 225 | 6278 | import sys
import re
import numpy as np
from scipy.sparse import csc_matrix, csr_matrix, lil_matrix
from sklearn.utils.testing import (assert_almost_equal, assert_array_equal,
assert_true)
from sklearn.datasets import load_digits
from sklearn.externals.six.moves import cStringIO as ... | bsd-3-clause |
rodluger/everest | everest/masksolve.py | 1 | 4064 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
:py:mod:`masksolve.py` - Solve a masked linear problem quickly
--------------------------------------------------------------
'''
from __future__ import division, print_function, absolute_import, \
unicode_literals
from .utils import prange
import numpy... | mit |
brianlorenz/COSMOS_IMACS_Redshifts | PlotCodes/Plot_Avs.py | 1 | 7341 | #Plots the Av magnitude due to the balmer decerment
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii
import sys, os, string
import pandas as pd
from astropy.io import fits
import collections
from astropy.stats import biweight_midvariance
#Folder to save the figures
figout = '/Users/blore... | mit |
eramirem/astroML | book_figures/chapter5/fig_signal_background.py | 3 | 3660 | """
Finding a signal in a background
--------------------------------
Figure 5.26
Fitting a model of a signal in an unknown background. The histogram in the
top-right panel visualizes a sample drawn from a Gaussian signal plus a
uniform background model given by eq. 5.83 and shown by the line. The remaining
panels sho... | bsd-2-clause |
victor-prado/broker-manager | environment/lib/python3.5/site-packages/pandas/tseries/tests/test_timeseries.py | 7 | 216448 | # pylint: disable-msg=E1101,W0612
import calendar
import operator
import sys
import warnings
from datetime import datetime, time, timedelta
from numpy.random import rand
import nose
import numpy as np
import pandas.index as _index
import pandas.lib as lib
import pandas.tslib as tslib
from pandas.types.common import i... | mit |
NICTA/linearizedGP | experiments/uspsbclass.py | 1 | 4452 | #! /usr/bin/env python
# linearizedGP -- Implementation of extended and unscented Gaussian processes.
# Copyright (C) 2014 National ICT Australia (NICTA)
#
# This file is part of linearizedGP.
#
# linearizedGP is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public... | gpl-3.0 |
cwu2011/scikit-learn | examples/ensemble/plot_gradient_boosting_regression.py | 227 | 2520 | """
============================
Gradient Boosting regression
============================
Demonstrate Gradient Boosting on the Boston housing dataset.
This example fits a Gradient Boosting model with least squares loss and
500 regression trees of depth 4.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prett... | bsd-3-clause |
jmmease/pandas | pandas/core/computation/engines.py | 15 | 3799 | """
Engine classes for :func:`~pandas.eval`
"""
import abc
from pandas import compat
from pandas.compat import map
import pandas.io.formats.printing as printing
from pandas.core.computation.align import _align, _reconstruct_object
from pandas.core.computation.ops import (
UndefinedVariableError,
_mathops, _re... | bsd-3-clause |
jlegendary/scikit-learn | sklearn/utils/tests/test_testing.py | 144 | 4121 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... | bsd-3-clause |
facemelters/data-science | Atlas/PyTagPredict.py | 1 | 7282 | import numpy as np
import pandas as pd
import urllib2
from sklearn import linear_model
from sklearn import metrics
from sklearn import cross_validation
from bs4 import BeautifulSoup
def get_tag_name(tag_url):
"""Takes a Atlas Obscura db dump and turns the tag_url into bare tags."""
return tag_url.split('/')[2... | gpl-2.0 |
xuewei4d/scikit-learn | examples/linear_model/plot_lasso_lars.py | 23 | 1048 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause |
robin-lai/scikit-learn | sklearn/metrics/scorer.py | 211 | 13141 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
bloyl/mne-python | examples/visualization/topo_customized.py | 15 | 1940 | """
========================================
Plot custom topographies for MEG sensors
========================================
This example exposes the :func:`~mne.viz.iter_topography` function that makes
it very easy to generate custom sensor topography plots.
Here we will plot the power spectrum of each channel on a... | bsd-3-clause |
maheshakya/scikit-learn | sklearn/linear_model/tests/test_coordinate_descent.py | 6 | 21872 | # 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 |
lab11/M-ulator | platforms/m3/programming/plot_pstack_radv8.py | 1 | 1786 | #!/usr/bin/python
# Python script to parse Pstack radio output
# Looks for alternating transmissions of C_MEAS and C_REF data
# 9/2/2015 Gyouho Kim
# 11/15/2015 Gyouho Kim: Added date/time logging
import sys
import csv
import matplotlib.pyplot as plt
import numpy as np
print()
text_file = open(sys.argv[1], "r")
line... | gpl-3.0 |
quheng/scikit-learn | examples/tree/plot_iris.py | 271 | 2186 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/matplotlib/backends/backend_template.py | 2 | 8926 | """
This is a fully functional do nothing backend to provide a template to
backend writers. It is fully functional in that you can select it as
a backend with
import matplotlib
matplotlib.use('Template')
and your matplotlib scripts will (should!) run without error, though
no output is produced. This provides a ... | mit |
ephes/scikit-learn | sklearn/utils/tests/test_class_weight.py | 140 | 11909 | import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_blobs
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testin... | bsd-3-clause |
fbagirov/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 |
Selameab/opencog | opencog/nlp/learn/Graphing Tools/creategraph.py | 20 | 1648 | #This file draws the actual graphs.
#it needs matplotlib as well as numpy to run.
import numpy
from matplotlib import pyplot as plt
import math
fp=open("tmep.txt","r")
a=[]
b=[]
for line in fp:
string=line.strip().split()
a.append(math.log(float(string[0])))
b.append(math.log(float(string[1])))
a=numpy.asarray(a,d... | agpl-3.0 |
skyduy/simple-dl | SoftmaxRegression/SR.py | 1 | 5049 | #!/usr/bin/python
# coding: utf-8
"""
准确率:92.6%
~~~~~~~~~~~~~~~~~~~~~~~~~~
Author: YuJun <cuteuy@gmail.com>
"""
import time
import numpy as np
import scipy.sparse
import scipy.optimize
from sklearn.externals import joblib
from utils import load_mnist_images, load_mnist_labels
class SoftmaxRegression(obj... | mit |
etkirsch/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 213 | 3359 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
ykim362/mxnet | example/bayesian-methods/bdk_demo.py | 45 | 15837 | # 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 |
IshankGulati/scikit-learn | sklearn/tests/test_multiclass.py | 26 | 26681 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal, assert_raises_regex
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from s... | bsd-3-clause |
brummer-simon/RIOT | tests/pkg_emlearn/generate_digit.py | 11 | 1304 | #!/usr/bin/env python3
"""Generate a binary file from a sample image of the MNIST dataset.
Pixel of the sample are stored as float32, images have size 8x8.
"""
import os
import argparse
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn import datase... | lgpl-2.1 |
xuzhuoran0106/cuda-convnet2 | shownet.py | 180 | 18206 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
yutiansut/QUANTAXIS | QUANTAXIS/QAData/base_datastruct.py | 2 | 41189 | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2021 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation th... | mit |
cdfassnacht/CodeCDF | python/lensfuncs.py | 1 | 11675 | """
A class LensInfo that holds relevant information about a
gravitational lens systems and calculate some relevant parameters
"""
import numpy as np
from astropy import constants as const
from math import pi
from matplotlib import pyplot as plt
class LensInfo:
def __init__(self, intable, h=0.7):
"""
... | mit |
lmallin/coverage_test | python_venv/lib/python2.7/site-packages/pandas/tests/frame/test_subclass.py | 15 | 9524 | # -*- coding: utf-8 -*-
from __future__ import print_function
from warnings import catch_warnings
import numpy as np
from pandas import DataFrame, Series, MultiIndex, Panel
import pandas as pd
import pandas.util.testing as tm
from pandas.tests.frame.common import TestData
class TestDataFrameSubclassing(TestData):... | mit |
jhnnsnk/nest-simulator | pynest/examples/gif_population.py | 7 | 5050 | # -*- coding: utf-8 -*-
#
# gif_population.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,... | gpl-2.0 |
eimrek/phase-field-crystal-mpi | python_code/main.py | 1 | 21301 | """
PFC code in python
- Kristjan Eimre
"""
import numpy as np
import matplotlib.pyplot as plt
import time
import scipy.signal
import scipy.ndimage
import equilibrium_algorithms
import equilibrium_algorithms_2
# number of cells in the grid and cell dimensions
# 384
# 1536
nx = 384
ny = 384
dx = 2.0
dy = 2.0
dt = 0... | gpl-3.0 |
castlest/shell-detection | fits-algs/contours-ellipse.py | 2 | 3135 | '''
contours_ellipse.py
Experiment with OpenCV for FITS files.
http://docs.opencv.org/trunk/doc/py_tutorials/py_tutorials.html
Author: S.T. Castle
Created: 20150217
'''
import numpy as np
import cv2
import fileinput
from matplotlib import pyplot as plt
import sys
from fits-proc import FitsProc
def main():
for ... | bsd-3-clause |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/sklearn/feature_extraction/image.py | 21 | 18105 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... | mit |
pevik/ltp | testcases/realtime/tools/ftqviz.py | 5 | 4412 | #!/usr/bin/env python3
# Filename: ftqviz.py
# Author: Darren Hart <dvhltc@us.ibm.com>
# Description: Plot the time and frequency domain plots of a times and
# counts log file pair from the FTQ benchmark.
# Prerequisites: numpy, scipy, and pylab packages. For debian/ubuntu:
# ... | gpl-2.0 |
droundy/deft | papers/thesis-kirstie/figs/plot_HardSphere_Potential.py | 1 | 1123 | #!/usr/bin/python3
#RUN this program from the directory it is listed in
#with command ./plot_HardSphere_Potential.py
from scipy import special
import numpy as np
import matplotlib.pyplot as plt
import math
#Plot Hard Sphere Potential vs r
R=1/1.781797436 #for a sigma=1 DOESN"T WORK!! graph wrong shape!
epsilon=... | gpl-2.0 |
PanDAWMS/panda-server | pandaserver/dataservice/DDMHandler.py | 1 | 1988 | '''
master hander for DDM
'''
import re
import threading
from pandaserver.dataservice.Finisher import Finisher
from pandaserver.dataservice.Activator import Activator
from pandacommon.pandalogger.PandaLogger import PandaLogger
from pandacommon.pandalogger.LogWrapper import LogWrapper
# logger
_logger = PandaLogge... | apache-2.0 |
trdean/grEME | gr-filter/examples/fir_filter_ccc.py | 6 | 4023 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# ... | gpl-3.0 |
arjoly/scikit-learn | sklearn/datasets/__init__.py | 15 | 3741 | """
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 |
j08lue/poppy | scripts/save_annual_max_timeseries.py | 1 | 2159 | #!/usr/bin/env python
from __future__ import print_function
import numpy as np
import pandas as pd
import argparse
import glob
import poppy.metrics
regionlims = {
'Global' : dict(lonlim=(-90,90),latlim=(-180,180)),
'Atlantic' : dict(lonlim=(-80,40),latlim=(-70,70)),
'PolarNorthAtlantic': dict... | gpl-2.0 |
groutr/numpy | numpy/core/code_generators/ufunc_docstrings.py | 14 | 90528 | """
Docstrings for generated ufuncs
The syntax is designed to look like the function add_newdoc is being
called from numpy.lib, but in this file add_newdoc puts the docstrings
in a dictionary. This dictionary is used in
numpy/core/code_generators/generate_umath.py to generate the docstrings
for the ufuncs in numpy.co... | bsd-3-clause |
B3AU/waveTree | examples/ensemble/plot_random_forest_embedding.py | 7 | 3511 | """
=========================================================
Hashing feature transformation using Totally Random Trees
=========================================================
RandomTreesEmbedding provides a way to map data to a
very high-dimensional, sparse representation, which might
be beneficial for classificati... | bsd-3-clause |
dcalacci/love-in-the-time-of-communism | src/sentiment_utils.py | 1 | 9017 | #!/usr/bin/env python
import difflib
import Levenshtein
import pandas as pd
import numpy as np
import lexicons.lexiconUtils as sentimentUtils
from collections import defaultdict
from corenlp_utils import *
liwc = sentimentUtils.LiwcDict()
def is_negated(w, sen):
"""
sen is an annotated sentence object, word is... | mit |
ifcharming/voltdb2.1 | tools/vis-micro.py | 4 | 8084 | #!/usr/bin/env python
# This is a visualizer which pulls TPC-C benchmark results from the MySQL
# databases and visualizes them. Four graphs will be generated, latency graph on
# sinigle node and multiple nodes, and throughput graph on single node and
# multiple nodes.
#
# Run it without any arguments to see what argu... | gpl-3.0 |
rohanp/scikit-learn | examples/svm/plot_svm_regression.py | 120 | 1520 | """
===================================================================
Support Vector Regression (SVR) using linear and non-linear kernels
===================================================================
Toy example of 1D regression using linear, polynomial and RBF kernels.
"""
print(__doc__)
import numpy as np
... | bsd-3-clause |
jayflo/scikit-learn | examples/ensemble/plot_forest_importances.py | 241 | 1761 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
Huyuwei/tvm | vta/tutorials/frontend/deploy_vision_on_vta.py | 1 | 11387 | # 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 |
giopastor/moose | test/tests/time_integrators/convergence/implicit_plot.py | 12 | 5535 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Use fonts that match LaTeX
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] = 17
rcParams['font.serif'] = ['Computer Modern Roman']
rcParams['text.usetex'] = True
# Small font size for the legend
from mat... | lgpl-2.1 |
sinhrks/pandas-ml | pandas_ml/skaccessors/cross_decomposition.py | 3 | 1938 | #!/usr/bin/env python
from pandas_ml.core.accessor import _AccessorMethods
class CrossDecompositionMethods(_AccessorMethods):
"""
Accessor to ``sklearn.cross_decomposition``.
"""
_module_name = 'sklearn.cross_decomposition'
_method_mapper = dict(fit={'PLSCanonical': '_fit', 'CCA': '_f... | bsd-3-clause |
RMKD/networkx | examples/graph/atlas.py | 54 | 2609 | #!/usr/bin/env python
"""
Atlas of all graphs of 6 nodes or less.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2004 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx... | bsd-3-clause |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/scipy/stats/_discrete_distns.py | 15 | 20781 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy import special
from scipy.special import entr, gammaln as gamln
from numpy import floor, ceil, log, exp, sqrt, log1p, expm1, tanh, cosh, s... | mit |
luminis-ams/blog-doc2vec | pvdbow.py | 1 | 11993 | # -*- coding: utf-8 -*-
# <nbformat>4</nbformat>
# <codecell>
import collections
import re
import numpy as np
import pandas as pd
import tensorflow as tf
import nltk
from nltk.corpus import reuters
from nltk.tokenize import word_tokenize
from sklearn.manifold import TSNE
from sklearn import svm
from sklearn.metrics... | mit |
wbinventor/openmc | examples/python/pincell_depletion/run_depletion.py | 1 | 6311 | import openmc
import openmc.deplete
import numpy as np
import matplotlib.pyplot as plt
###############################################################################
# Simulation Input File Parameters
###############################################################################
# OpenMC simula... | mit |
pkruskal/scikit-learn | examples/applications/topics_extraction_with_nmf_lda.py | 133 | 3517 | """
========================================================================================
Topics extraction with Non-Negative Matrix Factorization And Latent Dirichlet Allocation
========================================================================================
This is an example of applying Non Negative Matr... | bsd-3-clause |
dsquareindia/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 27 | 3847 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | bsd-3-clause |
credp/lisa | lisa/pelt.py | 1 | 16604 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019, Arm Limited and contributors.
#
# 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
#
# ... | apache-2.0 |
potash/scikit-learn | sklearn/datasets/species_distributions.py | 9 | 7865 | """
=============================
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/details/3038/0>`_ ,
the Bro... | bsd-3-clause |
lxybox1/MissionPlanner | Lib/site-packages/numpy/lib/recfunctions.py | 58 | 34495 | """
Collection of utilities to manipulate structured arrays.
Most of these functions were initially implemented by John Hunter for matplotlib.
They have been rewritten and extended for convenience.
"""
import sys
import itertools
import numpy as np
import numpy.ma as ma
from numpy import ndarray, recarray
from nump... | gpl-3.0 |
akionakamura/scikit-learn | sklearn/__init__.py | 154 | 3014 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
ChanChiChoi/scikit-learn | examples/svm/plot_rbf_parameters.py | 57 | 8096 | '''
==================
RBF SVM parameters
==================
This example illustrates the effect of the parameters ``gamma`` and ``C`` of
the Radius Basis Function (RBF) kernel SVM.
Intuitively, the ``gamma`` parameter defines how far the influence of a single
training example reaches, with low values meaning 'far' a... | bsd-3-clause |
aflaxman/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 44 | 2899 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from itert... | bsd-3-clause |
jcrudy/calibrators | example.py | 1 | 2184 | import numpy
from matplotlib import pyplot
from calibrators import SmoothIso, SmoothMovingAverage, spearman, kendall
numpy.random.seed(0)
# Generate some fake data with a lognormal distribution
m = 10000
n = 10
sigma = 1.0
X = numpy.random.normal(size=(m,n))
beta = 2.0 * numpy.random.binomial(1,.5,size=n) * numpy.rand... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.