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 |
|---|---|---|---|---|---|
luofan18/deep-learning | weight-initialization/helper.py | 153 | 3649 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
def hist_dist(title, distribution_tensor, hist_range=(-4, 4)):
"""
Display histogram of a TF distribution
"""
with tf.Session() as sess:
values = sess.run(distribution_tensor)
plt.title(title)
plt.hist(values, ... | mit |
has2k1/plotnine | setup.py | 1 | 3346 | """
plotnine is an implementation of a *grammar of graphics* in Python,
it is based on ggplot2. The grammar allows users to compose plots
by explicitly mapping data to the visual objects that make up the
plot.
Plotting with a grammar is powerful, it makes custom (and otherwise
complex) plots are easy to think about an... | gpl-2.0 |
fmacias64/MoodJournalAmerica | viz_data/news_visualizations.py | 2 | 19421 | """
Update data underlying visualizations on Mood Journal America
Some copy & paste from original qacprojects script
Runs on crontab, daily_download -> topicmoddeling.py -> << this >>
@authored malam,habdulkafi 31 June 2014
I/O,query functions originally by rpetchler,malam from qacprojects query script
Changelog:
@u... | bsd-3-clause |
pgrinaway/yank | Yank/utils.py | 1 | 61480 | import os
import re
import sys
import copy
import glob
import json
import shutil
import signal
import pandas
import inspect
import logging
import itertools
import subprocess
import collections
from contextlib import contextmanager
from pkg_resources import resource_filename
import mdtraj
import parmed
import numpy as... | lgpl-3.0 |
WarrenWeckesser/scipy | scipy/stats/morestats.py | 4 | 128655 | from __future__ import annotations
import math
import warnings
from collections import namedtuple
import numpy as np
from numpy import (isscalar, r_, log, around, unique, asarray, zeros,
arange, sort, amin, amax, atleast_1d, sqrt, array,
compress, pi, exp, ravel, count_nonzero, si... | bsd-3-clause |
cojacoo/testcases_echoRD | gen_test1111.py | 1 | 4398 | import numpy as np
import pandas as pd
import scipy as sp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os, sys
try:
import cPickle as pickle
except:
import pickle
#connect echoRD Tools
pathdir='../echoRD' #path to echoRD
lib_path = os.path.abspath(pathdir)
#sys.path.append(lib_pa... | gpl-3.0 |
davidam/python-examples | matplotlib/pyplot_text.py | 1 | 1407 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | gpl-3.0 |
sgraham/nope | ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py | 154 | 8545 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
import tempfile
import time
script_dir = os.path.dirname(__file__)
sys.path.append(os.path.join... | bsd-3-clause |
sjperkins/tensorflow | tensorflow/examples/learn/mnist.py | 45 | 3999 | # 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 |
ehogan/iris | lib/iris/tests/test_trajectory.py | 9 | 9235 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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) any l... | lgpl-3.0 |
buguen/pylayers | pylayers/antprop/examples/ex_antvsh.py | 3 | 1481 | from pylayers.antprop.antenna import *
from pylayers.antprop.spharm import *
from pylayers.antprop.antvsh import *
from pylayers.util.pyutil import *
import matplotlib.pyplot as plt
from numpy import *
import matplotlib.pyplot as plt
import os
_filename = 'S1R1.mat'
A = Antenna(_filename,'ant/UWBAN/Matfile')
filename=... | lgpl-3.0 |
subodhchhabra/pyxley | pyxley/charts/datamaps/datamaps.py | 2 | 4075 | from ..charts import Chart
import pandas as pd
from flask import request, jsonify, make_response
_COLOR_MAP = {
'light blue':'#add8e6',
"antique gold":'#fff4b0',
"antique silver":'#d7cdc4',
"beige": '#f5f5dc',
"black":'#000000',
"blue": '#8084ff',
"bronze": '#c95a0b',
"brown": '#864',
... | mit |
olologin/scikit-learn | sklearn/decomposition/truncated_svd.py | 19 | 7884 | """Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).
"""
# Author: Lars Buitinck
# Olivier Grisel <olivier.grisel@ensta.org>
# Michael Becker <mike@beckerfuffle.com>
# License: 3-clause BSD.
import numpy as np
import scipy.sparse as sp
try:
from scipy.sparse.linalg import svd... | bsd-3-clause |
harisbal/pandas | asv_bench/benchmarks/groupby.py | 3 | 18265 | import warnings
from string import ascii_letters
from itertools import product
from functools import partial
import numpy as np
from pandas import (DataFrame, Series, MultiIndex, date_range, period_range,
TimeGrouper, Categorical, Timestamp)
import pandas.util.testing as tm
method_blacklist = {
... | bsd-3-clause |
Blaffie/Hello-world | Programs/Firkant profil program.py | 1 | 5693 | #Program utregning av bøyningsspenning i Firkantprofil
import math
import matplotlib.pyplot as plt
from matplotlib import style
import numpy as np
from tkinter import * #Brukes til GUI
F = 1200 #N
lengde_start = 0
lengde_slutt = 2500 #mm
max_bøyespenning = 200 #N/mm2
#variabler
lengde_mellom = int(lengde_slutt / 10)
... | mit |
rmeertens/paparazzi | sw/misc/attitude_reference/test_att_ref.py | 49 | 3485 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Antoine Drouin
#
# This file is part of paparazzi.
#
# paparazzi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at y... | gpl-2.0 |
hansbrenna/NetCDF_postprocessor | plotter4.py | 1 | 3593 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 12 15:31:31 2015
@author: hanbre
"""
from __future__ import print_function
import sys
import numpy as np
import pandas as pd
import xray
import datetime
import netCDF4
from mpl_toolkits.basemap import Basemap
import matplotlib
from matplotlib.pylab import *
import matplo... | gpl-3.0 |
devanshdalal/scikit-learn | sklearn/cluster/dbscan_.py | 20 | 12730 | # -*- 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 |
vrmarcelino/Shape-4-Qiime | merge_fasta.py | 1 | 2297 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Concatenate different fasta files and add barcodes.
Run this script after separate fasta and qual files (see onvert_fastaqual_fastq.py from qiime)
Usage ex: merge_fasta.py samples_list.csv *.fna
Created on Thu Jul 31 15:49:39 2014
@author: VanessaRM
Still need to be... | mit |
sunyihuan326/DeltaLab | shuwei_fengge/practice_one/model/SoftMax.py | 1 | 5279 | # coding:utf-8
'''
Created on 2017/11/15.
@author: chk01
'''
# 读取数据
# 数据预处理-reshape-标准化
# 每一步迭代步骤
# 循环迭代步骤
import os
import tensorflow as tf
from tensorflow.python.framework import ops
import numpy as np
import matplotlib.pyplot as plt
import scipy.io as scio
from sklearn.model_selection import train_test_split
def... | mit |
nborggren/zipline | zipline/utils/data.py | 1 | 15731 | #
# Copyright 2013 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 |
rsignell-usgs/notebook | UGRID/NECOFS_wave_levels.py | 1 | 4737 |
# coding: utf-8
# # Extract NECOFS data using NetCDF4-Python and analyze/visualize with Pandas
# In[1]:
# Plot forecast water levels from NECOFS model from list of lon,lat locations
# (uses the nearest point, no interpolation)
import netCDF4
import datetime as dt
import pandas as pd
import numpy as np
import matplo... | mit |
maxhutch/HighHolidayHonorDrafter | assign.py | 1 | 7003 | #!/usr/bin/env python3
import pandas as pd
import numpy as np
from hungarian_algorithm.hungarian import *
from web_io import get_sheet
from conf import members_url, honors_url, mhu_url, categories_url
from conf import override_url
honors = get_sheet(honors_url)
print("Read honors")
members = get_sheet(members_url)
m... | gpl-3.0 |
cybercomgroup/Big_Data | Cloudera/Code/Titanic_Dataset/class_distr_gender_surv.py | 1 | 1704 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Path to file need to be changed.
titanic_df = pd.read_csv("train.csv")
classes = []
# We know there are First Class (1), Second (2) and Third (3)
for i in range(1,4):
classes.append( titanic_df[ titanic_df["Pclass"] == i ] )
fem = []
male ... | gpl-3.0 |
arcyfelix/ML-DL-AI | Supervised Learning/GANs/dcgan-tensorflayer/tensorlayer/utils.py | 1 | 21433 | #! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import tensorlayer as tl
from . import iterate
import numpy as np
import time
import math
import random
def fit(sess, network, train_op, cost, X_train, y_train, x, y_, acc=None, batch_size=100,
n_epoch=100, print_freq=5, X_val=None, y_val=None,... | apache-2.0 |
dryadb11781/machine-learning-python | Classification/py_source/plot_lda.py | 70 | 2413 | """
====================================================================
Normal and Shrinkage Linear Discriminant Analysis for classification
====================================================================
Shows how shrinkage improves classification.
"""
from __future__ import division
import numpy as np
import... | bsd-3-clause |
martinahogg/machinelearning | linear-regression/l1-regularisation.py | 1 | 1108 | import numpy as np
import matplotlib.pyplot as plt
# Create some training samples
# To demonstrate L1 regularisation we fabricate training data
# with 50 dimensions in our X matrix, where only 3 of which
# contribute significantly to the values in our Y vector.
# Construct X
X = (np.random.random((50,50)) - 0.5) * ... | apache-2.0 |
zorojean/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 |
DavidTingley/ephys-processing-pipeline | installation/klustaviewa-0.3.0/build/lib.linux-x86_64-2.7/kwiklib/dataio/tests/test_kwikloader.py | 2 | 6909 | """Unit tests for loader module."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os
from collections import Counter
import numpy as np
import numpy.random as rnd
import pandas ... | gpl-3.0 |
zzcclp/spark | python/pyspark/pandas/tests/test_spark_functions.py | 11 | 2127 | #
# 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 |
tensorflow/models | research/lfads/plot_lfads.py | 12 | 6564 | # Copyright 2017 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 a... | apache-2.0 |
MicheleDamian/ConnectopicMapping | scripts/run.py | 1 | 3900 | #!/usr/bin/env python
""" Run the pipeline for Haak connectopic mapping.
Consider changing the parameters contained in config.json to
set input and output folder and experiment with different behaviors
of the algorithm.
"""
import json
import os
import numpy
from connectopic_mapping import haak, utils
f... | apache-2.0 |
jseabold/scipy | scipy/special/basic.py | 9 | 62504 | #
# Author: Travis Oliphant, 2002
#
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy._lib.six import xrange
from numpy import (pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt,
where, mgrid, sin, place, issubdtype, extract,
... | bsd-3-clause |
lancezlin/ml_template_py | lib/python2.7/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_console_config.py | 24 | 21691 | # Configuration file for ipython-console.
c = get_config()
#------------------------------------------------------------------------------
# ZMQTerminalIPythonApp configuration
#------------------------------------------------------------------------------
# ZMQTerminalIPythonApp will inherit config from: TerminalIP... | mit |
LeeKamentsky/CellProfiler | cellprofiler/modules/saveimages.py | 1 | 60223 | '''<b>Save Images </b> saves image or movie files.
<hr>
Because CellProfiler usually performs many image analysis steps on many
groups of images, it does <i>not</i> save any of the resulting images to the
hard drive unless you specifically choose to do so with the <b>SaveImages</b>
module. You can save any of the
proc... | gpl-2.0 |
jseabold/statsmodels | statsmodels/tsa/statespace/tests/test_dynamic_factor.py | 4 | 38900 | """
Tests for VARMAX models
Author: Chad Fulton
License: Simplified-BSD
"""
import os
import re
import warnings
import numpy as np
from numpy.testing import assert_equal, assert_raises, assert_allclose
import pandas as pd
import pytest
from statsmodels.tsa.statespace import dynamic_factor
from .results import result... | bsd-3-clause |
JKarathiya/Lean | Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py | 1 | 14679 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | apache-2.0 |
sarunya-w/CS402-PROJECT | Project/feature_extraction/feature_extraction_local/hog_local.py | 1 | 4739 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 19 14:19:50 2015
@author: Sarunya
"""
import os
import sys
import numpy as np
from PIL import Image
import scipy.ndimage
import pickle
from skimage.feature import hog
from skimage import data, color, exposure
import scipy.ndimage
import time
from cv2 import HOGDescriptor... | mit |
abhishekkrthakur/scikit-learn | sklearn/linear_model/ridge.py | 3 | 38867 | """
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 |
Barmaley-exe/scikit-learn | examples/exercises/plot_cv_diabetes.py | 231 | 2527 | """
===============================================
Cross-validation on diabetes Dataset Exercise
===============================================
A tutorial exercise which uses cross-validation with linear models.
This exercise is used in the :ref:`cv_estimators_tut` part of the
:ref:`model_selection_tut` section of ... | bsd-3-clause |
alurban/mentoring | tidal_disruption/scripts/kepler_angular_momentum.py | 1 | 2501 | # Imports.
import numpy as np
from numpy import pi
import matplotlib.pyplot as plt
import matplotlib.patheffects as PE
from matplotlib import ticker
# Physical constants.
G = 6.67408e-11 # Newton's constant in m^3 / kg / s
MSun = 1.989e30 # Solar mass in kg
M = 1.4 * MSun # Mass of each neutron star in this exampl... | gpl-3.0 |
louispotok/pandas | pandas/tests/reshape/merge/test_join.py | 3 | 31341 | # pylint: disable=E1103
from warnings import catch_warnings
from numpy.random import randn
import numpy as np
import pytest
import pandas as pd
from pandas.compat import lrange
import pandas.compat as compat
from pandas.util.testing import assert_frame_equal
from pandas import DataFrame, MultiIndex, Series, Index, me... | bsd-3-clause |
shoyer/xarray | xarray/core/pdcompat.py | 2 | 2346 | # The remove_unused_levels defined here was copied based on the source code
# defined in pandas.core.indexes.muli.py
# For reference, here is a copy of the pandas copyright notice:
# (c) 2011-2012, Lambda Foundry, Inc. and PyData Development Team
# All rights reserved.
# Copyright (c) 2008-2011 AQR Capital Managemen... | apache-2.0 |
Interoute/API-fun-and-education | widget-cpu-graphs.py | 1 | 5450 | #! /usr/bin/env python
# Python script for the Interoute Virtual Data Centre API:
# Name: widget-cpu-graphs.py
# Purpose: GUI widget to display graphs of CPU loads on VMs in a VDC
# Requires: class VDCApiCall in the file vdc_api_call.py
# Use the repo: https://github.com/Interoute/API-fun-and-education
# Copyrig... | apache-2.0 |
MartinDelzant/scikit-learn | examples/ensemble/plot_gradient_boosting_regularization.py | 355 | 2843 | """
================================
Gradient Boosting regularization
================================
Illustration of the effect of different regularization strategies
for Gradient Boosting. The example is taken from Hastie et al 2009.
The loss function used is binomial deviance. Regularization via
shrinkage (``lear... | bsd-3-clause |
NicoRahm/CGvsPhoto | CGvsPhoto/model.py | 1 | 57552 | """
The ``model`` module
======================
Contains the class Model which implements the core model for CG detection,
training, testing and visualization functions.
"""
import os
import time
import random
from . import image_loader as il
import tensorflow as tf
import matplotlib.pyplot as plt
... | mit |
gundramleifert/exp_tf | models/lp/bdlstm_lp_v12.py | 1 | 13753 | '''
Author: Tobi and Gundram
'''
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import ctc_ops as ctc
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops.rnn import bidirectional_rnn
from util.LoaderUtil import read_image_list, get_list_vals
from random impo... | apache-2.0 |
xlhtc007/blaze | blaze/server/server.py | 10 | 11382 | from __future__ import absolute_import, division, print_function
import socket
import functools
import re
import flask
from flask import Blueprint, Flask, request, Response
try:
from bokeh.server.crossdomain import crossdomain
except ImportError:
def crossdomain(*args, **kwargs):
def wrapper(f):
... | bsd-3-clause |
inkenbrandt/WellApplication | wellapplication/chem.py | 1 | 20675 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 05 09:50:51 2016
@author: paulinkenbrandt
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pandas as pd
from datetime import datetime
import numpy as np
import requests
class WQP(object):
"""Downloads Water Qu... | mit |
rtavenar/tslearn | tslearn/docs/examples/metrics/plot_lb_keogh.py | 1 | 2786 | # -*- coding: utf-8 -*-
r"""
LB_Keogh
========
This example illustrates the principle of time series envelope and its
relationship to the "LB_Keogh" lower bound [1].
The envelope of a time series consists of two time series such that the
original time series is between the two time series. Denoting the original
time ... | bsd-2-clause |
CforED/Machine-Learning | examples/classification/plot_digits_classification.py | 289 | 2397 | """
================================
Recognizing hand-written digits
================================
An example showing how the scikit-learn can be used to recognize images of
hand-written digits.
This example is commented in the
:ref:`tutorial section of the user manual <introduction>`.
"""
print(__doc__)
# Autho... | bsd-3-clause |
ahye/FYS2140-Resources | src/TUSL/infinitewell.py | 1 | 3632 | ####################################################################################
###
### Program to find eigenenergies of the infinite square well.
###
####################################################################################
# Importing useful stuff
from numpy import *
from matplotlib.pyplot import *... | mit |
zaxtax/scikit-learn | sklearn/cluster/birch.py | 18 | 22732 | # 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 |
lateral/hyperplane-hasher | test_classes/test_key_value_store.py | 2 | 21404 | from nn.hh_ensemble_lookup import *
from nn.dictionary_store import *
from ann.hyperplane_hasher import HyperplaneHasher, NORMAL_VECTOR_ID, NUM_NORMAL_VECS_ID, CHAMBER_ID
import unittest, copy, string, numpy as np, random as rd, pandas as pd
RANK = 10
NAME = 'test_HHENL'
METRIC = 'l2'
NNV = 5
NHH = 4
NUM_VECS = 30
cl... | mit |
B3AU/waveTree | sklearn/decomposition/tests/test_dict_learning.py | 8 | 7108 | import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from ... | bsd-3-clause |
gauthiier/mailinglists | analysis/archive.py | 1 | 4681 | import numpy as np
import pandas as pd
import email, email.parser
import os, datetime, json, gzip, re
import analysis.util
import analysis.query
import search.archive ## circular...
def filter_date(msg, archive_name):
time_tz = analysis.util.format_date(msg, archive_name)
if not time_tz:
return None
dt = dat... | gpl-3.0 |
bmazin/ARCONS-pipeline | mosaicing/test/Mosaic_matchFinder.py | 1 | 1859 | import math
import numpy as np
from util import ObsFileSeq as ObsFileSeq
from util import utils
import pyfits
from util.popup import PopUp, plotArray
import matplotlib.pyplot as plt
import pickle
import astrometry.CentroidCalc as cc
import mosaicing.matchFinder as mf
#import obsfileViewerTest as ovt
# Define a set of ... | gpl-2.0 |
flightgong/scikit-learn | sklearn/ensemble/forest.py | 2 | 52025 | """Forest of trees-based ensemble methods
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls the ... | bsd-3-clause |
ds-hwang/deeplearning_udacity | python_practice/01_basics.py | 1 | 4919 |
# coding: utf-8
# In[ ]:
"""Summary of tensorflow basics.
Parag K. Mital, Jan 2016."""
# In[13]:
# %% Import tensorflow and pyplot
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
# In[ ]:
# %% tf.Graph represents a collection of tf.Operations
# You can create operations by writing o... | mit |
thesuperzapper/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder_test.py | 71 | 12923 | # 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 |
keitaroyam/yamtbx | yamtbx/dataproc/auto/command_line/auto_data_proc_gui.py | 1 | 84315 | """
(c) RIKEN 2015. All rights reserved.
Author: Keitaro Yamashita
This software is released under the new BSD License; see LICENSE.
"""
from yamtbx.dataproc.auto import gui_config as config
from yamtbx.dataproc.auto import gui_logger as mylog
from yamtbx.dataproc.auto import html_report
from yamtbx.dataproc.xds impo... | bsd-3-clause |
mlperf/training_results_v0.6 | Google/benchmarks/transformer/implementations/tpu-v3-128-transformer/dataset_preproc/data_generators/video_generated.py | 7 | 5683 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
sachinpro/sachinpro.github.io | tensorflow/contrib/learn/__init__.py | 1 | 1880 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
xumi1993/seispy | seispy/sviewerui.py | 1 | 6007 | import sys
import os
import argparse
# matplotlib.use("Qt5Agg")
from PyQt5.QtGui import QIcon, QKeySequence
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, \
QSizePolicy, QWidget, QDesktopWidget, \
QPushButton, QHBoxLayout, QFileDialog, \
... | gpl-3.0 |
rrohan/scikit-learn | examples/calibration/plot_calibration.py | 225 | 4795 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
bikong2/scikit-learn | sklearn/metrics/classification.py | 95 | 67713 | """Metrics to assess performance on classification task given classe prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gram... | bsd-3-clause |
daeilkim/refinery | refinery/bnpy/bnpy-dev/bnpy/__init__.py | 1 | 2170 | ''' bnpy module __init__ file
'''
import data
import distr
import util
import suffstats
import allocmodel
import obsmodel
from HModel import HModel
import ioutil
load_model = ioutil.ModelReader.load_model
save_model = ioutil.ModelWriter.save_model
import init
import learnalg
import Run
from Run import run
import o... | mit |
pylayers/pylayers | pylayers/location/geometric/Scenario_base.py | 2 | 39343 | # -*- coding:Utf-8 -*-
import numpy as np
import scipy as sp
import time
import pdb
import os
import sys
import pickle as pk
import matplotlib.pyplot as plt
from matplotlib.collections import PolyCollection # scenario CDF mode 3D
from matplotlib.colors import colorConverter # scenario CDF mode 3D
from pylayers.l... | mit |
hsiaoyi0504/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
josherick/bokeh | bokeh/charts/builder/horizon_builder.py | 43 | 12508 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Horizon class which lets you build your Horizon charts just
passing the arguments to the Chart class and calling the proper functions.
"""
from __future__ import absolute_import, division
import mat... | bsd-3-clause |
emhuff/regularizedInversion | reweightDES.py | 1 | 8538 | #!/usr/bin/env python
import matplotlib as mpl
mpl.use('Agg')
import argparse
import matplotlib.pyplot as plt
import cfunc
import mapfunc
import sys
import numpy as np
import healpy as hp
import esutil
import atpy
import sklearn
import numpy.lib.recfunctions as rf
from sklearn.neighbors import NearestNeighbors as NN
... | mit |
EDUlib/eTracesX | Translation_software/edx_to_MOOCdb/extractor.py | 1 | 6316 | #import MySQLdb
import csv
import os
import pickle
import json
import pandas as pd
import config as cfg
import edxTrackLogJSONParser
import gzip
def get_events():
src = cfg.INPUT_SOURCE
if src=='csv':
return CSVExtractor(cfg.EDX_TRACK_EVENT)
elif src=='mysql':
return MySQLExtractor()
el... | agpl-3.0 |
abimannans/scikit-learn | sklearn/metrics/tests/test_score_objects.py | 138 | 14048 | import pickle
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regexp
from sklearn.utils.testing import assert_true
from sklearn.utils.testing im... | bsd-3-clause |
ym-bob/TensorFlowBook | Titanic/03_skflow.py | 2 | 1255 | import pandas as pd
import tensorflow.contrib.learn as skflow
from sklearn import metrics
from sklearn.model_selection import train_test_split
from data_processing import get_test_data, get_train_data
train_data = get_train_data()
X = train_data[['Sex', 'Age', 'Pclass', 'SibSp', 'Parch', 'Fare', 'Child',
... | apache-2.0 |
DSLituiev/scikit-learn | examples/gaussian_process/plot_gpr_co2.py | 131 | 5705 | """
========================================================
Gaussian process regression (GPR) on Mauna Loa CO2 data.
========================================================
This example is based on Section 5.4.3 of "Gaussian Processes for Machine
Learning" [RW2006]. It illustrates an example of complex kernel engine... | bsd-3-clause |
raghavrv/scikit-learn | examples/ensemble/plot_bias_variance.py | 357 | 7324 | """
============================================================
Single estimator versus bagging: bias-variance decomposition
============================================================
This example illustrates and compares the bias-variance decomposition of the
expected mean squared error of a single estimator again... | bsd-3-clause |
bxlab/HiFive_Paper | Scripts/HiCLib/mirnylab-hiclib-460c3fbc0f72/src/hiclib/fragmentHiC.py | 2 | 93010 | # (c) 2012 Massachusetts Institute of Technology. All Rights Reserved
# Code written by: Maksim Imakaev (imakaev@mit.edu)
"""
This is a module class for fragment-level Hi-C data analysis.
The base class "HiCdataset" can load, save and merge Hi-C datasets,
perform certain filters, and save binned heatmaps.
Additional c... | bsd-3-clause |
DSLituiev/scikit-learn | examples/calibration/plot_calibration.py | 33 | 4794 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
sintetizzatore/ThinkStats2 | code/thinkstats2.py | 68 | 68825 | """This file contains code for use with "Think Stats" and
"Think Bayes", both by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
"""This file contains class definitions for:
H... | gpl-3.0 |
andrew0harney/Semantic-encoding-model | ldaUtils.py | 1 | 4140 | import glob
import re
import pickle
import numpy as np
import pandas as pd
import logging
from GridRegression import Encoder
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('__ldaUtils__')
"""Utility functions and classes for working with event(epoch) encodings"""
__author__ = 'Andrew O\Harney'
c... | mit |
dolremi/PiperLearn | piperlearn/analysis/process.py | 1 | 4743 | import pickle
import pickle
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as st
import seaborn as sns
from scipy.special import boxcox1p
from scipy.stats import norm
class FeatureBuilder(object):
def __init__(self, inputfile, output):
_check_file(inputfile)
s... | mit |
stefanodoni/mtperf | statistics/LiveStatsGenerator.py | 2 | 3271 | from database import DBConstants
from parsers.Parser import Parser
import pandas as pd
import numpy as np
import sys
class LiveStatsGenerator:
# The normalize_perf parameter is needed to correctly compute the number of perf metrics accordingly to the measurement interval
def extract(self, table, DBconn, start... | gpl-2.0 |
ephes/scikit-learn | sklearn/tests/test_grid_search.py | 83 | 28713 | """
Testing for grid search module (sklearn.grid_search)
"""
from collections import Iterable, Sized
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.externals.six.moves import xrange
from itertools import chain, product
import pickle
import sys
import numpy as np
import scipy.sparse as sp
... | bsd-3-clause |
jpmml/sklearn2pmml | sklearn2pmml/ensemble/tests/__init__.py | 1 | 1997 | from pandas import DataFrame
from sklearn.base import clone
from sklearn.dummy import DummyClassifier
from sklearn.linear_model import ElasticNet, LinearRegression, LogisticRegression, SGDClassifier, SGDRegressor
from sklearn.svm import LinearSVC
from sklearn2pmml.ensemble import _checkLM, _checkLR, _step_params, Selec... | agpl-3.0 |
jreback/pandas | pandas/tests/series/methods/test_align.py | 2 | 5341 | import numpy as np
import pytest
import pytz
import pandas as pd
from pandas import Series, date_range, period_range
import pandas._testing as tm
@pytest.mark.parametrize(
"first_slice,second_slice",
[
[[2, None], [None, -5]],
[[None, 0], [None, -5]],
[[None, -5], [None, 0]],
... | bsd-3-clause |
Averroes/statsmodels | examples/incomplete/wls_extended.py | 33 | 16137 | """
Weighted Least Squares
example is extended to look at the meaning of rsquared in WLS,
at outliers, compares with RLM and a short bootstrap
"""
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
data = sm.datasets.ccard.load()
data.exog = sm.add_c... | bsd-3-clause |
anntzer/scikit-learn | sklearn/neighbors/_lof.py | 2 | 21119 | # Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import numpy as np
import warnings
from ._base import NeighborsBase
from ._base import KNeighborsMixin
from ..base import OutlierMixin
from ..utils.validation im... | bsd-3-clause |
bloyl/mne-python | examples/decoding/ssd_spatial_filters.py | 10 | 5433 | """
===========================================================
Compute Spectro-Spatial Decomposition (SSD) spatial filters
===========================================================
In this example, we will compute spatial filters for retaining
oscillatory brain activity and down-weighting 1/f background signals
as ... | bsd-3-clause |
procoder317/scikit-learn | sklearn/linear_model/tests/test_omp.py | 272 | 7752 | # Author: Vlad Niculae
# Licence: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equa... | bsd-3-clause |
hyperspy/hyperspy | hyperspy/_signals/eds_tem.py | 1 | 40736 | # -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | gpl-3.0 |
icdishb/scikit-learn | sklearn/utils/tests/test_testing.py | 33 | 3783 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... | bsd-3-clause |
PuchatekwSzortach/printed_characters_net | scripts/debugging/visualize_net_training.py | 1 | 2148 | """
A simple program for visualizing networks development as it is trained
"""
import shelve
import configobj
import matplotlib.pyplot as plt
import seaborn
def plot_training_data(training_data):
epochs = sorted(training_data.keys())
statistics_count = 2
layers_count = len(training_data[0]['weights_perc... | mit |
deepakantony/sms-tools | lectures/07-Sinusoidal-plus-residual-model/plots-code/hprModelFrame.py | 22 | 2847 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import math
from scipy.fftpack import fft, ifft, fftshift
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel a... | agpl-3.0 |
gary159/Cure_Gun_Violence | gunviolence/gunviolence/views.py | 1 | 2167 | from gunviolence import app
from flask import Flask, render_template, url_for, jsonify
from werkzeug.serving import run_simple
from ConfigUtil import config
from ChicagoData import comm
import pandas as pd
import numpy as np
import random
def gen_hex_colour_code():
return ''.join([random.choice('0123456789ABCDEF') ... | apache-2.0 |
B3AU/waveTree | benchmarks/bench_plot_nmf.py | 5 | 5815 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
import gc
from time import time
import numpy as np
from collections import defaultdict
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import make_low_rank_matrix
from skle... | bsd-3-clause |
jordancheah/zipline | zipline/transforms/ta.py | 32 | 7988 | #
# Copyright 2013 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 |
Sunhick/ThinkStats2 | code/regression.py | 62 | 9652 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import math
import pandas
import random
import numpy as np
import statsmode... | gpl-3.0 |
convexopt/gpkit | gpkit/interactive/plotting.py | 2 | 2075 | """Plotting methods"""
import matplotlib.pyplot as plt
import numpy as np
from .plot_sweep import assign_axes
from .. import GPCOLORS
def compare(models, sweeps, posys, tol=0.001):
"""Compares the values of posys over a sweep of several models.
If posys is of the same length as models, this will plot differe... | mit |
CanisMajoris/ThinkStats2 | code/hypothesis.py | 75 | 10162 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import nsfg
import nsfg2
import first
import thinkstats2
import thinkplot
... | gpl-3.0 |
mirestrepo/voxels-at-lems | registration_eval/results/pert_compute_transformation_error.py | 1 | 8494 | #!/usr/bin/env python
# encoding: utf-8
"""
compute_transformation_error.py
Created by Maria Isabel Restrepo on 2012-09-24.
Copyright (c) 2012 . All rights reserved.
This script computes the distances betweeen an estimated similarity transformation and its ground truth
The transformation is used to transform a "source... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.