repo_name stringlengths 7 92 | path stringlengths 5 149 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 911 693k | license stringclasses 15
values |
|---|---|---|---|---|---|
justincely/rolodex | setup.py | 1 | 2102 | from setuptools import setup, find_packages
setup(
name = 'cos_monitoring',
version = '0.0.1',
description = 'Provide utilities and monotiring of cos data',
author = 'Justin Ely',
author_email = 'ely@stsci.edu',
keywords = ['astronomy'],
classifiers = ['Programming Language :: Python',
... | bsd-3-clause |
pycroscopy/pycroscopy | pycroscopy/processing/svd_utils.py | 1 | 20291 | # -*- coding: utf-8 -*-
"""
USID utilities for performing randomized singular value decomposition and reconstructing results
Created on Mon Mar 28 09:45:08 2016
@author: Suhas Somnath, Chris Smith
"""
from __future__ import division, print_function, absolute_import
import time
from multiprocessing import cpu_count
i... | mit |
juliojsb/sarviewer | plotters/matplotlib/swap.py | 1 | 2062 | #!/usr/bin/env python2
"""
Author :Julio Sanz
Website :www.elarraydejota.com
Email :juliojosesb@gmail.com
Description :Script to create a graph about swap usage
Dependencies :Python 2.x, matplotlib
Usage :python swap.py
License :GPLv3
"""
import matplotlib
matplotlib.use('Agg')
im... | gpl-3.0 |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/feature_selection/rfe.py | 6 | 17502 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Vincent Michel <vincent.michel@inria.fr>
# Gilles Louppe <g.louppe@gmail.com>
#
# License: BSD 3 clause
"""Recursive feature elimination for feature ranking"""
import warnings
import numpy as np
from ..utils import check_X_y, safe_sqr
fro... | mit |
AlexBryner/SalesforceTools | SalesforceScripts.py | 1 | 12737 | # coding: utf-8
import numpy as np
import pandas as pd
import time
from datetime import datetime, timedelta, date
from time import sleep, gmtime, strftime
from pandas import DataFrame, Series, read_csv
from salesforce_bulk_api import SalesforceBulkJob
from SalesforceBulkQuery import *
from simple_salesforce import *
... | mit |
Eigenstate/msmbuilder | msmbuilder/commands/implied_timescales.py | 12 | 5214 | # Author: Robert McGibbon <rmcgibbo@gmail.com>
# Contributors:
# Copyright (c) 2014, Stanford University
# All rights reserved.
"""Scan the implied timescales of MarkovStateModels with respect to lag time.
This command will build a series of MarkovStateModels at different lag times,
and save a file to disk containing ... | lgpl-2.1 |
deepmind/grid-cells | utils.py | 1 | 5720 | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
aayushidwivedi01/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 |
mattgiguere/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 |
looooo/paraBEM | examples/plots/lifting_line.py | 1 | 1404 | from __future__ import division
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import paraBEM
from paraBEM.liftingline import LiftingLine
from paraBEM.utils import check_path
# WingGeometry
spw = 2
numpos = 50
z_fac_1 = -0.3
z_fac_2 = -0.7
y = np.sin(np.linspace(0, np.pi/2... | gpl-3.0 |
tdhopper/scikit-learn | examples/svm/plot_svm_scale_c.py | 223 | 5375 | """
==============================================
Scaling the regularization parameter for SVCs
==============================================
The following example illustrates the effect of scaling the
regularization parameter when using :ref:`svm` for
:ref:`classification <svm_classification>`.
For SVC classificati... | bsd-3-clause |
DTUWindEnergy/Python4WindEnergy | lesson 3/results/ebra.py | 1 | 8402 | # -*- coding: utf-8 -*- <nbformat>3.0</nbformat>
# <headingcell level=1>
# Plotting with Matplotlib
# <headingcell level=2>
# Prepare for action
# <codecell>
import numpy as np
import scipy as sp
import sympy
# Pylab combines the pyplot functionality (for plotting) with the numpy
# functionality (for mathematics... | apache-2.0 |
B3AU/waveTree | sklearn/utils/testing.py | 4 | 12125 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# License: BSD 3 clause
import inspect
import pkgutil
import warnings
import scipy as sp
from functools import wraps
try:
# Python 2
... | bsd-3-clause |
kylerbrown/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 213 | 3359 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
cl4rke/scikit-learn | sklearn/metrics/tests/test_regression.py | 272 | 6066 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.... | bsd-3-clause |
ahye/FYS2140-Resources | examples/animation/func_animate_sin.py | 1 | 1284 | #!/usr/bin/env python
"""
Created on Mon 2 Dec 2013
Eksempelscript som viser hvordan en sinusboelge kan animeres med
funksjonsanimasjon.
@author Benedicte Emilie Braekken
"""
from numpy import *
from matplotlib.pyplot import *
from matplotlib import animation
def wave( x, t ):
'''
Funksjonen beskriver en sin... | mit |
briandalessandro/courses | deeplearning1/nbs/utils/utils.py | 8 | 7644 | from __future__ import division,print_function
import math, os, json, sys, re
import cPickle as pickle
from glob import glob
import numpy as np
from matplotlib import pyplot as plt
from operator import itemgetter, attrgetter, methodcaller
from collections import OrderedDict
import itertools
from itertools import chain
... | apache-2.0 |
DinoCow/airflow | tests/providers/apache/pinot/hooks/test_pinot.py | 3 | 9346 | #
# 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... | apache-2.0 |
rnowling/pop-gen-models | single-pop/single_pop.py | 1 | 3379 | import sys
import numpy as np
import numpy.random as npr
from sklearn.neighbors.kde import KernelDensity
from scipy.special import gammaln
import matplotlib.pyplot as plt
from calculate_phist import read_counts
from calculate_phist import normalize_haplotypes
def log_factorial(n):
return gammaln(n+1)
def log_multino... | apache-2.0 |
mljar/mljar-api-python | tests/result_client_test.py | 1 | 4641 | '''
ResultClient tests.
'''
import os
import unittest
import pandas as pd
import time
from mljar.client.project import ProjectClient
from mljar.client.dataset import DatasetClient
from mljar.client.experiment import ExperimentClient
from mljar.client.result import ResultClient
from mljar.exceptions import BadRequestEx... | apache-2.0 |
ephes/scikit-learn | sklearn/feature_extraction/tests/test_text.py | 110 | 34127 | 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 |
IssamLaradji/scikit-learn | sklearn/qda.py | 15 | 7139 | """
Quadratic Discriminant Analysis
"""
# Author: Matthieu Perrot <matthieu.perrot@gmail.com>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import BaseEstimator, ClassifierMixin
from .externals.six.moves import xrange
from .utils import check_array, check_X_y
__all__ = ['QDA']
class QDA... | bsd-3-clause |
elvandy/nltools | nltools/data/adjacency.py | 1 | 34227 | from __future__ import division
'''
This data class is for working with similarity/dissimilarity matrices
'''
__author__ = ["Luke Chang"]
__license__ = "MIT"
import os
import pandas as pd
import numpy as np
import six
from copy import deepcopy
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.mani... | mit |
tmhm/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
siutanwong/scikit-learn | examples/cluster/plot_mini_batch_kmeans.py | 265 | 4081 | """
====================================================================
Comparison of the K-Means and MiniBatchKMeans clustering algorithms
====================================================================
We want to compare the performance of the MiniBatchKMeans and KMeans:
the MiniBatchKMeans is faster, but give... | bsd-3-clause |
BiaDarkia/scikit-learn | examples/tree/plot_iris.py | 30 | 2062 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
erh3cq/hyperspy | hyperspy/_signals/signal1d.py | 2 | 61717 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
kobejean/tensorflow | tensorflow/contrib/metrics/python/ops/metric_ops.py | 5 | 178391 | # 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 |
wathen/PhD | MHD/FEniCS/ShiftCurlCurl/CppGradient/Efficient/CurlCurlSecondOrder.py | 1 | 5726 | import petsc4py, sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
import os, inspect
from dolfin import *
import numpy
import ExactSol
import MatrixOperations as MO
import CheckPetsc4py as CP
import HiptmairPrecond
import HiptmairSetup
from timeit import default_timer as timer
m = 8
errL2b =numpy.zeros((m-1,1))... | mit |
robcarver17/pysystemtrade | systems/provided/futures_chapter15/rules.py | 1 | 4311 | """
Trading rules for futures system
"""
from syscore.dateutils import ROOT_BDAYS_INYEAR
import pandas as pd
from sysquant.estimators.vol import robust_vol_calc
def ewmac(price, vol, Lfast, Lslow):
"""
Calculate the ewmac trading rule forecast, given a price and EWMA speeds Lfast, Lslow and vol_lookback
... | gpl-3.0 |
q1ang/scikit-learn | sklearn/neighbors/tests/test_kd_tree.py | 159 | 7852 | import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metrics import Dista... | bsd-3-clause |
bartosh/zipline | tests/pipeline/test_downsampling.py | 4 | 24457 | """
Tests for Downsampled Filters/Factors/Classifiers
"""
import pandas as pd
from pandas.util.testing import assert_frame_equal
from zipline.pipeline import (
Pipeline,
CustomFactor,
CustomFilter,
CustomClassifier,
)
from zipline.pipeline.data.testing import TestingDataSet
from zipline.pipeline.factor... | apache-2.0 |
Kongsea/tensorflow | tensorflow/examples/learn/hdf5_classification.py | 75 | 2899 | # 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 |
msmbuilder/msmbuilder | msmbuilder/decomposition/kernel_approximation.py | 9 | 4210 | # Author: Carlos Xavier Hernandez <cxh@stanford.edu>
# Contributors: Muneeb Sultan <msultan@stanford.edu>, Evan Feinberg <enf@stanford.edu>
# Copyright (c) 2015, Stanford University and the Authors
# All rights reserved.
from __future__ import absolute_import
import numpy as np
from scipy.linalg import svd
from skle... | lgpl-2.1 |
fenglu-g/incubator-airflow | airflow/hooks/presto_hook.py | 5 | 4772 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
Obus/scikit-learn | examples/semi_supervised/plot_label_propagation_structure.py | 247 | 2432 | """
==============================================
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 |
rexshihaoren/scikit-learn | doc/sphinxext/gen_rst.py | 142 | 40026 | """
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 |
charanpald/wallhack | wallhack/viroscopy/ContactGrowthStatistics.py | 1 | 49412 | import logging
import sys
import gc
import numpy
import os.path
import matplotlib.pyplot as plt
from datetime import date
from sandbox.util.PathDefaults import PathDefaults
from sandbox.util.DateUtils import DateUtils
from sandbox.util.Latex import Latex
from sandbox.util.Util import Util
from apgl.graph import *
fro... | gpl-3.0 |
fyffyt/scikit-learn | sklearn/preprocessing/tests/test_data.py | 71 | 38516 | import warnings
import numpy as np
import numpy.linalg as la
from scipy import sparse
from distutils.version import LooseVersion
from sklearn.utils.testing import assert_almost_equal, clean_warning_registry
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal... | bsd-3-clause |
UNR-AERIAL/scikit-learn | examples/linear_model/plot_iris_logistic.py | 283 | 1678 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <http://en.wikipedia.org/wiki/Iris_f... | bsd-3-clause |
saketkc/statsmodels | examples/incomplete/dates.py | 29 | 1251 | """
Using dates with timeseries models
"""
import statsmodels.api as sm
import pandas as pd
# Getting started
# ---------------
data = sm.datasets.sunspots.load()
# Right now an annual date series must be datetimes at the end of the year.
dates = sm.tsa.datetools.dates_from_range('1700', length=len(data.endog))
# ... | bsd-3-clause |
YoungKwonJo/mlxtend | tests/tests_evaluate/test_learning_curves.py | 1 | 2212 | from mlxtend.evaluate import plot_learning_curves
from sklearn import datasets
from sklearn.cross_validation import train_test_split
from sklearn.tree import DecisionTreeClassifier
import numpy as np
def test_training_size():
iris = datasets.load_iris()
X = iris.data
y = iris.target
X_train, X_test,... | bsd-3-clause |
bigdataelephants/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
wilselby/diy_driverless_car_ROS | rover_cv/camera_cal/src/camera_cal/camera_cal.py | 1 | 6503 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#https://github.com/paramaggarwal/CarND-Advanced-Lane-Lines/blob/master/Notebook.ipynb
from __future__ import print_function
from __future__ import division
import sys
import traceback
import rospy
import numpy as np
import cv2
import pickle
import glob
import time
import m... | bsd-2-clause |
AnasGhrab/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 |
kbrose/article-tagging | lib/tagnews/utils/load_data.py | 1 | 18109 | import pandas as pd
import numpy as np
import re
import json
import os
import warnings
import shutil
from pathlib import Path
import codecs
"""
Helper functions to load the article data. The main method to use
is load_data().
"""
# Caution! Modifying this in code will have no effect since the
# default arguments are ... | mit |
victorbergelin/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
wdxtub/Patriots | static/code/sentiment_lstm.py | 1 | 10671 | # -*- coding: utf-8 -*-
from __future__ import absolute_import #导入3.x的特征函数
from __future__ import print_function
import yaml
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import pandas as pd #导入Pandas
import numpy as np #导入Numpy
import jieba #导入结巴分词
import h5py, pickle, os, datetime
from keras.models import m... | gpl-3.0 |
ztultrebor/BARKEVIOUS | BARKEVIOUS.py | 1 | 1924 | # coding: utf-8
#read in libraries
import cPickle as pickle
from webcrawler import coredump
from dataloader import get_trawled_data, introduce_weighting
from ratings import PowerRater
from history import historical, model_the_model
from predict import predict
from oddsmaker import read_odds
from betting import wager
... | mit |
pratapvardhan/pandas | pandas/core/tools/numeric.py | 1 | 6034 | import numpy as np
import pandas as pd
from pandas.core.dtypes.common import (
is_scalar,
is_numeric_dtype,
is_decimal,
is_datetime_or_timedelta_dtype,
is_number,
_ensure_object)
from pandas.core.dtypes.generic import ABCSeries, ABCIndexClass
from pandas.core.dtypes.cast import maybe_downcast_to... | bsd-3-clause |
CoolProp/CoolProp | wrappers/Python/CoolProp/Plots/PsychScript.py | 2 | 2020 |
# This file was auto-generated by the PsychChart.py script in wrappers/Python/CoolProp/Plots
if __name__ == '__main__':
import numpy, matplotlib
from CoolProp.HumidAirProp import HAPropsSI
from CoolProp.Plots.Plots import InlineLabel
p = 101325
Tdb = numpy.linspace(-10, 60, 100) + 273.15
# M... | mit |
convexopt/gpkit | gpkit/tests/t_examples.py | 1 | 6270 | """Unit testing of tests in docs/source/examples"""
import unittest
import os
import numpy as np
from gpkit import settings
from gpkit.tests.helpers import generate_example_tests
from gpkit.small_scripts import mag
from gpkit.small_classes import Quantity
def assert_logtol(first, second, logtol=1e-6):
"Asserts t... | mit |
liffiton/ATLeS | src/analysis/plot.py | 1 | 11295 | import math
import re
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import collections, lines, patches
from analysis import heatmaps
import config
# Source: https://gist.github.com/jasonmc/1160951
def _set_foregroundcolor(ax, color):
'''For the specified axes, sets the color of the frame, m... | mit |
tsai1993/aisixiang | 01.download_1.py | 1 | 2415 | #!/usr/bin/python3
import os
from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas
import time
# 读取 00.get_metadata.R 获取的相关目录信息
D0 = pandas.read_csv("all_aisixiang_2017-05-24.csv")
# 意外中断时,可以修改 j 的值
j = 0
D = D0[j:]
for i in D['ID']:
Url = "http://www.aisixiang.com/data/" + str(i) + ".h... | mpl-2.0 |
ambikeshwar1991/sandhi-2 | module/gr36/gr-filter/examples/interpolate.py | 13 | 8584 | #!/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 |
lgarren/spack | var/spack/repos/builtin/packages/py-iminuit/package.py | 3 | 1800 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
marcusrehm/serenata-de-amor | rosie/rosie/chamber_of_deputies/classifiers/monthly_subquota_limit_classifier.py | 2 | 6711 | import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin
class MonthlySubquotaLimitClassifier(TransformerMixin):
"""
Monthly Subquota Limit classifier.
Dataset
-------
issue_date : datetime column
Date when the expense was made.
month : int column
The ... | mit |
MarineLasbleis/GrowYourIC | notebooks/Yoshida.py | 1 | 4212 | # -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt #for figures
#from mpl_toolkits.basemap import Basemap #to render maps
import math
from GrowYourIC import tracers, positions, geodyn, geodyn_trg, geodyn_static, plot_data, data, geodyn_analytical_flows
#plt.rcParams['figure.figsize'] = (8.0,... | mit |
xinfang/face-recognize | tests/openface_neural_net_training_tests.py | 5 | 3071 | # OpenFace training tests.
#
# Copyright 2015-2016 Carnegie Mellon University
#
# 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 req... | apache-2.0 |
hsuantien/scikit-learn | sklearn/mixture/tests/test_gmm.py | 200 | 17427 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... | bsd-3-clause |
PatrickOReilly/scikit-learn | sklearn/gaussian_process/gpr.py | 7 | 18711 | """Gaussian processes regression. """
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base im... | bsd-3-clause |
lsiemens/lsiemens.github.io | theory/fractional_calculus/code/old/FCC2.py | 1 | 1663 | """
Ideas about fractional calculus defined on C^2
J^b f(x, a) = f(x, a + b)
"""
import numpy
from matplotlib import pyplot
from scipy import special
def monomial(x, a, x_0, a_0):
return (x - x_0)**(a - a_0)/special.gamma(a - a_0 + 1)
def exp(x, a, b):
return b**(-a)*numpy.exp(b*x)
def projx(f, x, a):
n... | mit |
DistributedSystemsGroup/YELP-DS | Blending.py | 2 | 2128 | #!/usr/bin/env python
# encoding: utf-8
"""
This code implemented review texts classication by using Support Vector Machine, Support Vector Regression,
Decision Tree and Random Forest, the evaluation function has been implemented as well.
"""
from time import gmtime, strftime
from sklearn import ensemble, svm
impor... | apache-2.0 |
mayavanand/RMMAFinalProject | azimuth/model_comparison.py | 1 | 31399 | import predict as pd
import copy
import os
import numpy as np
import util
import shutil
import pickle
import pylab as plt
import pandas
import local_multiprocessing
import load_data
import features.featurization as feat
def check_feature_set_dims(feature_sets):
F2 = None
for set in feature_sets.keys():
... | bsd-3-clause |
phoebe-project/phoebe2-docs | 2.1/tutorials/saving_and_loading.py | 1 | 2914 | #!/usr/bin/env python
# coding: utf-8
# Saving and Loading
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the late... | gpl-3.0 |
idlead/scikit-learn | examples/linear_model/plot_lasso_lars.py | 363 | 1080 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause |
sarahgrogan/scikit-learn | sklearn/utils/multiclass.py | 83 | 12343 |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... | bsd-3-clause |
b0noI/AIF2 | src/test/integration/python/threshold_p_for_first_filter_separator_character.py | 3 | 50964 | # data collected by PropertyBasedSettingsTest.experimentWith_threshold_p_for_first_filter_separator_character
data = [
{"value": 0.000000, "errors": 55},
{"value": 0.000500, "errors": 55},
{"value": 0.001000, "errors": 55},
{"value": 0.001500, "errors": 54},
{"value": 0.002000, "errors": 54},
{"value": 0.002500, "erro... | mit |
vivekmishra1991/scikit-learn | sklearn/metrics/classification.py | 95 | 67713 | """Metrics to assess performance on classification task given classe prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gram... | bsd-3-clause |
HeraclesHX/scikit-learn | sklearn/cluster/tests/test_dbscan.py | 114 | 11393 | """
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from scipy.spatial import distance
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.utils.testing im... | bsd-3-clause |
Srisai85/scipy | scipy/stats/kde.py | 27 | 17303 | #-------------------------------------------------------------------------------
#
# Define classes for (uni/multi)-variate kernel density estimation.
#
# Currently, only Gaussian kernels are implemented.
#
# Written by: Robert Kern
#
# Date: 2004-08-09
#
# Modified: 2005-02-10 by Robert Kern.
# Contr... | bsd-3-clause |
simvisage/oricreate | docs/howtos/ex08_rigid_facets/sim031miura_ori_psi_cntl.py | 1 | 2750 | r'''
Fold the Miura ori crease pattern using psi control
---------------------------------------------------
'''
import numpy as np
from oricreate.api import \
SimulationTask, SimulationConfig, \
FTV, FTA
from oricreate.gu import \
GuConstantLength, GuDofConstraints, GuPsiConstraints, fix
def create_cp... | gpl-3.0 |
wanggang3333/scikit-learn | examples/model_selection/plot_validation_curve.py | 229 | 1823 | """
==========================
Plotting Validation Curves
==========================
In this plot you can see the training scores and validation scores of an SVM
for different values of the kernel parameter gamma. For very low values of
gamma, you can see that both the training score and the validation score are
low. ... | bsd-3-clause |
beni55/SimpleCV | SimpleCV/examples/util/ColorCube.py | 13 | 1901 | from SimpleCV import Image, Camera, Display, Color
import pygame as pg
import numpy as np
from pylab import *
from mpl_toolkits.mplot3d import axes3d
from matplotlib.backends.backend_agg import FigureCanvasAgg
import cv2
bins = 8
#precompute
idxs = []
colors = []
offset = bins/2
skip = 255/bins
for x in range(0,bins):... | bsd-3-clause |
raymondnoonan/Mpropulator | MPropulator/readConfig.py | 1 | 1536 | import pandas as pd
import os
from MPropulator import validations as vd
def readConfig(config):
'''
Reads in the config file as a dataframe
and validates the inputs and outputs of
this file.
args: config is the path to the config file csv
output: pandas dataframe that is a parsed and prepped... | mit |
barnabytprowe/great3-public | validation/plot_variable_submission.py | 2 | 3710 | #!/usr/bin/env python
# Copyright (c) 2014, the GREAT3 executive committee (http://www.great3challenge.info/?q=contacts)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of ... | bsd-3-clause |
OGGM/oggm | oggm/cli/benchmark.py | 2 | 8716 | """Command line arguments to the oggm_benchmark command
Type `$ oggm_benchmark -h` for help
"""
# External modules
import os
import sys
import argparse
import time
import logging
import pandas as pd
import geopandas as gpd
# Locals
import oggm.cfg as cfg
from oggm import utils, workflow, tasks
from oggm.exceptions ... | bsd-3-clause |
skrzym/monday-morning-quarterback | Research/report.py | 1 | 13031 | from matplotlib import pyplot as plt
import matplotlib.ticker as plticker
import seaborn as sns
import pandas as pd
import numpy as np
import math
import warnings
from collections import Counter
import nfldatatools as nfltools
rs_pbp = nfltools.gather_data(playoffs=False)
po_pbp = nfltools.gather_data(playoffs=True)
... | mit |
amancevice/stanhope | stanhope/stanhope/tables.py | 1 | 9826 | """
StanhopeFramers Tables
"""
import io
import subprocess
import pandas
from stanhope import utils
pandas.set_option('display.max_rows', 999)
pandas.set_option('display.width', 999)
pandas.set_option('display.max_colwidth', 999)
class Table(object):
def __init__(self, *tables):
self.tables = tables or ... | mit |
mikeireland/pynrm | go.py | 1 | 3044 | # -*- coding: utf-8 -*-
"""
Created on Fri May 2 13:49:11 2014
@author: mireland
A script for testing... Change this to try out your own analysis.
"""
import astropy.io.fits as pyfits
import numpy as np
import matplotlib.pyplot as plt
from azimuthalAverage import *
# This includes an AO Instrument called "aoinst"
... | mit |
JeanKossaifi/scikit-learn | sklearn/neighbors/nearest_centroid.py | 199 | 7249 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/mpl_toolkits/axisartist/axis_artist.py | 7 | 52735 | """
axis_artist.py module provides axis-related artists. They are
* axis line
* tick lines
* tick labels
* axis label
* grid lines
The main artist class is a AxisArtist and a GridlinesCollection. The
GridlinesCollection is responsible for drawing grid lines and the
AxisArtist is responsible for all other artists... | mit |
1kastner/analyse_weather_data | gather_weather_data/wunderground/summarize_raw_airport_data.py | 1 | 8898 | """
Summarize all downloaded airport weather station data files.
Uses UTC time zone.
Use
-m gather_weather_data.wunderground.summarize_raw_airport_data
to run the demo
"""
import os
import json
import datetime
import logging
import numpy
import pandas
import metar.Metar # needs https://github.com/tomp/python-meta... | agpl-3.0 |
shangwuhencc/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
manjunaths/tensorflow | tensorflow/contrib/learn/__init__.py | 8 | 2286 | # 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 |
305120262/ArcGISServerManageTools | GetServerLog.py | 1 | 3475 | #coding=utf-8
"""
-------------------------------------------------------------------------------
Name: getsvrlog.py
Purpose: Collect ArcGIS Server Site Logs
Author: Sean.L (luwl@esrichina.com.cn)
Created: 8/25/16
Copyright: (c) Sean.L 2016
---------------------------------------------------------... | apache-2.0 |
rahul-c1/scikit-learn | benchmarks/bench_lasso.py | 297 | 3305 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
cwu2011/scikit-learn | examples/linear_model/plot_lasso_coordinate_descent_path.py | 254 | 2639 | """
=====================
Lasso and Elastic Net
=====================
Lasso and elastic net (L1 and L2 penalisation) implemented using a
coordinate descent.
The coefficients can be forced to be positive.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import num... | bsd-3-clause |
glouppe/scikit-learn | benchmarks/bench_lasso.py | 297 | 3305 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
kastnerkyle/pylearn2 | pylearn2/cross_validation/tests/test_train_cv_extensions.py | 49 | 1681 | """
Tests for TrainCV extensions.
"""
import os
import tempfile
from pylearn2.config import yaml_parse
from pylearn2.testing.skip import skip_if_no_sklearn
def test_monitor_based_save_best_cv():
"""Test MonitorBasedSaveBestCV."""
handle, filename = tempfile.mkstemp()
skip_if_no_sklearn()
trainer = ya... | bsd-3-clause |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/sklearn/neighbors/graph.py | 208 | 7031 | """Nearest Neighbors graph functions"""
# Author: Jake Vanderplas <vanderplas@astro.washington.edu>
#
# License: BSD 3 clause (C) INRIA, University of Amsterdam
import warnings
from .base import KNeighborsMixin, RadiusNeighborsMixin
from .unsupervised import NearestNeighbors
def _check_params(X, metric, p, metric_... | gpl-2.0 |
cxmo/project-beta | code/dataprep_script.py | 4 | 1758 |
""" The following script will apply a 3mm Gaussian filter on all the data spatially
and will save each smoothed run into the data folder as 'smoothed_run_i', where
0 <= i <= 7 is the index of the run.
"""
#Import libraries
import numpy as np
import scipy
import scipy.ndimage
from scipy.ndimage.filters import gauss... | bsd-3-clause |
zimmermegan/smarda | nltk-3.0.3/nltk/parse/transitionparser.py | 5 | 31354 | # Natural Language Toolkit: Arc-Standard and Arc-eager Transition Based Parsers
#
# Author: Long Duong <longdt219@gmail.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import absolute_import
from __future__ import division
from __future... | mit |
ua-snap/downscale | snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_iem/old_code/cru_ts_downscaling_class_d.py | 3 | 20625 | # # #
# Downscale CRU Historical TS3.x data to a pre-processed climatology
# extent, resolution, reference system
#
# Author: Michael Lindgren (malindgren@alaska.edu)
# # #
# import some modules
import rasterio, xray, os
import numpy as np
import pandas as pd
import numpy as np
class DownscalingUtils( object ):
def... | mit |
waynenilsen/statsmodels | statsmodels/sandbox/examples/try_quantile_regression1.py | 33 | 1188 | '''Example to illustrate Quantile Regression
Author: Josef Perktold
polynomial regression with systematic deviations above
'''
import numpy as np
from statsmodels.compat.python import zip
from scipy import stats
import statsmodels.api as sm
from statsmodels.regression.quantile_regression import QuantReg
sige = 0.... | bsd-3-clause |
vibhorag/scikit-learn | sklearn/metrics/tests/test_score_objects.py | 138 | 14048 | import pickle
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regexp
from sklearn.utils.testing import assert_true
from sklearn.utils.testing im... | bsd-3-clause |
mdrumond/tensorflow | tensorflow/python/estimator/inputs/pandas_io.py | 86 | 4503 | # 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 |
mjgrav2001/scikit-learn | sklearn/metrics/tests/test_regression.py | 272 | 6066 | from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.... | bsd-3-clause |
hsiaoyi0504/scikit-learn | examples/classification/plot_lda.py | 164 | 2224 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | bsd-3-clause |
bjackman/lisa | libs/utils/perf_analysis.py | 3 | 6952 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.