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 |
|---|---|---|---|---|---|
selective-inference/selective-inference | doc/learning_examples/lasso_CV/followup.py | 3 | 5396 | import functools
import numpy as np
from scipy.stats import norm as ndist
import regreg.api as rr
from selection.tests.instance import gaussian_instance
from selection.learning.Rutils import lasso_glmnet
from selection.learning.utils import (full_model_inference,
pivot_plot,
... | bsd-3-clause |
JeanKossaifi/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/core/strings.py | 7 | 57832 | import numpy as np
from pandas.compat import zip
from pandas.types.generic import ABCSeries, ABCIndex
from pandas.types.missing import isnull, notnull
from pandas.types.common import (is_bool_dtype,
is_categorical_dtype,
is_object_dtype,
... | mit |
fbagirov/scikit-learn | examples/neural_networks/plot_rbm_logistic_classification.py | 258 | 4609 | """
==============================================================
Restricted Boltzmann Machine features for digit classification
==============================================================
For greyscale image data where pixel values can be interpreted as degrees of
blackness on a white background, like handwritten... | bsd-3-clause |
pythonvietnam/scikit-learn | examples/applications/topics_extraction_with_nmf_lda.py | 133 | 3517 | """
========================================================================================
Topics extraction with Non-Negative Matrix Factorization And Latent Dirichlet Allocation
========================================================================================
This is an example of applying Non Negative Matr... | bsd-3-clause |
flake123p/ProjectH | DSP/ThinkDSP/ws/thinkdsp_test.py | 1 | 1726 | """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 unittest
import thinkdsp
import matplotlib
import matplotlib.py... | gpl-3.0 |
oemof/examples | oemof_examples/oemof.solph/v0.2.x/storage_investment/v4_invest_optimize_all_technologies_with_fossil_share.py | 2 | 7015 | # -*- coding: utf-8 -*-
"""
General description
-------------------
This example shows how to perform a capacity optimization for
an energy system with storage. The following energy system is modeled:
input/output bgas bel
| | | |
| ... | gpl-3.0 |
cpaulik/xray | xray/core/ops.py | 1 | 15946 | from functools import partial
import contextlib
import inspect
import operator
import warnings
import numpy as np
import pandas as pd
from . import npcompat
from .pycompat import PY3, range, dask_array_type
from .nputils import (
nanfirst, nanlast, interleaved_concat as _interleaved_concat_numpy,
array_eq, ar... | apache-2.0 |
vybstat/scikit-learn | examples/gaussian_process/plot_gp_regression.py | 253 | 4054 | #!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
=========================================================
Gaussian Processes regression: basic introductory example
=========================================================
A simple one-dimensional regression exercise computed in two different ways:
1. A noise-free cas... | bsd-3-clause |
ajaybhat/scikit-image | doc/ext/plot2rst.py | 21 | 20507 | """
Example generation from python files.
Generate the rst files for the examples by iterating over the python
example files. Files that generate images should start with 'plot'.
To generate your own examples, add this extension to the list of
``extensions``in your Sphinx configuration file. In addition, make sure th... | bsd-3-clause |
jpzk/evopy | evopy/examples/experiments/fitness_dses_dsessvcal/latex.py | 1 | 7265 | '''
This file is part of evopy.
Copyright 2012 - 2013, Jendrik Poloczek
evopy 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.
evopy is di... | gpl-3.0 |
gauravsc/cuda-convnet2 | shownet.py | 180 | 18206 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
phobson/statsmodels | statsmodels/stats/sandwich_covariance.py | 1 | 28358 | # -*- coding: utf-8 -*-
"""Sandwich covariance estimators
Created on Sun Nov 27 14:10:57 2011
Author: Josef Perktold
Author: Skipper Seabold for HCxxx in linear_model.RegressionResults
License: BSD-3
Notes
-----
for calculating it, we have two versions
version 1: use pinv
pinv(x) scale pinv(x) used currently in... | bsd-3-clause |
mdeger/nest-simulator | topology/doc/user_manual_scripts/layers.py | 8 | 10527 | # -*- coding: utf-8 -*-
#
# layers.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (a... | gpl-2.0 |
ennehekma/enne-stage | python/plotorbit.py | 1 | 2633 | # text_file = open("../build/example.txt", "r")
# lines = text_file.readlines()
# print lines
# # print len(lines)
# text_file.close()
import math as math
import numpy as np
import math as math
import matplotlib
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from mpl_toolkits.... | mit |
thompsonjila/thompsonlib | common/colors.py | 1 | 3195 | """
Reference for colormaps included with Matplotlib.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
import random
import six
# Have colormaps separated into categories:
# http://matplotlib.org/examples/color/colormaps_reference.html
cmaps = ['viridis', 'inferno', 'plasma', 'magm... | mit |
trankmichael/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 57 | 16523 | from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.cross_validation import train_test_split
from sklearn.externals import joblib
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_... | bsd-3-clause |
JamesDWatson/BoidsAssessment | boids/command.py | 2 | 1344 |
#!/usr/bin/env python
from argparse import ArgumentParser
from matplotlib import pyplot as plt
from matplotlib import animation
import numpy as np
import yaml
import random
from .classes import Bird
def process():
parser = ArgumentParser(description = "Generate flock of boids")
parser.add_argument('--... | mit |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/sklearn/feature_selection/tests/test_from_model.py | 62 | 6762 | import numpy as np
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.ut... | gpl-2.0 |
rebaltina/DAT210x | Module5/assignment7.py | 1 | 6160 |
import random, math
import pandas as pd
import numpy as np
import scipy.io
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from sklearn.cross_validation import train_test_split
from sklearn import preprocessing
from sklearn.decomposition import PCA
from sklearn.neighbors import KNeighborsClass... | mit |
evanbiederstedt/RRBSfun | scripts/repeat_finder_scripts/faster_repeats/temp_RRBS_cw154_Tris_protease_GR_CAGAGAGG.py | 1 | 1390 | import glob
import pandas as pd
import numpy as np
df1 = pd.read_csv("repeats_hg19.csv")
RRBS_files = glob.glob("RRBS_cw154_Tris_protease_GR_CAGAGAGG*")
df_dict = {group : df for group, df in df1.groupby(by="chr")}
# In[11]:
from numpy import nan
def between_range(row, group_dict):
# get sub dataframe from ... | mit |
stuliveshere/Seismic-Processing-Prac1 | prac1/exersize3.py | 1 | 1647 | # in prac 1 we will build a synthetic shot record.
# it will compose of 3 separate components
# direct wave
# refracted wave
# reflected wave
# based up on a predefined model.
from toolbox import io
import toolbox
import numpy as np
import matplotlib.pyplot as pylab
from exersize1 import initialise
from exersize2 imp... | mit |
Fireblend/scikit-learn | sklearn/tests/test_random_projection.py | 142 | 14033 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
Garrett-R/scikit-learn | benchmarks/bench_plot_nmf.py | 206 | 5890 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... | bsd-3-clause |
yanlend/scikit-learn | sklearn/linear_model/tests/test_omp.py | 272 | 7752 | # Author: Vlad Niculae
# Licence: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equa... | bsd-3-clause |
talbrecht/pism_pik | examples/nbreen/showhydrovel.py | 2 | 4971 | #!/usr/bin/env python
from numpy import *
from matplotlib.pyplot import *
import sys
import argparse
try:
from netCDF4 import Dataset as NC
except:
print "netCDF4 is not installed!"
sys.exit(1)
parser = argparse.ArgumentParser(description='show quiver for the subglacial water velocity (or flux) field fr... | gpl-3.0 |
HyukjinKwon/spark | python/pyspark/pandas/tests/data_type_ops/test_date_ops.py | 6 | 10428 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
vshtanko/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 |
pschella/scipy | scipy/cluster/tests/test_hierarchy.py | 14 | 40869 | #
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this... | bsd-3-clause |
CVML/opengm | src/interfaces/python/examples/python_visitor_gui.py | 14 | 1377 | """
Usage: python_visitor_gui.py
This script shows how one can implement visitors
in pure python and inject them into OpenGM solver.
( not all OpenGM solvers support this kind of
code injection )
"""
import opengm
import numpy
import matplotlib
from matplotlib import pyplot as plt
shape=[100,100]
numLabels=... | mit |
magne-max/zipline-ja | tests/calendars/test_ice_calendar.py | 6 | 1818 | from unittest import TestCase
import pandas as pd
from .test_trading_calendar import ExchangeCalendarTestBase
from zipline.utils.calendars.exchange_calendar_ice import ICEExchangeCalendar
class ICECalendarTestCase(ExchangeCalendarTestBase, TestCase):
answer_key_filename = 'ice'
calendar_class = ICEExchangeC... | apache-2.0 |
bundgus/python-playground | matplotlib-playground/examples/pylab_examples/finance_demo.py | 1 | 1105 | #!/usr/bin/env python
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter, WeekdayLocator,\
DayLocator, MONDAY
from matplotlib.finance import quotes_historical_yahoo_ohlc, candlestick_ohlc
# (Year, month, day) tuples suffice as args for quotes_historical_yahoo
date1 = (2004, 2, 1)
date2 = (... | mit |
decvalts/landlab | landlab/components/radiation/examples/radiation_field_example.py | 1 | 5494 | # Sai Nudurupati and Erkan Istanbulluoglu - 14May2014 :
# Example to use radiation_field.py
"""
Article author: Sai S. Nudurupati (saisiddu@uw.edu) and Erkan Istanbulluoglu
Date: 22 May 2014
"""
"""
Radiation component calculates total incoming shortwave radiation and
relative radiation factor (ra... | mit |
jonathanunderwood/numpy | numpy/doc/creation.py | 118 | 5507 | """
==============
Array Creation
==============
Introduction
============
There are 5 general mechanisms for creating arrays:
1) Conversion from other Python structures (e.g., lists, tuples)
2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros,
etc.)
3) Reading arrays from disk, either from... | bsd-3-clause |
kylerbrown/scikit-learn | examples/linear_model/plot_theilsen.py | 232 | 3615 | """
====================
Theil-Sen Regression
====================
Computes a Theil-Sen Regression on a synthetic dataset.
See :ref:`theil_sen_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the Theil-Sen
estimator is robust against outliers. It has a breakd... | bsd-3-clause |
dilawar/moose-core | python/moose/server.py | 1 | 12836 | # -*- coding: utf-8 -*-
# This is moose.server.
# It accepts simulation request on a specified TCP port (default 31417).
# It simulates the given file (usually a archive file e.g., tar.bz2) and sends
# back artefacts generated by simulation (mostly images); and streams data from
# moose.Tables back to client.
__autho... | gpl-3.0 |
cojacoo/testcases_echoRD | gen_test1111.py | 1 | 4398 | import numpy as np
import pandas as pd
import scipy as sp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os, sys
try:
import cPickle as pickle
except:
import pickle
#connect echoRD Tools
pathdir='../echoRD' #path to echoRD
lib_path = os.path.abspath(pathdir)
#sys.path.append(lib_pa... | gpl-3.0 |
edonyM/toolkitem | updatesys/packages/filesline/dev/filebrowser.py | 1 | 5167 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------... | mit |
vibhorag/scikit-learn | sklearn/tests/test_kernel_approximation.py | 244 | 7588 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_array_equal, assert_equal, assert_true
from sklearn.utils.testing import assert_not_equal
from sklearn.utils.testing import assert_array_almost_equal, assert_raises
from sklearn.utils.testing import assert_less_equal
from ... | bsd-3-clause |
joernhees/scikit-learn | examples/ensemble/plot_ensemble_oob.py | 58 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause |
airobert/RDF2VecAtWebScale | hdt.py | 1 | 6118 | from __future__ import print_function
import os, re, sys, gzip
import numpy as np
import scipy.sparse as sp
import rdflib as rdf
import glob
import pandas as pd
import wget
import pickle as pkl
import shlex
from subprocess import Popen, PIPE, call
from rdflib.namespace import XSD
import datetime
import dateutil.parser... | gpl-3.0 |
google-research/google-research | strategic_exploration/hrl/master.py | 1 | 25306 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 |
dato-code/SFrame | oss_src/unity/python/sframe/test/test_sframe.py | 5 | 134915 | '''
Copyright (C) 2016 Turi
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
# from nose import with_setup
from ..data_structures.sframe import SFrame
from ..data_structures.sarray import SArray
from ..data_structures.image imp... | bsd-3-clause |
bthirion/nipy | nipy/algorithms/diagnostics/screens.py | 1 | 5656 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Diagnostic 4d image screen '''
from os.path import join as pjoin
import numpy as np
from ...core.api import Image, drop_io_dim, append_io_dim
from ...core.reference.coordinate_map import input_axis_in... | bsd-3-clause |
andrewnc/scikit-learn | sklearn/decomposition/tests/test_online_lda.py | 49 | 13124 | import numpy as np
from scipy.linalg import block_diag
from scipy.sparse import csr_matrix
from scipy.special import psi
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d,
_dirichlet_expect... | bsd-3-clause |
lcnature/brainiak | examples/eventseg/simulated_data.py | 7 | 3607 | """Example of finding event segmentations on simulated data
This code generates simulated datasets that have temporally-clustered
structure (with the same series of latent event patterns). An event
segmentation is learned on the first dataset, and then we try to find the same
series of events in other datasets. We mea... | apache-2.0 |
mncmilan/CUBA | free_mode_with_ML.py | 1 | 5037 | # free_mode_with_ML.py
# Mónica Milán (@mncmilan)
# mncmilan@gmail.com
# http://steelhummingbird.blogspot.com.es/
# This code obtains acceleration data from eZ430-Chronos watch by Texas Instruments, then it eliminates the noise in X
# and Y axis and finally it plots the resulting values. It also uses machine lea... | apache-2.0 |
kalekundert/mass_and_me | mass_and_me.py | 1 | 10225 | #!/usr/bin/env python
"""\
Search for expected peaks in mass spectrometry data.
Usage:
mass_plus_me <expected_masses_csv> <mass_spectra_csv>... [options]
Arguments:
<expected_masses_csv>
A *.csv file (as can be exported from Excel) containing a list of the
expected masses in its first column... | gpl-3.0 |
neurospin/pylearn-epac | doc/future_bottumup.py | 1 | 7240 | # -*- coding: utf-8 -*-
"""
Created on Thu May 23 15:21:35 2013
@author: ed203246
"""
from sklearn import datasets
from sklearn.svm import SVC
from sklearn.lda import LDA
from sklearn.feature_selection import SelectKBest
X, y = datasets.make_classification(n_samples=12, n_features=10,
... | bsd-3-clause |
moble/sympy | sympy/interactive/printing.py | 31 | 15830 | """Tools for setting up printing in interactive sessions. """
from __future__ import print_function, division
import sys
from distutils.version import LooseVersion as V
from io import BytesIO
from sympy import latex as default_latex
from sympy import preview
from sympy.core.compatibility import integer_types
from sy... | bsd-3-clause |
warrenmcg/spladder | python/spladder_viz.py | 1 | 11129 | import sys
import os
import re
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.patches as patches
import cPickle
import pdb
from modules.classes.gene import Gene
from modules.viz.graph import *
from modules.viz.coverage import *
from modu... | bsd-3-clause |
joshbohde/scikit-learn | sklearn/pipeline.py | 2 | 7339 | """
Pipeline: chain transforms and estimators to build a composite estimator.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Licence: BSD
from .base import BaseEstimator
class Pipeline(BaseEstimator):
""" Pipeline of transforms with a final estim... | bsd-3-clause |
manashmndl/scikit-learn | sklearn/utils/setup.py | 296 | 2884 | 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 |
facebookresearch/ParlAI | parlai/crowdsourcing/tasks/acute_eval/analysis.py | 1 | 31132 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
ACUTE-Eval Analyzer.
FOR ANALYSIS!!
"""
import hashlib
import json
import os
from copy import deepcopy
from datetim... | mit |
TomAugspurger/pandas | pandas/tests/frame/test_timezones.py | 2 | 6158 | """
Tests for DataFrame timezone-related methods
"""
import numpy as np
import pytest
import pytz
from pandas.core.dtypes.dtypes import DatetimeTZDtype
import pandas as pd
from pandas import DataFrame, Series
import pandas._testing as tm
from pandas.core.indexes.datetimes import date_range
class TestDataFrameTimezo... | bsd-3-clause |
espensirnes/paneltime | build/lib.win-amd64-3.7/paneltime/regstats.py | 2 | 9494 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#This module calculates statistics and saves it to a file
import statproc as stat
import numpy as np
import regprocs as rp
from scipy import stats as scstats
import csv
import os
import sys
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
imp... | gpl-3.0 |
terkkila/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 |
masfaraud/volmdlr | scripts/distance/cyl_pf.py | 1 | 4603 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 3 12:11:37 2020
@author: Mack Pro
"""
import numpy as npy
import volmdlr as volmdlr
import volmdlr.primitives3D as primitives3D
import volmdlr.primitives2D as primitives2D
import matplotlib.pyplot as plt
import random
import math
rmin, rmax = 10, 100
posmin, posmax = ... | gpl-3.0 |
chrsrds/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
talbrecht/pism_pik | site-packages/siple/opt/linesearchHZ.py | 2 | 11502 | ############################################################################
#
# This file is a part of siple.
#
# Copyright 2010, 2014 David Maxwell
#
# siple 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 Foundati... | gpl-3.0 |
Hi-king/scikitcl | hmm.py | 1 | 3145 | #! /usr/bin/python
# -*- coding: utf-8 -*-
##==========##
## argument ##
##==========##
import argparse
import sys
class ArgumentParser(argparse.ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)
class MyFormatter(argparse.Arg... | bsd-2-clause |
mwv/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
macks22/scikit-learn | sklearn/tests/test_random_projection.py | 142 | 14033 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
preprocessed-connectomes-project/NFB_skullstripped | validation_scripts/dice_boxplot_I&L.py | 1 | 4024 | #DICE coefficient plot
#Ben Puccio
#2016-06-08
#
#
#Load numpy arrays of IBSR & LPBA40 dice coefficients from dice.py
#Make boxplot using Matplotlib and Seaborn
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
#read each dice numpy array
ss = np.load('/home/bpuccio/dice/IB... | mit |
shangwuhencc/scikit-learn | sklearn/cross_decomposition/cca_.py | 209 | 3150 | from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Read more in the :ref:`User Guide <cross_decomposition>`.
Parameters
----------
n_components : int, (default 2).
numb... | bsd-3-clause |
sangwook236/SWDT | sw_dev/python/rnd/test/machine_learning/xgboost_test.py | 2 | 1902 | #!/usr/bin/env python
# REF [site] >> https://github.com/dmlc/xgboost
# REF [site] >> Installation in Windows.
# https://stackoverflow.com/questions/33749735/how-to-install-xgboost-package-in-python-windows-platform/39811079
import xgboost as xgb
import pandas as pd
import numpy as np
import time
def main():
# Read... | gpl-3.0 |
danbob123/gplearn | gplearn/tests/test_genetic.py | 2 | 33707 | """Testing the Genetic Programming module's underlying datastructure
(gplearn.genetic._Program) as well as the classes that use it,
gplearn.genetic.SymbolicRegressor and gplearn.genetic.SymbolicTransformer."""
# Author: Trevor Stephens <trevorstephens.com>
#
# License: BSD 3 clause
import numpy as np
import pickle
im... | bsd-3-clause |
jaredweiss/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/fontconfig_pattern.py | 72 | 6429 | """
A module for parsing and generating fontconfig patterns.
See the `fontconfig pattern specification
<http://www.fontconfig.org/fontconfig-user.html>`_ for more
information.
"""
# Author : Michael Droettboom <mdroe@stsci.edu>
# License : matplotlib license (PSF compatible)
# This class is defined here because it m... | gpl-3.0 |
yavalvas/yav_com | build/matplotlib/doc/mpl_examples/pylab_examples/webapp_demo.py | 6 | 1713 | #!/usr/bin/env python
# -*- noplot -*-
"""
This example shows how to use the agg backend directly to create
images, which may be of use to web application developers who want
full control over their code without using the pyplot interface to
manage figures, figure closing etc.
.. note::
It is not necessary to avo... | mit |
seckcoder/lang-learn | python/sklearn/examples/linear_model/plot_multi_task_lasso_support.py | 4 | 2176 | #!/usr/bin/env python
"""
=============================================
Joint feature selection with multi-task Lasso
=============================================
The multi-task lasso allows to fit multiple regression problems
jointly enforcing the selected features to be the same accross
tasks. This example simulate... | unlicense |
alee156/clviz | clarityviz/analysis.py | 1 | 44461 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
from numpy import linalg as LA
import cv2
from skimage import exposure
import math
import os
import plotly
from plotly.graph_objs import *
from plotly.offline import download_plotlyjs, init_notebook_m... | apache-2.0 |
huongttlan/statsmodels | statsmodels/tsa/arima_model.py | 10 | 77411 | # Note: The information criteria add 1 to the number of parameters
# whenever the model has an AR or MA term since, in principle,
# the variance could be treated as a free parameter and restricted
# This code does not allow this, but it adds consistency with other
# packages such as gretl and X1... | bsd-3-clause |
bbalasub1/glmnet_python | glmnet_python/glmnetPlot.py | 1 | 8744 | # -*- coding: utf-8 -*-
"""
--------------------------------------------------------------------------
glmnetPlot.m: plot coefficients from a "glmnet" object
--------------------------------------------------------------------------
DESCRIPTION:
Produces a coefficient profile plot fo the coefficient paths for a
... | gpl-2.0 |
joergdietrich/astropy | astropy/visualization/tests/test_lupton_rgb.py | 2 | 9343 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for RGB Images
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import os
import tempfile
import numpy as np
from numpy.testing import assert_equal
from ...convolution import convolve, Gaussia... | bsd-3-clause |
pagea/unstyle | experimental/helper_classes.py | 1 | 3722 | """
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be... | mit |
belltailjp/scikit-learn | examples/cluster/plot_cluster_comparison.py | 246 | 4684 | """
=========================================================
Comparing different clustering algorithms on toy datasets
=========================================================
This example aims at showing characteristics of different
clustering algorithms on datasets that are "interesting"
but still in 2D. The last ... | bsd-3-clause |
tseaver/google-cloud-python | monitoring/tests/unit/test__dataframe.py | 4 | 8297 | # Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
maheshakya/scikit-learn | examples/linear_model/plot_ard.py | 248 | 2622 | """
==================================================
Automatic Relevance Determination Regression (ARD)
==================================================
Fit regression model with Bayesian Ridge Regression.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary l... | bsd-3-clause |
rohanisaac/brillouin | brillouin.py | 1 | 7046 | """
description: functions to automate peak fitting, plotting and outputting fit
values to brillouin data
author: Rohan Isaac
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import spectra as sp
from uncertainties import ufloat
def par_val(fit_o... | gpl-3.0 |
yaukwankiu/armor | initialise.py | 1 | 1272 | import time, os, shutil, pickle, re
import numpy as np
import matplotlib.pyplot as plt
from armor import pattern
from armor import defaultParameters as dp
from armor.defaultParameters import *
from armor.misc import *
from armor import objects4 as ob
DBZ = pattern.DBZ
kongrey = ob.kongrey
kongreywrf... | cc0-1.0 |
mgoffin/malwarecookbook | 5/13/mapper.py | 2 | 4981 | #!/usr/bin/python
# Copyright (C) 2010 Michael Ligh
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... | gpl-3.0 |
M4573R/BuildingMachineLearningSystemsWithPython | ch01/gen_webstats.py | 23 | 1289 | # 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 generates web traffic data for our hypothetical
# web startup "MLASS" in chapter 01
impo... | mit |
kaspar030/RIOT | tests/pkg_emlearn/generate_digit.py | 11 | 1304 | #!/usr/bin/env python3
"""Generate a binary file from a sample image of the MNIST dataset.
Pixel of the sample are stored as float32, images have size 8x8.
"""
import os
import argparse
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn import datase... | lgpl-2.1 |
suku248/nest-simulator | pynest/examples/tsodyks_facilitating.py | 8 | 5630 | # -*- coding: utf-8 -*-
#
# tsodyks_facilitating.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the Li... | gpl-2.0 |
hitszxp/scikit-learn | sklearn/decomposition/base.py | 12 | 5524 | """Principal Component Analysis Base Classes"""
# 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>
# Kyle Kastner <kastnerkyle@gmail.com>
#
# Licen... | bsd-3-clause |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/pandas/tools/rplot.py | 9 | 29164 | import random
import warnings
from copy import deepcopy
from pandas.core.common import _values_from_object
import numpy as np
from pandas.compat import range, zip
#
# TODO:
# * Make sure legends work properly
#
warnings.warn("\n"
"The rplot trellis plotting interface is deprecated and will be "
... | apache-2.0 |
Petr-Kovalev/nupic-win32 | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py | 69 | 11729 | """
An agg http://antigrain.com/ backend
Features that are implemented
* capstyles and join styles
* dashes
* linewidth
* lines, rectangles, ellipses
* clipping to a rectangle
* output to RGBA and PNG
* alpha blending
* DPI scaling properly - everything scales properly (dashes, linewidths, etc)
* draw polygo... | gpl-3.0 |
saiwing-yeung/scikit-learn | sklearn/feature_extraction/image.py | 263 | 17600 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... | bsd-3-clause |
cauchycui/scikit-learn | sklearn/feature_selection/tests/test_feature_select.py | 143 | 22295 | """
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
wilsonkichoi/zipline | tests/pipeline/test_numerical_expression.py | 8 | 18722 | from itertools import permutations
from operator import (
add,
ge,
gt,
le,
lt,
methodcaller,
mul,
ne,
sub,
)
from string import ascii_uppercase
from unittest import TestCase
import numpy
from numpy import (
arange,
array,
eye,
float64,
full,
isnan,
zeros,... | apache-2.0 |
tedmeeds/tcga_encoder | tcga_encoder/models/svd/main.py | 1 | 10473 | from tcga_encoder.utils.helpers import *
from tcga_encoder.data.data import *
from tcga_encoder.definitions.tcga import *
from tcga_encoder.definitions.nn import *
from tcga_encoder.definitions.locations import *
from tcga_encoder.algorithms import *
import seaborn as sns
sns.set_style("whitegrid")
sns.set_context("ta... | mit |
brenthuisman/phd_tools | analysis.tle.parodi.conv.py | 1 | 2873 | #!/usr/bin/env python
import sys,copy,image,tle,plot,numpy as np,matplotlib.pyplot as plt,matplotlib as mpl,pickle
from math import sqrt
print >> sys.stderr, 'Processing'
### params
# ppsan = 314.248
# ppstle = 292.8
ppsan = (211.926+211.511)/2
ppstle = (199.421+200.71)/2
yn = 'mean3d.mhd' #yieldname
vn = 'var3d.mhd'... | lgpl-3.0 |
wq/django-rest-pandas | rest_pandas/serializers.py | 1 | 12906 | from rest_framework import serializers
from pandas import DataFrame
from pandas.api.types import is_numeric_dtype
from django.core.exceptions import ImproperlyConfigured
import datetime
from collections import OrderedDict
class PandasSerializer(serializers.ListSerializer):
"""
Transforms dataset into a datafr... | mit |
eqcorrscan/EQcorrscan | setup.py | 1 | 15595 | from __future__ import print_function
try:
# use setuptools if we can
from setuptools import setup, Command, Extension
from setuptools.command.build_ext import build_ext
using_setuptools = True
except ImportError:
from distutils.core import setup, Command, Extension
from distutils.command.build_... | gpl-3.0 |
jlegendary/scikit-learn | sklearn/datasets/tests/test_lfw.py | 230 | 7880 | """This test for the LFW require medium-size data dowloading and processing
If the data has not been already downloaded by running the examples,
the tests won't run (skipped).
If the test are run, the first execution will be long (typically a bit
more than a couple of minutes) but as the dataset loader is leveraging
... | bsd-3-clause |
nasirali1/CerebralCortex | cerebralcortex/data_processor/signalprocessing/vector.py | 3 | 5237 | # Copyright (c) 2017, MD2K Center of Excellence
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditio... | bsd-2-clause |
bsipocz/bokeh | bokeh/server/blaze/config.py | 29 | 2291 | from __future__ import absolute_import
import logging
import warnings
from os.path import dirname, join
import numpy as np
import pandas as pd
from blaze import resource
import bokeh.server.tests
log = logging.getLogger(__name__)
qty=10000
gauss = {'oneA': np.random.randn(qty),
'oneB': np.random.randn(qt... | bsd-3-clause |
aflaxman/scikit-learn | sklearn/datasets/base.py | 13 | 30226 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from __future__ import print_function
import os
import csv
import sy... | bsd-3-clause |
victorbergelin/scikit-learn | examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py | 252 | 3490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
==============================================================================
Gaussian Processes classification example: exploiting the probabilistic output
==============================================================================
A two-dimensional regression exerci... | bsd-3-clause |
russel1237/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 387 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.