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 |
|---|---|---|---|---|---|
ContinuumIO/dask | dask/dataframe/io/parquet/arrow.py | 1 | 31580 | from functools import partial
from collections import OrderedDict
import json
import warnings
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
from pyarrow.compat import guid
from ....utils import natural_sort_key, getargspec
from ..utils import _get_pyarrow_dtypes, _meta_from_dtypes
from ...utils... | bsd-3-clause |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/pandas/tools/tests/test_util.py | 6 | 3094 | import os
import locale
import codecs
import nose
import numpy as np
from numpy.testing import assert_equal
from pandas import date_range, Index
import pandas.util.testing as tm
from pandas.tools.util import cartesian_product
CURRENT_LOCALE = locale.getlocale()
LOCALE_OVERRIDE = os.environ.get('LOCALE_OVERRIDE', No... | mit |
roxyboy/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
KaiSzuttor/espresso | samples/lb_profile.py | 1 | 2744 | # Copyright (C) 2010-2019 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 v... | gpl-3.0 |
btabibian/scikit-learn | examples/feature_selection/plot_permutation_test_for_classification.py | 5 | 2294 | """
=================================================================
Test with permutations the significance of a classification score
=================================================================
In order to test if a classification score is significative a technique
in repeating the classification procedure aft... | bsd-3-clause |
hsiaoyi0504/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py | 254 | 2795 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
ominux/scikit-learn | examples/linear_model/plot_sgd_penalties.py | 2 | 1318 | """
==============
SGD: Penalties
==============
Plot the contours of the three penalties supported by `sklearn.linear_model.stochastic_gradient`.
"""
from __future__ import division
print __doc__
import numpy as np
import pylab as pl
def l1(xs): return np.array([np.sqrt((1 - np.sqrt(x**2.0))**2.0) for x in xs])
d... | bsd-3-clause |
vinodkc/spark | python/pyspark/pandas/tests/data_type_ops/test_categorical_ops.py | 7 | 7205 | #
# 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 |
Winand/pandas | pandas/core/ops.py | 1 | 55389 | """
Arithmetic operations for PandasObjects
This is not a public API.
"""
# necessary to enforce truediv in Python 2.X
from __future__ import division
import operator
import warnings
import numpy as np
import pandas as pd
import datetime
from pandas._libs import (lib, index as libindex,
tsli... | bsd-3-clause |
elmadjian/mac0499 | programas/plot_some_graph.py | 1 | 7762 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import threading
import matplotlib.pyplot as plt
import numpy as np
import re
import sys
import time
import math
#Detector de leitura (Elmadjian, 2015)
#------------------------------------
class Detector (threading.Thread):
def __init__(self, thresh, cv):
thre... | mit |
khkaminska/scikit-learn | examples/bicluster/bicluster_newsgroups.py | 142 | 7183 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
vvinuv/pyvinu | mytools.py | 1 | 10543 | import pylab as pl
import pyfits
import numpy as np
import os
import healpy as hp
from numpy import ma
from astropy.io import fits
import astropy.coordinates as co
from astropy import units as u
from astropy import wcs
import time
from matplotlib import ticker
def matrc1():
MatPlotParams = {'axes.titlesize': 15,... | gpl-2.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/ipykernel/inprocess/tests/test_kernel.py | 8 | 2417 | # Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import sys
import unittest
from ipykernel.inprocess.blocking import BlockingInProcessKernelClient
from ipykernel.inprocess.manager import InProcessKernelManager
from ipykernel.in... | gpl-3.0 |
LohithBlaze/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 |
simon-pepin/scikit-learn | examples/linear_model/plot_multi_task_lasso_support.py | 249 | 2211 | #!/usr/bin/env python
"""
=============================================
Joint feature selection with multi-task Lasso
=============================================
The multi-task lasso allows to fit multiple regression problems
jointly enforcing the selected features to be the same across
tasks. This example simulates... | bsd-3-clause |
TomAugspurger/pandas | pandas/tests/extension/test_boolean.py | 1 | 12167 | """
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... | bsd-3-clause |
nomadcube/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 |
tongwang01/tensorflow | tensorflow/examples/learn/text_classification_cnn.py | 13 | 4470 | # 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 |
fqez/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/magfit.py | 6 | 5105 | #!/usr/bin/env python
'''
fit best estimate of magnetometer offsets
'''
import sys, time, os, math
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--no-timestamps", dest="notimestamps", action='store_true', help="Log doesn't have timestamps")
parser.add_argument(... | gpl-3.0 |
kevinhikali/ml_kevin | bottom/gradient_descent.py | 1 | 1449 | # -*- coding: utf-8 -*-
"""
@author: kevinhikali
@email: hmingwei@gmail.com
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# global variable
SampleTh = np.array([[2],
[5]])
# function
def h(th, x):
global SampleTh
return np.dot(th.transpose... | gpl-3.0 |
lbsantos/psycholinguistic-regression | mlp.py | 1 | 2990 | from multiview_regression import W2VTransformer
from keras.layers import Input, Dense, Dropout, merge
from scipy.stats import spearmanr, pearsonr
from keras.callbacks import EarlyStopping
from sklearn.model_selection import KFold
from keras.models import Sequential, Model
import numpy as np
import pandas
import gensim
... | gpl-3.0 |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/indexes/timedeltas/test_timedelta.py | 1 | 22801 | import pytest
import numpy as np
from datetime import timedelta
import pandas as pd
import pandas.util.testing as tm
from pandas import (timedelta_range, date_range, Series, Timedelta,
DatetimeIndex, TimedeltaIndex, Index, DataFrame,
Int64Index)
from pandas.util.testing import ... | apache-2.0 |
paineliu/tflearn | han_cnn.py | 1 | 5666 | # encoding: UTF-8
# neural network structure:
#
# · · · · · · · · · · (input data, 1-deep) X [batch, 28, 28, 1]
# @ @ @ @ @ @ @ @ @ @ -- conv. layer 5x5x1=>4 stride 1 W1 [5, 5, 1, 4] B1 [4]
# ∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶ Y1 [batch, 28, 28, 4]
# @ ... | apache-2.0 |
ecatkins/telegram_chatbot | main_chatbot.py | 1 | 3683 | import json
import requests
import time
import urllib
from gensim import utils, matutils, models
from sklearn.externals import joblib
from secret import *
URL = "https://api.telegram.org/bot{}/".format(TOKEN)
def get_url(url):
''' Gets url that returns content '''
response = requests.get(url)
content = ... | mit |
amboar/fpos | lib/fpos/predict.py | 1 | 14065 | #!/usr/bin/python3
#
# Forecasts future spending based on cycles in historical data
# Copyright (C) 2013 Andrew Jeffery <andrew@aj.id.au>
#
# 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 Fo... | gpl-3.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/pandas/stats/moments.py | 7 | 31610 | """
Provides rolling statistical moments and related descriptive
statistics implemented in Cython
"""
from __future__ import division
import warnings
import numpy as np
from pandas.types.common import is_scalar
from pandas.core.api import DataFrame, Series
from pandas.util.decorators import Substitution, Appender
__a... | mit |
florian-wagner/gimli | python/pygimli/mplviewer/dataview.py | 1 | 2988 | # -*- coding: utf-8 -*-
import pygimli as pg
#import pygimli.utils
import numpy as np
#from numpy import arange, ndarray, array, ma
#import matplotlib as mpl
#from colorbar import *
#def annotateSeparationAxis(ax, shemeID, grid = False):
#'''
#Draw y-axes tick labels corresponding to the separation
... | gpl-3.0 |
CforED/Machine-Learning | sklearn/linear_model/tests/test_base.py | 19 | 12955 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_e... | bsd-3-clause |
drusk/pml | test/matchers/pandas_matchers.py | 1 | 5445 | # Copyright (C) 2012 David Rusk
#
# 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, copy, modify, merge, publish, distr... | mit |
UNR-AERIAL/scikit-learn | examples/mixture/plot_gmm.py | 248 | 2817 | """
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two Gaussians with EM
and variational Dirichlet process.
Both models have access to five components with which to fit the
data. Note that the EM model will necessari... | bsd-3-clause |
has2k1/plotnine | plotnine/tests/test_geom_segment.py | 1 | 1315 | import pandas as pd
from plotnine import ggplot, aes, geom_segment, arrow, theme
n = 4
# stepped horizontal line segments
df = pd.DataFrame({
'x': range(1, n+1),
'xend': range(2, n+2),
'y': range(n, 0, -1),
'yend': range(n, 0, -1),
'z': range(1, n+1)
})
_theme = theme(sub... | gpl-2.0 |
igryski/TRMM_blend | src/folium/plot_TRMM_precip_correct_map_folium.py | 1 | 14152 | # Make python script executable
#!/usr/bin/python
# pylint: disable=C0103
# pylint: disable-msg=C0103
# Script produces TRMM precip filtered using update (Zhong) Land Sea mask
# ==========================================
# Author: I.Stepanov (igor.stepanov@knmi.nl)
# 22.04.2016 @KNMI
# ==============================... | gpl-3.0 |
HolgerPeters/scikit-learn | examples/ensemble/plot_partial_dependence.py | 54 | 4704 | """
========================
Partial Dependence Plots
========================
Partial dependence plots show the dependence between the target function [2]_
and a set of 'target' features, marginalizing over the
values of all other features (the complement features). Due to the limits
of human perception the size of t... | bsd-3-clause |
herilalaina/scikit-learn | sklearn/feature_selection/variance_threshold.py | 123 | 2572 | # Author: Lars Buitinck
# License: 3-clause BSD
import numpy as np
from ..base import BaseEstimator
from .base import SelectorMixin
from ..utils import check_array
from ..utils.sparsefuncs import mean_variance_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(BaseEstimator, SelectorMixin):
... | bsd-3-clause |
mje-nz/PX4-Firmware | Tools/process_sensor_caldata.py | 4 | 31659 | #! /usr/bin/env python
from __future__ import print_function
import argparse
import os
import matplotlib.pyplot as plt
import numpy as np
from pyulog import *
"""
Reads in IMU data from a static thermal calibration test and performs a curve fit of gyro, accel and baro bias vs temperature
Data can be gathered using ... | bsd-3-clause |
miguelarauj1o/ackley | plots/plot.py | 1 | 1631 | # -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as pyplot
import time
def timestamped(name, fmt="png"):
return "plot_" + name + str(int(time.time())) + "." + fmt
def plot_vs_generation(data, yfield, title, xlabel, ylabel, filename):
y_axis = [row[yfield] for row in... | mit |
ManyBodyPhysics/LectureNotesPhysics | Programs/Chapter8-programs/python/unit_test_example/src/mbpt_version0.py | 1 | 3864 | #!/usr/bin/python
from sympy import *
from pylab import *
import matplotlib.pyplot as plt
below_fermi = (0,1,2,3)
above_fermi = (4,5,6,7)
states = [(1,1),(1,-1),(2,1),(2,-1),(3,1),(3,-1),(4,1),(4,-1)]
N = 8
g = Symbol('g')
def h0(p,q):
if p == q:
p1, s1 = states[p]
return (p1 - 1)
else:
... | cc0-1.0 |
liangz0707/scikit-learn | sklearn/linear_model/tests/test_sparse_coordinate_descent.py | 244 | 9986 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_true
from sklearn.utils.t... | bsd-3-clause |
felixbiessmann/active-manifesto | services/manifesto_data.py | 1 | 4027 | import itertools
import json
import urllib
import urllib.request
import pandas as pd
class ManifestoDataLoader(object):
def __init__(self, api_key):
self.base_url = "https://manifesto-project.wzb.eu/tools"
self.country = "Germany"
self.version = "MPDS2017b"
self.api_key = api_key
... | mit |
hainm/statsmodels | statsmodels/stats/tests/test_power.py | 28 | 25876 | # -*- coding: utf-8 -*-
# pylint: disable=W0231, W0142
"""Tests for statistical power calculations
Note:
tests for chisquare power are in test_gof.py
Created on Sat Mar 09 08:44:49 2013
Author: Josef Perktold
"""
import copy
import numpy as np
from numpy.testing import (assert_almost_equal, assert_allclose, as... | bsd-3-clause |
JPFrancoia/scikit-learn | benchmarks/bench_covertype.py | 57 | 7378 | """
===========================
Covertype dataset benchmark
===========================
Benchmark stochastic gradient descent (SGD), Liblinear, and Naive Bayes, CART
(decision tree), RandomForest and Extra-Trees on the forest covertype dataset
of Blackard, Jock, and Dean [1]. The dataset comprises 581,012 samples. It ... | bsd-3-clause |
manahl/arctic | arctic/serialization/incremental.py | 1 | 10075 | import abc
import hashlib
import logging
from threading import RLock
import numpy as np
import pandas as pd
from bson import Binary
from arctic._config import ARCTIC_AUTO_EXPAND_CHUNK_SIZE
from arctic.serialization.numpy_records import PandasSerializer
from .._compression import compress
from .._config import MAX_DOC... | lgpl-2.1 |
chrhartm/SORN | utils/plotting.py | 2 | 1697 | import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
def pretty_mpl_defaults():
# Sources:
# http://nbviewer.ipython.org/gist/olgabot/5357268
# http://stackoverflow.com/questions/24808739/modifying-the-built-in-colors-of-matplotlib
# Font size
# used 32 for ISI abstract
#... | mit |
probcomp/cgpm | tests/test_gpmcc_simple_composite.py | 1 | 8063 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | apache-2.0 |
kendricktan/rarepepes | data/enhance_x.py | 1 | 1279 | import os
import argparse
import glob
import sys
import skimage.filters as skfilters
import skimage.color as skcolor
import skimage.feature as skfeature
import skimage.io as skio
import skimage.util as skut
import skimage.morphology as skmo
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.f... | mit |
idlead/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
leesavide/pythonista-docs | Documentation/matplotlib/mpl_examples/units/artist_tests.py | 6 | 1475 | """
Test unit support with each of the matplotlib primitive artist types
The axes handles unit conversions and the artists keep a pointer to
their axes parent, so you must init the artists with the axes instance
if you want to initialize them with unit data, or else they will not
know how to convert the units to scala... | apache-2.0 |
renchuqiao/BayesianDLM | simulation/simulation_new.py | 1 | 4838 | ##===============
##==== libraries
##===============
import numpy as np
from numpy.linalg import inv
from scipy.stats import wishart
from scipy.stats import bernoulli
import math
from numpy import linalg as LA
# import matplotlib.pyplot as plt
# import seaborn as sns
##=====================
##==== global variables
##=... | gpl-3.0 |
samzhang111/scikit-learn | examples/tree/plot_tree_regression_multioutput.py | 206 | 1800 | """
===================================================================
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 |
Featuretools/featuretools | featuretools/entityset/entityset.py | 1 | 40323 | import copy
import logging
from collections import defaultdict
import cloudpickle
import numpy as np
import pandas as pd
from pandas.api.types import is_dtype_equal, is_numeric_dtype
import featuretools.variable_types.variable as vtypes
from featuretools.entityset import deserialize, serialize
from featuretools.entit... | bsd-3-clause |
raghavrv/scikit-learn | doc/sphinxext/sphinx_gallery/notebook.py | 16 | 5801 | # -*- coding: utf-8 -*-
r"""
Parser for Jupyter notebooks
============================
Class that holds the Jupyter notebook information
"""
# Author: Óscar Nájera
# License: 3-clause BSD
from __future__ import division, absolute_import, print_function
from functools import partial
import argparse
import json
import... | bsd-3-clause |
MATH497project/MATH497-DiabeticRetinopathy | data_aggregation/data_normalization_sqlite.py | 1 | 2204 | import pandas as pd
from pprint import pprint
import json
import numpy as np
import dataset
# ICD_list table must be re-built from, presumably, ICD_for_Enc due to some entries being
# pre-18th birthday. ICD_list entries are not timestamped!
table_names = ['all_encounter_data', 'demographics', 'encounters', 'family_h... | mit |
darioizzo/pykep | pykep/phasing/_dbscan.py | 2 | 6958 | class dbscan():
"""
This class can be used to locate areas of the interplanetary space that are 'dense' at one epoch.
Essentially, it locates planet clusters
"""
from pykep.core import AU, EARTH_VELOCITY
def _axis_equal_3d(self, ax):
"""Rescales 3D axis limits using equal scale."""
... | gpl-3.0 |
spgarbet/pysb | pysb/examples/paper_figures/fig6.py | 4 | 9163 | """Produce contact map for Figure 5D from the PySB publication"""
import pysb.integrate
import pysb.util
import numpy as np
import scipy.optimize
import scipy.interpolate
import matplotlib.pyplot as plt
import os
import sys
import inspect
from earm.lopez_embedded import model
# List of model observables and corresp... | bsd-2-clause |
timothydmorton/qa_explorer | explorer/plots.py | 1 | 17724 | from functools import partial
import param
import numpy as np
import pandas as pd
import holoviews as hv
import datashader as ds
import colorcet as cc
from param import ParameterizedFunction, ParamOverrides
from holoviews.core.operation import Operation
from holoviews.streams import Stream, BoundsXY, LinkedStream
fro... | mit |
DTMilodowski/EO_data_processing | src/plot_EO_data/plot_forest_loss_maps.py | 1 | 2311 | # This function plots up a series of maps illustrating forest loss through time,
# as modelled based on global forest watch annual forest loss distributed temporally
# based on the "seasonality" of FORMA
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from mpl_toolkits.basemap import Basemap, s... | gpl-3.0 |
hendrikTpl/deeppy | examples/siamese_mnist.py | 9 | 2485 | #!/usr/bin/env python
"""
Siamese networks
================
"""
import random
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import offsetbox
import deeppy as dp
# Fetch MNIST data
dataset = dp.dataset.MNIST()
x_train, y_train, x_test, y_test = dataset.data(flat=True, dp_dtypes=True)
# Normaliz... | mit |
RayMick/scikit-learn | sklearn/metrics/tests/test_pairwise.py | 71 | 25104 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... | bsd-3-clause |
ChayaSt/Torsions | torsionfit/plots.py | 4 | 23291 | """
Plotting module and data exploration for torsionfit
This module contains functions to simplify exploration of torsionfit output in addition to general plotting functions
"""
__author__ = 'Chaya D. Stern'
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
impor... | gpl-2.0 |
Sohojoe/damon | damon1/irt_tools.py | 1 | 70783 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 8 11:03:10 2016
@author: Mark H. Moulton, Educational Data Systems, Inc.
Dependencies: Numpy, Pandas
Stand-alone utility (not integrated with the main Damon workflow) for creating
raw-to-scale score conversion tables from item parameters. Supports Rasch,
2PL, 3PL, an... | apache-2.0 |
ruymanengithub/vison | vison/flat/FLAT0Xaux.py | 1 | 5248 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Auxiliary Functions and resources to FLAT0X.
Created on Tue Jan 30 17:39:00 2018
:author: Ruyman Azzollini
"""
# IMPORT STUFF
from pdb import set_trace as stop
import numpy as np
import os
from collections import OrderedDict
import string as st
from matplotlib imp... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/ipykernel/ipkernel.py | 5 | 13493 | """The IPython kernel implementation"""
import getpass
import sys
import traceback
from IPython.core import release
from ipython_genutils.py3compat import builtin_mod, PY3, unicode_type, safe_unicode
from IPython.utils.tokenutil import token_at_cursor, line_at_cursor
from traitlets import Instance, Type, Any, List
f... | gpl-3.0 |
chakki-works/seqeval | tests/test_metrics.py | 1 | 9057 | """
Evaluation test is performed for the following dataset.
https://www.clips.uantwerpen.be/conll2000/chunking/output.html
"""
import os
import random
import subprocess
import unittest
import numpy as np
import pytest
from sklearn.exceptions import UndefinedMetricWarning
from seqeval.metrics import (accuracy_score, c... | mit |
kevinpetersavage/BOUT-dev | examples/non-local_1d/analyse_target_heatflux.py | 3 | 6363 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Runs the conduction example, produces some output
#
from __future__ import print_function
from builtins import str
from builtins import range
nproc = 1 # Number of processors to use
from boututils import shell, launch, plotdata
from boutdata import collect
import n... | gpl-3.0 |
prabhjyotsingh/incubator-zeppelin | python/src/main/resources/python/mpl_config.py | 41 | 3653 | # 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 use ... | apache-2.0 |
lagadic/visp | example/calibration/camera_calibration_show_extrinsics.py | 2 | 12636 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ViSP, open source Visual Servoing Platform software.
# Copyright (C) 2005 - 2020 by Inria. All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redi... | gpl-2.0 |
subutai/nupic.research | nupic/research/frameworks/wandb/ray_wandb.py | 2 | 11410 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
bmazin/ARCONS-pipeline | flatcal/plotWeights.py | 1 | 4808 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.backends.backend_pdf import PdfPages
from util.FileName import FileName
# npzFileName = os.path.splitext(fullFlatCalFileName)[0]+'.npz'
#
# #calculate total spectra and medians for programs that expect old format flat ca... | gpl-2.0 |
HyukjinKwon/spark | python/pyspark/pandas/series.py | 9 | 197528 | #
# 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 |
jvivian/rnaseq-lib | src/rnaseq_lib/plot/__init__.py | 1 | 30364 | from __future__ import division
import holoviews as hv
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from rnaseq_lib.diff_exp import log2fc, de_pearson_dataframe
from rnaseq_lib.dim_red import run_tsne, run_trimap
from rnaseq_lib.math import l2norm, iqr_bounds
from rnaseq_lib.plot.opts impor... | mit |
kleskjr/scipy | scipy/interpolate/ndgriddata.py | 39 | 7457 | """
Convenience interface to N-D interpolation
.. versionadded:: 0.9
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from .interpnd import LinearNDInterpolator, NDInterpolatorBase, \
CloughTocher2DInterpolator, _ndim_coords_from_arrays
from scipy.spatial import cKDTree
_... | bsd-3-clause |
f3r/scikit-learn | sklearn/linear_model/tests/test_coordinate_descent.py | 21 | 25117 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.utils.testing ... | bsd-3-clause |
kevinthesun/mxnet | example/kaggle-ndsb1/gen_img_list.py | 42 | 7000 | # 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 u... | apache-2.0 |
mfs6174/Deep6174 | scripts/run-and-draw-last.py | 1 | 2768 | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: run-and-draw-last.py
# Date: Thu Sep 18 15:43:47 2014 -0700
import matplotlib.pyplot as plt
from scipy.misc import imread, imsave
import numpy as np
import os, sys
import glob
from copy import copy
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(_... | apache-2.0 |
VCG/gp | gp/cremi.py | 1 | 1951 | import glob
import h5py
import mahotas as mh
import matplotlib.pyplot as plt
import numpy as np
import partition_comparison
import os
from scipy import ndimage as nd
import skimage.measure
import tifffile as tif
class Cremi(object):
@staticmethod
def read_section(path, z, verbose=True):
'''
'''
imag... | mit |
equialgo/scikit-learn | sklearn/neighbors/approximate.py | 27 | 22368 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
wgmueller1/BDA_py_demos | demos_ch3/demo3_5.py | 19 | 2066 | """Bayesian Data Analysis, 3rd ed
Chapter 3, demo 5
Demonstrate a normal model for the Newcomb's data (BDA3 p. 66).
"""
from __future__ import division
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
# Edit default plot settings (colours from colorbrewer2.org)
plt.rc('font', size=14)
plt... | gpl-3.0 |
starimpact/fast-rcnn | lib/fast_rcnn/test.py | 43 | 11975 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Test a Fast R-CNN network on an imdb (image database)."""
from fast... | mit |
adamgreenhall/scikit-learn | examples/mixture/plot_gmm_classifier.py | 250 | 3918 | """
==================
GMM classification
==================
Demonstration of Gaussian mixture models for classification.
See :ref:`gmm` for more information on the estimator.
Plots predicted labels on both training and held out test data using a
variety of GMM classifiers on the iris dataset.
Compares GMMs with sp... | bsd-3-clause |
ycaihua/scikit-learn | examples/linear_model/plot_sgd_loss_functions.py | 249 | 1095 | """
==========================
SGD: convex loss functions
==========================
A plot that compares the various convex loss functions supported by
:class:`sklearn.linear_model.SGDClassifier` .
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def modified_huber_loss(y_true, y_pred):
z ... | bsd-3-clause |
debsankha/bedtime-programming | ls222/osc_mod.py | 1 | 4146 | #!/usr/bin/env python
import random
from random import normalvariate
from random import uniform
from math import *
import commands
import matplotlib.pyplot as plt
commands.getoutput('rm cat_mouse.out')
def maxwell(x,xmax):
if x<xmax: # a function <=1 with maxima at xmax
return sqrt(x*1.0/xmax)
else:
return e... | gpl-3.0 |
terkkila/scikit-learn | sklearn/utils/tests/test_validation.py | 133 | 18339 | """Tests for input validation functions"""
import warnings
from tempfile import NamedTemporaryFile
from itertools import product
import numpy as np
from numpy.testing import assert_array_equal
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true, assert_false, assert_equal
from sklearn.utils.... | bsd-3-clause |
SimonHL/TSA | simpleFF_s.py | 1 | 3844 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 16:22:26 2015
使用前向网络进行频率识别:直接延时法
@author: simon
"""
import sys,time
import numpy
import theano
import theano.tensor as T
import matplotlib.pyplot as plt
def step(*args):
#global n_input, n_hidden
x = [args[u] for u in xrange(n_input)]
W_in = [args[u... | bsd-2-clause |
jorge2703/scikit-learn | examples/ensemble/plot_gradient_boosting_regression.py | 227 | 2520 | """
============================
Gradient Boosting regression
============================
Demonstrate Gradient Boosting on the Boston housing dataset.
This example fits a Gradient Boosting model with least squares loss and
500 regression trees of depth 4.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prett... | bsd-3-clause |
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/mne-python-0.10/mne/viz/tests/test_topomap.py | 3 | 10198 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import os.path as op
import warnings
import numpy as np
from ... | bsd-3-clause |
phobson/statsmodels | statsmodels/datasets/longley/data.py | 3 | 1959 | """Longley dataset"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
The classic 1967 Longley Data
http://www.itl.nist.gov/div898/strd/lls/data/Longley.shtml
::
Longley, J.W. (1967) "An Appraisal of Least Squares Programs for the
El... | bsd-3-clause |
altairpearl/scikit-learn | sklearn/covariance/tests/test_graph_lasso.py | 24 | 5256 | """ Test the graph_lasso module.
"""
import sys
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_less
from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV,
empirical_... | bsd-3-clause |
tbarbette/clickwatcher | npf/npf.py | 1 | 17287 | import argparse
import os
from argparse import ArgumentParser
from typing import Dict, List
import regex
import re
from decimal import Decimal
from npf.node import Node
from .variable import VariableFactory
def get_valid_filename(s):
s = str(s).strip().replace(' ', '_')
return re.sub(r'(?u)[^-\w.]', '', s)
... | gpl-3.0 |
zzcclp/spark | python/pyspark/pandas/plot/matplotlib.py | 14 | 30172 | #
# 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 |
Jimmy-Morzaria/scikit-learn | sklearn/datasets/base.py | 15 | 17969 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import shutil
from os import environ
from os.pa... | bsd-3-clause |
maxlikely/scikit-learn | sklearn/metrics/pairwise.py | 1 | 28395 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.metrics.pairwise` submodule implements utilities to evaluate
pairwise distances or affinity of sets of samples.
This module contains both distance metrics and kernels. A brief summary is
given on the two here.
Distance metrics are a function d(a, b) such that d(a, b) < d(... | bsd-3-clause |
HaoMood/cs231n | assignment1/assignment1sol/features/features.py | 30 | 4807 | import matplotlib
import numpy as np
from scipy.ndimage import uniform_filter
def extract_features(imgs, feature_fns, verbose=False):
"""
Given pixel data for images and several feature functions that can operate on
single images, apply all feature functions to all images, concatenating the
feature vectors fo... | gpl-3.0 |
srgblnch/MeasuredFillingPattern | tango-ds/MeasuredFillingPatternFCT/BunchAnalyzer.py | 1 | 43934 | #! /usr/bin/env python
# -*- coding:utf-8 -*-
##############################################################################
## license : GPLv3+
##============================================================================
##
## File : BunchAnalyzer.py
##
## Project : Filling Pattern from the FCT
##
## d... | gpl-3.0 |
vlukes/sfepy | script/plot_logs.py | 4 | 3290 | #!/usr/bin/env python
"""
Plot logs of variables saved in a text file by sfepy.base.log.Log class.
The plot should be almost the same as the plot that would be generated by the
Log directly.
"""
from __future__ import absolute_import
import sys
sys.path.append('.')
from argparse import ArgumentParser, Action, RawDescr... | bsd-3-clause |
kapteyn-astro/kapteyn | doc/source/EXAMPLES/mu_clown.py | 1 | 1155 | from kapteyn import maputils
from matplotlib import pyplot as plt
from numpy import fft, log, asarray, float64, abs, angle
#f = maputils.FITSimage("m101.fits")
f = maputils.FITSimage("cl2.fits")
fig = plt.figure(figsize=(8,8))
frame = fig.add_subplot(2,2,1)
mplim = f.Annotatedimage(frame, cmap="gray")
mplim.Image()
... | bsd-3-clause |
rishikksh20/scikit-learn | examples/neural_networks/plot_mlp_training_curves.py | 58 | 3692 | """
========================================================
Compare Stochastic learning strategies for MLPClassifier
========================================================
This example visualizes some training loss curves for different stochastic
learning strategies, including SGD and Adam. Because of time-constrai... | bsd-3-clause |
mwv/scikit-learn | examples/bicluster/bicluster_newsgroups.py | 162 | 7103 | """
================================================================
Biclustering documents with the Spectral Co-clustering algorithm
================================================================
This example demonstrates the Spectral Co-clustering algorithm on the
twenty newsgroups dataset. The 'comp.os.ms-windows... | bsd-3-clause |
ldirer/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 8 | 5475 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
jonwright/ImageD11 | setup.py | 1 | 7186 |
from __future__ import print_function
# ImageD11_v1.0 Software for beamline ID11
# Copyright (C) 2005-2018 Jon Wright
#
# 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 2 of the... | gpl-2.0 |
harisbal/pandas | scripts/tests/test_validate_docstrings.py | 1 | 23041 | import string
import random
import io
import pytest
import numpy as np
import validate_docstrings
validate_one = validate_docstrings.validate_one
from pandas.util.testing import capture_stderr
class GoodDocStrings(object):
"""
Collection of good doc strings.
This class contains a lot of docstrings that... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.