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 |
|---|---|---|---|---|---|
SanPen/GridCal | src/GridCal/Engine/Devices/templates.py | 1 | 4004 | # 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 |
stephane-caron/pymanoid | pymanoid/misc.py | 3 | 8076 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2020 Stephane Caron <stephane.caron@normalesup.org>
#
# This file is part of pymanoid <https://github.com/stephane-caron/pymanoid>.
#
# pymanoid is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public Lic... | gpl-3.0 |
jereze/scikit-learn | examples/gaussian_process/gp_diabetes_dataset.py | 223 | 1976 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
========================================================================
Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset
========================================================================
In this example, we fit a Gaussian Process model onto... | bsd-3-clause |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/datasets/samples_generator.py | 20 | 56502 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing import MultiLabelBin... | mit |
brorfred/palettable | palettable/test/test_brewermap.py | 3 | 2824 | """
Test the BrewerMap class.
"""
import os
import sys
import tempfile
try:
import pytest
except ImportError:
raise ImportError('Tests require pytest >= 2.2.')
# figure out which URL lib to import
if sys.version_info[0] == 2:
import urllib2 as urllib
else:
import urllib.request as urllib
try:
f... | mit |
w3s7y/revels-learning | revels/dbase.py | 1 | 11904 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 6 08:10:30 2017
Does database IO for the revels training project.
Also has a basic cli class for interactive data addition to dbase.
@author: ben
"""
import logging
import sqlalchemy
import pandas
import os
import pickle
import io
logging.basicCo... | gpl-3.0 |
saiwing-yeung/scikit-learn | sklearn/metrics/tests/test_common.py | 31 | 41654 | from __future__ import division, print_function
from functools import partial
from itertools import product
import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils.multiclass import type_of_target
fro... | bsd-3-clause |
katyhuff/moose | modules/tensor_mechanics/doc/tests/beam_cosserat.py | 13 | 4653 | #!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
def expected(x):
ee = 1.2
nu = 0.3
t = 0.0002
ll = 10
z = 0.5
c = 0.5
gg = ee / 2 / (1+nu)
beta = 3 * t * (1 - nu * nu) / 4 / c / c / c / ee
dd = - beta * nu / (1 - nu)
delta = beta / ... | lgpl-2.1 |
huongttlan/statsmodels | statsmodels/sandbox/distributions/genpareto.py | 33 | 10406 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 12 14:59:03 2010
Warning: not tried out or tested yet, Done
Author: josef-pktd
"""
from __future__ import print_function
import numpy as np
from scipy import stats
from scipy.misc import comb
from scipy.stats.distributions import rv_continuous
from numpy import where, i... | bsd-3-clause |
nvoron23/scikit-learn | 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... | bsd-3-clause |
ssaeger/scikit-learn | examples/ensemble/plot_bias_variance.py | 357 | 7324 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
plotly/plotly.py | packages/python/plotly/plotly/graph_objs/_densitymapbox.py | 1 | 79182 | from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Densitymapbox(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "densitymapbox"
_valid_props = {
"autocolorscale",
"below",
"coloraxis",
... | mit |
jaredweiss/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt4agg.py | 70 | 4985 | """
Render to qt from agg
"""
from __future__ import division
import os, sys
import matplotlib
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\
show, draw_if_interactive, backend_version, \
NavigationToolba... | gpl-3.0 |
rraadd88/dms2dfe | dms2dfe/lib/io_data_files.py | 2 | 14758 | #!usr/bin/python
# Copyright 2016, Rohan Dandage <rraadd_8@hotmail.com,rohan@igib.in>
# This program is distributed under General Public License v. 3.
"""
================================
``io_data_files``
================================
"""
import sys
import pandas as pd
from os.path import exists,basename,abspat... | gpl-3.0 |
hydroshare/hydroshare2 | ga_resources/drivers/postgis.py | 2 | 14091 | # from ga_ows.views import wms, wfs
from uuid import uuid4
import json
from django.conf import settings as s
from django.contrib.gis.geos import Polygon, GEOSGeometry
import os
from osgeo import osr
from . import Driver
from pandas import DataFrame
from shapely import wkb
from psycopg2 import connect
from django.db im... | bsd-3-clause |
PeterDaveHello/eden | modules/tests/smoke/broken_links.py | 16 | 26739 | """ Sahana Eden Test Framework
@copyright: 2011-2015 (c) Sahana Software Foundation
@license: MIT
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, incl... | mit |
trustedanalytics/spark-tk | regression-tests/sparktkregtests/testcases/frames/lda_groupby_flow_test.py | 11 | 3240 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
kwailamchan/programming-languages | python/data_science/NYC/wrangle07_filter_by_regular.py | 3 | 1071 | import pandas
def filter_by_regular(filename):
'''
This function should read the csv file located at filename into a pandas dataframe,
and filter the dataframe to only rows where the 'DESCn' column has the value 'REGULAR'.
For example, if the pandas dataframe is as follows:
,C/A,UNIT,SCP,DATEn... | mit |
jayflo/scikit-learn | sklearn/feature_extraction/dict_vectorizer.py | 234 | 12267 | # 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 |
GuessWhoSamFoo/pandas | pandas/tests/frame/test_join.py | 2 | 5751 | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from pandas import DataFrame, Index, period_range
from pandas.tests.frame.common import TestData
import pandas.util.testing as tm
@pytest.fixture
def frame_with_period_index():
return DataFrame(
data=np.arange(20).reshape(4, 5),
columns=li... | bsd-3-clause |
Jerryzcn/Mmani | benchmarks/bench_laplacian_dense_temp.py | 1 | 5374 | #!/usr/bin/env python
"""
Benchmarks of geometry functions (distance_matrix, affinity_matrix,
graph_laplacian) in sparse vs dense representation.
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 increas... | bsd-2-clause |
chenmoshushi/shogun | examples/undocumented/python_modular/graphical/classifier_perceptron_graphical.py | 26 | 2311 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import latex_plot_inits
parameter_list = [[20, 5, 1., 1000, 1, None, 5], [100, 5, 1., 1000, 1, None, 10]]
def classifier_perceptron_graphical(n=100, distance=5, learn_rate=1., max_iter=1000, num_threads=1, seed=None, nperceptrons=5):
from mods... | gpl-3.0 |
pv/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 |
jmmease/pandas | 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):... | bsd-3-clause |
pv/scikit-learn | examples/applications/plot_out_of_core_classification.py | 255 | 13919 | """
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | bsd-3-clause |
toastedcornflakes/scikit-learn | examples/semi_supervised/plot_label_propagation_structure.py | 55 | 2433 | """
==============================================
Label Propagation learning a complex structure
==============================================
Example of LabelPropagation learning a complex internal structure
to demonstrate "manifold learning". The outer circle should be
labeled "red" and the inner circle "blue". Be... | bsd-3-clause |
Chunfang/defmod-swpc | example/F3Dp/F3D_plot.py | 1 | 1140 | #!/usr/bin/env python
import numpy as np
import sys
import scipy.io as io_mat
import argparse
from scipy.interpolate import griddata
import matplotlib
matplotlib.use('Svg')
import matplotlib.pyplot as plt
font = {'weight' : 'normal',
'size' : 12}
matplotlib.rc('font', **font)
name_sol = sys.argv[1]
name_fe =... | mit |
ricket1978/ggplot | ggplot/tests/test_theme.py | 12 | 2707 | from nose.tools import assert_equal, assert_true, assert_raises
from numpy import linspace
from pandas import DataFrame
from ggplot.tests import image_comparison, cleanup
from ggplot import *
df = DataFrame({"x": linspace(999, 1111, 9),
"y": linspace(999, 1111, 9)})
simple_gg = ggplot(aes(x="x", y="y"... | bsd-2-clause |
followthesheep/galpy | galpy/util/bovy_plot.py | 1 | 37669 | ##############################################################################
#
# bovy_plot.py: general wrappers for matplotlib plotting
#
# 'public' methods:
# bovy_end_print
# bovy_dens2d
# bovy_hist
# bovy_plot
#... | bsd-3-clause |
ambikeshwar1991/gnuradio | gr-filter/examples/channelize.py | 13 | 6790 | #!/usr/bin/env python
#
# Copyright 2009,2012 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 optio... | gpl-3.0 |
yidawang/brainiak | examples/fcma/mvpa_voxel_selection.py | 5 | 3982 | # Copyright 2016 Intel Corporation
#
# 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... | apache-2.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/sklearn/svm/tests/test_bounds.py | 6 | 2369 | import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression
from sklearn.utils.testing import assert_true, raises
from sklearn.utils.testing import assert_raise_message
dense_X = [[-1, 0], [0... | mit |
mjudsp/Tsallis | sklearn/utils/tests/test_shortest_path.py | 303 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
yavuzovski/playground | machine learning/Udacity/ud120-projects/final_project/poi_id.py | 1 | 4416 | #!/usr/bin/python
import sys
import pickle
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
from tester import dump_classifier_and_data
from time import time
### Task 1: Select what features you'll use.
### features_list is a list of strings, each of which is a feature name.
... | gpl-3.0 |
mmottahedi/neuralnilm_prototype | scripts/e532.py | 2 | 7518 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource)
from neuralnilm.source import (standardise, discretize, fdiff, power_and_fdiff,
... | mit |
lintusj1/elfi | elfi/methods/post_processing.py | 1 | 8096 | """Post-processing for posterior samples from other ABC algorithms.
References
----------
Fundamentals and Recent Developments in Approximate Bayesian Computation
Lintusaari et. al
Syst Biol (2017) 66 (1): e66-e82.
https://doi.org/10.1093/sysbio/syw077
"""
import warnings
import numpy as np
from sklearn.linear_model... | bsd-3-clause |
SnippyHolloW/speech_embeddings | vq.py | 2 | 1899 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------
# file: vq.py
# date: Fri May 02 12:10 2014
# author:
# Maarten Versteegh
# github.com/mwv
# maartenversteegh AT gmail DOT com
#
# Licensed under GPLv3
# ------------------------------------
"""vq:
"""
from __future__ import division
i... | mit |
viisar/brew | test/dataset.py | 3 | 1583 | import numpy as np
import sklearn.datasets as datasets
# this indices will always be used so that we get reproduceable results in the tests
iris_index = np.array([ 69, 63, 32, 131, 13, 94, 10, 17, 4, 108, 29, 96, 100,
143, 20, 86, 35, 144, 78, 18, 11, 33, 72, 106, 24, 84,
... | mit |
taknevski/tensorflow-xsmm | tensorflow/examples/learn/iris_custom_decay_dnn.py | 56 | 1959 | # 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 |
Garrett-R/scikit-learn | examples/neighbors/plot_species_kde.py | 282 | 4059 | """
================================================
Kernel Density Estimate of Species Distributions
================================================
This shows an example of a neighbors-based query (in particular a kernel
density estimate) on geospatial data, using a Ball Tree built upon the
Haversine distance metric... | bsd-3-clause |
jdmcbr/Shapely | docs/sphinxext/inheritance_diagram.py | 98 | 13648 | """
Defines a docutils directive for inserting inheritance diagrams.
Provide the directive with one or more classes or modules (separated
by whitespace). For modules, all of the classes in that module will
be used.
Example::
Given the following classes:
class A: pass
class B(A): pass
class C(A): pass
... | bsd-3-clause |
spallavolu/scikit-learn | sklearn/feature_extraction/tests/test_feature_hasher.py | 258 | 2861 | from __future__ import unicode_literals
import numpy as np
from sklearn.feature_extraction import FeatureHasher
from nose.tools import assert_raises, assert_true
from numpy.testing import assert_array_equal, assert_equal
def test_feature_hasher_dicts():
h = FeatureHasher(n_features=16)
assert_equal("dict",... | bsd-3-clause |
mpld3/mplexporter | mplexporter/utils.py | 1 | 12719 | """
Utility Routines for Working with Matplotlib Objects
====================================================
"""
import itertools
import io
import base64
import numpy as np
import warnings
import matplotlib
from matplotlib.colors import colorConverter
from matplotlib.path import Path
from matplotlib.markers import ... | bsd-3-clause |
depet/scikit-learn | examples/semi_supervised/plot_label_propagation_digits.py | 12 | 2734 | """
===================================================
Label Propagation digits: Demonstrating performance
===================================================
This example demonstrates the power of semisupervised learning by
training a Label Spreading model to classify handwritten digits
with sets of very few labels.... | bsd-3-clause |
kagayakidan/scikit-learn | sklearn/linear_model/setup.py | 146 | 1713 | 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
config = Configuration('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... | bsd-3-clause |
wzbozon/statsmodels | statsmodels/nonparametric/_kernel_base.py | 29 | 18238 | """
Module containing the base object for multivariate kernel density and
regression, plus some utilities.
"""
from statsmodels.compat.python import range, string_types
import copy
import numpy as np
from scipy import optimize
from scipy.stats.mstats import mquantiles
try:
import joblib
has_joblib = True
exce... | bsd-3-clause |
nupic-community/nupic.audio | HTMforGenreClassification/aim.py | 2 | 6931 | #!/usr/bin/env python
# Plotting auditory image model stuff
import pickle
from pylab import *
import sys
from matplotlib import pyplot
from marsyas import MarSystemManager,MarControlPtr
# create a global MarSystemManager
msm = MarSystemManager()
# helper function to create a list of MarSystems from a list of... | gpl-3.0 |
LABSN/expyfun | expyfun/analyze/_analyze.py | 2 | 13954 | # -*- coding: utf-8 -*-
"""Analysis functions (mostly for psychophysics data).
"""
from collections import namedtuple
import warnings
import numpy as np
import scipy.stats as ss
from scipy.optimize import curve_fit
from .._utils import string_types
def press_times_to_hmfc(presses, targets, foils, tmin, tmax,
... | bsd-3-clause |
fbagirov/scikit-learn | examples/applications/plot_species_distribution_modeling.py | 254 | 7434 | """
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
varia... | bsd-3-clause |
christinahedges/PyKE | pyke/kepfilter.py | 2 | 11104 | from .utils import PyKEArgumentHelpFormatter
from . import kepio, kepmsg, kepkey, kepfunc, kepstat
from astropy.io import fits as pyfits
from matplotlib import pyplot as plt
import numpy as np
from tqdm import tqdm
__all__ = ['kepfilter']
def kepfilter(infile, passband, outfile=None, datacol='SAP_FLUX', function='b... | mit |
CVML/scikit-learn | examples/plot_multilabel.py | 87 | 4279 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
totalgood/nlpia | src/nlpia/futil.py | 1 | 14939 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" File utilities comparable to similarly named bash utils: rm_rf(), rm_f(), and mkdir_p()
dataset1.0 is in files like: PPE1.rar PPE2.zip PPE3.zip PP4.7zip
dataset2.0 is in gs:/Buckets/safety_monitoring/data/obj/supplemental/"""
from __future__ import print_function, unic... | mit |
herilalaina/scikit-learn | sklearn/datasets/species_distributions.py | 22 | 8840 | """
=============================
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 |
springcoil/pymc3 | pymc3/tests/test_models_utils.py | 2 | 2938 | import numpy as np
import pandas as pd
import theano.tensor as tt
from pymc3.glm import utils
import pytest
class TestUtils(object):
def setup_method(self):
self.data = pd.DataFrame(dict(a=[1, 2, 3], b=[4, 5, 6]))
def assertMatrixLabels(self, m, l, mt=None, lt=None):
assert np.all(
... | apache-2.0 |
morganics/bayesianpy | bayesianpy/model.py | 1 | 42144 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 19 16:31:18 2016
@author: imorgan.admin
"""
from bayesianpy.jni import bayesServerInference
from bayesianpy.decorators import deprecated
import bayesianpy.network
import pandas as pd
from bayesianpy.jni import bayesServer
from bayesianpy.jni import bayesServerParams
fro... | apache-2.0 |
antiface/audiolazy | examples/animated_plot.py | 1 | 3974 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of AudioLazy, the signal processing Python package.
# Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini
#
# AudioLazy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | gpl-3.0 |
vigilv/scikit-learn | sklearn/utils/arpack.py | 265 | 64837 | """
This contains a copy of the future version of
scipy.sparse.linalg.eigen.arpack.eigsh
It's an upgraded wrapper of the ARPACK library which
allows the use of shift-invert mode for symmetric matrices.
Find a few eigenvectors and eigenvalues of a matrix.
Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/
"""
#... | bsd-3-clause |
marawanokasha/ecml_fhv_paper_code | src/06_bow_classification/init.py | 1 | 8317 | import os
import sys
import argparse
import random
import cPickle as pickle
from sklearn.multiclass import OneVsRestClassifier
from sklearn import linear_model
import logging
from logging import info
sys.path.append(os.path.abspath('..'))
from utils.metrics import get_metrics
from utils.classification import get_la... | gpl-3.0 |
gusseppe/pymach | pymach/dashboard/apps/predict_front.py | 1 | 16624 | # -*- coding: utf-8 -*-
import json
import base64
import datetime
import io
import os
import glob
import pandas as pd
import numpy as np
import dash_table
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from app import app, indicator
from core ... | mit |
pianomania/scikit-learn | examples/gaussian_process/plot_gpc_isoprobability.py | 64 | 3049 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=================================================================
Iso-probability lines for Gaussian Processes classification (GPC)
=================================================================
A two-dimensional classification example showing iso-probability lines for... | bsd-3-clause |
jeffglover/pycache | service.py | 1 | 6981 | #!/usr/bin/env python2
'''
Created on Jan 2, 2016
@author: jglover,ddorroh
'''
import zmq
import argparse
import yamlio
import json
import pandas as pd
import msgpackio
import timers
from urlparse import urlparse
from socket import gethostname
class Service(object):
def __init__(self, *args, **kwargs):
s... | apache-2.0 |
abhisg/scikit-learn | sklearn/utils/testing.py | 6 | 26573 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# Giorgio Patrini
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
import... | bsd-3-clause |
sirex/manopozicija.lt | manopozicija/tests/test_indicators.py | 2 | 6402 | import io
import mock
import datetime
import pytest
import pkg_resources as pres
import pandas as pd
import numpy
from django.urls import reverse
from manopozicija import factories
from manopozicija import indicators
from manopozicija.models import Indicator
timedelta = datetime.timedelta
def dt(*args):
return... | agpl-3.0 |
ErBa508/data-science-from-scratch | code/working_with_data.py | 61 | 16549 | from __future__ import division
from collections import Counter, defaultdict
from functools import partial
from linear_algebra import shape, get_row, get_column, make_matrix, \
vector_mean, vector_sum, dot, magnitude, vector_subtract, scalar_multiply
from statistics import correlation, standard_deviation, mean
from... | unlicense |
siavooshpayandehazad/ScheduleAndDepend | src/main/python/Mapper/Mapping_Reports.py | 2 | 13724 | # Copyright (C) 2015 Siavoosh Payandeh Azad
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from ConfigAndPackages import Config
from ArchGraphUtilities import AG_Functions
import random
import networkx
def report_mapping(ag, logging):
"""
Reports mapping into log file
:param ag: Arch... | gpl-2.0 |
vinhqdang/wikipedia_analysis | lang_model/enwiki/cnn.py | 1 | 4343 | from __future__ import division, print_function, absolute_import
import csv
import numpy as np
from sklearn import metrics, cross_validation
# import pandas
import tensorflow as tf
import tflearn
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_1d
from tflearn.l... | gpl-2.0 |
dkdfirefly/speaker_project | code/separateLeadStereo/separateLeadStereoParam.py | 1 | 41756 | #!/usr/bin/python
# copyright (C) 2011 Jean-Louis Durrieu
#
# 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 ... | mit |
nmartensen/pandas | pandas/tests/test_panelnd.py | 15 | 3726 | # -*- coding: utf-8 -*-
import pytest
from warnings import catch_warnings
from pandas.core import panelnd
from pandas.core.panel import Panel
from pandas.util.testing import assert_panel_equal
import pandas.util.testing as tm
class TestPanelnd(object):
def setup_method(self, method):
pass
def test... | bsd-3-clause |
navoj/ecell4 | ecell4/egfrd/legacy/samples/mapk/plot_tc.py | 6 | 1345 | #!/usr/bin/env python
import sys
import numpy
import scipy.io
from matplotlib.pylab import *
def load_header(filename):
file = open(filename)
header = []
for line in file.readlines():
if line[0:2] == '#@':
hline = line[2:].lstrip()
header.append(hline)
return header
... | gpl-2.0 |
chrysante87/pyterpol | pyterpol_examples/observed_spectra_fitting/v746cas/v746cas_2.py | 2 | 2974 | """
V746Cas - fitting of a observed spectra.
This example also show, ho we can proceed if
we want to fit parameters step by step.
"""
import pyterpol
import matplotlib.pyplot as plt
def inspect_spectra(f):
ifile = open(f, 'r')
slist = ifile.readlines()
ifile.close()
for rec in slist:
ifile = ... | gpl-2.0 |
StagPython/StagPy | tests/test_stagyydata.py | 2 | 2183 | import pytest
import f90nml
import pandas
import stagpy.stagyydata
import stagpy._step
import stagpy.error
def test_sdat_path(example_dir, sdat):
assert sdat.path == example_dir
def test_sdat_deflt_nfields_max(sdat):
assert sdat.nfields_max == 50
def test_sdat_set_nfields_max(sdat):
sdat.nfields_max =... | apache-2.0 |
jalexvig/tensorflow | tensorflow/contrib/eager/python/examples/rnn_colorbot/rnn_colorbot.py | 14 | 13765 | # 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 |
jszopi/repESP | scripts/old/compromise.py | 1 | 8488 | from repESP import resp, resp_helpers, graphs
from repESP.field_comparison import rms_and_rep
from repESP.charges import update_with_charges, _update_molecule_with_charges
from repESP.charges import compare_charges
import os
import matplotlib.pyplot as plt
import math
import shutil
# NOTE: This ad-hoc script has been... | gpl-3.0 |
pyxll/pyxll-utils | pyxll_utils/pandastypes.py | 1 | 7908 | """
Custom excel types for pandas objects (eg dataframes).
For information about custom types in PyXLL see:
https://www.pyxll.com/docs/udfs.html#custom-types
For information about pandas see:
http://pandas.pydata.org/
Including this module in your pyxll config adds the following custom types that can
be used as retu... | bsd-2-clause |
nik7273/computational-medical-knowledge | src/listFreqs.py | 2 | 1765 | # -*- coding: utf-8 -*-
"Get frequencies and plot them"
from pdfParser import pdfparser
import nltk, matplotlib, numpy, pylab, string, codecs
from plotSave import plot_and_save
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
stop = stopwords.words('english')
READ = 'rb'
WRITE = 'wb'
lemma = n... | apache-2.0 |
andreadelprete/sot-torque-control | python/compress_force_sin_data.py | 2 | 8609 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 23 09:02:21 2015
@author: adelpret
q.shape"""
import numpy as np
import matplotlib.pyplot as plt
import plot_utils as plut
from hrp2_motors_parameters import *
FOLDER_ID = 1;
EST_DELAY = 40; ''' delay introduced by the estimation in number of samples '''
JOINT_ID = ... | lgpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/io/tests/parser/comment.py | 27 | 3757 | # -*- coding: utf-8 -*-
"""
Tests that comments are properly handled during parsing
for all of the parsers defined in parsers.py
"""
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame
from pandas.compat import StringIO
class CommentTests(object):
def test_comment(self):
d... | gpl-3.0 |
sorgerlab/indra | indra/databases/cbio_client.py | 5 | 16459 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import pandas
import logging
import requests
from collections import defaultdict
# Python3
try:
from functools import lru_cache
from io import StringIO
# Python2
except ImportError:
from functoo... | bsd-2-clause |
rzambre/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 |
soulmachine/scikit-learn | examples/decomposition/plot_faces_decomposition.py | 204 | 4452 | """
============================
Faces dataset decompositions
============================
This example applies to :ref:`olivetti_faces` different unsupervised
matrix decomposition (dimension reduction) methods from the module
:py:mod:`sklearn.decomposition` (see the documentation chapter
:ref:`decompositions`) .
"""... | bsd-3-clause |
vshtanko/scikit-learn | examples/model_selection/plot_precision_recall.py | 249 | 6150 | """
================
Precision-Recall
================
Example of Precision-Recall metric to evaluate classifier output quality.
In information retrieval, precision is a measure of result relevancy, while
recall is a measure of how many truly relevant results are returned. A high
area under the curve represents both ... | bsd-3-clause |
ctozlm/Dato-Core | src/unity/python/graphlab/data_structures/sgraph.py | 13 | 58501 | """
.. warning:: This product is currently in a beta release. The API reference is
subject to change.
This package defines the GraphLab Create SGraph, Vertex, and Edge objects. The SGraph
is a directed graph, consisting of a set of Vertex objects and Edges that
connect pairs of Vertices. The methods in this module are... | agpl-3.0 |
rupakc/Kaggle-Compendium | Porto Seguro Safe Driver Prediction/porto-baseline.py | 1 | 2887 | import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.ensemble import BaggingClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.neural_network import MLPClassifie... | mit |
ntduong/ML | Misc/simple_knn.py | 1 | 2777 | """
Simple Implementation of K-nearest neighbor algorithm.
"""
import numpy as np
import matplotlib.pyplot as plt
def edist(x, y):
""" Compute the Euclidean distance between two samples x, y \in R^d."""
try:
dist = np.sqrt(np.sum((x-y)**2))
except ValueError:
print 'Dimensionality of s... | mit |
sdrogers/ms2ldaviz | ms2ldaviz/annotation/tasks.py | 1 | 3544 |
from ms2ldaviz.celery_tasks import app
from django.db import transaction
import numpy as np
import pandas as pd
from keras.models import load_model
from basicviz.models import Document, FeatureInstance
from annotation.models import SubstituentTerm, SubstituentInstance
@app.task
def predict_substituent_terms(expe... | mit |
d10genes/pystan | doc/sphinxext/numpydoc/plot_directive.py | 89 | 20530 | """
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... | gpl-3.0 |
Richert/BrainNetworks | CMC/analysis/WC_delays.py | 1 | 3630 | # pyrates imports
from pyrates.frontend import EdgeTemplate, CircuitTemplate
from pyrates.backend import ComputeGraph
from pyrates.ir import CircuitIR
# additional imports
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage.filters import gaussian_filter1d
# general parameters
dt = 5e-3 ... | apache-2.0 |
sameera2004/bluesky | bluesky/callbacks.py | 1 | 14318 | """
Useful callbacks for the Run Engine
"""
import sys
from itertools import count
import asyncio
import warnings
from prettytable import PrettyTable
import matplotlib.backends.backend_qt5
from matplotlib.backends.backend_qt5 import _create_qApp
import matplotlib.pyplot as plt
from datetime import datetime
import num... | bsd-3-clause |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | 1 | 19664 | import numpy as np
from hagelslag.util.munkres import Munkres
import pandas as pd
class ObjectMatcher(object):
"""
ObjectMatcher calculates distances between two sets of objects and determines the optimal object assignments
based on the Hungarian object matching algorithm. ObjectMatcher supports the use o... | mit |
kipkurui/Kibet-F1000Research | code/Assess_motifsdb.py | 1 | 18632 | """
Assess_motif is a python module for assessing the motif Performance using
ChIP-seq.
Requires:
-> A motif file in meme format
-> ChIP-seq file (for now) in tab delimited format Chr score sequence
-> A motif scoring framework to use:
-gomeroccupancyscore
-sumoccupancyscore
-maxoccu... | gpl-2.0 |
jlegendary/scikit-learn | sklearn/neighbors/tests/test_neighbors.py | 103 | 41083 | from itertools import product
import numpy as np
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix)
from sklearn.cross_validation import train_test_split
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
jlegendary/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 |
jakevdp/scipy | scipy/misc/common.py | 17 | 6104 | """
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import arange, newaxis, hstack, product, array, fromstring
__all__ = ['central_diff_weights', 'derivative', 'lena', 'ascent', 'f... | bsd-3-clause |
elkingtonmcb/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 248 | 2588 | """
=========================
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 |
Ledoux/ShareYourSystem | Pythonlogy/ShareYourSystem/Specials/Predicters/Predicter/draft/__init__ copy 2.py | 4 | 6766 | # -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
import types
BaseModuleStr="ShareYourSystem.Standards.Controllers.Systemer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Clas... | mit |
earthoutreach/pykml | docs/sphinxext/matplotlib/ipython_directive.py | 7 | 15656 | import sys, os, shutil, imp, warnings, cStringIO, re
import IPython
from IPython.Shell import MatplotlibShell
try:
from hashlib import md5
except ImportError:
from md5 import md5
from docutils.parsers.rst import directives
import sphinx
sphinx_version = sphinx.__version__.split(".")
# The split is necessar... | bsd-3-clause |
speignier/suppositoire | helpers.py | 1 | 6396 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 5 02:02:54 2014
@author: Ilya
"""
import re
import numpy as np
from collections import OrderedDict
import pandas as pd
import sys
def file_to_str(filepath):
with open (filepath, "r") as myfile:
data=myfile.read()
return data
def relfunmod_byname(mod_n, ... | gpl-2.0 |
jacquesqiao/Paddle | python/paddle/fluid/tests/demo/fc_gan.py | 5 | 5964 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
ldirer/scikit-learn | examples/applications/plot_topics_extraction_with_nmf_lda.py | 12 | 4759 | """
========================================================
Topic extraction with Non-negative Matrix Factorization\
and Latent Dirichlet Allocation
========================================================
This is an example of applying :class:`sklearn.decomposition.NMF` and
:class:`sklearn.decomposition.LatentDirich... | bsd-3-clause |
Kleptobismol/scikit-bio | skbio/stats/ordination/__init__.py | 1 | 3884 | r"""
Ordination methods (:mod:`skbio.stats.ordination`)
==================================================
.. currentmodule:: skbio.stats.ordination
This module contains several ordination methods, including Principal
Coordinate Analysis, Correspondence Analysis, Redundancy Analysis and
Canonical Correspondence Analy... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.