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 |
|---|---|---|---|---|---|
mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part06-e05_plant_clustering/src/plant_clustering.py | 1 | 1234 | #!/usr/bin/env python3
import scipy
from sklearn.naive_bayes import GaussianNB
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn import naive_bayes
from sklearn import metrics
from sklearn.cluster import KMeans
def find_permutation(n_clusters, real_labels, label... | gpl-3.0 |
ahoyosid/scikit-learn | sklearn/metrics/scorer.py | 13 | 13090 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
dr-bigfatnoob/quirk | models/xomo/cocomo.py | 2 | 43541 | import sys
sys.dont_write_bytecode = True
def demo(f=None, demos=[]):
if f:
demos.append(f)
return f
for d in demos:
print '\n--|', d.func_name, '|', '-' * 40, '\n', d.__doc__, '\n'
d()
def test(f=None, tests=[]):
if f:
tests.append(f)
return f
ok = no = 0
for t in tests:
print... | unlicense |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/svm/plot_custom_kernel.py | 1 | 1524 | """
======================
SVM with custom kernel
======================
Simple usage of Support Vector Machines to classify a sample. It will
plot the decision surface and the support vectors.
"""
print(__doc__)
import matplotlib.pyplot as plt
import numpy as np
from sklearn import svm, datasets
# import some data... | mit |
rafwiewiora/msmbuilder | msmbuilder/cluster/ndgrid.py | 12 | 4316 | # Author: Robert McGibbon <rmcgibbo@gmail.com>
# Contributors:
# Copyright (c) 2014, Stanford University
# All rights reserved.
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import... | lgpl-2.1 |
mo-g/iris | docs/iris/example_code/General/custom_file_loading.py | 4 | 11862 | """
Loading a cube from a custom file format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This example shows how a custom text file can be loaded using the standard Iris load mechanism.
The first stage in the process is to define an Iris :class:`FormatSpecification <iris.io.format_picker.FormatSpecification>` for the fil... | gpl-3.0 |
billy-inn/scikit-learn | sklearn/linear_model/tests/test_logistic.py | 105 | 26588 | import numpy as np
import scipy.sparse as sp
from scipy import linalg, optimize, sparse
from sklearn.utils.testing import assert_almost_equal
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.util... | bsd-3-clause |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/IPython/kernel/inprocess/ipkernel.py | 9 | 6881 | """An in-process kernel"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#------------------------... | bsd-3-clause |
Titan-C/scikit-learn | examples/plot_multioutput_face_completion.py | 79 | 2986 | """
==============================================
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 |
haoyuchen1992/osf.io | scripts/analytics/addons.py | 21 | 2200 | # -*- coding: utf-8 -*-
import os
import re
import matplotlib.pyplot as plt
from framework.mongo import database
from website import settings
from website.app import init_app
from .utils import plot_dates, oid_to_datetime, mkdirp
log_collection = database['nodelog']
FIG_PATH = os.path.join(settings.ANALYTICS_PATH... | apache-2.0 |
MediffRobotics/DeepRobotics | DeepLearnMaterials/tutorials/matplotlibTUT/plt15_subplot.py | 3 | 1313 | # View more python tutorials on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
# 15 - subplot
"""
Please note, this script is for python3+.
If you are using python2+, please modify it accordin... | gpl-3.0 |
swirlingsand/deep-learning-foundations | play/matplotlib-fun.py | 1 | 1642 |
import matplotlib.pyplot as plt
# testing examples from http://matplotlib.org/users/pyplot_tutorial.html
def example_line():
numbers = [1, 2, 3, 4]
plt.plot(numbers)
plt.ylabel('Numbers :) ')
plt.show()
# example_line()
def example_red_dots():
numbers = [1, 2, 3, 4]
more_numbers = [1, 4, ... | mit |
chenyyx/scikit-learn-doc-zh | examples/zh/applications/plot_model_complexity_influence.py | 14 | 6372 | """
==========================
Model Complexity Influence
==========================
Demonstrate how model complexity influences both prediction accuracy and
computational performance.
The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for
regression (resp. classification).
For each class of models we m... | gpl-3.0 |
mmilutinovic1313/zipline-with-algorithms | tests/test_perf_tracking.py | 1 | 73634 | #
# 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 |
JPFrancoia/scikit-learn | sklearn/model_selection/tests/test_split.py | 7 | 41116 | """Test the split module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from scipy import stats
from scipy.misc import comb
from itertools import combinations
from sklearn.utils.fixes import combinations_with_replacement
from sklearn.u... | bsd-3-clause |
danielhrisca/asammdf | asammdf/gui/cx.py | 1 | 2464 | import os
import shutil
import sys
from cx_Freeze import Executable, setup
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {
"packages": ["os", "numpy", "pyqtgraph"],
"excludes": [
"gtk",
"tkinter",
"bcolz",
"bokeh",
"bs4",
... | lgpl-3.0 |
jeffschulte/protein | pyplots/arrow_plot.py | 2 | 3921 | from __future__ import division
import matplotlib
import sys
if "show" not in sys.argv:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import file_loader as load
from matplotlib.font_manager import FontProperties
#membrane.dat or arrow.dat printed transposed, gotta align them:
cell_membra... | mit |
Roboticmechart22/sms-tools | lectures/05-Sinusoidal-model/plots-code/sineModel-anal-synth.py | 24 | 1483 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import sineModel as SM
import utilFunctions as UF
(fs, x) = UF.wavread(os.p... | agpl-3.0 |
jakevdp/periodogram | periodogram/timeseries.py | 2 | 1861 | from __future__ import division,print_function
"""
Base class for time series
"""
import numpy as np
import matplotlib.pyplot as plt
class TimeSeries(object):
def init(self, t, f, df=None, mask=None,
band=None):
"""
Base class for time series data
Parameters
---------... | mit |
google-research/google-research | aav/util/dataset_utils.py | 1 | 10090 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
precedenceguo/mxnet | example/ssd/dataset/pycocotools/coco.py | 21 | 18778 | __author__ = 'tylin'
__version__ = '2.0'
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visualizing the annotations in COCO.
# Pleas... | apache-2.0 |
dimitri-justeau/niamoto-core | niamoto/taxonomy/taxonomy_manager.py | 2 | 20206 | # coding: utf-8
from datetime import datetime
import time
from sqlalchemy import select, func, bindparam, Index, cast
from sqlalchemy.dialects.postgresql import JSONB
import pandas as pd
from niamoto.db.connector import Connector
from niamoto.db import metadata as meta
from niamoto.exceptions import MalformedDataSou... | gpl-3.0 |
agartland/utils | ics/process_compass_out.py | 1 | 2345 | import sys
import pandas as pd
"""Reformats the CSV output from a COMPASS run as a human navigable CSV"""
fn = sys.argv[1]
# fn = r'T:/vaccine/p602/analysis/lab/pt_reports/ics/2018_02_compass/adata/hvtn602_compass_results'
prFn = fn + '_mean_gamma.csv'
stimFn = fn + '_stim_counts.csv'
unstimFn = fn + '_unstim_counts... | mit |
scls19fr/morse-talk | morse_talk/cli_mplot.py | 1 | 1208 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A Morse Binary CLI plotter
Copyright (C) 2015 by
Sébastien Celles <s.celles@gmail.com>
All rights reserved.
Usage:
$ mplot -m "MORSE CODE"
"""
import argparse
import matplotlib.pyplot as plt
import morse_talk as mtalk
import morse_talk.plot as mplot
from morse_tal... | gpl-2.0 |
mequanta/z-runner | examples/quanto/fundamental_data_algorithm.py | 1 | 4843 | """
Trading Strategy using Fundamental Data
1. Filter the top 50 companies by market cap
2. Find the top two sectors that have the highest average PE ratio
3. Every month exit all the positions before entering new ones at the month
4. Log the positions that we need
"""
from zipline.api import date... | agpl-3.0 |
hbhzwj/GAD | tools/FSDataVisualizer.py | 1 | 1208 | #!/usr/bin/env python
from __future__ import print_function, division
import sys; sys.path.append('../')
from Detector.Data import MEM_FS
# from pylab import *
import matplotlib.pyplot as plt
class Visualizer(MEM_FS):
# def __init__(self, f_name):
# self.f_name = f_name
# data, self.keys = RawParse... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/pandas/io/json/normalize.py | 3 | 9363 | # ---------------------------------------------------------------------
# JSON normalization routines
import copy
from collections import defaultdict
import numpy as np
from pandas._libs.writers import convert_json_to_lines
from pandas import compat, DataFrame
def _convert_to_line_delimits(s):
"""Helper functio... | mit |
rkwitt/quicksilver | 3rd_party_software/pyca/Examples/ROFTV.py | 1 | 7180 | from PyCA.Core import *
import PyCA.Common as common
import PyCA.Display as display
import numpy as np
import matplotlib.pyplot as plt
#
# Allocate all necessary data
#
def InitializeData(grid, mType):
global scratchI
scratchI = Image3D(grid, mType)
global dxf
dxf = Image3D(grid, mType)
global dy... | apache-2.0 |
kastnerkyle/PyCon2015 | matrix_factorization.py | 2 | 6591 | # (C) Kyle Kastner, June 2014
# License: BSD 3 clause
# Latest version can be found at:
# https://gist.github.com/kastnerkyle/9341182
import numpy as np
from scipy import sparse
def minibatch_indices(X, minibatch_size):
minibatch_indices = np.arange(0, len(X), minibatch_size)
minibatch_indices = np.asarray(l... | bsd-3-clause |
boland1992/SeisSuite | build/lib.linux-x86_64-2.7/seissuite/spectrum/network_spectrum.py | 8 | 15670 | # -*- coding: utf-8 -*-
"""
Created on Fri July 6 11:04:03 2015
@author: boland
"""
import os
import glob
import scipy
import datetime
import numpy as np
import datetime as dt
import multiprocessing as mp
import matplotlib.pyplot as plt
from numpy.lib.stride_tricks import as_strided
from numpy.fft import rfft, irfft
... | gpl-3.0 |
ky822/scikit-learn | sklearn/__check_build/__init__.py | 345 | 1671 | """ Module to give helpful messages to the user that did not
compile the scikit properly.
"""
import os
INPLACE_MSG = """
It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.""... | bsd-3-clause |
arthurmensch/modl | exps/exp_decompose_images.py | 1 | 3480 | # Author: Arthur Mensch
# License: BSD
import os
from os.path import join
import matplotlib.pyplot as plt
from sacred import Experiment
from sacred.observers import FileStorageObserver
from modl.datasets.image import load_image
from modl.decomposition.image import ImageDictFact, DictionaryScorer
from modl.feature_ext... | bsd-2-clause |
areeda/gwpy | examples/signal/qscan.py | 3 | 3247 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) Alex Urban (2019-2020)
#
# This file is part of GWpy.
#
# GWpy 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
... | gpl-3.0 |
kdaily/cloudbiolinux | installed_files/ipython_config.py | 15 | 14156 | # Configuration file for ipython.
c = get_config()
c.InteractiveShell.autoindent = True
c.InteractiveShell.colors = 'Linux'
c.InteractiveShell.confirm_exit = False
c.AliasManager.user_aliases = [
('ll', 'ls -l'),
('lt', 'ls -ltr'),
]
#------------------------------------------------------------------------------
#... | mit |
saquiba2/numpytry | doc/source/conf.py | 63 | 9811 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
import sys, os, re
# Check Sphinx version
import sphinx
if sphinx.__version__ < "1.0.1":
raise RuntimeError("Sphinx 1.0.1 or newer required")
needs_sphinx = '1.0'
# ----------------------------------------------------------... | bsd-3-clause |
poryfly/scikit-learn | examples/exercises/plot_iris_exercise.py | 323 | 1602 | """
================================
SVM Exercise
================================
A tutorial exercise for using different SVM kernels.
This exercise is used in the :ref:`using_kernels_tut` part of the
:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`.
"""
print(__doc__)
import numpy as np
i... | bsd-3-clause |
kernc/scikit-learn | examples/ensemble/plot_gradient_boosting_quantile.py | 392 | 2114 | """
=====================================================
Prediction Intervals for Gradient Boosting Regression
=====================================================
This example shows how quantile regression can be used
to create prediction intervals.
"""
import numpy as np
import matplotlib.pyplot as plt
from skle... | bsd-3-clause |
samuel1208/scikit-learn | sklearn/decomposition/nmf.py | 16 | 19101 | """ Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# NMF implementation)
# Author: Anthony Di Franco (original Python and NumPy port)
# License: BSD 3 clause
from __future__ ... | bsd-3-clause |
amybingzhao/basic-rr-monitor | test/interrupt.py | 1 | 6582 | import peakutils
import RPi.GPIO as GPIO
import time
import Adafruit_ADS1x15
from collections import deque
from subprocess import call
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figu... | mit |
ShangLanyu/shanglanyu.github.io | markdown_generator/talks.py | 199 | 4000 |
# coding: utf-8
# # Talks markdown generator for academicpages
#
# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_i... | mit |
muxiaobai/CourseExercises | python/tianchi/20180201yancheng/201802/model20180226answer.py | 1 | 2687 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
#https://www.kaggle.com/dansbecker/selecting-and-filtering-in-pandas
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from sklearn import cross_validation
... | gpl-2.0 |
capergroup/bayou | src/main/python/bayou/experiments/embed/infer.py | 1 | 2617 | # Copyright 2017 Rice University
#
# 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 writin... | apache-2.0 |
rs2/pandas | pandas/tests/frame/test_nonunique_indexes.py | 2 | 17501 | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, MultiIndex, Series, date_range
import pandas._testing as tm
class TestDataFrameNonuniqueIndexes:
def test_column_dups_operations(self):
def check(result, expected=None):
if expected is not None:
... | bsd-3-clause |
lemiere/python-lecture | tp_aleatoire/correction/distribution.py | 1 | 1837 | #!/usr/bin/python3.5
# -*- coding: utf-8 -*-
# Lemiere Yves
# Juillet 2017
import matplotlib.pyplot as plt
import random
import math
def bunch_of_random_real(param_min,param_max,number_of_sample):
tmp_list = []
for i in range(number_of_sample):
tmp_list.append(random.uniform(param_min,param_max))
... | gpl-3.0 |
chintak/scikit-image | skimage/feature/tests/test_util.py | 1 | 2735 | import numpy as np
import matplotlib.pyplot as plt
from numpy.testing import assert_equal, assert_raises
from skimage.feature.util import (FeatureDetector, DescriptorExtractor,
_prepare_grayscale_input_2D,
_mask_border_keypoints, plot_matches)
def t... | bsd-3-clause |
alheinecke/tensorflow-xsmm | tensorflow/contrib/metrics/python/kernel_tests/histogram_ops_test.py | 130 | 9577 | # 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 |
YinongLong/scikit-learn | examples/svm/plot_svm_margin.py | 318 | 2328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM Margins Example
=========================================================
The plots below illustrate the effect the parameter `C` has
on the separation line. A large value of `C` basically tells
our model that w... | bsd-3-clause |
odejesush/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 5 | 64267 | # 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 |
michaelStettler/HISI | HISI/run_mnist_HISI.py | 1 | 5512 | import sys
import numpy as np
import matplotlib.pylab as plt
import scipy.misc
from HISI import *
import datetime
from multiprocessing import Process
# mnist
# data = np.load("Stimuli/mnist_test.npy")
data = np.load("Stimuli/mnist_test_4bar.npy")
# data = np.load("Stimuli/mnist_train_3bar.npy")
# data = np.load("Stimu... | mit |
Transkribus/TranskribusDU | TranskribusDU/util/metrics.py | 1 | 9562 |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Jochen Wersdorfer <jochen@wersdoerfer.de>
# Lars Buitinck
# Joel Nothman <joel.nothma... | bsd-3-clause |
kashif/scikit-learn | sklearn/linear_model/randomized_l1.py | 3 | 23475 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
kagayakidan/scikit-learn | sklearn/linear_model/sag.py | 64 | 9815 | """Solvers for Ridge and LogisticRegression using SAG algorithm"""
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
#
# Licence: BSD 3 clause
import numpy as np
import warnings
from ..utils import ConvergenceWarning
from ..utils import check_array
from .base import make_dataset
from .sgd_fast import Log, Squ... | bsd-3-clause |
wanggang3333/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 264 | 1804 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
procoder317/scikit-learn | examples/exercises/plot_cv_digits.py | 232 | 1206 | """
=============================================
Cross-validation on Digits Dataset Exercise
=============================================
A tutorial exercise using Cross-validation with an SVM on the Digits dataset.
This exercise is used in the :ref:`cv_generators_tut` part of the
:ref:`model_selection_tut` section... | bsd-3-clause |
LIKAIMO/MissionPlanner | Lib/site-packages/scipy/stats/distributions.py | 53 | 207806 | # Functions to implement several important functions for
# various Continous and Discrete Probability Distributions
#
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
import math
import warnings
from copy import copy
from scipy.misc import comb, derivative
from s... | gpl-3.0 |
mvaz/PyData2016-Amsterdam | compute.py | 1 | 3634 | import pandas as pd
from arctic.date import DateRange
from datetime import datetime as dt
def iterate_stocks(lib, snapshot=None, date_range=None):
for sym in lib.list_symbols(snapshot=snapshot):
yield lib.read(sym, as_of=snapshot, date_range=date_range)
def loop_return_computation(lib, snapshot='alpha')... | mit |
CamDavidsonPilon/lifelines | lifelines/tests/test_estimation.py | 1 | 233306 | # -*- coding: utf-8 -*-
import warnings
from io import StringIO, BytesIO as stringio
from collections.abc import Iterable
from itertools import combinations
from collections import Counter
import pickle
import os
import numpy as np
import pandas as pd
import pytest
from scipy.stats import weibull_min, norm, logistic... | mit |
nhmc/xastropy | xastropy/xguis/spec_guis.py | 1 | 45369 | """
#;+
#; NAME:
#; spec_guis
#; Version 1.0
#;
#; PURPOSE:
#; Module for Spectroscopy Guis with QT
#; These call pieces from spec_widgets
#; 12-Dec-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, ... | bsd-3-clause |
jseabold/scikit-learn | sklearn/covariance/__init__.py | 389 | 1157 | """
The :mod:`sklearn.covariance` module includes methods and algorithms to
robustly estimate the covariance of features given a set of points. The
precision matrix defined as the inverse of the covariance is also estimated.
Covariance estimation is closely related to the theory of Gaussian Graphical
Models.
"""
from ... | bsd-3-clause |
loli/semisupervisedforests | sklearn/tree/export.py | 30 | 4529 | """
This module defines export functions for decision trees.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Dawe <noel@dawe.me>
# Satrajit Gosh <satrajit.ghosh@gmail.com>
# Licence: BSD 3 ... | bsd-3-clause |
hsiaoyi0504/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
fengzhyuan/scikit-learn | examples/calibration/plot_compare_calibration.py | 241 | 5008 | """
========================================
Comparison of Calibration of Classifiers
========================================
Well calibrated classifiers are probabilistic classifiers for which the output
of the predict_proba method can be directly interpreted as a confidence level.
For instance a well calibrated (bi... | bsd-3-clause |
zfrenchee/pandas | pandas/core/indexes/datetimelike.py | 1 | 30137 | """
Base and utility classes for tseries type pandas objects.
"""
import warnings
from datetime import datetime, timedelta
from pandas import compat
from pandas.compat.numpy import function as nv
from pandas.core.tools.timedeltas import to_timedelta
import numpy as np
from pandas.core.dtypes.common import (
_ens... | bsd-3-clause |
RuanJG/paparazzi | sw/airborne/test/ahrs/ahrs_utils.py | 86 | 4923 | #! /usr/bin/env python
# Copyright (C) 2011 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 your option)
# any later ... | gpl-2.0 |
dipteam/wcad | wcad/model_plotterc.py | 1 | 10816 | #!/usr/bin/env python2
#
# Copyright 2015 by Ss Cyril and Methodius University in Skopje, Macedonia
# Copyright 2015 by Idiap Research Institute in Martigny, Switzerland
#
# See the file COPYING for the licence associated with this software.
#
# Author(s):
# Branislav Gerazov, October 2015
# Aleksandar Gjoreski, O... | gpl-3.0 |
PiotrGrzybowski/NeuralNetworks | networks/neurons/patest.py | 1 | 7722 | import matplotlib.pyplot as plt
import numpy as np
# with open("configs/adaline_and.yml", 'r') as yml_file:
# config = yaml.load(yml_file)
#
# training_set_config = config['data_set']['training_data']
# validation_set_config = config['data_set']['validation_data']
# neuron_config = config['neuron']
# optimizer_co... | apache-2.0 |
bjackman/lisa | libs/utils/analysis/tasks_analysis.py | 2 | 29151 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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
#
# ... | apache-2.0 |
wdv4758h/ZipPy | edu.uci.python.benchmark/src/benchmarks/sympy/sympy/plotting/tests/test_plot_implicit.py | 17 | 2600 | import warnings
from sympy import (plot_implicit, cos, Symbol, Eq, sin, re, And, Or, exp, I,
tan, pi)
from sympy.plotting.plot import unset_show
from tempfile import NamedTemporaryFile
from sympy.utilities.pytest import skip
from sympy.external import import_module
#Set plots not to show
unset_show(... | bsd-3-clause |
qiime2/q2-diversity | q2_diversity/plugin_setup.py | 1 | 39197 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
atztogo/phonopy | test/spectrum/test_dynamic_structure_factor.py | 1 | 8367 | import unittest
import numpy as np
from phonopy.api_phonopy import Phonopy
from phonopy.spectrum.dynamic_structure_factor import atomic_form_factor_WK1995
from phonopy import load
import os
data_dir = os.path.dirname(os.path.abspath(__file__))
# D. Waasmaier and A. Kirfel, Acta Cryst. A51, 416 (1995)
# f(Q) = \sum_i... | bsd-3-clause |
jcrist/blaze | blaze/server/serialization.py | 10 | 1069 | from collections import namedtuple
from functools import partial
import json as json_module
import pandas.msgpack as msgpack_module
from ..compatibility import pickle as pickle_module, unicode
from ..utils import json_dumps
SerializationFormat = namedtuple('SerializationFormat', 'name loads dumps')
def _coerce_st... | bsd-3-clause |
jonyroda97/redbot-amigosprovaveis | lib/matplotlib/testing/determinism.py | 2 | 4923 | """
Provides utilities to test output reproducibility.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import io
import os
import re
import sys
from subprocess import check_output
import pytest
import matplotlib
from matplotlib import pypl... | gpl-3.0 |
dataplumber/nexus | analysis/webservice/algorithms/TimeSeries.py | 1 | 23587 | """
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology. All rights reserved
"""
import calendar
import logging
import traceback
from cStringIO import StringIO
from datetime import datetime
from multiprocessing.dummy import Pool, Manager
import matplotlib.dates as mdates
import matplotlib... | apache-2.0 |
meduz/scikit-learn | examples/applications/wikipedia_principal_eigenvector.py | 50 | 7817 | """
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | bsd-3-clause |
vortex-exoplanet/VIP | docs/source/conf.py | 2 | 11168 | # -*- coding: utf-8 -*-
#
# VIP - Vortex Image Processing documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 19 13:08:16 2016.
#
# 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
# aut... | mit |
biocore/qiita | qiita_db/metadata_template/test/test_util.py | 2 | 41564 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
fabioticconi/scikit-learn | examples/linear_model/plot_huber_vs_ridge.py | 127 | 2206 | """
=======================================================
HuberRegressor vs Ridge on dataset with strong outliers
=======================================================
Fit Ridge and HuberRegressor on a dataset with outliers.
The example shows that the predictions in ridge are strongly influenced
by the outliers p... | bsd-3-clause |
josherick/bokeh | examples/interactions/interactive_bubble/gapminder.py | 20 | 4375 | import pandas as pd
from jinja2 import Template
from bokeh.browserlib import view
from bokeh.models import (
ColumnDataSource, Plot, Circle, Range1d,
LinearAxis, HoverTool, Text,
SingleIntervalTicker,
)
from bokeh.models.actions import Callback
from bokeh.models.widgets import Slider
from bokeh.palettes i... | bsd-3-clause |
sassoftware/saspy | saspy/sasiohttp.py | 1 | 75045 | #
# Copyright SAS Institute
#
# 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 writing... | apache-2.0 |
aolindahl/aolPyModules | cookie_box.py | 1 | 16382 | import numpy as np
import tof
from configuration import loadConfiguration as loadConfig
from aolUtil import struct
import sys
import random
import lmfit
from burning_detectors import projector
import simplepsana
# A bunch of methods to take care of the cookie box data
_source_dict = {}
def get_source(source_string):
... | gpl-2.0 |
combust-ml/mleap | python/tests/sklearn/feature_extraction/text_test.py | 2 | 3803 | import json
import os
import shutil
import tempfile
import unittest
import uuid
from mleap.sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
class TransformerTests(unittest.TestCase):
def setUp(self):
self.tmp_dir = tempfile.mkdtemp()
self.docs = ['test']
self.tfid... | apache-2.0 |
abhishekkrthakur/scikit-learn | examples/linear_model/plot_sparse_recovery.py | 243 | 7461 | """
============================================================
Sparse recovery: feature selection for sparse linear models
============================================================
Given a small number of observations, we want to recover which features
of X are relevant to explain y. For this :ref:`sparse linear ... | bsd-3-clause |
boada/astlib_dev | examples/cosmologyTest/cosmologyTest.py | 2 | 1371 | #!/usr/bin/env python
#File: cosmologyTest/cosmologyTest.py
#Created: Sat Dec 15 17:23:27 2012
#Last Change: Sat Dec 15 17:25:32 2012
# -*- coding: utf-8 -*-
#
# Tests astCalc routines
from astLib import astCalc
import numpy
import pylab
import IPython
import sys
pylab.matplotlib.interactive(True)
omegaMs = [1.0, 0.2... | lgpl-2.1 |
rahuldhote/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 303 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
dpinney/omf | omf/scratch/disaggDataGeneration/nilmtk/code/generateOmfDisaggCSV.py | 1 | 5976 | import csv, glob
import pandas as pd
# user provided constants -----------------------------------------------------
FRACTION_DATA_TRAIN = 0.6
SAMPLE_RATE_SECS = 60
COL_NAMES = ['time','power','appliance']
INPUT_FILES_PATH = './NetZeroEnergyHouseSim/out_*'
OUTPUT_FILENAME_TRAIN = 'disaggTraining.csv'
OUTPUT_FILENAM... | gpl-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/backends/backend_wxagg.py | 10 | 5840 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import matplotlib
from matplotlib.figure import Figure
from .backend_agg import FigureCanvasAgg
from . import wx_compat as wxc
from . import backend_wx
from .backend_wx import (FigureManagerWx, Fi... | gpl-3.0 |
lbishal/scikit-learn | sklearn/svm/tests/test_bounds.py | 280 | 2541 | import nose
from nose.tools import assert_equal, assert_true
from sklearn.utils.testing import clean_warning_registry
import warnings
import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression... | bsd-3-clause |
nathanpucheril/PyBayes | PyBayes/BayesNet.py | 1 | 4864 | # Bayes Net Implementation
# ________________________
# @author Nathan Pucheril
# @author Keith Hardaway
from copy import deepcopy, copy
import networkx as nx
from PyBayes.ProbabilityTable import *
from warnings import warn
class BayesNet(object):
""" Bayes Net Implementation
Usage:
-
... | apache-2.0 |
poldracklab/mriqc | mriqc/classifier/sklearn/cv_nested.py | 1 | 14009 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: oesteban
# @Date: 2015-11-19 16:44:27
"""
=====================
Extensions to sklearn
=====================
Extends sklearn's GridSearchCV to a model search object
"""
import warnings
import numbers
import time
from functools import partial
from collectio... | bsd-3-clause |
valexandersaulys/airbnb_kaggle_contest | prototype_alpha/gradientBoost_take4.py | 1 | 4305 | """
Take 4 on the Gradient Boost, predicting for country_destinations.
"""
import pandas as pd
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.cross_validation import train_test_split
# ------------- Build create_submission function
def create_submission_format(df,dummies):
# Columns --> ['id'... | gpl-2.0 |
google-research/dads | unsupervised_skill_learning/dads_off.py | 1 | 69071 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
artmusic0/theano-learning.part03 | training data.new/pack_v7.py | 1 | 1824 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 24 04:03:19 2015
@author: winpython
"""
from matplotlib.pyplot import imshow
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import pickle as cPickle
import gzip
# read filename tag
my_data = np.genfromtxt('data.csv', delimiter = ',')
final_out... | gpl-3.0 |
ChanderG/scikit-learn | sklearn/metrics/cluster/tests/test_unsupervised.py | 230 | 2823 | import numpy as np
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn.metrics.cluster.unsupervised import silhouette_score
from sklearn.metrics import pairwise_distances
from sklearn.utils.testing import assert_false, assert_almost_equal
from sklearn.utils.testing import assert_raises_regexp... | bsd-3-clause |
zorojean/scikit-learn | benchmarks/bench_plot_incremental_pca.py | 374 | 6430 | """
========================
IncrementalPCA benchmark
========================
Benchmarks for IncrementalPCA
"""
import numpy as np
import gc
from time import time
from collections import defaultdict
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_lfw_people
from sklearn.decomposition import Incre... | bsd-3-clause |
Nyker510/scikit-learn | examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py | 252 | 3490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
==============================================================================
Gaussian Processes classification example: exploiting the probabilistic output
==============================================================================
A two-dimensional regression exerci... | bsd-3-clause |
espenhgn/LFPy | examples/example_loadL5bPCmodelsEH.py | 1 | 3701 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example script loading and execiting a simulation with the
Hay et al. 2011 L5b-pyramidal cell model, which is implemented by default
using templates.
This script assume that the model files is downloaded and unzipped inside
this folder from ModelDB:
http://senselab.med... | gpl-3.0 |
spbguru/repo1 | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_ps.py | 69 | 50262 | """
A PostScript backend, which can produce both PostScript .ps and .eps
"""
from __future__ import division
import glob, math, os, shutil, sys, time
def _fn_name(): return sys._getframe(1).f_code.co_name
try:
from hashlib import md5
except ImportError:
from md5 import md5 #Deprecated in 2.5
from tempfile im... | gpl-3.0 |
Adai0808/scikit-learn | sklearn/metrics/cluster/__init__.py | 312 | 1322 | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... | bsd-3-clause |
YingYang/STFT_R_git_repo | STFT_R/test/test_optim_tree_group_lasso_duality.py | 1 | 12938 | import matplotlib.pyplot as plt
import numpy as np
from mne.inverse_sparse.mxne_optim import _Phi, _PhiT
import os,sys,inspect
# for my desktop
os.chdir('/home/ying/Dropbox/MEG_source_loc_proj/STFT_R_git_repo/')
# for my laptop
#os.chdir('/home/yingyang/Dropbox/MEG_source_loc_proj/stft_tree_group_lasso/')
currentdir = ... | gpl-3.0 |
intel-analytics/analytics-zoo | pyzoo/zoo/examples/anomalydetection/anomaly_detection.py | 1 | 3293 | #
# Copyright 2018 Analytics Zoo 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 law or agreed to... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.