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 |
|---|---|---|---|---|---|
zxc2694/moonbear-firmware | program/pythonGUI/gui3.py | 3 | 2637 | ################################################################################
# File name: gui.py
#
# Function: Display three data from stm32f4 using Python (matplotlib)
# The three data is roll, pith, yall angle of quadcopter attitude.
#
# Reference:http://electronut.in/plotting-real-time-data-from-arduino-usin... | mit |
93lorenzo/software-suite-movie-market-analysis | timeSeriesForecast.py | 1 | 3809 | from pandas import read_csv
from pandas import datetime
import os
from matplotlib import pyplot
from statsmodels.tsa.arima_model import ARIMA
from statsmodels.graphics.tsaplots import *
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error
import numpy as np
date_list = []
COUN... | gpl-3.0 |
shahankhatch/scikit-learn | sklearn/decomposition/pca.py | 192 | 23117 | """ Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Michael Eickenberg <michael.eickenberg@inria.fr>
#
# Lice... | bsd-3-clause |
gwpy/seismon | seismon/trend.py | 2 | 5100 | #!/usr/bin/python
import os, glob, optparse, shutil, warnings, pickle, math, copy, pickle, matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal, scipy.stats
import scipy.io
import seismon.NLNM, seismon.html
import seismon.eqmon, seismon.utils
try:
import gwpy.time, gwpy.timeseries
... | gpl-3.0 |
jay-tyler/data-science-from-scratch | code/recommender_systems.py | 60 | 6291 | from __future__ import division
import math, random
from collections import defaultdict, Counter
from linear_algebra import dot
users_interests = [
["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"],
["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"],
["Python", "scikit-learn", "sci... | unlicense |
sbg2133/miscellaneous_projects | carina/carina_lic.py | 1 | 4405 | from getIQU import IQU
from subprocess import call
import sys
import numpy as np
import glob
import matplotlib.pyplot as plt
from astropy.convolution import convolve, Gaussian2DKernel
from astropy.io import fits
import scipy.ndimage
from skimage import filters
plt.ion()
if len(sys.argv) < 2:
print "You must supply... | gpl-3.0 |
spennihana/h2o-3 | h2o-py/tests/testdir_algos/deeplearning/pyunit_anomaly_deeplearning_large.py | 8 | 1702 | from __future__ import print_function
from builtins import range
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deeplearning import H2OAutoEncoderEstimator
def anomaly():
print("Deep Learning Anomaly Detection MNIST")
train = h2o.impo... | apache-2.0 |
CVML/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 75 | 34122 | from __future__ import unicode_literals
import warnings
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.fe... | bsd-3-clause |
mhallsmoore/qstrader | tests/integration/trading/test_backtest_e2e.py | 1 | 4268 | import os
import pandas as pd
import pytz
import pytest
from qstrader.alpha_model.fixed_signals import FixedSignalsAlphaModel
from qstrader.asset.universe.static import StaticUniverse
from qstrader.trading.backtest import BacktestTradingSession
def test_backtest_sixty_forty(etf_filepath):
"""
Ensures that a... | mit |
IQSS/miniverse | scripts/bin_test.py | 1 | 6301 | if __name__ == '__main__':
import os, sys
import django
from os.path import realpath, dirname
proj_path = dirname(dirname(realpath(__file__)))
sys.path.append(proj_path)
#sys.path.append(dirname(proj_path))
django.setup()
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "miniverse.settin... | mit |
liquidmetal/pgmpy | pgmpy/extern/tabulate.py | 8 | 38706 | # -*- coding: utf-8 -*-
"""Pretty-print tabular data."""
from __future__ import print_function
from __future__ import unicode_literals
from collections import namedtuple
from platform import python_version_tuple
import re
from pgmpy.extern.six.moves import map, range
if python_version_tuple()[0] < "3":
from iter... | mit |
autocorr/besl | besl/bplot/stages_plot.py | 1 | 11264 | """
=========================
Evolutionary Stages Plots
=========================
Plot the BGPS maps and label-masks overplotted with various catalogs for
sign-posts of star-formation and evolutionary stage.
"""
import aplpy
import numpy as _np
import matplotlib.pyplot as _plt
import matplotlib.patheffects as PathEf... | gpl-3.0 |
timothydmorton/bokeh | examples/compat/seaborn/violin.py | 34 | 1153 | import seaborn as sns
from bokeh import mpl
from bokeh.plotting import output_file, show
tips = sns.load_dataset("tips")
sns.set_style("whitegrid")
# ax = sns.violinplot(x="size", y="tip", data=tips.sort("size"))
# ax = sns.violinplot(x="size", y="tip", data=tips,
# order=np.arange(1, 7), palett... | bsd-3-clause |
atreyv/atom-phys | libatomphys.py | 1 | 21937 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 2 15:47:18 2015
@author: pedro
"""
from libphys import *
import matplotlib
def double_gaussian1d(A1, x1, sig1, A0):
sig1 = float(sig1)
return lambda x: (A0*np.exp(-(x-x0)**2/(2*sig0**2)) + offset) * (1 - A1*np.exp(-(x-x1)**2/(2*sig1**2)))
def double_gauss1d_m... | gpl-3.0 |
nguyentu1602/statsmodels | examples/python/contrasts.py | 33 | 8722 |
## Contrasts Overview
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
# This document is based heavily on this excellent resource from UCLA http://www.ats.ucla.edu/stat/r/library/contrast_coding.htm
# A categorical variable of K categories, or levels, usually enters a regressio... | bsd-3-clause |
jmschrei/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
samzhang111/scikit-learn | sklearn/neighbors/regression.py | 32 | 11019 | """Nearest Neighbor Regression"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by Arna... | bsd-3-clause |
bennlich/scikit-image | skimage/viewer/plugins/color_histogram.py | 5 | 3279 | import numpy as np
import matplotlib.pyplot as plt
from ... import color, exposure
from .plotplugin import PlotPlugin
from ..canvastools import RectangleTool
class ColorHistogram(PlotPlugin):
name = 'Color Histogram'
def __init__(self, max_pct=0.99, **kwargs):
super(ColorHistogram, self).__init__(hei... | bsd-3-clause |
simiden/tushare | tushare/stock/fundamental.py | 21 | 15148 | # -*- coding:utf-8 -*-
"""
基本面数据接口
Created on 2015/01/18
@author: Jimmy Liu
@group : waditu
@contact: jimmysoa@sina.cn
"""
import pandas as pd
from tushare.stock import cons as ct
import lxml.html
from lxml import etree
import re
from pandas.compat import StringIO
try:
from urllib.request import ur... | bsd-3-clause |
mkukielka/oddt | oddt/scoring/functions/NNScore.py | 1 | 5160 | from __future__ import print_function
import sys
from os.path import dirname, isfile, join as path_join
import numpy as np
import warnings
from joblib import Parallel, delayed
from scipy.stats import pearsonr
from sklearn.metrics import r2_score
from oddt import random_seed
from oddt.utils import method_caller
from o... | bsd-3-clause |
brdauria/beads_draw_maker | basic_units.py | 3 | 10875 | """
===========
Basic Units
===========
"""
import six
import math
import numpy as np
import matplotlib.units as units
import matplotlib.ticker as ticker
from matplotlib.axes import Axes
from matplotlib.cbook import iterable
class ProxyDelegate(object):
def __init__(self, fn_name, proxy_type):
self.pr... | mit |
MiroslavVitkov/micli | graph_temperature/plot.py | 1 | 5293 | #!/usr/bin/env python
"""A colelction of classes for high-quality, dynamically
updated XY-plots.
"""
# Generic imports
import matplotlib.pyplot as plt
import collections as col
import numpy as np
# Assignment specific imports
from dispatch import TIME_INTERVALS, MINUTE_S
class Demuxer(object):
"""This class i... | mit |
DynamicGravitySystems/DGP | tests/test_hdf5store.py | 1 | 2471 | # -*- coding: utf-8 -*-
from datetime import datetime
from pathlib import Path
import pytest
from pandas import DataFrame
from dgp.core import DataType
from dgp.core.models.flight import Flight
from dgp.core.models.datafile import DataFile
from dgp.core.hdf5_manager import HDF5Manager
HDF5_FILE = "test.hdf5"
def ... | apache-2.0 |
agiovann/CalBlitz | calblitz/granule_cells/utils_granule.py | 1 | 44647 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 16 17:56:14 2016
@author: agiovann
"""
import os
import cv2
import h5py
import numpy as np
import pylab as pl
from glob import glob
# import ca_source_extraction as cse
import calblitz as cb
from scipy import signal
import scipy
import sys
from ipyparallel import Client
f... | gpl-3.0 |
DestructHub/ProjectEuler | stats.py | 1 | 20501 | #!/usr/bin/env python3
# coding=utf-8
#
# Python Script
#
# Copyleft © Manoel Vilela
#
#
import pandas as pd # sudo pip install pandas
import numpy as np # sudo pip install numpy
from distutils.spawn import find_executable
from optparse import OptionParser
from os import path
import os
import time
import iterto... | mit |
manashmndl/scikit-learn | examples/model_selection/plot_train_error_vs_test_error.py | 349 | 2577 | """
=========================
Train error vs Test error
=========================
Illustration of how the performance of an estimator on unseen data (test data)
is not the same as the performance on training data. As the regularization
increases the performance on train decreases while the performance on test
is optim... | bsd-3-clause |
kwinkunks/geopandas | tests/test_tools.py | 8 | 1589 | from __future__ import absolute_import
from shapely.geometry import Point, MultiPoint, LineString
from geopandas import GeoSeries
from geopandas.tools import collect
from .util import unittest
class TestTools(unittest.TestCase):
def setUp(self):
self.p1 = Point(0,0)
self.p2 = Point(1,1)
sel... | bsd-3-clause |
jakevdp/mpld3 | mpld3/test_plots/test_hist.py | 2 | 11306 | """Plot to test polygons"""
import matplotlib.pyplot as plt
import numpy as np
import mpld3
random_data =[1.6088185574147464,
-0.6865771485141146,
-1.6136369485782012,
-0.3392658435669958,
1.4387492600538156,
-1.7432591997998272,
-1.1082471324814325,
1.6589479820353064,
-0.13049658094505667,
1.257665812338603... | bsd-3-clause |
tum-pbs/PhiFlow | phi/vis/_matplotlib/_matplotlib_plots.py | 1 | 11190 | import os
from numbers import Number
from typing import Callable
import matplotlib.pyplot as plt
import numpy
import numpy as np
from matplotlib import animation
from phi import math
from phi.geom import Sphere, BaseBox
from phi.math import channel, batch
from phi.vis._plot_util import smooth_uniform_curve
from phi.v... | mit |
kedz/cuttsum | wp-scripts/make-lm-dev.py | 1 | 6784 | import corenlp as cnlp
import re
import os
import gzip
import cuttsum.events
import cuttsum.judgements
import pandas as pd
from collections import defaultdict
matches_df = cuttsum.judgements.get_merged_dataframe()
def heal_text(sent_text):
sent_text = sent_text.decode("utf-8")
sent_text = re.sub(
ur"[... | apache-2.0 |
RPGOne/Skynet | scikit-learn-0.18.1/examples/cluster/plot_color_quantization.py | 61 | 3444 | # -*- coding: utf-8 -*-
"""
==================================
Color Quantization using K-Means
==================================
Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace
(China), reducing the number of colors required to show the image from 96,615
unique colors to 64, while pre... | bsd-3-clause |
arabenjamin/scikit-learn | sklearn/utils/validation.py | 67 | 24013 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals i... | bsd-3-clause |
rseubert/scikit-learn | examples/decomposition/plot_sparse_coding.py | 247 | 3846 | """
===========================================
Sparse coding with a precomputed dictionary
===========================================
Transform a signal as a sparse combination of Ricker wavelets. This example
visually compares different sparse coding methods using the
:class:`sklearn.decomposition.SparseCoder` esti... | bsd-3-clause |
luwei0917/awsemmd_script | archive/tensorFlow_next_gen.py | 1 | 3398 | # 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... | mit |
legacysurvey/legacypipe | py/legacyanalysis/cosmos-subs.py | 1 | 17956 | from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
from astrometry.util.fits import fits_table, merge_tables
import numpy as np
import pylab as plt
from legacypipe.survey import *
from legacypipe.decam import DecamImage
from tractor.sfd import SFDMap
from tractor import NanoMaggies
'''
Thi... | bsd-3-clause |
IssamLaradji/scikit-learn | examples/datasets/plot_random_dataset.py | 348 | 2254 | """
==============================================
Plot randomly generated classification dataset
==============================================
Plot several randomly generated 2D classification datasets.
This example illustrates the :func:`datasets.make_classification`
:func:`datasets.make_blobs` and :func:`datasets.... | bsd-3-clause |
robclewley/compneuro | WC_2D_needs_finishing.py | 1 | 4077 | import PyDSTool as dst
from PyDSTool import args
import numpy as np
from matplotlib import pyplot as plt
pars = {'eps': 1e-2, 'a': 0.5}
icdict = {'x': pars['a'],
'y': pars['a'] - pars['a']**3/3}
xstr = '(y - (x*x*x/3 - x))/eps'
ystr = 'a - x'
event_x_a = dst.makeZeroCrossEvent('x-a', 0,
... | bsd-3-clause |
ai-se/Transfer-Learning | src/utils/stats_utils/abcd.py | 2 | 2733 | from __future__ import division, print_function
import numpy as np
from sklearn.metrics import *
def abcd(actual, predicted, distribution, as_percent=True, threshold=0):
actual = [1 if a > 0 else 0 for a in actual]
"""
Confusion Matrix:
|`````````````|`````````````|
| TN[0][0] | FP[0][1] |... | unlicense |
jcrudy/sklearntools | sklearntools/kfold.py | 1 | 7787 | from sklearn.externals.joblib.parallel import Parallel, delayed
from .calibration import no_cv
from sklearn.cross_validation import check_cv
from sklearn.base import is_classifier, clone
from .sklearntools import _fit_and_predict, non_fit_methods, BaseDelegatingEstimator, safe_assign_subset, safer_call
import numpy as ... | bsd-3-clause |
tschaume/pymatgen | pymatgen/analysis/interface.py | 4 | 46759 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to store, generate, and manipulate material interfaces.
"""
from pymatgen.core.surface import SlabGenerator
from pymatgen import Lattice, Structure
from pymatgen.core.surface i... | mit |
abhishekkrthakur/scikit-learn | sklearn/semi_supervised/tests/test_label_propagation.py | 307 | 1974 | """ test the label propagation module """
import nose
import numpy as np
from sklearn.semi_supervised import label_propagation
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
ESTIMATORS = [
(label_propagation.LabelPropagation, {'kernel': 'rbf'}),
(label_propa... | bsd-3-clause |
juanprietob/ExtractMSLesion | py/plot_separating_hyperplane.py | 1 | 2463 | """
=========================================
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... | apache-2.0 |
Sentient07/scikit-learn | sklearn/decomposition/nmf.py | 19 | 44148 | """ Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck
# Mathieu Blondel <mathieu@mblondel.org>
# Tom Dupre la Tour
# License: BSD 3 clause
from __future__ import division, print_function
from math import sqrt
import warnings
import numbers
import time
import numpy ... | bsd-3-clause |
Mooooony/plot-tutorial | some numbers.py | 1 | 1150 | '''matplotlib.pyplot is a collection of command style functions that make matplotlib work like MATLAB. Each pyplot
function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines
in a plotting area, decorates the plot with labels, etc. In matplotlib.pyplot various ... | mpl-2.0 |
aelaguiz/pyvotune | setup.py | 1 | 1364 | #!/usr/bin/env python
import re
from setuptools import setup
from pyvotune import __author__, __email__, __version__
DESCRIPTION = 'Python Evolutionary Parametric Hypertuning'
def parse_requirements(file_name):
requirements = []
for line in open(file_name, 'r').read().split('\n'):
if re.match(r'(\s... | mit |
RachitKansal/scikit-learn | examples/ensemble/plot_adaboost_hastie_10_2.py | 355 | 3576 | """
=============================
Discrete versus Real AdaBoost
=============================
This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates
the difference in performance between the discrete SAMME [2] boosting
algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate... | bsd-3-clause |
merlinmarek/ICTScan | Python/custom_edge_detection/custom_edge_detection.py | 1 | 1401 | import numpy as np
from matplotlib import pyplot as plt
import cv2
help_message = '''USAGE: custom_edge_detection.py [<image>]'''
if __name__ == '__main__':
import sys
try:
fn = sys.argv[1]
except:
print help_message
sys.exit(-1)
img = cv2.imread(fn, True);
img_gray = cv2.... | bsd-2-clause |
abhisg/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 365 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
luispedro/BuildingMachineLearningSystemsWithPython | ch06/03_clean.py | 22 | 5972 | # 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
#
# This script tries to improve the classifier by cleaning the tweets a bit
#
import time
start_time ... | mit |
moutai/scikit-learn | sklearn/manifold/setup.py | 24 | 1279 | import os
from os.path import join
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("manifold", parent_package, top_path)
libraries = []
if os.name == 'posix':
... | bsd-3-clause |
mikebenfield/scikit-learn | sklearn/linear_model/coordinate_descent.py | 3 | 82298 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... | bsd-3-clause |
alekz112/statsmodels | statsmodels/sandbox/examples/ex_cusum.py | 33 | 3219 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 02 11:41:25 2010
Author: josef-pktd
"""
import numpy as np
from scipy import stats
from numpy.testing import assert_almost_equal
import statsmodels.api as sm
from statsmodels.sandbox.regression.onewaygls import OneWayLS
from statsmodels.stats.diagnostic import recursive... | bsd-3-clause |
clemkoa/scikit-learn | sklearn/utils/tests/test_metaestimators.py | 86 | 2304 | from sklearn.utils.testing import assert_true, assert_false
from sklearn.utils.metaestimators import if_delegate_has_method
class Prefix(object):
def func(self):
pass
class MockMetaEstimator(object):
"""This is a mock meta estimator"""
a_prefix = Prefix()
@if_delegate_has_method(delegate="a... | bsd-3-clause |
untom/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 127 | 25365 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | bsd-3-clause |
rupakc/Kaggle-Compendium | Twitter User Gender Classification/preprocess.py | 7 | 9387 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 22:25:49 2016
Preprocessing Utilities for cleaning and processing of data
@author: Rupak Chakraborty
"""
import pandas as pd
from nltk.corpus import stopwords
import string
from nltk.stem import PorterStemmer
stopword_list = set(stopwords.words("english"))
punctuatio... | mit |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/benchmarks/bench_plot_omp_lars.py | 1 | 4446 | """Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle
regression (:ref:`least_angle_regression`)
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
import gc
import sys
from time import time
import numpy as np
from sklearn.datasets.samples_g... | mit |
Srisai85/scikit-learn | sklearn/decomposition/nmf.py | 100 | 19059 | """ Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# NMF implementation)
# Author: Anthony Di Franco (original Python and NumPy port)
# License: BSD 3 clause
from __future__ ... | bsd-3-clause |
BhallaLab/moose | moose-examples/paper-2015/Fig4_ReacDiff/Fig4GHIJ.py | 2 | 9411 | ########################################################################
# This program is copyright (c) Upinder S. Bhalla, NCBS, 2015.
# It is licenced under the GPL 2.1 or higher.
# There is no warranty of any kind. You are welcome to make copies under
# the provisions of the GPL.
# This program builds a multiscale ... | gpl-3.0 |
AllenDowney/DataExploration | marriage.py | 2 | 19515 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import bisect
import numpy as np
import pandas as pd
import nsfg
imp... | mit |
jls713/jfactors | flattened/all_plot.py | 1 | 1543 | # -*- coding: utf-8 -*-
## Generates Figure 10 of SEG (2016)
## ============================================================================
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import sys
sys.path.append('/home/jls/work/data/jfactors/spherical/')
from J_D_table i... | mit |
Aasmi/scikit-learn | sklearn/utils/tests/test_multiclass.py | 72 | 15350 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from itertools import product
from functools import partial
from sklearn.externals.six.moves import xrange
from sklearn.externals.six import iteritems
from scipy.sparse import issparse
from scipy.sparse import csc_matrix
from scipy.sparse im... | bsd-3-clause |
aosingh/Regularization | LassoRegularization/LassoRegressionTester.py | 1 | 3174 | import numpy as np
from sklearn.datasets.samples_generator import make_regression
from sklearn import linear_model
from LassoRegression import LassoRegression
# Define synthetic data-set constants. Change this to experiment with different data sets
NUM_OF_SAMPLES = 200
NUM_OF_FEATURES = 2
NOISE = 10
# Define the numb... | mit |
pivotalsoftware/pymadlib | pymadlib/pymadlib.py | 1 | 37354 | '''
Python wrapper for MADlib
vatsan.cs@utexas.edu, 3 Jan 2013
This currently implements the following algorithms of MADlib 0.5:
1) Linear regression (+ can also accept categorical columns as features)
2) Logistic Regression (+ can also accept categorical columns as features)
3) ... | bsd-2-clause |
vipulroxx/sympy | examples/intermediate/sample.py | 107 | 3494 | """
Utility functions for plotting sympy functions.
See examples\mplot2d.py and examples\mplot3d.py for usable 2d and 3d
graphing functions using matplotlib.
"""
from sympy.core.sympify import sympify, SympifyError
from sympy.external import import_module
np = import_module('numpy')
def sample2d(f, x_args):
"""
... | bsd-3-clause |
canismarko/xanespy | tests/test_math.py | 1 | 22307 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2016 Mark Wolf
#
# This file is part of Xanespy.
#
# Xanespy 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
# ... | gpl-3.0 |
llcao/keras | examples/addition_rnn.py | 50 | 5900 | # -*- coding: utf-8 -*-
from __future__ import print_function
from keras.models import Sequential, slice_X
from keras.layers.core import Activation, Dense, RepeatVector
from keras.layers import recurrent
from sklearn.utils import shuffle
import numpy as np
"""
An implementation of sequence to sequence learning for per... | mit |
tdhopper/scikit-learn | doc/sphinxext/gen_rst.py | 106 | 40198 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
mikebenfield/scikit-learn | benchmarks/bench_plot_lasso_path.py | 84 | 4005 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
huazhisong/race_code | kaggle_ws/dog_cat_ws/codes/training.py | 1 | 5813 | #By @Kevin Xu
#kevin28520@gmail.com
#Youtube: https://www.youtube.com/channel/UCVCSn4qQXTDAtGWpWAe4Plw
#
#The aim of this project is to use TensorFlow to process our own data.
# - input_data.py: read in data and generate batches
# - model: build the model architecture
# - training: train
# I used Ubuntu with... | gpl-3.0 |
shishaochen/TensorFlow-0.8-Win | tensorflow/contrib/learn/python/learn/tests/test_saver.py | 2 | 3423 | # Copyright 2015-present The Scikit Flow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
samzhang111/scikit-learn | sklearn/exceptions.py | 4 | 4328 | """
The :mod:`sklearn.exceptions` module includes all custom warnings and error
classes used across scikit-learn.
"""
__all__ = ['NotFittedError',
'ChangedBehaviorWarning',
'ConvergenceWarning',
'DataConversionWarning',
'DataDimensionalityWarning',
'EfficiencyWarn... | bsd-3-clause |
mugizico/scikit-learn | sklearn/metrics/pairwise.py | 104 | 42995 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck ... | bsd-3-clause |
nikitasingh981/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 46 | 7057 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# License: BSD 3 clause
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process import regression_models as regression
from sklearn.gaussian_proce... | bsd-3-clause |
buddyd16/Structural-Engineering | Concrete/concrete_T_beam_gui.py | 1 | 75572 | '''
BSD 3-Clause License
Copyright (c) 2019, Donald N. Bockoven III
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
l... | bsd-3-clause |
openfisca/openfisca-france-data | openfisca_france_data/assets/zone_apl_data/zone_apl/zone_apl_imputation_data_reader.py | 1 | 1840 | # -*- coding: utf-8 -*-
from pandas import read_csv
import numpy as np
if __name__ == '__main__':
with open('zone_apl_2006.csv') as zone_csv:
Z = read_csv(zone_csv, delimiter = ";")
#% PSDC99 population sans double compte 99
#% Pop_mun_2006 population municipale 2006
#% M.POL9... | agpl-3.0 |
klocey/ScalingMicroBiodiversity | fig-scripts/AppFigs/OLS_Checks/SampleSize.py | 2 | 42401 | from __future__ import division
#from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gaussian_kde
import random
#import scipy as sc
#from scipy import stats
import os
import sys
#from scipy.stats.distributions import t
import statsmodels.stats.api as sms
... | gpl-3.0 |
jameshensman/pymc3 | pymc3/tests/test_stats.py | 4 | 12020 | from ..stats import *
from .models import Model, Normal, Metropolis
import numpy as np
import numpy.testing as npt
import pandas as pd
import pymc3 as pm
from pymc3.tests import backend_fixtures as bf
from pymc3.backends import ndarray
from numpy.random import random, normal, seed
from numpy.testing import assert_equal... | apache-2.0 |
jamesHuffman/pyciss | setup.py | 1 | 1658 | from os import path
from setuptools import find_packages, setup
DISTNAME = 'pyciss'
DESCRIPTION = "Software for handling Cassini ISS data"
AUTHOR = "K.-Michael Aye"
AUTHOR_EMAIL = "michael.aye@lasp.colorado.edu"
MAINTAINER_EMAIL = AUTHOR_EMAIL
URL = "https://github.com/michaelaye/pyciss"
LICENSE = "ISC"
KEYWORDS = ['... | isc |
aclapes/darwintree | kernels.py | 1 | 35342 | __author__ = 'aclapes'
import numpy as np
import cPickle
from os.path import join
from os.path import isfile, exists
from os import makedirs
from sklearn import svm
from sklearn.metrics import average_precision_score
from sklearn.cross_validation import StratifiedKFold
import sys
import itertools
from joblib import de... | bsd-3-clause |
victor-prado/broker-manager | environment/lib/python3.5/site-packages/pandas/io/tests/parser/quoting.py | 7 | 5796 | # -*- coding: utf-8 -*-
"""
Tests that quoting specifications are properly handled
during parsing for all of the parsers defined in parsers.py
"""
import csv
import pandas.util.testing as tm
from pandas import DataFrame
from pandas.compat import PY3, StringIO, u
class QuotingTests(object):
def test_bad_quote_... | mit |
davidrobles/mlnd-capstone-code | experiments/c4_dqn_uci.py | 1 | 2308 | import pandas as pd
from capstone.datasets.ucic4 import get_random_game, get_random_win_game
from capstone.game.games import Connect4 as C4
from capstone.game.players import RandPlayer
from capstone.rl import Environment, GameMDP, FixedGameMDP
from capstone.rl.learners import ApproximateQLearning
from capstone.rl.polic... | mit |
lbishal/scikit-learn | sklearn/utils/tests/test_fixes.py | 281 | 1829 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from numpy.testing import (assert_almost_equal,
... | bsd-3-clause |
nawawi/poedit | deps/boost/libs/metaparse/tools/benchmark/benchmark.py | 8 | 10484 | #!/usr/bin/python
"""Utility to benchmark the generated source files"""
# Copyright Abel Sinkovics (abel@sinkovics.hu) 2016.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import argparse
import os
im... | mit |
mwv/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 127 | 25365 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | bsd-3-clause |
drphilmarshall/LocalGroupHaloProps | localgroup/likelihood.py | 1 | 9210 | # ======================================================================
import localgroup
import numpy as np
from sklearn import mixture
from sklearn.grid_search import GridSearchCV
from scipy import linalg
import matplotlib as mpl
mpl.rc('text', usetex=True)
import triangle
# ======================================... | gpl-2.0 |
simon-pepin/scikit-learn | sklearn/linear_model/tests/test_randomized_l1.py | 214 | 4690 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.linear_model.randomized_l1 i... | bsd-3-clause |
jeffzheng1/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_test.py | 2 | 39016 | # 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 |
JackKelly/autoalign | autoalign.py | 1 | 11336 | #! /usr/bin/python
from __future__ import print_function, division
import datetime
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import sys
"""
Attempts to automatically align a WattsUp power signature to a Current Cost
power time series.
This script is just a bit of tinkering. The algorithm i... | mit |
mkomeichi/BuildingMLSystemsWithPython | ch10/neighbors.py | 21 | 1787 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
import numpy as np
import mahotas as mh
from glob import glob
from features import texture, color_histogram
from matplotlib import pyplot as plt
from ... | mit |
gibil5/openhealth | models/pricelist/pricelist_container_pl.py | 1 | 6203 | # -*- coding: utf-8 -*-
"""
Pricelist Container
Created: 23 Apr 2019
Prev: 10 Aug 2019
Last: 11 apr 2021
"""
from __future__ import print_function
from openerp import models, fields, api
#import pandas
from pandas import read_csv
from . import px_vars
from . import pl_funcs
# ------------------------------... | agpl-3.0 |
openelections/openelections-data-ca | src/parse_special_primary_2015.py | 2 | 9037 | import io
import pandas as pd
import requests
import tempfile
import zipfile
import PyPDF2
from tabula import read_pdf
candidates = {'JOHN M. W. MOORLACH': 'John M. W. Moorlach',
'DONALD P. WAGNER': 'Donald P. Wagner',
'NAZ NAMAZI': 'Naz Namazi',
'SHARON RUNNER': 'Sharon Runn... | mit |
davidgbe/scikit-learn | sklearn/utils/tests/test_sparsefuncs.py | 157 | 13799 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
inplace_column_scale,
... | bsd-3-clause |
orangeYao/twiOpinion | sklearnClassify.py | 1 | 2998 | from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.naive_bayes import MultinomialNB #naive bayes
from sklearn.naive_bayes import BernoulliNB
from sklearn.linear_model import SGDClassifier #svm
from s... | mit |
kastnerkyle/kaggle-decmeg2014 | amievil_clf.py | 1 | 1832 | from scipy.io import loadmat
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
def load_training_data():
print("Creating the trains... | bsd-3-clause |
slinderman/theano_pyglm | pyglm/components/priors.py | 1 | 13640 | import numpy as np
import theano
import theano.tensor as T
from pyglm.components.component import Component
def create_prior(model, **kwargs):
typ = model['type'].lower()
if typ == 'normal' or \
typ == 'gaussian':
return Gaussian(model, **kwargs)
elif typ == 'categorical':
return Cate... | mit |
jbloomlab/dms_tools2 | tests/test_fastqfromsra.py | 1 | 2743 | """Tests `dms_tools2.sra.fastqFromSRA`.
Requires installation of ``fastq-dump`` and ``ascp``
for tests to run.
"""
import os
import time
import unittest
import pandas
import dms_tools2.sra
class test_fastqFromSRA(unittest.TestCase):
"""Tests `fastqFromSRA` with `aspera=None`.
Before running, ensure tha... | gpl-3.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/dask/dataframe/tests/test_ufunc.py | 4 | 15369 | from __future__ import absolute_import, division, print_function
import pytest
pd = pytest.importorskip('pandas')
import pandas.util.testing as tm
import numpy as np
import dask.array as da
import dask.dataframe as dd
from dask.dataframe.utils import assert_eq
_BASE_UFUNCS = ['conj', 'exp', 'log', 'log2', 'log10'... | gpl-3.0 |
ldirer/scikit-learn | sklearn/covariance/tests/test_graph_lasso.py | 33 | 6157 | """ 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.utils.testing import assert_warns_message
from sklearn.covariance import (graph_lasso, GraphLasso, G... | bsd-3-clause |
DiCarloLab-Delft/PycQED_py3 | pycqed/analysis/tools/data_manipulation.py | 1 | 21438 | """
Part of the 'new' analysis toolbox.
This should contain all the functions that where previously/are now contained
in modules/analysis/analysis_toolbox.py in the Analysis tools section.
To give a feeling of what functions belong here, the old a_tools can be
roughly split into
- file-handling tools
- data manipulatio... | mit |
cleemesser/eeg-hdfstorage | notebooks/stacklineplot.py | 1 | 4432 | # -*- coding: utf-8 -*
from __future__ import division, print_function, absolute_import
""" based on multilineplot example in matplotlib with MRI data (I think)
uses line collections (might actually be from pbrain example)
- clm """
import numpy as np
from matplotlib.pyplot import *
from matplotlib.collections import... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.