repo_name stringlengths 6 67 | path stringlengths 5 185 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 1.02k 962k | license stringclasses 15
values |
|---|---|---|---|---|---|
jmorris0x0/CFDscraper | CFDscraper.py | 1 | 31725 | #! /usr/bin/env python3
# -*- coding: utf-8
"""
A module to scrape financial data from web tables and write to MySQL.
Usage: python CFDscraper.py ./config1.cfg
First and only arg is optional path to a config file.
One of the items is a list of lists with table info in it that seems like
a headache to parse with confi... | mit |
aminert/scikit-learn | benchmarks/bench_20newsgroups.py | 377 | 3555 | from __future__ import print_function, division
from time import time
import argparse
import numpy as np
from sklearn.dummy import DummyClassifier
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.metrics import accuracy_score
from sklearn.utils.validation import check_array
from sklearn.ensemb... | bsd-3-clause |
RomainBrault/scikit-learn | examples/decomposition/plot_ica_blind_source_separation.py | 349 | 2228 | """
=====================================
Blind source separation using FastICA
=====================================
An example of estimating sources from noisy data.
:ref:`ICA` is used to estimate sources given noisy measurements.
Imagine 3 instruments playing simultaneously and 3 microphones
recording the mixed si... | bsd-3-clause |
parenthetical-e/wheelerexp | meta/kmeans_trialtime.py | 1 | 2374 | """
usage: python ./kmeans_trialtime.py name data roifile cond tr window [, filtfile]
"""
import sys, os
import numpy as np
import argparse
# from fmrilearn.analysis import fir
from fmrilearn.load import load_roifile
from sklearn.cluster import KMeans
from wheelerexp.base import Trialtime
from wheelerexp.base import ... | bsd-2-clause |
michellab/Sire | wrapper/Tools/ap.py | 2 | 27471 | """
Package that allows you to plot simple graphs in ASCII, a la matplotlib.
This package is a inspired from Imri Goldberg's ASCII-Plotter 1.0
(https://pypi.python.org/pypi/ASCII-Plotter/1.0)
At a time I was enoyed by security not giving me direct access to my computer,
and thus to quickly make figures from python, I l... | gpl-2.0 |
nelson-liu/scikit-learn | examples/cluster/plot_face_segmentation.py | 71 | 2839 | """
===================================================
Segmenting the picture of a raccoon face in regions
===================================================
This example uses :ref:`spectral_clustering` on a graph created from
voxel-to-voxel difference on an image to break this image into multiple
partly-homogeneous... | bsd-3-clause |
nesterione/scikit-learn | sklearn/ensemble/tests/test_weight_boosting.py | 35 | 16763 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal, assert_true
from sklearn.utils.testing import assert_raises... | bsd-3-clause |
huaxz1986/git_book | chapters/PreProcessing/feature_selection_filter.py | 1 | 1469 | # -*- coding: utf-8 -*-
"""
数据预处理
~~~~~~~~~~~~~~~~
过滤式特征选择
:copyright: (c) 2016 by the huaxz1986.
:license: lgpl-3.0, see LICENSE for more details.
"""
from sklearn.feature_selection import VarianceThreshold,SelectKBest,f_classif
def test_VarianceThreshold():
'''
测试 VarianceThreshold 的... | gpl-3.0 |
AshleySetter/optoanalysis | PotentialComparisonMass.py | 3 | 6062 | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import least_squares, curve_fit
def steady_state_potential(xdata,HistBins=100):
"""
Calculates the steady state potential.
Parameters
----------
xdata : ndarray
Position data for a degree of freedom
HistBins : int... | mit |
surhudm/scipy | scipy/spatial/_plotutils.py | 33 | 5483 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.decorator import decorator as _decorator
__all__ = ['delaunay_plot_2d', 'convex_hull_plot_2d', 'voronoi_plot_2d']
@_decorator
def _held_figure(func, obj, ax=None, **kw):
import matplotlib.pyplot as plt
if ax... | bsd-3-clause |
UCBerkeleySETI/blimpy | blimpy/plotting/plot_spectrum.py | 1 | 2041 | from .config import *
from ..utils import rebin, db
def plot_spectrum(wf, t=0, f_start=None, f_stop=None, logged=False, if_id=0, c=None, **kwargs):
""" Plot frequency spectrum of a given file
Args:
t (int): integration number to plot (0 -> len(data))
logged (bool): Plot in linear (False) or d... | bsd-3-clause |
dolaameng/keras | examples/mnist_sklearn_wrapper.py | 7 | 3506 | '''Example of how to use sklearn wrapper
Builds simple CNN models on MNIST and uses sklearn's GridSearchCV to find best model
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers... | mit |
adammenges/statsmodels | examples/python/regression_plots.py | 33 | 9585 |
## Regression Plots
from __future__ import print_function
from statsmodels.compat import lzip
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.formula.api import ols
### Duncan's Prestige Dataset
#### Load the Data
# We can use a utility function... | bsd-3-clause |
bigbigdata/IEA-electricity-statistics | IEA_extract.py | 1 | 1607 | import xlrd
import pandas
import matplotlib.pyplot as plt
from pandas import DataFrame
OrgIndex=[] # index of organization
CombustibuleYear=[]
NuclearYear=[]
HydroYear=[]
GWSOYear=[] #Geothermal + wind + solar + other
CombustibuleMonth=[]
NuclearMonth=[]
HydroMonth=[]
GWSOMonth=[] #Geothermal + wind + solar + o... | mit |
SENeC-Initiative/PyNCulture | setup.py | 1 | 1509 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import os, errno
from setuptools import setup, find_packages
# create directory
directory = 'PyNCulture/'
try:
os.makedirs(directory)
except OSError as e:
if e.errno != errno.EEXIST:
raise
# move important
move = (
'__init__.py',
'LICENSE',
'... | gpl-3.0 |
msarahan/bokeh | bokeh/charts/builders/bar_builder.py | 1 | 12402 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Bar class which lets you build your Bar charts just passing
the arguments to the Chart class and calling the proper functions.
It also add a new chained stacked method.
"""
# ------------------------... | bsd-3-clause |
matthiasmengel/sealevel | sealevel/projection.py | 1 | 5508 | # This file is part of SEALEVEL - a tool to estimates future sea-level rise
# constrained by past obervations and long-term sea-level commitment
# Copyright (C) 2016 Matthias Mengel working at PIK Potsdam
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pub... | gpl-3.0 |
lancezlin/ml_template_py | lib/python2.7/site-packages/pandas/tools/merge.py | 7 | 67927 | """
SQL-style merge routines
"""
import copy
import warnings
import string
import numpy as np
from pandas.compat import range, lrange, lzip, zip, map, filter
import pandas.compat as compat
from pandas import (Categorical, DataFrame, Series,
Index, MultiIndex, Timedelta)
from pandas.core.categori... | mit |
raman-sharma/pyAudioAnalysis | data/testComputational.py | 5 | 3609 | import sys
from pyAudioAnalysis import audioBasicIO
from pyAudioAnalysis import audioFeatureExtraction
from pyAudioAnalysis import audioTrainTest as aT
from pyAudioAnalysis import audioSegmentation as aS
import matplotlib.pyplot as plt
import time
nExp = 4
def main(argv):
if argv[1] == "-shortTerm":
for i in range... | apache-2.0 |
prasadtalasila/MailingListParser | lib/deprecated/graph_authors_infomap_community.py | 1 | 19491 | """
This module is used to find the community structure of the network according to the Infomap method of Martin Rosvall
and Carl T. Bergstrom and returns an appropriate VertexClustering object. This module has been implemented using both
the iGraph package and the Infomap tool from MapEquation.org. The VertexClusterin... | gpl-3.0 |
louispotok/pandas | pandas/core/reshape/merge.py | 2 | 61842 | """
SQL-style merge routines
"""
import copy
import warnings
import string
import numpy as np
from pandas.compat import range, lzip, zip, map, filter
import pandas.compat as compat
from pandas import (Categorical, DataFrame,
Index, MultiIndex, Timedelta)
from pandas.core.arrays.categorical import... | bsd-3-clause |
ppries/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/pandas_io_test.py | 11 | 2404 | # Copyright 2015 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 |
Garrett-R/scikit-learn | sklearn/datasets/tests/test_20news.py | 42 | 2416 | """Test the 20news downloader, if the data is available."""
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import SkipTest
from sklearn import datasets
def test_20news():
try:
data = dat... | bsd-3-clause |
pminder/ksvd | Test/demo_ksvd.py | 1 | 2021 | #coding:utf8
"""Run very simple tests for ksvd algorithm"""
import random
import imp
ksvd = imp.load_source('ksvd', '../Source/ksvd.py')
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import orthogonal_mp
from skimage.draw import circle_perimeter, ellipse_perimeter, polygon, line
######... | mit |
aerler/HGS-Tools | Python/enkf_utils/enkf_input.py | 1 | 26739 | '''
Created on Jan 1, 2018
A collection of functions to generate EnKF input files.
@author: Andre R. Erler, GPL v3
'''
# imports
import os, yaml
import numpy as np
import pandas as pd
from glob import glob
from collections import OrderedDict
from scipy import stats as ss
from collections import namedtuple
# interna... | gpl-3.0 |
jandom/GromacsWrapper | gromacs/formats.py | 1 | 1486 | # GromacsWrapper: formats.py
# Copyright (c) 2009-2010 Oliver Beckstein <orbeckst@gmail.com>
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.
""":mod:`gromacs.formats` -- Accessing various files
=================================================
This module contain... | gpl-3.0 |
chrisburr/scikit-learn | sklearn/cluster/dbscan_.py | 19 | 11713 | # -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from ..base import BaseEst... | bsd-3-clause |
humdings/zipline | zipline/utils/security_list.py | 6 | 5399 | import warnings
from datetime import datetime
from os import listdir
import os.path
import pandas as pd
import pytz
import zipline
from zipline.errors import SymbolNotFound
from zipline.finance.asset_restrictions import SecurityListRestrictions
from zipline.zipline_warnings import ZiplineDeprecationWarning
DATE_FOR... | apache-2.0 |
ahoyosid/scikit-learn | sklearn/feature_selection/__init__.py | 244 | 1088 | """
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from .univariate_selection import chi2
from .univariate_selection import f_classif
from .univariate_selection import f_... | bsd-3-clause |
smccaffrey/PIRT_ASU | scripts/due_dates_example(PHY132).py | 2 | 3045 | """Import python functionality"""
import sys
"""Append Local file locations to to PYTHONPATH"""
sys.path.append('/Users/smccaffrey/Desktop/LMSA-core/src/')
import time
import pandas as pd
from selenium import webdriver
"""Append Local file locations to to PYTHONPATH"""
sys.path.append('/Users/smccaffrey/Desktop/LMSA-... | apache-2.0 |
zangsir/sms-tools | lectures/09-Sound-description/plots-code/centroid.py | 23 | 1086 | import numpy as np
import matplotlib.pyplot as plt
import essentia.standard as ess
M = 1024
N = 1024
H = 512
fs = 44100
spectrum = ess.Spectrum(size=N)
window = ess.Windowing(size=M, type='hann')
centroid = ess.Centroid(range=fs/2.0)
x = ess.MonoLoader(filename = '../../../sounds/speech-male.wav', sampleRate = fs)()
c... | agpl-3.0 |
KEHANG/AutoFragmentModeling | ipython/3. reporting/mw_distri_comparison.py | 1 | 3467 | #~/usr/bin/env python
#-*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import os
import numpy as np
# set global settings
def init_plotting():
plt.rcParams['figure.figsize'] = (4, 3)
plt.rcParams['font.size'] = 8
plt.rcParams['font.family'] = 'Helvetica'
plt.rcParams['axes.labelsize'] = plt.rcPa... | mit |
colour-science/colour | colour/utilities/__init__.py | 1 | 5150 | # -*- coding: utf-8 -*-
import sys
from .data_structures import (Lookup, Structure, CaseInsensitiveMapping,
LazyCaseInsensitiveMapping)
from .common import (
handle_numpy_errors, ignore_numpy_errors, raise_numpy_errors,
print_numpy_errors, warn_numpy_errors, ignore_python_warning... | bsd-3-clause |
girving/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/ops.py | 27 | 46439 | # 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 |
the13fools/Bokeh_Examples | plotting/file/glucose.py | 3 | 1456 |
import pandas as pd
from bokeh.sampledata.glucose import data
from bokeh.plotting import *
output_file("glucose.html", title="glucose.py example")
hold()
dates = data.index.to_series()
figure(x_axis_type="datetime", tools="pan,wheel_zoom,box_zoom,reset,previewsave")
line(dates, data['glucose'], color='red', lege... | bsd-3-clause |
massgov/incubator-superset | superset/views/core.py | 1 | 84670 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict
from datetime import datetime, timedelta
import json
import logging
import pandas as pd
import pickle
import re
import time
import tra... | apache-2.0 |
robbymeals/scikit-learn | examples/model_selection/plot_confusion_matrix.py | 244 | 2496 | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | bsd-3-clause |
tedoreve/tools | naimaabc/naimaabc.py | 1 | 2243 | import numpy as np
import matplotlib.pyplot as plt
import naima
from naima.models import (ExponentialCutoffPowerLaw, Synchrotron,
InverseCompton)
from astropy.constants import c
import astropy.units as u
ECPL = ExponentialCutoffPowerLaw(1e36*u.Unit('1/eV'), 1*u.TeV, 2.0, 13*u.TeV)
... | mit |
AlexanderFabisch/scikit-learn | sklearn/cross_decomposition/pls_.py | 34 | 30531 | """
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from distutils.version import LooseVersion
from sklearn.utils.extmath import svd_flip
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..u... | bsd-3-clause |
KrasnitzLab/sgains | sgains/pipelines/varbin_10x_pipeline.py | 1 | 9166 | import os
import time
import glob
import shutil
from io import BytesIO
from collections import defaultdict, namedtuple
import pandas as pd
import numpy as np
from dask.distributed import Queue, worker_client, wait
from termcolor import colored
import pysam
from sgains.genome import Genome
from sgains.pipelines.ex... | mit |
BryanCutler/spark | python/pyspark/sql/pandas/typehints.py | 26 | 6324 | #
# 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 |
gfyoung/pandas | pandas/core/tools/times.py | 2 | 4601 | from datetime import datetime, time
from typing import List, Optional
import numpy as np
from pandas._libs.lib import is_list_like
from pandas.core.dtypes.generic import ABCIndex, ABCSeries
from pandas.core.dtypes.missing import notna
def to_time(arg, format=None, infer_time_format=False, errors="raise"):
"""
... | bsd-3-clause |
jphall663/bellarmine_py_intro | exercises.py | 1 | 13625 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2015 by Patrick Hall, jpatrickhall@gmail.com
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 requi... | apache-2.0 |
elkingtonmcb/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/colors.py | 69 | 31676 | """
A module for converting numbers or color arguments to *RGB* or *RGBA*
*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the
range 0-1.
This module includes functions and classes for color specification
conversions, and for mapping numbers to colors in a 1-D array of
colors called a colormap. Color... | agpl-3.0 |
petosegan/scikit-learn | examples/model_selection/plot_roc_crossval.py | 247 | 3253 | """
=============================================================
Receiver Operating Characteristic (ROC) with cross validation
=============================================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality using cross-validation.
ROC curv... | bsd-3-clause |
lewislone/mStocks | packets-analysis/lib/XlsxWriter-0.7.3/examples/pandas_chart_stock.py | 9 | 1931 | ##############################################################################
#
# An example of converting a Pandas dataframe with stock data taken from the
# web to an xlsx file with a line chart using Pandas and XlsxWriter.
#
# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org
#
import pandas as pd
import pand... | mit |
twotwo/tools-python | pandas-sample/save-stock-info.py | 1 | 1444 | # fetch remove data to local excel: AAPL.xls/MSFT.xls
# https://github.com/pydata/pandas-datareader/blob/master/pandas_datareader/data.py
import datetime
import os
import pandas as pd
import pandas_datareader.data as web
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
warnin... | mit |
rickdberg/mgmodel | bottom_temp_vs_depth_estimator.py | 1 | 2702 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 10 12:42:04 2017
@author: rickdberg
Data explorer
"""
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
import matplotlib.pyplot as plt
from scipy import stats
engine = create_engine("mysql://root:neogene227@localhost/iodp_compiled")
# Load m... | mit |
afgaron/rgz-analysis | python/processing.py | 2 | 13922 | import logging, time
from astropy import coordinates as coord, units as u
import mechanize, httplib, StringIO
import astroquery, requests
from astroquery.irsa import Irsa
import numpy as np
import pandas as pd
import itertools
from astropy.cosmology import Planck13 as cosmo
#custom modules for the RGZ catalog
import c... | mit |
gokalpdemirci/momentum | Readstq.py | 1 | 2052 | # File: Readstq.py
import datetime
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.neural_network import MLPRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVR
from sklearn.svm import LinearSVR
class readSTQFormat:
def __ini... | gpl-3.0 |
ysekky/GPy | travis_tests.py | 5 | 1919 | #===============================================================================
# Copyright (c) 2015, Max Zwiessele
#
# 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 sour... | bsd-3-clause |
treycausey/scikit-learn | examples/tree/plot_tree_regression.py | 8 | 1405 | """
===================================================================
Decision Tree Regression
===================================================================
A 1D regression with decision tree.
The :ref:`decision trees <tree>` is
used to fit a sine curve with addition noisy observation. As a result, it
learns ... | bsd-3-clause |
louispotok/pandas | pandas/tests/indexing/test_indexing.py | 3 | 37492 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101
""" test fancy indexing & misc """
import pytest
import weakref
from warnings import catch_warnings
from datetime import datetime
from pandas.core.dtypes.common import (
is_integer_dtype,
is_float_dtype)
from pandas.compat import range, lrange, lzip,... | bsd-3-clause |
q1ang/scikit-learn | examples/plot_isotonic_regression.py | 303 | 1767 | """
===================
Isotonic Regression
===================
An illustration of the isotonic regression on generated data. The
isotonic regression finds a non-decreasing approximation of a function
while minimizing the mean squared error on the training data. The benefit
of such a model is that it does not assume a... | bsd-3-clause |
WaveBlocks/WaveBlocks | src/scripts_spawn_na/PlotWavefunctionSpawn.py | 1 | 4334 | """The WaveBlocks Project
Plot the wavefunctions probability densities of the
spawned wavepackets.
@author: R. Bourquin
@copyright: Copyright (C) 2011 R. Bourquin
@license: Modified BSD License
"""
import sys
from numpy import angle, conj, real, imag
from matplotlib.pyplot import *
from WaveBlocks import Potential... | bsd-3-clause |
nvoron23/scikit-learn | examples/ensemble/plot_gradient_boosting_regression.py | 227 | 2520 | """
============================
Gradient Boosting regression
============================
Demonstrate Gradient Boosting on the Boston housing dataset.
This example fits a Gradient Boosting model with least squares loss and
500 regression trees of depth 4.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prett... | bsd-3-clause |
pereirapysensing/GeoPython_2017_3D | GeoPython_2017.py | 1 | 9004 | # -*- coding: utf-8 -*-
'''
Working with 3D point clouds with Python: GeoPython 2017, Basel - Switzerland
@author: Joao Paulo Pereira
University of Freiburg
Chair of Remote Sensing and Landscape Information Systems - FeLis
------------------------------... | mit |
MechCoder/scikit-garden | skgarden/mondrian/ensemble/forest.py | 1 | 14687 | import numpy as np
from scipy import sparse
from sklearn.base import ClassifierMixin
from sklearn.ensemble.forest import ForestClassifier
from sklearn.ensemble.forest import ForestRegressor
from sklearn.exceptions import NotFittedError
from sklearn.externals.joblib import delayed, Parallel
from sklearn.preprocessing im... | bsd-3-clause |
WarrenWeckesser/scikits-image | doc/examples/plot_ransac.py | 24 | 1589 | """
=========================================
Robust line model estimation using RANSAC
=========================================
In this example we see how to robustly fit a line model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from skimage.measure import ... | bsd-3-clause |
zhenv5/scikit-learn | sklearn/manifold/setup.py | 99 | 1243 | 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 |
mhdella/scikit-learn | examples/ensemble/plot_partial_dependence.py | 249 | 4456 | """
========================
Partial Dependence Plots
========================
Partial dependence plots show the dependence between the target function [1]_
and a set of 'target' features, marginalizing over the
values of all other features (the complement features). Due to the limits
of human perception the size of t... | bsd-3-clause |
ratnania/pigasus | python/plugin/parabolic_monge_ampere.py | 1 | 6136 | # -*- coding: UTF-8 -*-
#! /usr/bin/python
import sys
import numpy as np
from pigasus.gallery.basicPDE import *
import matplotlib.pyplot as plt
import numpy as np
from caid.cad_geometry import cad_nurbs
from __main__ import __file__ as filename
# ...
abs = np.abs; sin = np.sin ; cos = np.cos ; exp =... | mit |
jiajunshen/partsNet | scripts/popLargeMatchUpdateVaryParts.py | 1 | 12328 | from __future__ import division, print_function,absolute_import
import pylab as plt
import amitgroup.plot as gr
import numpy as np
import amitgroup as ag
import os
import pnet
import matplotlib.pylab as plot
from pnet.cyfuncs import index_map_pooling
from Queue import Queue
def extract(ims,allLayers):
#print(allLay... | bsd-3-clause |
vermouthmjl/scikit-learn | examples/ensemble/plot_adaboost_twoclass.py | 347 | 3268 | """
==================
Two-class AdaBoost
==================
This example fits an AdaBoosted decision stump on a non-linearly separable
classification dataset composed of two "Gaussian quantiles" clusters
(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision
boundary and decision scores. The di... | bsd-3-clause |
revzin/uav-firmware | pc-navsys/graph_data.py | 1 | 3349 | from __future__ import unicode_literals
import json, pprint, time
from matplotlib import rc
font = {'family': 'Times New Roman',
'weight': 'normal',
'size': '15'}
rc('font', **font)
import matplotlib.pyplot as plt
def tosec(jtime):
return ((jtime["h"] * 24) + (jtime["m"] * 60) + jtime["s"])
... | gpl-2.0 |
adamhajari/spyre | spyre/example_show_all_the_inputs.py | 1 | 7551 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from numpy import pi
import requests
import json
from bokeh.resources import INLINE
try:
from . import server
except Exception:
import server
server.include_df_index = True
class TestApp1(server.App):
colors = [
{"label": "Gr... | mit |
marcharper/python-ternary | setup.py | 1 | 1160 | import setuptools
from distutils.core import setup
version = "1.0.8"
with open('README.txt') as file:
long_description = file.read()
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language ... | mit |
OshynSong/scikit-learn | sklearn/utils/metaestimators.py | 283 | 2353 | """Utilities for meta-estimators"""
# Author: Joel Nothman
# Andreas Mueller
# Licence: BSD
from operator import attrgetter
from functools import update_wrapper
__all__ = ['if_delegate_has_method']
class _IffHasAttrDescriptor(object):
"""Implements a conditional property using the descriptor protocol.
... | bsd-3-clause |
jarthurgross/bloch_distribution | scripts/plot_parallelogram_area_q12.py | 1 | 1437 | #!/usr/bin/python3
import matplotlib.pyplot as plt
from matplotlib import cm, colors
import numpy as np
from bloch_distribution.invert_angles import parallelogram_area_q12
from my_cms import husl_hot
# Parameters
epsilon = 0.575
q1_min = -4
q1_max = 4
q1_samples = 512
q2_min = -4
q2_max = 4
q2_samples = 512
Q1 = np.l... | mit |
oemof/examples | oemof_examples/oemof.solph/v0.3.x/generic_chp/mchp.py | 2 | 3042 | # -*- coding: utf-8 -*-
"""
General description
-------------------
Example that illustrates how to use custom component `GenericCHP` can be used.
In this case it is used to model a motoric chp.
Installation requirements
-------------------------
This example requires the version v0.3.x of oemof. Install by:
pip... | gpl-3.0 |
felixcheung/vagrant-projects | Spark-IPython-32bit/ipython-pyspark.py | 4 | 3462 | #!/usr/bin/env python
# https://github.com/felixcheung/vagrant-projects
import getpass
import glob
import inspect
import os
import platform
import re
import subprocess
import sys
import time
#-----------------------
# PySpark
#
master = 'local[*]'
num_executors = 12 #24
executor_cores = 2
executor_memory = '1g'... | apache-2.0 |
RachitKansal/scikit-learn | sklearn/cluster/tests/test_birch.py | 342 | 5603 | """
Tests for the birch clustering algorithm.
"""
from scipy import sparse
import numpy as np
from sklearn.cluster.tests.common import generate_clustered_data
from sklearn.cluster.birch import Birch
from sklearn.cluster.hierarchical import AgglomerativeClustering
from sklearn.datasets import make_blobs
from sklearn.l... | bsd-3-clause |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py | 10 | 7837 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import FigureManagerBase, FigureCanvasBase, \
NavigationToolbar2, TimerBase
from matplotlib.backend_bases impor... | gpl-3.0 |
ClimbsRocks/scikit-learn | sklearn/tests/test_discriminant_analysis.py | 15 | 13124 | import sys
import numpy as np
from nose import SkipTest
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
fro... | bsd-3-clause |
JackKelly/neuralnilm_prototype | neuralnilm/metrics.py | 2 | 3184 | from __future__ import print_function, division
import numpy as np
import sklearn.metrics as metrics
METRICS = {
'classification': [
'accuracy_score',
'f1_score',
'precision_score',
'recall_score'
],
'regression': [
'mean_absolute_error'
]
}
def run_metrics(y_... | mit |
botswana-harvard/edc-rdb | bcpp_rdb/mixins/dataframe_mixin.py | 1 | 1841 | import pytz
import pandas as pd
from django.conf import settings
from sqlalchemy.engine import create_engine
from ..private_settings import Rdb, Edc
tz = pytz.timezone(settings.TIME_ZONE)
class DataframeMixin:
conn_settings = Rdb, Edc
def __init__(self, *args, **kwargs):
super().__init__(*args, *... | gpl-2.0 |
bstadie/cgt | examples/demo_variational_autoencoder.py | 18 | 10799 | import cgt
from cgt import core
from cgt import nn
import numpy as np
import cPickle as pickle
from scipy.stats import norm
import matplotlib.pyplot as plt
from example_utils import fetch_dataset
'''
MNIST manifold demo (with 2-dimensional latent z) using variational autoencoder
'''
rng = np.random.RandomState(1234)
... | mit |
murali-munna/scikit-learn | sklearn/neighbors/tests/test_ball_tree.py | 129 | 10192 | import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dis... | bsd-3-clause |
rgerkin/upsit | scratch.py | 1 | 33324 | import inspect
import builtins
import re
import time
import nbformat
from IPython.display import Image,display,HTML
import numpy as np
from scipy.special import beta as betaf
from scipy.stats import norm,beta
from scipy.optimize import minimize
import seaborn as sns
import pandas as pd
from sklearn.naive_bayes impo... | gpl-2.0 |
phoebe-project/phoebe2-docs | 2.2/examples/binary_pulsations.py | 2 | 1716 | #!/usr/bin/env python
# coding: utf-8
# Binary with Pulsations
# ============================
#
# **NOTE: pulsations are currently being tested but not yet supported**
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line... | gpl-3.0 |
tracierenea/gnuradio | gr-filter/examples/fft_filter_ccc.py | 47 | 4363 | #!/usr/bin/env python
#
# Copyright 2013 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 option)
# ... | gpl-3.0 |
nkeim/trackpy | trackpy/identification.py | 1 | 9989 | #Copyright 2013 Thomas A Caswell
#tcaswell@uchicago.edu
#http://jfi.uchicago.edu/~tcaswell
#
#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) an... | gpl-3.0 |
apache/spark | python/pyspark/pandas/__init__.py | 11 | 4308 | #
# 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 |
clauwag/WikipediaGenderInequality | src/GoogleTrendAnalyzer.py | 1 | 19323 | __author__ = 'wagnerca'
from os import listdir
from os.path import isfile, join
import scipy.stats as stats
import numpy as np
import pandas as pd
import pylab as plt
from scipy.stats import itemfreq
import sys
import util as ut
import re
import os
import seaborn as sns
from statsmodels.formula.api impo... | mit |
abhisg/scikit-learn | sklearn/__init__.py | 2 | 3038 | """
Machine learning module for Python
==================================
sklearn is a Python module integrating classical machine
learning algorithms in the tightly-knit world of scientific Python
packages (numpy, scipy, matplotlib).
It aims to provide simple and efficient solutions to learning problems
that are acc... | bsd-3-clause |
vigilv/scikit-learn | examples/linear_model/plot_polynomial_interpolation.py | 251 | 1895 | #!/usr/bin/env python
"""
========================
Polynomial interpolation
========================
This example demonstrates how to approximate a function with a polynomial of
degree n_degree by using ridge regression. Concretely, from n_samples 1d
points, it suffices to build the Vandermonde matrix, which is n_samp... | bsd-3-clause |
phageghost/pg_tools | pgtools/name_translation.py | 1 | 24079 | import os
import csv
import pandas
import argparse
import random
import collections
import itertools
import datetime
import numpy
from pgtools import toolbox
DATA_BASEPATH = toolbox.home_path('orthology/')
MODENCODE_TABLE_FNAME = os.path.join(DATA_BASEPATH, 'modencode/modencode.common.orth.txt')
def load_modencode(... | mit |
djgagne/scikit-learn | sklearn/metrics/tests/test_ranking.py | 127 | 40813 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projec... | bsd-3-clause |
hugo-lorenzo-mato/meteo-galicia-db | pruebaPlot.py | 1 | 1757 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter
import string
import random
'''
# the random data
x = np.random.randn(1000)
y = np.random.randn(1000)
nullfmt = NullFormatter() # no labels
# definitions for the axes
left, width = 0.1, 0.65
bottom, height = 0.1, 0.... | mit |
tbabej/astropy | astropy/visualization/mpl_style.py | 4 | 3102 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains dictionaries that can be used to set a matplotlib
plotting style. It is mostly here to allow a consistent plotting style
in tutorials, but can be used to prepare any matplotlib figure.
"""
from ..utils import minversion
# This re... | bsd-3-clause |
nmayorov/scikit-learn | examples/manifold/plot_manifold_sphere.py | 23 | 5102 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionality reducti... | bsd-3-clause |
fengzhyuan/scikit-learn | examples/preprocessing/plot_robust_scaling.py | 221 | 2702 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Robust Scaling on Toy Data
=========================================================
Making sure that each Feature has approximately the same scale can be a
crucial preprocessing step. However, when data contains o... | bsd-3-clause |
siconos/siconos | kernel/swig/tests/test_bouncing_ball.py | 4 | 10411 | #!/usr/bin/env python
from siconos.tests_setup import working_dir
import siconos.kernel as sk
import numpy as np
import os
def test_bouncing_ball1():
"""Run a complete simulation (Bouncing ball example)
LagrangianLinearTIDS, no plugins.
"""
t0 = 0. # start time
tend = 10. # end time
... | apache-2.0 |
jcfr/mystic | scripts/mystic_model_plotter.py | 1 | 21412 | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE
__doc__ = """
mystic_model_p... | bsd-3-clause |
RPGOne/Skynet | scikit-learn-0.18.1/sklearn/utils/random.py | 46 | 10523 | # Author: Hamzeh Alsalhi <ha258@cornell.edu>
#
# License: BSD 3 clause
from __future__ import division
import numpy as np
import scipy.sparse as sp
import operator
import array
from sklearn.utils import check_random_state
from sklearn.utils.fixes import astype
from ._random import sample_without_replacement
__all__ =... | bsd-3-clause |
elkingtonmcb/bcbio-nextgen | bcbio/variation/coverage_experimental.py | 1 | 7319 | import os
import pandas as pd
import subprocess
from collections import Counter
import numpy as np
import math
import pysam
import pybedtools
from bcbio.utils import (file_exists, tmpfile, chdir, splitext_plus,
max_command_length, robust_partition_all)
from bcbio.provenance import do
from bcb... | mit |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/sklearn/neighbors/nearest_centroid.py | 37 | 7348 | # -*- 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... | mit |
Sentient07/scikit-learn | benchmarks/bench_plot_omp_lars.py | 72 | 4514 | """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 six
import numpy as np
from sklearn.linea... | bsd-3-clause |
airazabal/smartemail | bin/python_parser_remove_tokens.py | 1 | 2463 | import csv
import re
import codecs
input_files = []
# input_files.append("v2_COI_Set_1_modified.csv")
# input_files.append("v2COI_Set_2_modified.csv")
# input_files.append("v2COI_Set_3_modified.csv")
# input_files.append("v2_Updated_Additional_COI.csv")
#input_files.append("v2COI_TrainingSet4_4_18_modified.csv")
input... | apache-2.0 |
hainm/statsmodels | statsmodels/base/model.py | 25 | 76781 | from __future__ import print_function
from statsmodels.compat.python import iterkeys, lzip, range, reduce
import numpy as np
from scipy import stats
from statsmodels.base.data import handle_data
from statsmodels.tools.tools import recipr, nan_dot
from statsmodels.stats.contrast import ContrastResults, WaldTestResults
f... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.