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 |
|---|---|---|---|---|---|
mortonjt/American-Gut | setup.py | 1 | 1825 | import re
import ast
from setuptools import find_packages, setup
# https://github.com/mitsuhiko/flask/blob/master/setup.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('americangut/__init__.py', 'rb') as f:
hit = _version_re.search(f.read().decode('utf-8')).group(1)
version = str(ast.literal... | bsd-3-clause |
zorroblue/scikit-learn | sklearn/mixture/tests/test_gaussian_mixture.py | 27 | 40216 | # Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clauseimport warnings
import sys
import warnings
import numpy as np
from scipy import stats, linalg
from sklearn.covariance import EmpiricalCovariance
from sklearn.datasets.samples_generator import... | bsd-3-clause |
reinvantveer/Topology-Learning | model/baseline/archaeo_feature_type_svm_rbf.py | 1 | 4383 | """
This script executes the task of estimating the type of an archaeological feature, based solely on the geometry for
that feature. The data for this script can be found at http://hdl.handle.net/10411/GYPPBR.
"""
import multiprocessing
import os
import sys
from datetime import datetime, timedelta
from pathlib import... | mit |
kshedstrom/pyroms | examples/CCS1_SODA3.3.1/Boundary/remap_bdry_uv.py | 1 | 14025 | import numpy as np
import os
try:
import netCDF4 as netCDF
except:
import netCDF3 as netCDF
import matplotlib.pyplot as plt
import time
import datetime as dt
from matplotlib.dates import date2num, num2date
import pyroms
import pyroms_toolbox
import _remapping
class nctime(object):
pass
def remap_bdry_uv(src_... | bsd-3-clause |
yask123/scikit-learn | examples/exercises/plot_cv_diabetes.py | 231 | 2527 | """
===============================================
Cross-validation on diabetes Dataset Exercise
===============================================
A tutorial exercise which uses cross-validation with linear models.
This exercise is used in the :ref:`cv_estimators_tut` part of the
:ref:`model_selection_tut` section of ... | bsd-3-clause |
phaustin/pythermo | code/soundings/thesounding.py | 1 | 5552 | from sounding_dir.readsoundings import readsound
import numpy as np
import string
from scipy.io import savemat
import glob
import matplotlib.pyplot as plt
from ubcplot.stdplot import simplots
import pickle
def findz(press,temp,z0):
Rd=287.
rho=press*100./((temp+273.15)*Rd)
delz=-np.diff(press*100.)/(rho[:... | mit |
rsivapr/scikit-learn | sklearn/mixture/gmm.py | 5 | 27249 | """
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import numpy as np
from ..base... | bsd-3-clause |
Sk1talec/diploma_project | geometric_model/model.py | 1 | 2303 | import os
__author__ = 'Kirill'
import cv2
import numpy as np
import random
#Добавить шум к проекциям
#Возвращать 3D массив. Номер кадра, Номер точки, Номер координаты. Хранится координата.
#В результате хотим алгоритм structure motion
'''
Хотим найти свою координату и координаты всех точек.
'''
# x + ... | mit |
RPGOne/Skynet | scikit-learn-0.18.1/examples/linear_model/plot_polynomial_interpolation.py | 168 | 2088 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... | bsd-3-clause |
treycausey/scikit-learn | sklearn/manifold/tests/test_isomap.py | 31 | 3991 | 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 |
cleesmith/sentdex_scikit_machine_learning_tutorial_for_investing | p15.py | 2 | 2010 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, preprocessing
import pandas as pd
from matplotlib import style
style.use("ggplot")
FEATURES = [
'DE Ratio',
'Trailing P/E',
'Price/Sales',
'Price/Book',
'Profit Margin',
'Operating Margin',
'Return on Assets',
'Return on Equit... | mit |
paulirish/dadi | tests/admixture_test_manual.py | 7 | 5134 | """
Test script for validating performance of different simulation techniques
when admixture is present.
"""
import cPickle, os, sys, time
import numpy
from numpy import array
import matplotlib.pyplot as pyplot
import dadi
REFRESH_DADI = True
try:
dadi_cache = cPickle.load(file('dadi_cache.bp'))
ms_cache = cP... | bsd-3-clause |
mdhaber/scipy | scipy/signal/fir_filter_design.py | 13 | 47827 | # -*- coding: utf-8 -*-
"""Functions for FIR filter design."""
from math import ceil, log
import operator
import warnings
import numpy as np
from numpy.fft import irfft, fft, ifft
from scipy.special import sinc
from scipy.linalg import (toeplitz, hankel, solve, LinAlgError, LinAlgWarning,
ls... | bsd-3-clause |
drandykass/fatiando | gallery/gridder/interpolate.py | 6 | 2505 | """
Interpolate irregular data
--------------------------
The functions :func:`fatiando.gridder.interp` and
:func:`fatiando.gridder.interp_at` offer convenient wrappers around
``scipy.interpolate.griddata``. The scipy function is more general and can
interpolate n-dimensional data. Our functions offer the convenience ... | bsd-3-clause |
shangwuhencc/scikit-learn | benchmarks/bench_mnist.py | 76 | 6136 | """
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... | bsd-3-clause |
festeh/BuildingMachineLearningSystemsWithPython | ch02/figure1.py | 22 | 1199 | # 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
#
# It is made available under the MIT License
from matplotlib import pyplot as plt
# We load the data with load_iris from sklearn
from sklearn.datas... | mit |
clemkoa/scikit-learn | examples/manifold/plot_manifold_sphere.py | 89 | 5055 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionality reducti... | bsd-3-clause |
phobson/statsmodels | statsmodels/examples/ex_kde_normalreference.py | 34 | 1704 | # -*- coding: utf-8 -*-
"""
Author: Padarn Wilson
Performance of normal reference plug-in estimator vs silverman. Sample is drawn
from a mixture of gaussians. Distribution has been chosen to be reasoanbly close
to normal.
"""
from __future__ import print_function
import numpy as np
from scipy import stats
import matp... | bsd-3-clause |
mattilyra/scikit-learn | sklearn/tests/test_common.py | 1 | 8373 | """
General tests for all estimators in sklearn.
"""
# Authors: Andreas Mueller <amueller@ais.uni-bonn.de>
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
from __future__ import print_function
import os
import warnings
import sys
import pkgutil
from sklearn.externals.six import PY3
fr... | bsd-3-clause |
vortex-exoplanet/VIP | vip_hci/metrics/phase_function.py | 2 | 14865 | #! /usr/bin/env python
"""
Phase_function class definition
"""
__author__ = 'Julien Milli'
__all__ = []
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
class Phase_function(object):
""" This class represents the scattering phase function (spf).
It contains the attri... | mit |
olivierverdier/sfepy | examples/linear_elasticity/linear_elastic_probes.py | 1 | 6292 | """
This example shows how to use the post_process_hook and probe_hook options.
Use it as follows (assumes running from the sfepy directory; on Windows, you
may need to prefix all the commands with "python " and remove "./"):
1. solve the problem:
./simple.py examples/linear_elasticity/linear_elastic_probes.py
2... | bsd-3-clause |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pandas/tests/io/json/test_json_table_schema.py | 9 | 18572 | """Tests for Table Schema integration."""
import json
from collections import OrderedDict
import numpy as np
import pandas as pd
import pytest
from pandas import DataFrame
from pandas.core.dtypes.dtypes import (
PeriodDtype, CategoricalDtype, DatetimeTZDtype)
from pandas.io.json.table_schema import (
as_json_... | mit |
mmagnus/rna-pdb-tools | rna_tools/tools/rna_alignment/utils/rna_alignment_calc_energy.py | 1 | 7975 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Calculate energy (.cet) format::
UGGC-CCCUGCGCAA-GGAUGACA
(((..((((.....).))..))))
(((..(((((***)).))..))))
Examples::
$ rna_alignment_calc_energy.py --template alignments/u6-lower.cet alignments/u6-only-RemovedGapped.stk -v
--loop-upper gua... | gpl-3.0 |
rue89-tech/edx-analytics-pipeline | edx/analytics/tasks/reports/tests/test_total_events_report.py | 3 | 3154 | """
Test total events daily report
"""
import textwrap
import tempfile
import os
import shutil
import pandas
from StringIO import StringIO
from edx.analytics.tasks.tests import unittest
from edx.analytics.tasks.tests.target import FakeTarget
from edx.analytics.tasks.reports.total_events_report import TotalEventsRepor... | agpl-3.0 |
jopequ/leds-detect | leds/pair.py | 1 | 5197 | import cv2
import numpy as np
import math
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from .point import *
#
# Class Pair
#
# Stores two points, the distance, the relative ratio,
# the distance to diameter ratio
# and if they can be a pair
#
# Attributes:
# ori : first point
# ... | apache-2.0 |
mjgrav2001/scikit-learn | examples/cluster/plot_kmeans_assumptions.py | 270 | 2040 | """
====================================
Demonstration of k-means assumptions
====================================
This example is meant to illustrate situations where k-means will produce
unintuitive and possibly unexpected clusters. In the first three plots, the
input data does not conform to some implicit assumptio... | bsd-3-clause |
geobricks/Playground | playground/clustering/cluster_internet/lset.py | 1 | 1782 | import matplotlib.pyplot as plt
import numpy as np
import scipy.signal as signal
import time
from evolution import *
from plot_u import *
import gdal
from gdalconst import *
def gauss_kern():
""" Returns a normalized 2D gauss kernel array for convolutions """
h1 = 15
h2 = 15
x, y = np.mgrid[0:h2, 0:h1]... | gpl-2.0 |
ben-hopps/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qtagg.py | 73 | 4972 | """
Render to qt from agg
"""
from __future__ import division
import os, sys
import matplotlib
from matplotlib import verbose
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
from backend_qt import qt, FigureManagerQT, FigureCanvasQT,\
show, draw_if_interactive, backend_version, \
... | agpl-3.0 |
eickenberg/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 33 | 7918 | 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 |
scikit-optimize/scikit-optimize | skopt/tests/test_forest_opt.py | 1 | 2587 | from functools import partial
from sklearn.tree import DecisionTreeClassifier
import pytest
from skopt import gbrt_minimize
from skopt import forest_minimize
from skopt.benchmarks import bench1
from skopt.benchmarks import bench2
from skopt.benchmarks import bench3
from skopt.benchmarks import bench4
MINIMIZERS = [(... | bsd-3-clause |
bozhko-egor/dota2-discord-bot | cogs/utils/hero_graph.py | 1 | 1513 | import math
import matplotlib.pyplot as plt
from .hero_dictionary import hero_dic
import matplotlib.dates as mdates
from opendota_api.player import Player
def hero_per_month(player_id, hero_id):
hist = Player(player_id).stat_func('matches', hero_id=hero_id)
hist = hist[::-1]
time = hist[0]['start_time']
... | mit |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/sklearn/metrics/cluster/tests/test_bicluster.py | 394 | 1770 | """Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils.testing import assert_equal, assert_almost_equal
from sklearn.metrics.cluster.bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([T... | mit |
wronk/mne-python | mne/channels/montage.py | 2 | 27379 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Marijn van Vliet <w.m.vanvliet@gmail.com>
# Jona Sassenhagen <jona.sass... | bsd-3-clause |
dingocuster/scikit-learn | examples/svm/plot_separating_hyperplane_unbalanced.py | 329 | 1850 | """
=================================================
SVM: Separating hyperplane for unbalanced classes
=================================================
Find the optimal separating hyperplane using an SVC for classes that
are unbalanced.
We first find the separating plane with a plain SVC and then plot
(dashed) the ... | bsd-3-clause |
SiggyF/sealevel | sealevelapp/views.py | 1 | 3107 | import io
import logging
from pyramid.view import view_config
from pyramid.response import Response
import rpy2.rinterface
from rpy2.robjects import pandas2ri
pandas2ri.activate()
from . import models
logger = logging.getLogger(__name__)
MIMES = {"png": "image/png",
"pdf": "application/pdf",
"jso... | gpl-3.0 |
louispotok/pandas | pandas/tests/sparse/frame/test_frame.py | 3 | 49033 | # pylint: disable-msg=E1101,W0612
import operator
import pytest
from warnings import catch_warnings
from numpy import nan
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, bdate_range, Panel
from pandas.core.indexes.datetimes import DatetimeIndex
from pandas.tseries.offsets import BDay
fro... | bsd-3-clause |
xubenben/scikit-learn | examples/linear_model/plot_lasso_and_elasticnet.py | 249 | 1982 | """
========================================
Lasso and Elastic Net for Sparse Signals
========================================
Estimates Lasso and Elastic-Net regression models on a manually generated
sparse signal corrupted with an additive noise. Estimated coefficients are
compared with the ground-truth.
"""
print(... | bsd-3-clause |
oew1v07/scikit-image | doc/tools/plot_pr.py | 34 | 4128 | import json
import urllib
import dateutil.parser
from collections import OrderedDict
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from matplotlib.transforms import blended_transfo... | bsd-3-clause |
ruhulsbu/WEAT4TwitterGroups | histwords/gender_bias_plot.py | 1 | 5322 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 13 20:55:28 2017
@author: moamin
"""
import os, sys, time, gzip, math
import numpy as np,csv, json, re
#from gensim.models import Word2Vec
import matplotlib.pyplot as plt
#from sets import Set
from representations.sequentialembedding import Sequen... | mit |
hvasbath/beat | test/test_laplacian.py | 1 | 1712 | import unittest
import logging
from time import time
from beat.models import laplacian
from matplotlib import pyplot as plt
import numpy as num
from numpy.testing import assert_allclose
from pyrocko import util
logger = logging.getLogger('test_laplacian')
class LaplacianTest(unittest.TestCase):
def setUp(self... | gpl-3.0 |
LiaoPan/scikit-learn | examples/calibration/plot_calibration_curve.py | 225 | 5903 | """
==============================
Probability Calibration curves
==============================
When performing classification one often wants to predict not only the class
label, but also the associated probability. This probability gives some
kind of confidence on the prediction. This example demonstrates how to di... | bsd-3-clause |
raghavrv/scikit-learn | examples/gaussian_process/plot_gpc_iris.py | 100 | 2269 | """
=====================================================
Gaussian process classification (GPC) on iris dataset
=====================================================
This example illustrates the predicted probability of GPC for an isotropic
and anisotropic RBF kernel on a two-dimensional version for the iris-dataset.
... | bsd-3-clause |
JoseGuzman/NeuralNetworks | GammaOscillations/custom_plots.py | 2 | 3042 | """
custom_plots.py
Jose Guzman, sjm.guzman@gmail.com
Claudia Espinoza, claum.espinoza@gmail.com
Last change: Thu Oct 6 20:58:42 CEST 2016
Plots to represent network of cells
"""
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure, show
from matplotlib.collections import RegularPolyCollection
imp... | gpl-2.0 |
Musicophilia/nga_hacks | flask/src/cnn_processing.py | 1 | 3047 | import numpy as np
from preprocessing import *
from sklearn.cross_validation import train_test_split
degree_interval = 0.08
num_timesteps = 10
def fill_grid(grid, clean_dict, cardinals):
north, south, east, west = cardinals
grid_province_dict = {}
for province, rows in clean_dict.iteritems():
rows... | mit |
RecipeML/Recipe | recipe/preprocessors/binarizer.py | 1 | 1096 | # -*- coding: utf-8 -*-
"""
Copyright 2016 Walter José and Alex de Sá
This file is part of the RECIPE Algorithm.
The RECIPE 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 |
bstelte/investigate | investigate.py | 1 | 5402 | #!/usr/bin/python2
# investigate.py
#
# build network graph from a list of domains
# input: input.txt
# output stdout: csv list (only changes, remove pickle file to get actual list)
# output pdf: network graph
#
# (c) 2015 Bjoern Stelte
#
# DISCLAIMER - USE AT YOUR OWN RISK.
#
# This program is free softwa... | gpl-2.0 |
zzyfisherman/moose | framework/scripts/memory_logger.py | 20 | 43940 | #!/usr/bin/env python
from tempfile import TemporaryFile, SpooledTemporaryFile
import os, sys, re, socket, time, pickle, csv, uuid, subprocess, argparse, decimal, select, platform
class LLDB:
def __init__(self):
self.debugger = lldb.SBDebugger.Create()
self.command_interpreter = self.debugger.GetCommandInter... | lgpl-2.1 |
cbertinato/pandas | pandas/plotting/_misc.py | 1 | 15347 | from contextlib import contextmanager
import warnings
from pandas.util._decorators import deprecate_kwarg
from pandas.plotting._core import _get_plot_backend
def table(ax, data, rowLabels=None, colLabels=None, **kwargs):
"""
Helper function to convert DataFrame and Series to matplotlib.table
Parameters... | bsd-3-clause |
Sentient07/scikit-learn | sklearn/utils/setup.py | 77 | 2993 | import os
from os.path import join
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('utils', parent_package, top_path)
config.add_subpackage('sparsetools')
... | bsd-3-clause |
rosswhitfield/mantid | qt/python/mantidqt/widgets/plotconfigdialog/imagestabwidget/test/test_imagestabwidgetpresenter.py | 3 | 8967 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
boada/HETDEXCluster | code_snippets/dbtest.py | 2 | 1739 | import numpy as np
from sklearn.cluster import DBSCAN
import matplotlib.pyplot as plt
# Creating data
#c1 = np.random.randn(100, 2) + 5
#c2 = np.random.randn(50, 2)
# Creating a uniformly distributed background
#u1 = np.random.uniform(low=-10, high=10, size=100)
#u2 = np.random.uniform(low=-10, high=10, size=100)
#c3... | mit |
vibhorag/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
aetilley/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 |
jmmease/pandas | pandas/tests/plotting/test_converter.py | 14 | 7243 | import pytest
from datetime import datetime, date
import numpy as np
from pandas import Timestamp, Period, Index
from pandas.compat import u
import pandas.util.testing as tm
from pandas.tseries.offsets import Second, Milli, Micro, Day
from pandas.compat.numpy import np_datetime64_compat
converter = pytest.importorski... | bsd-3-clause |
ldirer/scikit-learn | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
siutanwong/scikit-learn | examples/cluster/plot_lena_ward_segmentation.py | 271 | 1998 | """
===============================================================
A demo of structured Ward hierarchical clustering on Lena image
===============================================================
Compute the segmentation of a 2D image with Ward hierarchical
clustering. The clustering is spatially constrained in order
... | bsd-3-clause |
mattjj/pyhsmm-slds | examples/meanfield.py | 2 | 2458 | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from pyhsmm.basic.distributions import PoissonDuration
from autoregressive.distributions import AutoRegression
from pyhsmm.util.text import progprint_xrange
from pyslds.models import DefaultSLDS
np.random.seed(0)
###################... | mit |
janmedlock/HIV-95-vaccine | plots/infections_per_capita_averted_map.py | 1 | 4534 | #!/usr/bin/python3
'''
Make maps of the infections per capita averted at different times.
'''
import os.path
import sys
from matplotlib import colors as mcolors
from matplotlib import pyplot
from matplotlib import ticker
import numpy
import pandas
import stats
from scipy import integrate
sys.path.append(os.path.dirn... | agpl-3.0 |
trungnt13/scikit-learn | examples/linear_model/plot_ransac.py | 250 | 1673 | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | bsd-3-clause |
rob-nn/motus | motus.py | 1 | 4939 | from Tkinter import *
import cmac
import gait_loader
from numpy import *
import matplotlib.pyplot as plt
class Motus(cmac.CMAC):
def __init__(self, \
desc='Motus', \
activations=3, \
configs= None, \
out_index = 1):
if configs == None:
configs =... | gpl-2.0 |
Bulochkin/tensorflow_pack | tensorflow/contrib/learn/python/learn/grid_search_test.py | 137 | 2035 | # 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 |
geophysics/mtpy | mtpy/imaging/pek2dplotting.py | 1 | 4075 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 08 11:16:46 2014
@author: a1655681
"""
import matplotlib.pyplot as plt
import numpy as np
class PlotResponses():
"""
plot responses and data from any 2d model, requires two dictionaries
containing period, resistivity, phase arrays with the following dimensio... | gpl-3.0 |
jat255/hyperspy | hyperspy/learn/mlpca.py | 3 | 5720 | # -*- coding: utf-8 -*-
# This file is a transcription of a MATLAB code obtained from the
# following research paper: Darren T. Andrews and Peter D. Wentzell,
# “Applications of maximum likelihood principal component analysis:
# incomplete data sets and calibration transfer,”
# Analytica Chimica Acta 350, no. 3 (Septem... | gpl-3.0 |
abhishek8gupta/sp17-i524 | project/S17-IO-3012/code/bin/benchmark_version_find.py | 19 | 4572 | import matplotlib.pyplot as plt
import sys
import pandas as pd
def get_parm():
"""retrieves mandatory parameter to program
@param: none
@type: n/a
"""
try:
return sys.argv[1]
except:
print ('Must enter file name as parameter')
exit()
def read_file(filename):
"""... | apache-2.0 |
jjx02230808/project0223 | sklearn/utils/fixes.py | 35 | 13320 | """Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fixe is no longer needed.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# ... | bsd-3-clause |
pythonvietnam/scikit-learn | sklearn/metrics/__init__.py | 214 | 3440 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... | bsd-3-clause |
RPGOne/scikit-learn | examples/model_selection/plot_roc.py | 102 | 5056 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... | bsd-3-clause |
alexeyum/scikit-learn | sklearn/covariance/tests/test_graph_lasso.py | 272 | 5245 | """ Test the graph_lasso module.
"""
import sys
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_less
from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV,
empirical_... | bsd-3-clause |
NEONScience/NEON-Data-Skills | tutorials/Python/Hyperspectral/hyperspectral-classification/Classification_Scikit_SVM_py/Classification_Scikit_SVM_py.py | 1 | 6618 | #!/usr/bin/env python
# coding: utf-8
# ---
# syncID: 1497c1da6ed64a7591e56ff1f2fce18d
# title: "Classification of Hyperspectral Data with Support Vector Machine (SVM) Using SciKit in Python"
# description: "Learn to classify spectral data using the Support Vector Machine (SVM) method."
# dateCreated: 2017-06-19
# a... | agpl-3.0 |
TinyOS-Camp/DDEA-DEV | Development/plot_csv.py | 5 | 27192 | """
==============================================
Visualizing the enegy-sensor-weather structure
==============================================
This example employs several unsupervised learning techniques to extract
the energy data structure from variations in Building Automation System (BAS)
and historial weather ... | gpl-2.0 |
nikitasingh981/scikit-learn | examples/cluster/plot_kmeans_silhouette_analysis.py | 83 | 5888 | """
===============================================================================
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 |
sfletc/sRNAmapper_suffix | sRNAmapper42_suff.py | 1 | 48834 | # Copyright 2013 Stephen Fletcher Licensed under the
# Educational Community 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.osedu.org/licenses/ECL-2.0
#
# Unless required by applic... | apache-2.0 |
hunter-cameron/Bioinformatics | job_scripts/omri/compare_fuzzy_kmers.py | 1 | 70095 |
import argparse
import os
import sys
import math
import time
import numpy as np
import logging
import re
import pickle
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
import queue
import multiprocessing
import psutil
import sqlite3
#import matplotlib.pyplot as plt
import objgraph
fro... | mit |
LeKono/pyhgnc | src/pyhgnc/manager/database.py | 1 | 16369 | # -*- coding: utf-8 -*-
"""PyHGNC loads HGNC contant into a relational database and provides a RESTFull API."""
import os
import sys
import time
import logging
import json
import pandas
import numpy
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session, load_only
from tqdm impo... | apache-2.0 |
eg-zhang/scikit-learn | examples/linear_model/plot_iris_logistic.py | 283 | 1678 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <http://en.wikipedia.org/wiki/Iris_f... | bsd-3-clause |
TinyOS-Camp/DDEA-DEV | REFACTORING/pre_bn_processing.py | 1 | 37094 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 5 15:28:13 2014
@author: deokwooj
"""
# To force float point division
from __future__ import division
import numpy as np
from scipy import stats
from scipy.interpolate import interp1d
from sklearn import mixture
from sklearn.cluster import KMeans
import time
from data_to... | gpl-2.0 |
jmtyszka/atlaskit | prob_weighted_metric.py | 1 | 3568 | #!/usr/bin/env python3
"""
Calculate probability-weighted metrics given a metric image and a probabilistic atlas
Authors
----
Mike Tyszka, Caltech Brain Imaging Center
License
----
This file is part of atlaskit.
atlaskit is free software: you can redistribute it and/or modify
it under the terms of the GNU Ge... | gpl-3.0 |
cactusbin/nyt | matplotlib/lib/matplotlib/gridspec.py | 6 | 14985 | """
:mod:`~matplotlib.gridspec` is a module which specifies the location
of the subplot in the figure.
``GridSpec``
specifies the geometry of the grid that a subplot will be
placed. The number of rows and number of columns of the grid
need to be set. Optionally, the subplot layout parameter... | unlicense |
vatsan/pymadlib | build/lib/pymadlib/pyroc.py | 3 | 12162 | #!/usr/bin/env python
# encoding: utf-8
"""
PyRoc.py
Created by Marcel Caraciolo on 2009-11-16.
Copyright (c) 2009 Federal University of Pernambuco. All rights reserved.
IMPORTANT:
Based on the original code by Eithon Cadag (http://www.eithoncadag.com/files/pyroc.txt)
Python Module for calculating the area under the... | bsd-2-clause |
jeongyoonlee/Kaggler | kaggler/model/nn.py | 1 | 11840 | from logging import getLogger
import numpy as np
from scipy import sparse
from scipy.optimize import minimize
from sklearn.metrics import roc_auc_score
import time
from ..const import SEC_PER_MIN
logger = getLogger(__name__)
class NN(object):
"""Implement a neural network with a single h layer."""
def __... | mit |
Chuban/moose | modules/navier_stokes/test/tests/ins/mms/supg/adv_dominated_plot_convergence.py | 3 | 3446 | # Example script for plotting MMS cases
import sys
import numpy as np
import matplotlib.pyplot as plt
from itertools import chain
# Use fonts that match LaTeX
from matplotlib import rcParams
from matplotlib.font_manager import FontProperties
rcParams['font.family'] = 'serif'
rcParams['font.size'] = 17
rcParams['font... | lgpl-2.1 |
simonschaal/greengraph | greengraph/map.py | 2 | 1526 | import numpy as np
from StringIO import StringIO
from matplotlib import image as img
import requests
class Map(object):
def __init__(self, lat, long, satellite=True, zoom=10, size=(400,400), sensor=False):
base="http://maps.googleapis.com/maps/api/staticmap?"
params=dict(
sensor= str... | mit |
rbalda/neural_ocr | env/lib/python2.7/site-packages/scipy/stats/_distn_infrastructure.py | 3 | 114867 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy._lib.six import string_types, exec_
from scipy._lib._util import getargspec_no_self as _getargspec
import sys
import keyword
import re
imp... | mit |
huletlab/PyAbel | examples/example_direct_gaussian.py | 2 | 1468 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib.pyplot as plt
from time import time
import sys
from abel.direct import direct_transform
from abel.tools.analytical import Gaus... | mit |
IssamLaradji/scikit-learn | sklearn/metrics/tests/test_ranking.py | 7 | 33931 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projection import sparse_random_matrix
fro... | bsd-3-clause |
Jasper-Koops/THESIS_LIFEBOAT | analyzer.py | 1 | 10760 | from bs4 import BeautifulSoup
from datetime import datetime
from fuzzywuzzy import fuzz
from collections import defaultdict
import itertools
import re
import requests
import sqlite3
import time
import wget #kan weg volgens mij
import os #Moet nog worden gebruikt
import PyPDF2
import random
import matplotlib.pyplot as p... | mit |
jmccormac/pySceneNetRGBD | calculate_optical_flow.py | 1 | 10949 | from PIL import Image
import math
import matplotlib
import numpy as np
import os
import pathlib
import random
import scenenet_pb2 as sn
import sys
import scipy.misc
def normalize(v):
return v/np.linalg.norm(v)
def load_depth_map_in_m(file_name):
image = Image.open(file_name)
pixel = np.array(image)
re... | gpl-3.0 |
kevin-intel/scikit-learn | sklearn/tests/test_kernel_ridge.py | 9 | 3320 | import pytest
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._test... | bsd-3-clause |
GuessWhoSamFoo/pandas | pandas/core/dtypes/common.py | 1 | 53111 | """ common type operations """
import warnings
import numpy as np
from pandas._libs import algos, lib
from pandas._libs.tslibs import conversion
from pandas.compat import PY3, PY36, string_types
from pandas.core.dtypes.dtypes import (
CategoricalDtype, DatetimeTZDtype, ExtensionDtype, IntervalDtype,
PandasEx... | bsd-3-clause |
nalyd88/modeling-and-simulation | practice/pycxsimulator.py | 1 | 10732 | ## "pycxsimulator.py"
## Realtime Simulation GUI for PyCX
##
## Developed by:
## Chun Wong
## email@chunwong.net
##
## Revised by:
## Hiroki Sayama
## sayama@binghamton.edu
##
## Copyright 2012 Chun Wong & Hiroki Sayama
##
## Simulation control & GUI extensions
## Copyright 2013 Przemyslaw Szufel & Bogumi... | mit |
pastas/pasta | pastas/io/base.py | 1 | 5849 | """
Import model
"""
from importlib import import_module
from os import path
import gc
from pandas import DataFrame, to_numeric
import pastas as ps
def load(fname, **kwargs):
"""Method to load models from file supported by the pastas library.
Parameters
----------
fname: str
string with th... | mit |
1suming/readthedocs.org | deploy/fab/fabfile.py | 1 | 9924 | import os
from fabric.api import cd, env, put, run, sudo, settings
from fabric.decorators import hosts
from fabric.contrib.files import upload_template
import fabtools
cwd = os.getcwd()
all_users = ['docs', 'builder']
required_dirs = ['checkouts', 'etc', 'run', 'log']
asgard_ip = '10.176.7.42'
backup_ip = '10.176.4.... | mit |
eg-zhang/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 |
kedz/cuttsum | wp-scripts/make-wtmf-models.py | 1 | 1454 | import os
import gzip
import wtmf
from sklearn.externals import joblib
def main(input_path, output_path, norm, stop, ne, lam):
input_path = "{}.norm-{}{}{}.spl.gz".format(
input_path, norm, ".stop" if stop else "", ".ne" if ne else "")
dirname, fname = os.path.split(output_path)
if dirname != "" ... | apache-2.0 |
jzt5132/scikit-learn | examples/linear_model/plot_robust_fit.py | 238 | 2414 | """
Robust linear estimator fitting
===============================
Here a sine function is fit with a polynomial of order 3, for values
close to zero.
Robust fitting is demoed in different situations:
- No measurement errors, only modelling errors (fitting a sine with a
polynomial)
- Measurement errors in X
- M... | bsd-3-clause |
HBNLdev/DataStore | db/neuropsych_projections.py | 1 | 5910 | from db import database as D
import db.compilation as C
import pandas as pd
import sys
#knowledge
neuropsych_variables = ['motivCBST', 'motivTOLT','mim_3b', 'mom_3b', 'em_3b', 'ao_3b', 'apt_3b', 'atoti_3b',
'ttrti_3b', 'atrti_3b','mim_4b', 'mom_4b', 'em_4b', 'ao_4b', 'apt_4b', 'atoti_4b', 'tt... | gpl-3.0 |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/matplotlib/backends/backend_wx.py | 6 | 64967 | """
A wxPython backend for matplotlib, based (very heavily) on
backend_template.py and backend_gtk.py
Author: Jeremy O'Donoghue (jeremy@o-donoghue.com)
Derived from original copyright work by John Hunter
(jdhunter@ace.bsd.uchicago.edu)
Copyright (C) Jeremy O'Donoghue & John Hunter, 2003-4
License: This work ... | apache-2.0 |
rahul003/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 |
datapythonista/pandas | pandas/tests/indexes/interval/test_interval_range.py | 8 | 13249 | from datetime import timedelta
import numpy as np
import pytest
from pandas.core.dtypes.common import is_integer
from pandas import (
DateOffset,
Interval,
IntervalIndex,
Timedelta,
Timestamp,
date_range,
interval_range,
timedelta_range,
)
import pandas._testing as tm
from pandas.tse... | bsd-3-clause |
beiko-lab/gengis | plugins/MultiTreeOptimalCrossingTest/MultiTreeGraph.py | 1 | 1634 | #=======================================================================
# Author: Donovan Parks
#
# Copyright 2012 Brett O'Donnell
#
# This file is part of GenGIS.
#
# GenGIS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.