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 |
|---|---|---|---|---|---|
dominikwille/comp | sheet9/sheet09.py | 1 | 4151 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
#
# @author Dominik Wille
# @author Stefan Pojtinger
# @tutor Alexander Schlaich
# @sheet 9
#
#Packete einlesen:
import numpy as np
import matplotlib.pyplot as plt
from scipy import special
#Aufgabe 9.1.1:
def next(Fx, Fy, vx, vy, t, h, g, k):
K1x = Fx(t, vx, vy, k,... | bsd-2-clause |
MartinDelzant/scikit-learn | sklearn/ensemble/voting_classifier.py | 178 | 8006 | """
Soft Voting/Majority Rule classifier.
This module contains a Soft Voting/Majority Rule classifier for
classification estimators.
"""
# Authors: Sebastian Raschka <se.raschka@gmail.com>,
# Gilles Louppe <g.louppe@gmail.com>
#
# Licence: BSD 3 clause
import numpy as np
from ..base import BaseEstimator
f... | bsd-3-clause |
IndraVikas/scikit-learn | sklearn/externals/joblib/parallel.py | 86 | 35087 | """
Helpers for embarrassingly parallel code.
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
from __future__ import division
import os
import sys
import gc
import warnings
from math import sqrt
import functools
import time
import thr... | bsd-3-clause |
khalidm/hiplexpipe | scripts/alignment_stats.py | 1 | 9100 | import argparse
import os
import time
import logging as log
import pandas as pd
import yaml
import subprocess
#import matplotlib
from os import listdir
from os.path import isfile, join
#matplotlib.use('Agg') # non-interactive backend
#import matplotlib.pyplot as plt
#import seaborn as sns
import numpy as np
from st... | mit |
jjdmol/LOFAR | CEP/PyBDSM/src/python/cleanup.py | 1 | 1638 | """
Does miscellaneous jobs at the end, which assumes all other tasks are run.
"""
import numpy as N
import os
from image import *
import mylogger, os
from . import has_pl
if has_pl:
import matplotlib.pyplot as pl
import matplotlib.cm as cm
import functions as func
class Op_cleanup(Op):
""" """
... | gpl-3.0 |
theoryno3/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 |
phdowling/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | 121 | 3429 | """
Testing for mean shift clustering methods
"""
import numpy as np
import warnings
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import asser... | bsd-3-clause |
yonglehou/scikit-learn | sklearn/metrics/tests/test_common.py | 83 | 41144 | from __future__ import division, print_function
from functools import partial
from itertools import product
import numpy as np
import scipy.sparse as sp
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils.multiclass import type_of_target
fro... | bsd-3-clause |
thdtjsdn/FreeCAD | src/Mod/Plot/Plot.py | 16 | 12328 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
abhisg/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
AlexRobson/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 |
msrconsulting/atm-py | atmPy/for_removal/POPS/mie.py | 6 | 51426 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This temporary script file is located here:
/Users/htelg/.spyder2/.temp.py
"""
#ToDo
#- ich denke nicht, dass wir neutral nehen muessen .. unserer laser is polarisiert ...
#- indes of refraction at 405 nm for psl
#- results plotten
# Check using http://omlc.ogi.edu/calc/mie_... | mit |
mavenlin/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/pandas_io_test.py | 111 | 7865 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/matplotlib/tri/triinterpolate.py | 10 | 66366 | """
Interpolation inside triangular grids.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange
from matplotlib.tri import Triangulation
from matplotlib.tri.trifinder import TriFinder
from matplotlib.tri.tritools impor... | gpl-3.0 |
joernhees/scikit-learn | sklearn/tree/export.py | 16 | 18309 | """
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>
# Trevor... | bsd-3-clause |
fbagirov/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 |
agua/StarClusterDev | starcluster/balancers/sge/visualizer.py | 1 | 2166 | #!/usr/bin/env python
"""
StarCluster SunGrinEngine stats visualizer module
"""
import os
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
from starcluster.logger import log
class SGEVisualizer(object):
"""
Stats Visualizer for SGE Load Balancer
stats_file - file containin... | gpl-3.0 |
dsquareindia/scikit-learn | examples/svm/plot_iris.py | 65 | 3742 | """
==================================================
Plot different SVM classifiers in the iris dataset
==================================================
Comparison of different linear SVM classifiers on a 2D projection of the iris
dataset. We only consider the first 2 features of this dataset:
- Sepal length
- Se... | bsd-3-clause |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/pandas/core/indexes/frozen.py | 20 | 4619 | """
frozen (immutable) data structures to support MultiIndexing
These are used for:
- .names (FrozenList)
- .levels & .labels (FrozenNDArray)
"""
import numpy as np
from pandas.core.base import PandasObject
from pandas.core.dtypes.cast import coerce_indexer_dtype
from pandas.io.formats.printing import pprint_thing
... | agpl-3.0 |
xyguo/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 7 | 9510 | import numpy as np
from scipy import linalg
from sklearn.decomposition import (NMF, ProjectedGradientNMF,
non_negative_factorization)
from sklearn.decomposition import nmf # For testing internals
from scipy.sparse import csc_matrix
from sklearn.utils.testing import assert_true
from... | bsd-3-clause |
mblondel/scikit-learn | sklearn/decomposition/tests/test_fastica.py | 3 | 7919 | """
Test the fastica algorithm.
"""
import itertools
import warnings
import numpy as np
from scipy import stats
from nose.tools import assert_raises
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from skl... | bsd-3-clause |
rs2/pandas | pandas/tests/indexes/categorical/test_formats.py | 2 | 5742 | """
Tests for CategoricalIndex.__repr__ and related methods.
"""
import pandas._config.config as cf
import pandas as pd
class TestCategoricalIndexRepr:
def test_string_categorical_index_repr(self):
# short
idx = pd.CategoricalIndex(["a", "bb", "ccc"])
expected = """CategoricalIndex(['a', ... | bsd-3-clause |
celiacintas/candela_maps | pie_maps.py | 1 | 5213 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class MainDisplay(object):
"""docstring for MainDisplay"""
def __init__(self, figsize=(11.7,8.3)):
super(Main... | gpl-2.0 |
dev-coop/machine-learning | playing_around5.py | 1 | 3420 | '''
Working with my personal data again, using sk-learn
Thanks mchan on freenode ##machine-learning for guiding me on rolling window and such
'''
from sklearn import tree, linear_model, neighbors, cross_validation
import pandas as pd
import numpy
data_labels = ["Happiness", "Motivation", "Flexibility", "Strength", ... | mit |
aminert/scikit-learn | benchmarks/bench_20newsgroups.py | 377 | 3555 | from __future__ import print_function, division
from time import time
import argparse
import numpy as np
from sklearn.dummy import DummyClassifier
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.metrics import accuracy_score
from sklearn.utils.validation import check_array
from sklearn.ensemb... | bsd-3-clause |
Featuretools/featuretools | featuretools/entityset/deserialize.py | 1 | 8042 | import json
import os
import tarfile
import tempfile
from pathlib import Path
import boto3
import pandas as pd
from featuretools.entityset.relationship import Relationship
from featuretools.entityset.serialize import FORMATS
from featuretools.utils.gen_utils import (
check_schema_version,
use_s3fs_es,
use... | bsd-3-clause |
mhdella/scikit-learn | sklearn/semi_supervised/tests/test_label_propagation.py | 307 | 1974 | """ test the label propagation module """
import nose
import numpy as np
from sklearn.semi_supervised import label_propagation
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
ESTIMATORS = [
(label_propagation.LabelPropagation, {'kernel': 'rbf'}),
(label_propa... | bsd-3-clause |
juanamari94/mlaas-example | main.py | 1 | 4398 | #!flask/bin/python
import os
from flask import Flask, render_template, request, Markup
import csv
from sklearn import linear_model
from werkzeug.utils import secure_filename
from models import SupervisedBinaryClassificationModel, SupervisedEstimationModel
UPLOAD_FOLDER = os.getcwd() + '/datasets'
ALLOWED_EXTENSIONS = ... | mit |
ishanic/scikit-learn | examples/ensemble/plot_forest_importances.py | 241 | 1761 | """
=========================================
Feature importances with forests of trees
=========================================
This examples shows the use of forests of trees to evaluate the importance of
features on an artificial classification task. The red bars are the feature
importances of the forest, along wi... | bsd-3-clause |
Myasuka/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/HardContact_NonLinHardSoftShear/Shear_Zone_Length/SZ_h_1e4/Normal_Stress_Plot.py | 72 | 2800 | #!/usr/bin/python
import h5py
import matplotlib.pylab as plt
import matplotlib as mpl
import sys
import numpy as np;
import matplotlib;
import math;
from matplotlib.ticker import MaxNLocator
plt.rcParams.update({'font.size': 28})
# set tick width
mpl.rcParams['xtick.major.size'] = 10
mpl.rcParams['xtick.major.width']... | cc0-1.0 |
activitynet/ActivityNet | Evaluation/eval_classification.py | 1 | 9960 | import json
import urllib2
import numpy as np
import pandas as pd
from utils import get_blocked_videos
from utils import interpolated_prec_rec
class ANETclassification(object):
GROUND_TRUTH_FIELDS = ['database', 'taxonomy', 'version']
PREDICTION_FIELDS = ['results', 'version', 'external_data']
def __ini... | mit |
IssamLaradji/scikit-learn | sklearn/cluster/tests/test_hierarchical.py | 10 | 11608 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012
# License: BSD 3 clause
from tempfile import mkdtemp
import warnings
import numpy as np
from scipy import sparse
from scipy.cluster import hierarchy
from sklearn.utils.testing import assert_true
fr... | bsd-3-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/core/missing.py | 7 | 21165 | """
Routines for filling missing data
"""
import numpy as np
from distutils.version import LooseVersion
import pandas.algos as algos
import pandas.lib as lib
from pandas.compat import range, string_types
from pandas.types.common import (is_numeric_v_string_like,
is_float_dtype, is_dat... | gpl-3.0 |
antoinecarme/pyaf | tests/bugs/issue_58/issue_58_1_categorical_exogenous.py | 1 | 1382 | import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
b1 = tsds.load_ozone_exogenous_categorical()
df = b1.mPastData
print(b1.mExogenousDataFrame.Exog2.cat.categories)
print(b1.mExogenousDataFrame.Exog3.cat.categories)
print(b1.mExogenousDataFrame.Exog4.cat.... | bsd-3-clause |
soulmachine/scikit-learn | sklearn/decomposition/pca.py | 1 | 22689 | """ Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
#
# License: BSD 3 clause
from math import log, sqrt
import numpy... | bsd-3-clause |
mjabri/holoviews | holoviews/element/annotation.py | 1 | 6814 | import numpy as np
import param
from ..core import Dimension, Element2D
class Annotation(Element2D):
"""
An Annotation is a special type of element that is designed to be
overlaid on top of any arbitrary 2D element. Annotations have
neither key nor value dimensions allowing them to be overlaid over
... | bsd-3-clause |
bert9bert/statsmodels | statsmodels/tsa/tests/test_tsa_indexes.py | 2 | 29988 | """
Test index support in time series models
1. Test support for passing / constructing the underlying index in __init__
2. Test wrapping of output using the underlying index
3. Test wrapping of prediction / forecasting using the underlying index or
extensions of it.
Author: Chad Fulton
License: BSD-3
"""
from __f... | bsd-3-clause |
spallavolu/scikit-learn | examples/decomposition/plot_ica_blind_source_separation.py | 349 | 2228 | """
=====================================
Blind source separation using FastICA
=====================================
An example of estimating sources from noisy data.
:ref:`ICA` is used to estimate sources given noisy measurements.
Imagine 3 instruments playing simultaneously and 3 microphones
recording the mixed si... | bsd-3-clause |
Anveling/sp17-i524 | project/S17-IO-3017/code/projectearth/dbscanplot.py | 5 | 3603 | from pymongo import MongoClient
import requests
import time
import dblayer
from sklearn.cluster import DBSCAN
import plotly
import plotly.graph_objs as go
import pandas as pd
import numpy as np
import random
# Create random colors in list
color_list = []
def generate_color(ncluster):
for i in range(ncluster):
... | apache-2.0 |
akrherz/dep | scripts/util/huc12_summary.py | 2 | 2547 | """Generate DEP summary."""
from calendar import month_abbr
from pyiem.dep import read_env
from pyiem.util import get_dbconn
import pandas as pd
from pandas.io.sql import read_sql
from tqdm import tqdm
def main():
"""Go Main Go."""
dbconn = get_dbconn("idep")
gpd = read_sql(
"SELECT huc_12 from h... | mit |
vshtanko/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 |
xray/xray | xarray/core/variable.py | 1 | 98528 | import copy
import functools
import itertools
import numbers
import warnings
from collections import defaultdict
from datetime import timedelta
from distutils.version import LooseVersion
from typing import (
Any,
Dict,
Hashable,
Mapping,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
)
... | apache-2.0 |
andycasey/snob | articles/chemical-tagging-gmm/experiments/early-on/experiment_v0.py | 1 | 3997 |
import numpy as np
from astropy.table import Table
from snob import mixture_ka as snob
from sklearn import mixture
catalog = Table.read("catalog.fits")
realisations = {}
# Number of Monte-Carlo realisations to do for each number of true clusters
M = 10
# Number of potential clusters.
N = len(set(catalog["group... | mit |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_epochs_to_data_frame.py | 4 | 8926 | """
.. _tut_io_export_pandas:
=================================
Export epochs to Pandas DataFrame
=================================
In this example the pandas exporter will be used to produce a DataFrame
object. After exploring some basic features a split-apply-combine
work flow will be conducted to examine the laten... | bsd-3-clause |
mhdella/scikit-learn | doc/sphinxext/gen_rst.py | 142 | 40026 | """
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from __future__ import division, print_function
from time import time
import ast
import os
import re
import shutil
import traceback
i... | bsd-3-clause |
google/ml-fairness-gym | environments/infectious_disease.py | 1 | 18237 | # coding=utf-8
# Copyright 2020 The ML Fairness Gym 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 |
licode/scikit-xray | doc/sphinxext/tests/test_docscrape.py | 12 | 14257 | # -*- encoding:utf-8 -*-
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
from docscrape_sphinx import SphinxDocString, SphinxClassDoc
from nose.tools import *
doc_txt = '''\
numpy.multivariate_normal(mean, cov, shape=No... | bsd-3-clause |
b-carter/numpy | numpy/core/function_base.py | 3 | 12116 | from __future__ import division, absolute_import, print_function
import warnings
import operator
from . import numeric as _nx
from .numeric import (result_type, NaN, shares_memory, MAY_SHARE_BOUNDS,
TooHardError,asanyarray)
__all__ = ['logspace', 'linspace', 'geomspace']
def _index_deprecate(... | bsd-3-clause |
bthirion/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py | 103 | 2017 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
QUANTAXIS/QUANTAXIS | QUANTAXIS_Test/QAFetch_Test/QAQuery_Option_Test.py | 2 | 5245 | import unittest
import pprint
from QUANTAXIS import QUANTAXIS as QA
from QUANTAXIS.QAUtil.QADate import *
from QUANTAXIS.QAUtil.QADate_trade import *
from QUANTAXIS.QASU.save_tdx import (QA_fetch_get_option_contract_time_to_market)
from QUANTAXIS.QAFetch.QATdx import (QA_fetch_get_commodity_option_M_contract_time_to_... | mit |
glouppe/scikit-learn | examples/mixture/plot_gmm_pdf.py | 284 | 1528 | """
=============================================
Density Estimation for a mixture of Gaussians
=============================================
Plot the density estimation of a mixture of two Gaussians. Data is
generated from two Gaussians with different centers and covariance
matrices.
"""
import numpy as np
import ma... | bsd-3-clause |
abimannans/scikit-learn | sklearn/ensemble/tests/test_bagging.py | 127 | 25365 | """
Testing for the bagging ensemble module (sklearn.ensemble.bagging).
"""
# Author: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.te... | bsd-3-clause |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/pandas/sparse/array.py | 5 | 16980 | """
SparseArray data structure
"""
from __future__ import division
# pylint: disable=E1101,E1103,W0231
from numpy import nan, ndarray
import numpy as np
from pandas.core.base import PandasObject
import pandas.core.common as com
from pandas import compat, lib
from pandas.compat import range
from pandas._sparse impor... | gpl-2.0 |
cbertinato/pandas | pandas/tests/io/parser/conftest.py | 1 | 1874 | import os
import pytest
from pandas import read_csv, read_table
class BaseParser:
engine = None
low_memory = True
float_precision_choices = []
def update_kwargs(self, kwargs):
kwargs = kwargs.copy()
kwargs.update(dict(engine=self.engine,
low_memory=self.lo... | bsd-3-clause |
CopyChat/Plotting | Python/netcdf_plot.py | 1 | 2250 | #!/usr/local/bin python
from Scientific.IO.NetCDF import NetCDFFile
import numpy as np
import math
import pylab as pl
import matplotlib as mpl
import matplotlib.pyplot as plt
## Open the file
file = NetCDFFile('/Users/tang/solar_energy/Modeling/test/output/SWIO_1_RAD.1979010100.nc', 'r')
#ifile2=sys.argv[3]
#exp2=sys... | gpl-3.0 |
gpu/CLBlast | scripts/benchmark/plot.py | 2 | 5558 | # This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This file follows the
# PEP8 Python style guide and uses a max-width of 120 characters per line.
#
# Author(s):
# Cedric Nugteren <www.cedricnugteren.nl>
import utils
import matplotlib
matplotlib.use('Agg')
from matplotlib... | apache-2.0 |
grehujt/SmallPythonProjects | ClusteringRelatedPosts/lda.py | 1 | 3073 |
import os
import scipy as sp
import nltk.stem
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.decomposition import LatentDirichletAllocation
from scipy.spatial import distance
import matplotlib.pyplot as plt
stemmer = nltk.stem.SnowballStemmer('english')
class StemmedTfidfVectorizer(TfidfVe... | mit |
mikebenfield/scikit-learn | sklearn/linear_model/randomized_l1.py | 4 | 25106 | """
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 |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/io/formats/test_printing.py | 8 | 7359 | # -*- coding: utf-8 -*-
import pytest
import numpy as np
import pandas as pd
from pandas import compat
import pandas.io.formats.printing as printing
import pandas.io.formats.format as fmt
import pandas.core.config as cf
def test_adjoin():
data = [['a', 'b', 'c'], ['dd', 'ee', 'ff'], ['ggg', 'hhh', 'iii']]
e... | apache-2.0 |
projectcuracao/projectcuracao | graphprep/powersupplygraph.py | 1 | 3688 | # power graph generation
# filename: powersupplygraph.py
# Version 1.3 09/12/13
#
# contains event routines for data collection
#
#
import sys
import time
import RPi.GPIO as GPIO
import gc
import datetime
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
from matplotlib im... | gpl-3.0 |
ville-k/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/dataframe_test.py | 62 | 3753 | # 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 |
bert9bert/statsmodels | statsmodels/compat/numpy.py | 2 | 17727 | """Compatibility functions for numpy versions in lib
np.unique
---------
Behavior changed in 1.6.2 and doesn't work for structured arrays if
return_index=True.
Only needed for this case, use np.unique otherwise
License:
np_unique below is copied form the numpy source before the change and is
distributed under the B... | bsd-3-clause |
behzadnouri/scipy | scipy/signal/filter_design.py | 6 | 122824 | """Filter design.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy
from numpy import (atleast_1d, poly, polyval, roots, real, asarray, allclose,
resize, pi, absolute, logspace, r_, sqrt, tan, log10,
arctan, arcsinh, sin, exp, cosh,... | bsd-3-clause |
luirink/yank | docs/conf.py | 1 | 9722 | # -*- coding: utf-8 -*-
#
# MDTraj documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 11 21:23:28 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | lgpl-3.0 |
JensWehner/votca-scripts | xtp/xtp_convergence_occP.py | 2 | 2825 | #!/usr/bin/env python
import sqlite3
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.patches as mpatches
import argparse as ap
from matplotlib.pyplot import cm
import itertools
import scipy.constants as ct
parser=ap.ArgumentParser(description="Check if occPs ha... | apache-2.0 |
anhaidgroup/py_entitymatching | py_entitymatching/dask/dask_rfmatcher.py | 1 | 1496 | """
This module contains the functions for Random Forest classifier.
"""
# from py_entitymatching.matcher.mlmatcher import MLMatcher
from py_entitymatching.dask.daskmlmatcher import DaskMLMatcher
from py_entitymatching.matcher.matcherutils import get_ts
from sklearn.ensemble import RandomForestClassifier
class Dask... | bsd-3-clause |
nicproulx/mne-python | examples/inverse/plot_morph_data.py | 15 | 2220 | """
==========================================================
Morph source estimates from one subject to another subject
==========================================================
A source estimate from a given subject 'sample' is morphed
to the anatomy of another subject 'fsaverage'. The output
is a source estimate ... | bsd-3-clause |
Mega-DatA-Lab/mxnet | python/mxnet/model.py | 17 | 39894 | # 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 |
PrashntS/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | 5170 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | bsd-3-clause |
asnir/airflow | airflow/contrib/hooks/salesforce_hook.py | 30 | 12110 | # -*- coding: utf-8 -*-
#
# 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, software
... | apache-2.0 |
BenSchannes/Epidemium | Regressor_blend_1.py | 1 | 2027 |
# REGRESSOR
from sklearn.base import BaseEstimator
from sklearn.pipeline import make_pipeline
from sklearn.ensemble import *
from sklearn.preprocessing import *
from sklearn import linear_model
from sklearn import svm
class Regressor(BaseEstimator):
def __init__(self):
self.clf1 = [make_pip... | mit |
icdishb/scikit-learn | sklearn/neighbors/regression.py | 39 | 10464 | """Nearest Neighbor Regression"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by Arna... | bsd-3-clause |
liangz0707/scikit-learn | sklearn/feature_extraction/image.py | 263 | 17600 | """
The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to
extract features from images.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel
# Vlad Niculae
# License: BSD 3 clause
fro... | bsd-3-clause |
arikpoz/mxnet | example/speech_recognition/stt_utils.py | 11 | 5031 | import logging
import os
import os.path
import numpy as np
import soundfile
from numpy.lib.stride_tricks import as_strided
logger = logging.getLogger(__name__)
def calc_feat_dim(window, max_freq):
return int(0.001 * window * max_freq) + 1
def conv_output_length(input_length, filter_size, border_mode, stride,... | apache-2.0 |
johannfaouzi/pyts | pyts/utils/utils.py | 1 | 5388 | """Code for utility tools."""
# Author: Johann Faouzi <johann.faouzi@gmail.com>
# License: BSD-3-Clause
import numpy as np
from numpy.lib.stride_tricks import as_strided
from numba import njit
from sklearn.utils import check_array
def segmentation(ts_size, window_size, overlapping=False, n_segments=None):
"""Co... | bsd-3-clause |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/examples/skflow/hdf5_classification.py | 9 | 1992 | # 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 |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | 1 | 19350 | # yellowbrick.features.rankd
# Implements 1D (histograms) and 2D (joint plot) feature rankings.
#
# Author: Benjamin Bengfort
# Created: Fri Oct 07 15:14:01 2016 -0400
#
# Copyright (C) 2016 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: rankd.py [ee754dc] benjamin@bengfort.com $
"""
Im... | apache-2.0 |
letsgoexploring/signalingAnimation | code/signalingAnimationSeparatingHighType.py | 1 | 4337 | from __future__ import division
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.patches as patches
import matplotlib.path as path
import subprocess
plt.style.use('classic')
# Parameters for animation
aL=4
cH=0.25
lam... | mit |
yuchenhou/elephant | elephant/plot.py | 1 | 3079 | import pandas
def compare():
data_sets = ['airport', 'collaboration', 'congress', 'forum', ]
# models = ['pWSBM', 'bWSBM', 'SBM', 'DCWBM', 'node2vec', 'LLE', 'Model R', ]
# errors = pandas.DataFrame([
# [0.0486, 0.0543, 0.0632, 0.0746, 0.0171, 0.0170, 0.0114, ],
# [0.0407, 0.0462, 0.0497, ... | mit |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pandas/tests/io/msgpack/test_obj.py | 22 | 2405 | # coding: utf-8
import pytest
from pandas.io.msgpack import packb, unpackb
class DecodeError(Exception):
pass
class TestObj(object):
def _arr_to_str(self, arr):
return ''.join(str(c) for c in arr)
def bad_complex_decoder(self, o):
raise DecodeError("Ooops!")
def _decode_complex(... | mit |
Fireblend/scikit-learn | sklearn/utils/random.py | 234 | 10510 | # Author: Hamzeh Alsalhi <ha258@cornell.edu>
#
# License: BSD 3 clause
from __future__ import division
import numpy as np
import scipy.sparse as sp
import operator
import array
from sklearn.utils import check_random_state
from sklearn.utils.fixes import astype
from ._random import sample_without_replacement
__all__ =... | bsd-3-clause |
7even7/DAT210x | Module4/assignment2.py | 1 | 3442 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
import assignment2_helper as helper
from sklearn.decomposition import PCA
# Look pretty...
matplotlib.style.use('ggplot')
# Do * NOT * alter this line, until instructed!
scaleFeatures = True
# TODO: Load up the dataset and remove any and all
# ... | mit |
xyficu/rts2 | scripts/shiftstore.py | 1 | 9390 | #!/usr/bin/python
#
# Shift-store focusing.
#
# You will need: scipy matplotlib sextractor
# This should work on Debian/ubuntu:
# sudo apt-get install python-matplotlib python-scipy python-pyfits sextractor
#
# If you would like to see sextractor results, get DS9 and pyds9:
#
# http://hea-www.harvard.edu/saord/ds9/
#
#... | gpl-2.0 |
jblackburne/scikit-learn | sklearn/linear_model/tests/test_theil_sen.py | 58 | 9948 | """
Testing for Theil-Sen module (sklearn.linear_model.theil_sen)
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import os
import sys
from contextlib import contextmanager
import numpy as np
from numpy.testing import ... | bsd-3-clause |
hgonzale/hssim | polyped/sch.py | 1 | 5235 | # system
import os
import time
# numerics, plotting
import numpy as np
import pylab as plt
import matplotlib as mpl
import scipy as sp
font = {'family' : 'serif',
'size' : 14}
mpl.rc('font', **font)
np.set_printoptions(precision=2)
# simulation
import relax as rx
import poly
# util
from util import Struct
imp... | bsd-2-clause |
combust-ml/mleap | python/tests/sklearn/preprocessing/data_test.py | 2 | 39318 |
#
# 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 |
choderalab/bayesian-itc | examples/sampl4_notebook/ITC.py | 3 | 67766 | #!/usr/bin/python
#=============================================================================================
# A module implementing Bayesian analysis of isothermal titration calorimentry (ITC) experiments
#
# Written by John D. Chodera <jchodera@gmail.com>, Pande lab, Stanford, 2008.
#
# Copyright (c) 2008 Stanfo... | gpl-3.0 |
mxjl620/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
a301-teaching/a301_code | notebooks/python/derivs_and_ints.py | 1 | 3397 |
# coding: utf-8
# # working with numpy arrays
#
# This notebook demonstrates how to use differences and sums to calculate derivatives and integrals and make some simple plots using the matplotlib module. If you haven't seen matlab-style array indexing before, take a look at:
#
# * The [Whirlwind section on lists](... | mit |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/scipy/stats/_continuous_distns.py | 6 | 146462 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.misc.doccer import inherit_docstring_from
from scipy import optimize
from scipy import integrate
impor... | mit |
cdr-stats/cdr-stats | cdr_stats/cdr_alert/tasks.py | 1 | 19322 | # -*- coding: utf-8 -*-
#
# CDR-Stats License
# http://www.cdr-stats.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.... | mpl-2.0 |
thomasaarholt/hyperspy | hyperspy/tests/drawing/test_plot_signal2d.py | 2 | 20767 | # Copyright 2007-2020 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 your option) any later ... | gpl-3.0 |
saiwing-yeung/scikit-learn | doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py | 103 | 2017 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
cbertinato/pandas | pandas/tests/extension/test_integer.py | 1 | 6409 | """
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 |
fengzhyuan/scikit-learn | examples/neighbors/plot_regression.py | 349 | 1402 | """
============================
Nearest Neighbors regression
============================
Demonstrate the resolution of a regression problem
using a k-Nearest Neighbor and the interpolation of the
target using both barycenter and constant weights.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@... | bsd-3-clause |
beepee14/scikit-learn | examples/datasets/plot_random_dataset.py | 348 | 2254 | """
==============================================
Plot randomly generated classification dataset
==============================================
Plot several randomly generated 2D classification datasets.
This example illustrates the :func:`datasets.make_classification`
:func:`datasets.make_blobs` and :func:`datasets.... | bsd-3-clause |
Srisai85/scikit-learn | sklearn/feature_extraction/tests/test_dict_vectorizer.py | 276 | 3790 | # Authors: Lars Buitinck <L.J.Buitinck@uva.nl>
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from sklearn.utils.testing import (assert_equal, assert_in,
... | bsd-3-clause |
warmspringwinds/scikit-image | doc/examples/plot_regional_maxima.py | 18 | 3316 | """
=========================
Filtering regional maxima
=========================
Here, we use morphological reconstruction to create a background image, which
we can subtract from the original image to isolate bright features (regional
maxima).
First we try reconstruction by dilation starting at the edges of the ima... | bsd-3-clause |
bavardage/statsmodels | statsmodels/graphics/tests/test_gofplots.py | 3 | 2821 | import numpy as np
from numpy.testing import dec
import statsmodels.api as sm
from statsmodels.graphics.gofplots import qqplot, qqline, ProbPlot
from scipy import stats
try:
import matplotlib.pyplot as plt
import matplotlib
if matplotlib.__version__ < '1':
raise
have_matplotlib = True
except:... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.