repo_name stringlengths 6 112 | path stringlengths 4 204 | copies stringlengths 1 3 | size stringlengths 4 6 | content stringlengths 714 810k | license stringclasses 15
values |
|---|---|---|---|---|---|
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/tests/frame/test_alter_axes.py | 7 | 26538 | # -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime, timedelta
import numpy as np
from pandas.compat import lrange
from pandas import (DataFrame, Series, Index, MultiIndex,
RangeIndex)
import pandas as pd
from pandas.util.testing import (assert_series_equ... | apache-2.0 |
Athemis/charm | charm-cli.py | 1 | 16017 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
charm-cli.py: Simple command line interface for CHarm.
"""
import argparse
import logging
try:
import matplotlib
matplotlib.use('Agg')
matplotlib.rc('font', **{'sans-serif': 'DejaVu Sans',
'serif': 'DejaVu Serif',
... | mit |
pythonvietnam/scikit-learn | sklearn/linear_model/__init__.py | 270 | 3096 | """
The :mod:`sklearn.linear_model` module implements generalized linear models. It
includes Ridge regression, Bayesian Regression, Lasso and Elastic Net
estimators computed with Least Angle Regression and coordinate descent. It also
implements Stochastic Gradient Descent related algorithms.
"""
# See http://scikit-le... | bsd-3-clause |
raph333/Consensus-residue-contact-calculator | scripts/calculate_networks.py | 1 | 4884 | '''
------------------------------------------------------------------------------
AUTHOR: Raphael Peer, raphael1peer@gmail.com
PURPOSE:
Calculation of residue contact networks of all structures in the input-
directory.
OUTPUT:
csv-file of residue contact networks of all input structures.
Each contact is given in the... | mit |
dare0021/ClusteringBasedID | run.py | 1 | 16148 | import numpy as np
import os
import speakerInfo as sinfo
import infoSingleFile
from unpackMFC import run as unmfc
from pyAudioAnalysis import audioBasicIO, audioFeatureExtraction
from datetime import datetime
import sklearn
from threading import Thread, BoundedSemaphore
import modelStorage as mds
from enum import Enum... | mit |
OmnesRes/pan_cancer | paper/figures/figure_2/gene_set_overlap/gene_sets.py | 1 | 16387 | ##script for finding the overlap in the top 100 most significant gene sets from msigdb for good and bad genes
##load necessary modules
import pylab as plt
import numpy as np
import math
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
##I did not wri... | mit |
stscieisenhamer/glue | doc/conf.py | 2 | 13273 | # -*- coding: utf-8 -*-
#
# Glue documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 25 12:05:47 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | bsd-3-clause |
dmnfarrell/epitopepredict | epitopepredict/plotting.py | 1 | 37189 | #!/usr/bin/env python
"""
epitopepredict plotting
Created February 2016
Copyright (C) Damien Farrell
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 th... | apache-2.0 |
wrightni/OSSP | training_gui.py | 1 | 40462 | #title: Training Set Creation for Random Forest Classification
#author: Nick Wright
#Inspired by: Justin Chen
#purpose: Creates a GUI for a user to identify watershed superpixels of an image as
# melt ponds, sea ice, or open water to use as a training data set for a
# Random Forest Classification method... | mit |
HolgerPeters/scikit-learn | sklearn/metrics/tests/test_ranking.py | 46 | 41270 | 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.datasets import make_multilabel_classification
from sklearn.random_projection import sparse_random_mat... | bsd-3-clause |
dsm054/pandas | asv_bench/benchmarks/io/csv.py | 3 | 7375 | import random
import string
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame, Categorical, date_range, read_csv
from pandas.compat import cStringIO as StringIO
from ..pandas_vb_common import BaseIO
class ToCSV(BaseIO):
fname = '__test__.csv'
params = ['wide', 'long', 'mixed'... | bsd-3-clause |
blaze/distributed | distributed/protocol/tests/test_pandas.py | 1 | 2399 | import numpy as np
import pandas as pd
import pytest
from dask.dataframe.utils import assert_eq
from distributed.protocol import serialize, deserialize, decompress
dfs = [
pd.DataFrame({}),
pd.DataFrame({"x": [1, 2, 3]}),
pd.DataFrame({"x": [1.0, 2.0, 3.0]}),
pd.DataFrame({0: [1, 2, 3]}),
pd.Dat... | bsd-3-clause |
ericxk/MachineLearningExercise | ML_in_action/chapter7/adaboost.py | 1 | 6050 | from numpy import *
def loadSimpData():
datMat = matrix([[ 1. , 2.1],
[ 2. , 1.1],
[ 1.3, 1. ],
[ 1. , 1. ],
[ 2. , 1. ]])
classLabels = [1.0, 1.0, -1.0, -1.0, 1.0]
return datMat,classLabels
##通过阈值比较对数据进行分类,在阈值一边的数据会分到类别-1,其中lt是小于等于
def stumpClassify(dataM... | mit |
anirudhjayaraman/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 98 | 20870 | from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.cross_validation import train_test_split
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing impor... | bsd-3-clause |
c-m/Licenta | src/data_loader.py | 1 | 5476 | # load datasets from files
import csv
import numpy as np
import os
from matplotlib import pyplot as plt
from sklearn.decomposition import PCA
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import PolynomialFeatures
from sklearn.preprocessing import StandardScaler
DATA_PATH = '../data_sets... | mit |
iproduct/course-social-robotics | 11-dnn-keras/venv/Lib/site-packages/pandas/core/shared_docs.py | 1 | 10730 | from typing import Dict
_shared_docs: Dict[str, str] = {}
_shared_docs[
"aggregate"
] = """
Aggregate using one or more operations over the specified axis.
Parameters
----------
func : function, str, list or dict
Function to use for aggregating the data. If a function, must either
work when passed a {kla... | gpl-2.0 |
raincoatrun/basemap | doc/users/figures/hurrtracks.py | 6 | 1695 | """
draw Atlantic Hurricane Tracks for storms that reached Cat 4 or 5.
part of the track for which storm is cat 4 or 5 is shown red.
ESRI shapefile data from http://nationalatlas.gov/mld/huralll.html
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
# Lambert Conformal Con... | gpl-2.0 |
pv/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 228 | 11221 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | bsd-3-clause |
kashif/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 8 | 44274 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
icrtiou/coursera-ML | helper/anomaly.py | 1 | 1667 | import numpy as np
from scipy import stats
from sklearn.metrics import f1_score, classification_report
# X data shape
# array([[ 13.04681517, 14.74115241],
# [ 13.40852019, 13.7632696 ],
# [ 14.19591481, 15.85318113],
# [ 14.91470077, 16.17425987],
# [ 13.57669961, 14.04284944]])
def... | mit |
joernhees/scikit-learn | sklearn/cluster/tests/test_dbscan.py | 56 | 13916 | """
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 |
yichiliao/yichiliao.github.io | markdown_generator/talks.py | 199 | 4000 |
# coding: utf-8
# # Talks markdown generator for academicpages
#
# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i... | mit |
jlegendary/scikit-learn | examples/linear_model/plot_robust_fit.py | 238 | 2414 | """
Robust linear estimator fitting
===============================
Here a sine function is fit with a polynomial of order 3, for values
close to zero.
Robust fitting is demoed in different situations:
- No measurement errors, only modelling errors (fitting a sine with a
polynomial)
- Measurement errors in X
- M... | bsd-3-clause |
scottpurdy/nupic.fluent | fluent/models/classification_model.py | 1 | 7033 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | gpl-3.0 |
abelcarreras/aiida_extensions | workflows/tools/plot_phonon_info.py | 1 | 3164 | from aiida import load_dbenv
load_dbenv()
from aiida.orm import load_node, load_workflow
from aiida.orm import Code, DataFactory
import matplotlib.pyplot as plt
StructureData = DataFactory('structure')
ParameterData = DataFactory('parameter')
ArrayData = DataFactory('array')
KpointsData = DataFactory('array.kpoints'... | mit |
0x90/skybluetero | plotter.py | 3 | 4319 | # Copyright (c) 2009 Emiliano Pastorino <emilianopastorino@gmail.com>
#
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use... | mit |
Edouard360/text-mining-challenge | main.py | 1 | 4387 | """
Module docstring
"""
from time import localtime, strftime
import pandas as pd
from sklearn import metrics
from classifier import Classifier
from featureEngineering.FeatureExporter import FeatureExporter
from featureEngineering.FeatureImporter import FeatureImporter
from tools import random_sample
time_sub = str... | apache-2.0 |
tbereau/espresso | samples/python/electrophoresis.py | 1 | 8509 | #
# Copyright (C) 2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | gpl-3.0 |
bennlich/scikit-image | doc/ext/notebook.py | 44 | 3042 | __all__ = ['python_to_notebook', 'Notebook']
import json
import copy
import warnings
# Skeleton notebook in JSON format
skeleton_nb = """{
"metadata": {
"name":""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type":... | bsd-3-clause |
Newlife005/nestle | examples/plot_line.py | 5 | 1484 | """
====
Line
====
Example of fitting a straight line to some data.
"""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import corner
import nestle
np.random.seed(0)
def model(theta, x):
m, c = theta
return m*x + c
# Generate some data
theta_true = [0.5, 10.0]
N =... | mit |
mblondel/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 |
thebucknerlife/caravel | caravel/forms.py | 1 | 25665 | """Contains the logic to create cohesive forms on the explore view"""
from wtforms import (
Form, SelectMultipleField, SelectField, TextField, TextAreaField,
BooleanField, IntegerField, HiddenField)
from wtforms import validators, widgets
from copy import copy
from caravel import app
from collections import Or... | apache-2.0 |
dingocuster/scikit-learn | sklearn/tests/test_pipeline.py | 162 | 14875 | """
Test the pipeline module.
"""
import numpy as np
from scipy import sparse
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_raises, assert_raises_regex, assert_raise_message
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn... | bsd-3-clause |
nvoron23/statsmodels | statsmodels/datasets/heart/data.py | 25 | 1858 | """Heart Transplant Data, Miller 1976"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """???"""
TITLE = """Transplant Survival Data"""
SOURCE = """ Miller, R. (1976). Least squares regression with censored dara. Biometrica, 63 (3). 449-464.
"""
DESCRSHORT = """Survival times after receiving a hear... | bsd-3-clause |
caisq/tensorflow | tensorflow/python/estimator/canned/baseline_test.py | 11 | 54918 | # 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 |
michigraber/scikit-learn | sklearn/linear_model/ridge.py | 89 | 39360 | """
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# Michael Eickenberg <michael.eickenberg@nsup.org>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
impor... | bsd-3-clause |
zfrenchee/pandas | pandas/core/computation/expressions.py | 1 | 7066 | """
Expressions
-----------
Offer fast expression evaluation through numexpr
"""
import warnings
import numpy as np
from pandas.core.common import _values_from_object
from pandas.core.computation.check import _NUMEXPR_INSTALLED
from pandas.core.config import get_option
if _NUMEXPR_INSTALLED:
import numexpr as n... | bsd-3-clause |
jseabold/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 228 | 11221 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | bsd-3-clause |
russel1237/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 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/pandas/tests/formats/test_printing.py | 8 | 4905 | # -*- coding: utf-8 -*-
import nose
from pandas import compat
import pandas.formats.printing as printing
import pandas.formats.format as fmt
import pandas.util.testing as tm
import pandas.core.config as cf
_multiprocess_can_split_ = True
def test_adjoin():
data = [['a', 'b', 'c'], ['dd', 'ee', 'ff'], ['ggg', 'hh... | apache-2.0 |
costypetrisor/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 127 | 25365 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | bsd-3-clause |
haphaeu/yoshimi | Qt/MotionCurves/orbit.py | 1 | 5357 | # -*- coding: utf-8 -*-
"""
Ctrl+E to clear screen.
Created on Tue Aug 16 15:44:46 2016
@author: rarossi
"""
from PyQt4 import QtGui, QtCore
import numpy as np
import scipy.interpolate as itp
from math import sin, cos
from matplotlib import pyplot as plt
from time import sleep
class Window(QtGui.QWidget):
def __... | lgpl-3.0 |
benanne/morb | examples/example_mnist_labeled.py | 1 | 6200 | import morb
from morb import rbms, stats, updaters, trainers, monitors, units, parameters
import theano
import theano.tensor as T
import numpy as np
import gzip, cPickle
import matplotlib.pyplot as plt
plt.ion()
from utils import generate_data, get_context, one_hot
# DEBUGGING
from theano import ProfileMode
# mo... | gpl-3.0 |
SedFoam/sedfoam | tutorials/Py/plot_tuto1DBedLoadCLB.py | 1 | 3893 | import subprocess
import sys
import numpy as np
import fluidfoam
from pylab import matplotlib, mpl, figure, subplot, savefig, show
import matplotlib.gridspec as gridspec
from analytic_coulomb2D import analytic_coulomb2D
#
# Change fontsize
#
matplotlib.rcParams.update({'font.size': 20})
mpl.rcParams['lines.linewidth']... | gpl-2.0 |
davidbrazdil/nacl | site_scons/site_tools/naclsdk.py | 1 | 26632 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""NaCl SDK tool SCons."""
import __builtin__
import re
import os
import shutil
import sys
import SCons.Scanner
import SCons.Scri... | bsd-3-clause |
google-research/neural-structural-optimization | setup.py | 1 | 1236 | # Copyright 2019 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 |
adrn/SuperFreq | superfreq/tests/test_simple.py | 1 | 6697 | # coding: utf-8
""" Simple unit tests of SuperFreq """
# Third-party
from astropy.utils import isiterable
import numpy as np
# Project
from ..naff import SuperFreq
def test_cy_naff():
"""
This checks the Cython frequency determination function. We construct a simple
time series with known frequencies a... | mit |
achim1/pmttools | setup.py | 1 | 1961 | from setuptools import setup
from pmttools import __version__
def parse_requirements(req_file):
with open(req_file) as f:
reqs = []
for r in f.readlines():
if not r.startswith("http"):
reqs.append(r)
return reqs
try:
requirements = parse_requirements("requ... | gpl-3.0 |
iamjakob/lumiCalc | LumiDB/test/matplotlibLumi.py | 1 | 4192 | import sys
from numpy import arange,sin,pi,random
batchonly=False
def destroy(e) :
sys.exit()
import matplotlib
try:
matplotlib.use('TkAgg',warn=False)
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg as CanvasBackend
from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg
... | apache-2.0 |
yunfeilu/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 |
lancezlin/ml_template_py | lib/python2.7/site-packages/matplotlib/tests/test_pickle.py | 6 | 8450 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
from matplotlib.externals.six.moves import cPickle as pickle
from matplotlib.externals.six.moves import xrange
from io import BytesIO
from nose.tools import assert_equal, ... | mit |
DrarPan/tensorflow | reinforcement_learning/QLearning/GridWorld.py | 1 | 8451 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import math
import random
import itertools
import scipy.misc
import os
import cv2 as cv
import numpy as np
import tensorflow as tf
slim=tf.contrib.slim
import matplotlib.pyplo... | gpl-3.0 |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/axes_grid1/simple_axisline4.py | 1 | 1442 | """
================
Simple Axisline4
================
"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
import numpy as np
# nodebox section
if __name__ == '__builtin__':
# were in nodebox
import os
import tempfile
W = 800
in... | mit |
garibaldu/boundary-seekers | Boundary Hunter Ideas/TensorFlow/AdaptiveMixturesOfLocalExperts.py | 1 | 7316 | import tensorflow as tf
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import random
import math
np.random.seed(1234)
random.seed(1234)
plt.switch_backend("TkAgg")
def plotScatter(points, color):
xs = [x[0] for x in points]
ys = [y[1] for y in points]
plt.scatter(xs, ys, c=colo... | mit |
kylerbrown/scikit-learn | examples/linear_model/lasso_dense_vs_sparse_data.py | 348 | 1862 | """
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | bsd-3-clause |
dokato/connectivipy | connectivipy/plot.py | 1 | 1536 | # -*- coding: utf-8 -*-
#! /usr/bin/env python
from __future__ import absolute_import
import numpy as np
import matplotlib.pyplot as plt
from six.moves import range
# plain plotting from values
def plot_conn(values, name='', fs=1, ylim=None, xlim=None, show=True):
'''
Plot connectivity estimation results. All... | bsd-2-clause |
CartoDB/cartoframes | setup.py | 1 | 2389 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def walk_subpkg(name):
data_files = []
package_dir = 'cartoframes'
for parent, _, files in os.walk(os.path.join(package_dir, name)):
# Remove package_dir from the path.
sub_dir = os.sep.joi... | bsd-3-clause |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_topo_compare_conditions.py | 8 | 2192 | """
=================================================
Compare evoked responses for different conditions
=================================================
In this example, an Epochs object for visual and auditory responses is created.
Both conditions are then accessed by their respective names to create a sensor
layout... | bsd-3-clause |
MartinSavc/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 |
TomAugspurger/pandas | pandas/core/groupby/grouper.py | 1 | 28910 | """
Provide user facing operators for doing the split part of the
split-apply-combine paradigm.
"""
from typing import Dict, Hashable, List, Optional, Tuple
import warnings
import numpy as np
from pandas._typing import FrameOrSeries
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common im... | bsd-3-clause |
JeanKossaifi/scikit-learn | examples/text/document_clustering.py | 230 | 8356 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | bsd-3-clause |
survey-methods/samplics | src/samplics/weighting/adjustment.py | 1 | 25028 | """Sample weighting module
*SampleWeight* is the main class in this module which implements weight adjustments to account for
nonresponse, calibrate to auxiliary information, normalize weights, and trim extreme weights. Valliant, R. and Dever, J. A. (2018) [#vd2018]_ provides a step-by-step guide on calculating
samp... | mit |
mthiffau/csvgrapher | grapher.py | 1 | 6977 | #!/usr/bin/python
import argparse, sys, time, os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from collections import deque
class RealTimePlot:
def __init__(self, filename, x_hist, y_range, y_botflex, y_topflex):
'''Create a real time data plot animation.
... | mit |
jreback/pandas | asv_bench/benchmarks/eval.py | 8 | 1989 | import numpy as np
import pandas as pd
try:
import pandas.core.computation.expressions as expr
except ImportError:
import pandas.computation.expressions as expr
class Eval:
params = [["numexpr", "python"], [1, "all"]]
param_names = ["engine", "threads"]
def setup(self, engine, threads):
... | bsd-3-clause |
aditiiyer/CERR | CERR_core/ModelImplementationLibrary/SegmentationModels/ModelDependencies/CT_HeartStructure_DeepLab/dataloaders/utils.py | 4 | 3279 | import matplotlib.pyplot as plt
import numpy as np
import torch
def decode_seg_map_sequence(label_masks, dataset='heart'):
rgb_masks = []
for label_mask in label_masks:
rgb_mask = decode_segmap(label_mask, dataset)
rgb_masks.append(rgb_mask)
rgb_masks = torch.from_numpy(np.array(rgb_masks).... | lgpl-2.1 |
LiaoPan/blaze | blaze/compute/tests/test_postgresql_compute.py | 6 | 4809 | from datetime import timedelta
import itertools
import re
import pytest
sa = pytest.importorskip('sqlalchemy')
pytest.importorskip('psycopg2')
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from odo import odo, resource, drop, discover
from blaze import symbol, compute, concat
names = ('... | bsd-3-clause |
ChanderG/scikit-learn | sklearn/cross_validation.py | 96 | 58309 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
chris-hld/sfs-python | doc/conf.py | 1 | 10001 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SFS documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 4 14:01:37 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | mit |
Arafatk/sympy | doc/ext/docscrape_sphinx.py | 51 | 9709 | from __future__ import division, absolute_import, print_function
import sys
import re
import inspect
import textwrap
import pydoc
import sphinx
import collections
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
if sys.version_info[0] >= 3:
sixu = lambda s: s
else:
sixu = lambda s: unicode(s, 'uni... | bsd-3-clause |
luo66/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 365 | 6996 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
prateeknepaliya09/rodeo | rodeo/kernel.py | 8 | 7985 | # start compatibility with IPython Jupyter 4.0+
try:
from jupyter_client import BlockingKernelClient
except ImportError:
from IPython.kernel import BlockingKernelClient
# python3/python2 nonsense
try:
from Queue import Empty
except:
from queue import Empty
import atexit
import subprocess
import uuid
i... | bsd-2-clause |
RJTK/dwglasso_cweeds | src/data/calculate_covars.py | 1 | 6158 | '''
A 'helper' script to calculate and subsequently cache the
covariance matrices ZZT and YZT. This is time consuming so it's
certainly wise to cache this caculation. This is basically a prereq
to running the dwglasso algorithm.
NOTE: This file is intended to be executed by make from the top
level of the project dir... | mit |
Kolyan-1/MSc-Thesis-Code | Data/synthetic1.py | 1 | 1507 | ######################################
#
# Nikolai Rozanov (C) 2017-Present
#
# nikolai.rozanov@gmail.com
#
#####################################
#
# the bottom part of this file is not by me (as is indicated below)
#
import numpy as np
from sklearn.utils import check_random_state
def circle(n,var,rs=1):
rs ... | bsd-3-clause |
projectcuracao/projectcuracao | graphprep/environcolor.py | 1 | 3436 | # environmental color graph
# filename:environmentalgraph.py
# Version 1.0 10/13/13
#
# contains event routines for data collection
#
#
import sys
import time
import RPi.GPIO as GPIO
import gc
import datetime
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
from matplotli... | gpl-3.0 |
alex1818/industrial_training | training/orig/demo_descartes/src/plan_and_run/src/generate_lemniscate_trajectory.py | 12 | 1825 | #!/usr/bin/env python
import numpy
import math
import matplotlib.pyplot as pyplot
from mpl_toolkits.mplot3d import Axes3D
def generateLemniscatePoints():
# 3D plotting setup
fig = pyplot.figure()
ax = fig.add_subplot(111,projection='3d')
a = 6.0
ro = 4.0
dtheta = 0.1
nsamples = 200
... | apache-2.0 |
abigailStev/lag_spectra | simple_plot_lag-freq.py | 1 | 3854 | #!/usr/bin/env
"""
Plots the lag-frequency spectrum.
Example call:
python simple_plot_lag-freq.py ./cygx1_lag-freq.fits -o "./cygx1" --ext "png"
Enter python simple_plot_lag-freq.py -h at the command line for help.
"""
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
from matplotlib.... | mit |
exa-analytics/exatomic | exatomic/adf/output.py | 2 | 25123 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2020, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
ADF Composite Output
#########################
This module provides the primary (user facing) output parser.
"""
from __future__ import absolute_import
from __future__ import pri... | apache-2.0 |
cl4rke/scikit-learn | sklearn/manifold/t_sne.py | 106 | 20057 | # Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de>
# License: BSD 3 clause (C) 2014
# This is the standard t-SNE implementation. There are faster modifications of
# the algorithm:
# * Barnes-Hut-SNE: reduces the complexity of the gradient computation from
# N^2 to N log N (http://arxiv.org/abs/1301.... | bsd-3-clause |
okadate/romspy | romspy/tplot/tplot_param.py | 1 | 4044 | # coding: utf-8
# (c) 2016-01-27 Teruhisa Okada
import netCDF4
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
from matplotlib.offsetbox import AnchoredText
import numpy as np
import pandas as pd
import glob
import romspy
def tplot_param(inifiles, vname, ax=plt.gca()):
for inifile in i... | mit |
ychfan/tensorflow | tensorflow/contrib/factorization/python/ops/kmeans_test.py | 13 | 19945 | # 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 |
binghongcha08/pyQMD | QMC/MC_exchange/permute3d/5.0/energy.py | 3 | 1784 | import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pylab
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
font = {'family' : 'Times New Roman', 'weight' : 'regular', 'size' : '18'}
mpl.rc('font', **font) # pass in the font dict as kwargs
mpl.rcParams['xtick.majo... | gpl-3.0 |
michigraber/scikit-learn | sklearn/preprocessing/tests/test_label.py | 35 | 18559 | import numpy as np
from scipy.sparse import issparse
from scipy.sparse import coo_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.testing impor... | bsd-3-clause |
LEX2016WoKaGru/pyClamster | scripts/doppel/doppel_test_sensitivy.py | 1 | 2659 | #!/usr/bin/env python3
import pyclamster
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('tfinn-poster')
#plt.ticklabel_format(style='sci', axis='x', scilimits=(-100000,100000))
rng = np.random.RandomState(42)
azi1, ele1 = 3.526, 0.636
azi2, ele2 = 3.567, 0.666
stdev = 0.1
points = 1000
azi1 = azi... | gpl-3.0 |
phantomlinux/IoT-tracking | VAUGHN/webapp/src/utils/database_cass.py | 2 | 2768 | from src.utils import logger, tools
from cassandra.cluster import Cluster
import pandas as pd
log = logger.create_logger(__name__)
CNT_QUERY = "SELECT prodID, consID, topic, ts,count(*) as cnt " \
"FROM CNT " \
"WHERE ts >= %s " \
"AND ts <= %s"\
"GROUP BY id, prodID, ... | apache-2.0 |
jkthompson/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_fltkagg.py | 69 | 20839 | """
A backend for FLTK
Copyright: Gregory Lielens, Free Field Technologies SA and
John D. Hunter 2004
This code is released under the matplotlib license
"""
from __future__ import division
import os, sys, math
import fltk as Fltk
from backend_agg import FigureCanvasAgg
import os.path
import matplotli... | gpl-3.0 |
arabenjamin/scikit-learn | examples/tree/plot_tree_regression.py | 206 | 1476 | """
===================================================================
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 |
pylayers/pylayers | pylayers/util/CDF.py | 1 | 6249 | # -*- coding:Utf-8 -*-
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pdb
#import mplrc.ieee.transaction
#
# mplrc is a python module which provides an easy way to change
# matplotlib's plotting configuration for specific publications.
# git clone https://github.com/arsenovic/mplrc.git
#
#... | mit |
Flumotion/flumotion | tools/theora-bench.py | 3 | 6965 | #!/usr/bin/env python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the ... | lgpl-2.1 |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/zz_under_construction/zz_old/TensorFlow/SkFlow_DEPRECATED/text_classification_character_cnn.py | 6 | 3495 | # Copyright 2015-present Scikit Flow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
0asa/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 249 | 1563 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties.
All of the above are supported by
:class:`sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def l1(xs):
return np.array([np.... | bsd-3-clause |
nilmtk/nilmtk | nilmtk/legacy/disaggregate/combinatorial_optimisation.py | 1 | 10630 | from warnings import warn
import pandas as pd
import numpy as np
import pickle
import copy
from ...utils import find_nearest
from ...feature_detectors import cluster
from . import Disaggregator
from ...datastore import HDFDataStore
class CombinatorialOptimisation(Disaggregator):
"""1 dimensional combinatorial o... | apache-2.0 |
devanshdalal/scikit-learn | sklearn/utils/tests/test_fixes.py | 28 | 3156 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import pickle
import numpy as np
import math
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
... | bsd-3-clause |
anomam/pvlib-python | pvlib/bifacial.py | 1 | 7458 | """
The ``bifacial`` module contains functions for modeling back surface
plane-of-array irradiance under various conditions.
"""
import pandas as pd
import numpy as np
def pvfactors_timeseries(
solar_azimuth, solar_zenith, surface_azimuth, surface_tilt,
axis_azimuth,
timestamps, dni, dhi, gcr... | bsd-3-clause |
bcwolven/spidercam | spidercam.py | 1 | 12277 | #!/usr/local/bin/python3
import os
import argparse
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
# Convolution method?
# This was slow at best, and crashed on the high-res Moon pic for an
# authentically sized "spider FWHM."
# import scipy.... | mit |
rhattersley/cartopy | lib/cartopy/crs.py | 1 | 90404 | # (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | lgpl-3.0 |
Aasmi/scikit-learn | sklearn/ensemble/tests/test_base.py | 284 | 1328 | """
Testing for the base module (sklearn.ensemble.base).
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
from numpy.testing import assert_equal
from nose.tools import assert_true
from sklearn.utils.testing import assert_raise_message
from sklearn.datasets import load_iris
from sklearn.ensemble import BaggingCla... | bsd-3-clause |
kemerelab/NeuroHMM | helpers/datapackage.py | 3 | 7447 | from path import path
import hashlib
import json
import numpy as np
import os
import pandas as pd
from datetime import datetime
def md5(data_path):
# we need to compute the md5 sum one chunk at a time, because some
# files are too large to fit in memory
md5 = hashlib.md5()
with open(data_path, 'r') as... | mit |
rrozewsk/OurProject | Boostrappers/CDSBootstrapper/CDSVasicekBootstrapper.py | 1 | 3334 | import numpy as np
import pandas as pd
from scipy.optimize import minimize
from parameters import trim_start,trim_end,referenceDate,x0Vas
from datetime import date
from Products.Credit.CDS import CDS
from parameters import freq
from MonteCarloSimulators.Vasicek.vasicekMCSim import MC_Vasicek_Sim
class BootstrapperCDSL... | mit |
DSLituiev/scikit-learn | sklearn/metrics/cluster/bicluster.py | 359 | 2797 | from __future__ import division
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from sklearn.utils.validation import check_consistent_length, check_array
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks their shap... | bsd-3-clause |
pratapvardhan/pandas | pandas/tests/extension/base/setitem.py | 3 | 5431 | import operator
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
from .base import BaseExtensionTests
class BaseSetitemTests(BaseExtensionTests):
def test_setitem_scalar_series(self, data):
arr = pd.Series(data)
arr[0] = data[1]
assert arr[0] == data[... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.