repo_name
stringlengths
7
90
path
stringlengths
5
191
copies
stringlengths
1
3
size
stringlengths
4
6
content
stringlengths
976
581k
license
stringclasses
15 values
piotroxp/scibibscan
scib/lib/python3.5/site-packages/numpy/linalg/linalg.py
32
75738
"""Lite version of scipy.linalg. Notes ----- This module is a lite version of the linalg.py module in SciPy which contains high-level Python interface to the LAPACK library. The lite version only accesses the following LAPACK functions: dgesv, zgesv, dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr...
mit
petosegan/scikit-learn
examples/linear_model/plot_bayesian_ridge.py
248
2588
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
bsd-3-clause
ZENGXH/scikit-learn
benchmarks/bench_mnist.py
154
6006
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
bsd-3-clause
lanceculnane/electricity-conservation
code/building_rf_mean.py
1
1826
import numpy as np import pandas as pd import datetime from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squared_error from sklearn.cross_validation import train_test_split from sklearn.preprocessing import Imputer full_pre = pd.read_csv("buildingfull.csv") # full_pre.fillna(0, inpla...
gpl-3.0
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/sklearn/metrics/cluster/supervised.py
13
31406
"""Utilities to evaluate the clustering performance of models. Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # Arnaud Fouchet ...
mit
wukan1986/kquant_data
demo_stock/B_5min_000016/E03_merge_000905.py
1
2775
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 指定数据目录,生成对应的合约行业数据 分为两种 1. 全市场数据,将部分标记上权重 2. 只对历史上成为成份股的,进行处理,由于前面已经转换了数据,这里只要跳选数据并处理即可 """ import os import pandas as pd from kquant_data.config import __CONFIG_H5_STK_WEIGHT_DIR__, __CONFIG_H5_STK_DIR__, __CONFIG_TDX_STK_DIR__, \ __CONFIG_H5_STK_DIVIDEND_DIR__ ...
bsd-2-clause
NikitaRzm/ivs-lab
src/modules/Kalman/model/kalman.py
1
2418
import numpy as np import matplotlib.pyplot as plt # https://ru.wikipedia.org/wiki/%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80_%D0%9A%D0%B0%D0%BB%D0%BC%D0%B0%D0%BD%D0%B0 def kalman( x, P, measurement, R, motion=np.matrix('0. 0. 0. 0.').T, Q=np.matrix(np.eye(4)), F=np.matrix(''' 1. 0. 1. 0.; 0. 1...
mit
stanford-gfx/Horus
Code/flashlight/quadrotorcamera3d.py
1
16189
from pylab import * import sklearn import sklearn.preprocessing import transformations import linalgutils import trigutils import sympy import sympy.matrices import sympy.physics import sympy.physics.mechanics import sympy.physics.mechanics.functions import trigutils import sympyutils import pathutils m = 1.0 ...
bsd-3-clause
Alex-Ian-Hamilton/sunpy
sunpy/time/tests/test_time.py
1
4400
from __future__ import absolute_import, division, print_function from datetime import datetime from sunpy import time from sunpy.time import parse_time import numpy as np import pandas from sunpy.extern.six.moves import range LANDING = datetime(1966, 2, 3) def test_parse_time_24(): assert parse_time("2010-10-...
bsd-2-clause
jakirkham/bokeh
examples/app/export_csv/main.py
9
1472
from os.path import dirname, join import pandas as pd from bokeh.layouts import row, widgetbox from bokeh.models import ColumnDataSource, CustomJS from bokeh.models.widgets import RangeSlider, Button, DataTable, TableColumn, NumberFormatter from bokeh.io import curdoc df = pd.read_csv(join(dirname(__file__), 'salary...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/_cm.py
6
67361
""" Nothing here but dictionaries for generating LinearSegmentedColormaps, and a dictionary of these dictionaries. Documentation for each is in pyplot.colormaps(). Please update this with the purpose and type of your colormap if you add data for one here. """ from __future__ import (absolute_import, division, print_...
gpl-3.0
johnmgregoire/JCAPRamanDataProcess
PlateAlignViaEdge_v1.py
1
12112
import sys,os, pickle, numpy, pylab, operator import cv2 from shutil import copy as copyfile from PyQt4.QtCore import * from PyQt4.QtGui import * import matplotlib.pyplot as plt from DataParseApp import dataparseDialog from sklearn.decomposition import NMF projectpath=os.path.split(os.path.abspath(__file__))[0] sys.pa...
bsd-3-clause
deepnarainsingh/data-science-from-scratch
code/recommender_systems.py
60
6291
from __future__ import division import math, random from collections import defaultdict, Counter from linear_algebra import dot users_interests = [ ["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"], ["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"], ["Python", "scikit-learn", "sci...
unlicense
vortex-ape/scikit-learn
sklearn/tests/test_discriminant_analysis.py
4
13934
import numpy as np 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 from sklearn.utils.testing import assert...
bsd-3-clause
Nucleoos/condor-copasi
web_frontend/condor_copasi_db/views.py
2
69192
from django.shortcuts import render_to_response, redirect import datetime, os, shutil, re, math import logging from django import forms from django.db import IntegrityError from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from django.http import HttpResponseRedire...
artistic-2.0
hainm/statsmodels
statsmodels/examples/ex_regressionplots.py
34
4457
# -*- coding: utf-8 -*- """Examples for Regression Plots Author: Josef Perktold """ from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std import statsmodels.graphics.regressionplots ...
bsd-3-clause
Vimos/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
55
2433
""" ============================================== 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
kaylanb/SkinApp
test_bootstrap/test_bootstrap.py
1
1191
from flask import Flask from flask import render_template, flash, redirect import numpy as np #forms # from flask.ext.wtf import Form # from wtforms import TextField, SubmitField, TextAreaField, BooleanField, SelectField,SelectMultipleField # from wtforms.validators import Required, Optional #other from pandas import r...
bsd-3-clause
sanja7s/SR_Twitter
src_general/explain_bar_plot_edge_FORMATION_REL_SIMPLE.py
1
4554
#!/usr/bin/env python # a bar plot with errorbars import matplotlib import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse, Polygon from pylab import * width = 0.37 # the width of the bars font = {'family' : 'sans-serif', 'variant' : 'normal', 'weight' : 'light', ...
mit
chrsrds/scikit-learn
benchmarks/bench_tsne_mnist.py
4
6009
""" ============================= MNIST dataset T-SNE benchmark ============================= """ # License: BSD 3 clause import os import os.path as op from time import time import numpy as np import json import argparse from joblib import Memory from sklearn.datasets import fetch_openml from sklearn.manifold impo...
bsd-3-clause
TheProgrammingDuck/Europa-Challenge
Site/WPSsite/SVM.py
1
1518
from sklearn.svm import SVC from sklearn.externals import joblib import numpy as np class SVM: def __init__(self): pass #self.X_train = X_train #self.X_test = X_test #self.y_train = y_train #self.y_test = y_test #self.classify() def initialise(self, X_train, X_test, y_train, y_t...
mit
SCP-028/UGA
methylation_model/TCGA_data.py
1
6815
#!python3 """ Download methylation data from the GDC (TCGA) database. Only works on Linux machines because `uvloop` is used for asynchronous downloading. """ import asyncio import glob import logging import os import re import sys import pandas as pd import requests import aiohttp import uvloop ROOTPATH = os.path.di...
apache-2.0
RobertABT/heightmap
build/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
4
83550
#!/usr/bin/python # axes3d.py, original mplot3d version by John Porter # Created: 23 Sep 2005 # Parts fixed by Reinier Heeres <reinier@heeres.eu> # Minor additions by Ben Axelrod <baxelrod@coroware.com> # Significant updates and revisions by Ben Root <ben.v.root@gmail.com> """ Module containing Axes3D, an object which...
mit
johndpope/tensorflow
tensorflow/python/estimator/inputs/pandas_io_test.py
89
8340
# 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
jpautom/scikit-learn
sklearn/model_selection/_split.py
7
55305
""" The :mod:`sklearn.model_selection._split` module includes classes and functions to split the data based on a preset strategy. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Girsel <olivier.grisel@ensta.org> # Ragha...
bsd-3-clause
elendiastarman/jaw-tracking
jawTracking_consistentPointOrdering.py
1
15768
import numpy as np import matplotlib.pyplot as plt from math import sqrt, cos, sin, pi, copysign from time import clock from copy import deepcopy class Blob: def __init__(self,x,y,r): self.x = x self.y = y self.r = r self.path = [(x,y)] def addToPath(self,nx,ny): ...
mit
StudTeam6/competition
sw/airborne/test/math/compare_utm_enu.py
77
2714
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import sys import os PPRZ_SRC = os.getenv("PAPARAZZI_SRC", "../../../..") sys.path.append(PPRZ_SRC + "/sw/lib/python") from pprz_math.geodetic import * from pprz_math.algebra import DoubleRMat, DoubleEulers, DoubleVect3 from math ...
gpl-2.0
albertbup/DeepBeliefNet
dbn/tensorflow/models.py
3
21558
import atexit from abc import ABCMeta import numpy as np import tensorflow as tf from sklearn.base import ClassifierMixin, RegressorMixin from ..models import AbstractSupervisedDBN as BaseAbstractSupervisedDBN from ..models import BaseModel from ..models import BinaryRBM as BaseBinaryRBM from ..models import Unsuperv...
mit
SXBK/kaggle
amazon/vgg_tsf.py
1
3156
'''Transform Learning using vgg16 models ''' from __future__ import absolute_import from __future__ import print_function from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, normalization from keras.layers.advanced_a...
gpl-3.0
cbosoft/pyproflosim
main.py
1
1534
import matplotlib.pyplot as plt import networkx as nx from data import components from colours import col from process import Process, ProcessNode, NodeType, UnitType from vis import draw from chemical_component import ChemicalComponent def main(): G = nx.DiGraph() G.add_edge(0,1, data={ ...
gpl-3.0
jrbadiabo/Coursera-Stanford-ML-Class
Python_Version/Ex2.Logistic_Regression/ml.py
1
2666
import numpy as np from matplotlib import pyplot as plt from pandas import Series from mpl_toolkits.mplot3d import axes3d def plotData(X,y): pos = X[np.where(y==1,True,False).flatten()] neg = X[np.where(y==0,True,False).flatten()] plt.plot(pos[:,0], pos[:,1], '+', markersize=7, markeredgecolor='black', ma...
mit
nulman/REM
server/internals_db.py
1
1787
""" @editor: Liran Funaro <funaro@cs.technion.ac.il> @author: Alex Nulman <anulman@cs.haifa.ac.il> """ import sqlite3 import os from contextlib import closing import pandas as pd import json class InternalsDB: TABLE = '''CREATE TABLE IF NOT EXISTS "presets" ( `items` TEXT, `json` ...
gpl-3.0
tclose/PyPe9
pype9/cmd/plot.py
2
1904
""" Simple tool for plotting the output of PyPe9 simulations using Matplotlib_. Since Pype9 output is stored in Neo_ format, it can be used to plot generic Neo_ files but it also includes handling of Pype9-specific annotations, such as regime transitions. """ from argparse import ArgumentParser from pype9.utils.argumen...
mit
andaag/scikit-learn
sklearn/cluster/birch.py
207
22706
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Joel Nothman <joel.nothman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings import numpy as np from scipy import sparse from math import sqrt fro...
bsd-3-clause
mmottahedi/neuralnilm_prototype
scripts/e491.py
2
6823
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectiona...
mit
kashif/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
gatieme/AderXCoding
technology/machine_learning/ID3/id3plot.py
1
3306
# -*- coding: utf-8 -* # -*- coding: utf-8 -*- ''' Created on 2015年7月27日 @author: pcithhb ''' import matplotlib.pyplot as plt decisionNode = dict(boxstyle="sawtooth", fc="0.8") leafNode = dict(boxstyle="round4", fc="0.8") arrow_args = dict(arrowstyle="<-") #获取叶节点的数目 def getNumLeafs(myTree): numLeafs = 0 fir...
gpl-2.0
aravindhv10/CPP_Wrappers
NewData/SRC/MXNET_VAE/START.py
1
4386
#!/usr/bin/python3 from __future__ import division, print_function, absolute_import import numpy as np import mxnet as mx from mxnet import nd, autograd, gluon from mxnet.gluon import nn import matplotlib.pyplot as plt import os ctx = mx.cpu() data_ctx = ctx model_ctx = ctx batch_size = 200 width=40 num_inputs = widt...
gpl-2.0
AdityaSoni19031997/Machine-Learning
kaggle/ieee_fraud_detection/src/aditya/2018_08_19_early_eda_experiments.py
1
42777
# coding: utf-8 # In[853]: # for C4, C6, C7, C8, C10 outliers, lookit cat variables to see if we can identify groupings... #C8,c10 we can kinda tell, 0.51 # C12=0.553 # Hard winsorize: traintr.loc[traintr.D4>484,'D4'] = 485 testtr.loc[testtr.D4>484,'D4'] = 485 data.loc[data.D4>484,'D4'] = np.nan test_cvs(data, 'D...
mit
francisco-dlp/hyperspy
doc/sphinxext/docscrape_sphinx.py
11
7840
import re import inspect import textwrap import pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc import collections class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): self.use_plots = config.get('use_plots', False) NumpyDocString.__init...
gpl-3.0
Mixpap/MasterThesis
Notebooks/f.py
1
14430
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.gridspec as gridspec import seaborn #import yt import pyPLUTO as pp from astropy.io import ascii import os import sys from ipywidgets import interactive, widgets,fixed from IPython.display import Audio, display import matplotl...
mit
Vijaysai005/KProject
vijay/DBSCAN/dbscan.py
1
5973
# usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Jul 06 13:15:05 2017 @author: Vijayasai S """ # Use python3 import csv, time, numpy as np, pandas as pd, matplotlib.pyplot as plt from sklearn.cluster import DBSCAN from . import load_data def loadData(filename, *args): # Loading data from csv fil...
gpl-3.0
awanke/bokeh
bokeh/server/tests/config/test_blaze_config.py
29
1202
from __future__ import absolute_import import numpy as np import pandas as pd qty=10000 gauss = {'oneA': np.random.randn(qty), 'oneB': np.random.randn(qty), 'cats': np.random.randint(0,5,size=qty), 'hundredA': np.random.randn(qty)*100, 'hundredB': np.random.randn(qty)*100} gauss =...
bsd-3-clause
tlhr/plumology
plumology/vis.py
1
16471
"""vis - Visualisation and plotting tools""" from typing import Union, Sequence, Optional, List, Tuple import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.collections import RegularPolyCollection from matplotlib.colors import LinearSegmentedColormap, ListedColormap from ...
mit
akrherz/idep
scripts/plots/slope_histogram.py
2
1337
"""Plot a histogram of slopes used in DEP""" from __future__ import print_function import os import glob import numpy as np import matplotlib.pyplot as plt import pandas as pd from pyiem.dep import read_slp def read_data(): """Do intensive stuff""" os.chdir("/i/0/slp") res = [] for huc8 in glob.glob(...
mit
bigdataelephants/scikit-learn
examples/plot_multioutput_face_completion.py
330
3019
""" ============================================== Face completion with a multi-output estimators ============================================== This example shows the use of multi-output estimator to complete images. The goal is to predict the lower half of a face given its upper half. The first column of images sho...
bsd-3-clause
galad-loth/DescHash
AnchorGraphHash.py
1
3513
import numpy as npy from sklearn.decomposition import PCA from sklearn.cluster import KMeans from LoadData import ReadFvecs from Utils import KernelRBF, GetRetrivalMetric , GetKnnIdx, GetCompactCode import pdb def GetAnchorData(data, nAnchor, mode=0): ''' Generate anchor data by random sampling or k...
apache-2.0
glennq/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
e-q/scipy
scipy/cluster/hierarchy.py
1
147998
""" Hierarchical clustering (:mod:`scipy.cluster.hierarchy`) ======================================================== .. currentmodule:: scipy.cluster.hierarchy These functions cut hierarchical clusterings into flat clusterings or find the roots of the forest formed by a cut by providing the flat cluster ids of each ...
bsd-3-clause
emtpb/pyfds
setup.py
1
1215
from setuptools import setup from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst')) as readme_file: long_description = readme_file.read() setup( name='pyfds', description='Modular field simulation tool using finite differences.', long_description=long...
bsd-3-clause
fspaolo/scikit-learn
examples/tree/plot_tree_regression_multioutput.py
7
1768
""" =================================================================== Multi-output Decision Tree Regression =================================================================== An example to illustrate multi-output regression with decision tree. The :ref:`decision trees <tree>` is used to predict simultaneously the ...
bsd-3-clause
emanuetre/crossmodal
SCM_experiment.py
1
1971
# Experiment to perform semantic correlation matching (SCM) # take care of some imports from scipy.io import loadmat import numpy as np from sklearn.metrics import label_ranking_average_precision_score, average_precision_score from crossmodal import correlation_matching, semantic_matching # read features data from...
isc
chreman/isis-praktikum
sustainabilitylsa.py
1
20232
# import string import glob import time import xml.etree.ElementTree as ET from itertools import chain # Import reader import xlrd import csv import requests # Import data handlers import collections # Import Network Analysis Tools import networkx as nx import igraph as ig # Import language processing tools from g...
mit
gt-ros-pkg/hrl-haptic-manip
hrl_fabric_based_tactile_sensor/src/hrl_fabric_based_tactile_sensor/tactile_sensor_model.py
1
11343
#!/usr/bin/python # Charlie Kemp's initial attempt to model the force -> digital signal # curves for a single taxel. # # + First version written on June 4, 2012. # + Cleaned up, documented, and made minor edits June 5, 2012 import matplotlib.pylab as pl def logistic(t): return(1.0/(1.0 + pl.exp(-t))) def norm...
apache-2.0
mgaillard/CNNFeaturesRobustness
features_extractor/image_features.py
1
32581
""" A class that extract features from images in a directory. """ from os import listdir from os.path import isfile, join from keras.preprocessing import image from keras.models import Model from keras.layers.pooling import GlobalAveragePooling2D, GlobalMaxPooling2D import keras.applications.vgg16 as app_vgg16 import ...
gpl-3.0
elkingtonmcb/seldon-server
external/predictor/python/seldon/pipeline/pipelines.py
5
11288
import seldon.fileutil as fu import json from sklearn.externals import joblib import os.path import logging import shutil import unicodecsv class Feature_transform(object): """Base feature transformation class with method defaults """ def __init__(self): self.pos = 0 self.input_feature = "...
apache-2.0
saiwing-yeung/scikit-learn
sklearn/linear_model/tests/test_bayes.py
299
1770
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.linear_model.bayes import BayesianRidge, ARDRegres...
bsd-3-clause
f3r/scikit-learn
examples/text/hashing_vs_dict_vectorizer.py
284
3265
""" =========================================== FeatureHasher and DictVectorizer Comparison =========================================== Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. The example demonstrates syntax and speed only; it doesn't actually do anything useful with the e...
bsd-3-clause
StratsOn/zipline
tests/risk/answer_key.py
39
11989
# # Copyright 2014 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
biocore/American-Gut
americangut/plots.py
5
4518
#!/usr/bin/env python from __future__ import division import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties from numpy import cumsum, arange __author__ = "Sam Way" __copyright__ = "Copyright 2013, The American Gut Project" __credits__ = ["Sam Way"] __license__ = "BSD" __version__ = "unve...
bsd-3-clause
canaltinova/servo
tests/heartbeats/process_logs.py
139
16143
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import matplotlib.pyplot as plt import numpy as np import os from os import path ...
mpl-2.0
yebrahim/pydatalab
google/datalab/data/_csv_file.py
6
7141
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
lukebarnard1/bokeh
examples/glyphs/colors.py
25
8920
from __future__ import print_function from math import pi import pandas as pd from bokeh.models import Plot, ColumnDataSource, FactorRange, CategoricalAxis, TapTool, HoverTool, OpenURL from bokeh.models.glyphs import Rect from bokeh.document import Document from bokeh.embed import file_html from bokeh.resources impor...
bsd-3-clause
mwv/scikit-learn
sklearn/datasets/samples_generator.py
103
56423
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing import MultiLabelBin...
bsd-3-clause
zorroblue/scikit-learn
sklearn/linear_model/tests/test_huber.py
26
7588
# Authors: Manoj Kumar mks542@nyu.edu # License: BSD 3 clause import numpy as np from scipy import optimize, sparse 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.testing import assert_array_a...
bsd-3-clause
Aufuray/ross-sea-project
app/models/image_nd.py
1
3950
import os import sys import numpy as np from matplotlib import pyplot as plt from tools import data class ImageND(object): SENSOR = None def __init__(self, filename, dimensions=3): if dimensions < 3: print "The image doesn't have the minimum of 3 dimensions" sys.exit(1) ...
mit
NixaSoftware/CVis
venv/lib/python2.7/site-packages/pandas/tests/io/formats/test_to_html.py
2
48009
# -*- coding: utf-8 -*- import re from textwrap import dedent from datetime import datetime from distutils.version import LooseVersion import pytest import numpy as np import pandas as pd from pandas import compat, DataFrame, MultiIndex, option_context, Index from pandas.compat import u, lrange, StringIO from pandas....
apache-2.0
ctoher/pymatgen
pymatgen/analysis/diffraction/xrd.py
2
14724
# coding: utf-8 from __future__ import division, unicode_literals """ This module implements an XRD pattern calculator. """ from six.moves import filter from six.moves import map from six.moves import zip __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __mai...
mit
kdebrab/pandas
pandas/tests/io/parser/na_values.py
3
12848
# -*- coding: utf-8 -*- """ Tests that NA values are properly handled during parsing for all of the parsers defined in parsers.py """ import numpy as np from numpy import nan import pandas.io.common as com import pandas.util.testing as tm from pandas import DataFrame, Index, MultiIndex from pandas.compat import Str...
bsd-3-clause
ravindrapanda/tensorflow
tensorflow/examples/learn/iris_custom_model.py
43
3449
# 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
krishauser/Klampt
Python/klampt/vis/colorize.py
1
16675
"""Colorize an object to show heatmaps, false color images, etc. """ from OpenGL.raw.GL.VERSION.GL_1_1 import GL_NONE from ..robotsim import * from ..math import vectorops try: import numpy as np except Exception: HAVE_NUMPY = False def colorize(object,value,colormap=None,feature=None,vrange=None,lighting=No...
bsd-3-clause
aarora79/sitapt
sitapt/analyze/network_layer.py
1
4309
#!/usr/bin/env python #title :network_layer.py #description :Top level file for db module in the SITAPT package #author :aarora79 #date :20151003 #version :0.1 #usage :python dbif.py #notes : #python_version :2.7.10 #========================================...
isc
mwv/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
DistrictDataLabs/intro-to-nltk
exercises/summarize.py
3
3816
# summarize # Uses TFIDF to extract relevent sentences from text. # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Sun Oct 26 16:06:36 2014 -0400 # # ID: summarize.py [] benjamin@bengfort.com $ """ Uses TFIDF to extract relevent sentences from text. Based off of Charlie Greenbacker's example from "...
mit
MatthieuBizien/scikit-learn
sklearn/linear_model/__init__.py
83
3139
""" 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
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/doc/mpl_examples/pylab_examples/image_masked.py
12
1768
#!/usr/bin/env python '''imshow with masked array input and out-of-range colors. The second subplot illustrates the use of BoundaryNorm to get a filled contour effect. ''' from pylab import * from numpy import ma import matplotlib.colors as colors delta = 0.025 x = y = arange(-3.0, 3.0, delta) X, Y = meshgri...
mit
BoltzmannBrain/nupic.research
projects/sound_encoder/live_sound_encoding_demo.py
12
2494
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
virneo/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_qt4.py
69
20664
from __future__ import division import math import os import sys import matplotlib from matplotlib import verbose from matplotlib.cbook import is_string_like, onetrue from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \ FigureManagerBase, FigureCanvasBase, NavigationToolbar2, IdleEvent, curso...
agpl-3.0
M-R-Houghton/euroscipy_2015
bokeh/bokeh/tests/test_sources.py
26
3245
from __future__ import absolute_import import unittest from unittest import skipIf import warnings try: import pandas as pd is_pandas = True except ImportError as e: is_pandas = False from bokeh.models.sources import DataSource, ColumnDataSource, ServerDataSource class TestColumnDataSourcs(unittest.Test...
mit
wilsonianb/nacl_contracts
site_scons/site_tools/naclsdk.py
2
26336
#!/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
jlegendary/scikit-learn
doc/conf.py
210
8446
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # 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. ...
bsd-3-clause
anomam/pvlib-python
pvlib/tests/test_numerical_precision.py
1
4290
""" Test numerical precision of explicit single diode calculation using symbolic mathematics. SymPy is a computer algebra system, that uses infinite precision symbols instead of standard floating point and integer computer number types. http://docs.sympy.org/latest/modules/evalf.html#accuracy-and-error-handling This m...
bsd-3-clause
kalvdans/scipy
scipy/stats/_multivariate.py
12
112182
# # Author: Joris Vankerschaver 2013 # from __future__ import division, print_function, absolute_import import math import numpy as np import scipy.linalg from scipy.misc import doccer from scipy.special import gammaln, psi, multigammaln, xlogy, entr from scipy._lib._util import check_random_state from scipy.linalg.bl...
bsd-3-clause
dropofwill/author-attr-experiments
multidoc_mnb.py
1
3904
from sklearn import datasets from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import CountVectorizer from sklearn.cross_validation import train_test_split from sklearn.cross_validation import cross_val_score from sklearn.cross_validation import ShuffleSplit from sklearn....
unlicense
imperial-genomics-facility/data-management-python
igf_data/utils/fileutils.py
1
23415
#!/usr/bin/env python import pandas as pd import os,subprocess,hashlib,string,re import tarfile,fnmatch from shlex import quote from datetime import datetime from dateutil.parser import parse from tempfile import mkdtemp,gettempdir from shutil import rmtree, move, copy2,copytree def move_file(source_path,des...
apache-2.0
ambikeshwar1991/sandhi-2
module/gr36/gr-filter/examples/fmtest.py
12
7793
#!/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
caryan/PyBio
TnSeq/PySyntenyPlot.py
1
4310
# Copyright 2013 Colm Ryan colm@colmryan.org # License GPL v3 (http://www.gnu.org/licenses/gpl.txt) ''' Created on Jul 5, 2011 Do some arrow synteny plots for Veronica @author: caryan ''' from __future__ import division #Let's write to SVG style graphics #import matplotlib #matplotlib.use('svg') import matplotli...
gpl-3.0
teonlamont/mne-python
mne/decoding/tests/test_receptive_field.py
2
21429
# Authors: Chris Holdgraf <choldgraf@gmail.com> # # License: BSD (3-clause) import os.path as op import pytest import numpy as np from numpy.testing import assert_array_equal, assert_allclose, assert_equal from mne import io, pick_types from mne.fixes import einsum from mne.utils import requires_version, run_tests_i...
bsd-3-clause
vivekmishra1991/scikit-learn
examples/cluster/plot_segmentation_toy.py
258
3336
""" =========================================== Spectral clustering for image segmentation =========================================== In this example, an image with connected circles is generated and spectral clustering is used to separate the circles. In these settings, the :ref:`spectral_clustering` approach solve...
bsd-3-clause
pianomania/scikit-learn
benchmarks/bench_plot_ward.py
117
1283
""" Benchmark scikit-learn's Ward implement compared to SciPy's """ import time import numpy as np from scipy.cluster import hierarchy import matplotlib.pyplot as plt from sklearn.cluster import AgglomerativeClustering ward = AgglomerativeClustering(n_clusters=3, linkage='ward') n_samples = np.logspace(.5, 3, 9) n...
bsd-3-clause
NINAnor/QGIS
python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
1
10160
# -*- coding: utf-8 -*- """ *************************************************************************** QGISAlgorithmProvider.py --------------------- Date : December 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***************...
gpl-2.0
madscatt/zazzie
src/sassie/calculate/sascalc_pbc/scatteringCalc.py
2
3946
''' Full exponential calculator. This one takes only one pdb/dcd pair. Has the same inputs as debye.py output is I[frame][Q] as a .npy file, which can be loaded with np.load Also outputs Q_list.npy O(num GV * N^2) ''' from __future__ import division import matplotlib.pyplot as plt import numpy as np import sasmol.sasmo...
gpl-3.0
Panchatantra/EQSignal
libeqs/eqspy.py
1
7675
from enum import Enum from ctypes import POINTER, c_int, c_double, byref from eqs_wrapper import libeqs import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') def plotTH(t, acc, vel, dsp, title="Time History Curves"): plt.figure(title,(8,6)) plt.subplot(3,1,1) plt.plot(t,acc) plt....
mit
jesse-norris/ml
lr/mclr.py
1
4060
import os, sys, time import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize ### "ex3data1.csv" contains 5,000 samples of 401 element arrays ### These correspond to 20x20 pixel images (400 elements) and 1 classification ### The images are written numbers and the classifications ar...
gpl-3.0
dsm054/pandas
pandas/tests/frame/test_mutate_columns.py
1
9750
# -*- coding: utf-8 -*- from __future__ import print_function import pytest from pandas.compat import range, lrange import numpy as np from pandas.compat import PY36 from pandas import DataFrame, Series, Index, MultiIndex from pandas.util.testing import assert_frame_equal import pandas.util.testing as tm from pand...
bsd-3-clause
edhuckle/statsmodels
statsmodels/datasets/tests/test_utils.py
26
1697
import os import sys from statsmodels.datasets import get_rdataset, webuse, check_internet from numpy.testing import assert_, assert_array_equal, dec cur_dir = os.path.dirname(os.path.abspath(__file__)) def test_get_rdataset(): # smoke test if sys.version_info[0] >= 3: #NOTE: there's no way to test bo...
bsd-3-clause
Achuth17/scikit-learn
sklearn/feature_selection/tests/test_feature_select.py
143
22295
""" Todo: cross-check the F-value with stats model """ from __future__ import division import itertools import warnings import numpy as np from scipy import stats, sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises...
bsd-3-clause
weissercn/MLTools
Dalitz_simplified/evaluation_of_optimised_classifiers/miranda_Dalitz/miranda_Dalitz_evaluation_of_optimised_classifiers.py
1
4772
import sys sys.path.insert(0,'../..') import classifier_eval_simplified """ This script can be used to get the p value for the Miranda method (=chi squared). It takes input files with column vectors corresponding to features and lables. """ print(__doc__) import sys sys.path.insert(0,'../..') import os from scipy...
mit
lucidfrontier45/scikit-learn
sklearn/utils/__init__.py
2
9822
""" The :mod:`sklearn.utils` module includes various utilites. """ import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, check_arrays, safe_asarray, assert_all_finite, array2d, atleast2d_or_csc, ...
bsd-3-clause
potash/scikit-learn
examples/feature_stacker.py
80
1911
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is beneficial to combine several methods to obtain good performance. Th...
bsd-3-clause