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 |
|---|---|---|---|---|---|
jiangzhonglian/MachineLearning | src/py3.x/ml/3.DecisionTree/DTSklearn.py | 1 | 3999 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# 原始链接: http://blog.csdn.net/lsldd/article/details/41223147
# GitHub: https://github.com/apachecn/AiLearning
import numpy as np
from sklearn import tree
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import classification_report
from sklearn.model_selec... | gpl-3.0 |
stuliveshere/SeismicProcessing2015 | prac1_staff/toolbox/toolbox.py | 1 | 12170 | import numpy as np
import matplotlib.pyplot as pylab
from matplotlib.widgets import Slider
pylab.rcParams['image.interpolation'] = 'sinc'
#==================================================
# decorators
#==================================================
def io(func):
'''
... | mit |
mugizico/scikit-learn | examples/decomposition/plot_ica_vs_pca.py | 306 | 3329 | """
==========================
FastICA on 2D point clouds
==========================
This example illustrates visually in the feature space a comparison by
results using two different component analysis techniques.
:ref:`ICA` vs :ref:`PCA`.
Representing ICA in the feature space gives the view of 'geometric ICA':
ICA... | bsd-3-clause |
bpinsard/PySurfer | setup.py | 4 | 3134 | #! /usr/bin/env python
#
# Copyright (C) 2011-2014 Alexandre Gramfort
# Michael Waskom
# Scott Burns
# Martin Luessi
# Eric Larson
descr = """PySurfer: cortical surface visualization using Python."""
import os
# deal with ... | bsd-3-clause |
GoogleCloudPlatform/professional-services-data-validator | samples/functions/main.py | 1 | 1319 | # Copyright 2020 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 |
rdipietro/tensorflow | tensorflow/examples/learn/text_classification_character_rnn.py | 8 | 3322 | # 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 |
hetland/xray | xray/test/test_formatting.py | 6 | 3865 | import numpy as np
import pandas as pd
from xray.core import formatting
from xray.core.pycompat import PY3
from . import TestCase
class TestFormatting(TestCase):
def test_get_indexer_at_least_n_items(self):
cases = [
((20,), (slice(10),)),
((3, 20,), (0, slice(10))),
... | apache-2.0 |
ranaroussi/fix-yahoo-finance | yfinance/__init__.py | 1 | 1330 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Yahoo! Finance market data downloader (+fix for Pandas Datareader)
# https://github.com/ranaroussi/yfinance
#
# Copyright 2017-2019 Ran Aroussi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | apache-2.0 |
mblondel/scikit-learn | examples/decomposition/plot_faces_decomposition.py | 204 | 4452 | """
============================
Faces dataset decompositions
============================
This example applies to :ref:`olivetti_faces` different unsupervised
matrix decomposition (dimension reduction) methods from the module
:py:mod:`sklearn.decomposition` (see the documentation chapter
:ref:`decompositions`) .
"""... | bsd-3-clause |
decvalts/landlab | landlab/plot/video_out.py | 1 | 8077 | #! /usr/bin/env python
"""
This component allows creation of mp4 animations of output from Landlab.
It does so by stitching together output from the conventional Landlab
static plotting routines from plot/imshow.py.
It is compatible with all Landlab grids, though cannot handle an evolving grid
as yet.
Initialize the... | mit |
glenngillen/dotfiles | .vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydev_ipython/qt_for_kernel.py | 2 | 3698 | """ Import Qt in a manner suitable for an IPython kernel.
This is the import used for the `gui=qt` or `matplotlib=qt` initialization.
Import Priority:
if Qt4 has been imported anywhere else:
use that
if matplotlib has been imported and doesn't support v2 (<= 1.0.1):
use PyQt4 @v1
Next, ask ETS' ... | mit |
astocko/statsmodels | statsmodels/nonparametric/_kernel_base.py | 29 | 18238 | """
Module containing the base object for multivariate kernel density and
regression, plus some utilities.
"""
from statsmodels.compat.python import range, string_types
import copy
import numpy as np
from scipy import optimize
from scipy.stats.mstats import mquantiles
try:
import joblib
has_joblib = True
exce... | bsd-3-clause |
jobovy/apogee-maps | py/plot_ah_location.py | 1 | 8658 | ###############################################################################
# plot_ah_location: plot the range of extinctions effor a given location
###############################################################################
import os, os.path
import sys
import pickle
import numpy
import matplotlib
matplotlib.... | bsd-3-clause |
santis19/fatiando | gallery/gravmag/eqlayer_transform.py | 6 | 3046 | """
Equivalent layer for griding and upward-continuing gravity data
-------------------------------------------------------------------------
The equivalent layer is one of the best methods for griding and upward
continuing gravity data and much more. The trade-off is that performing this
requires an inversion and lat... | bsd-3-clause |
lhilt/scipy | scipy/interpolate/fitpack2.py | 4 | 63081 | """
fitpack --- curve and surface fitting with splines
fitpack is based on a collection of Fortran routines DIERCKX
by P. Dierckx (see http://www.netlib.org/dierckx/) transformed
to double routines by Pearu Peterson.
"""
# Created by Pearu Peterson, June,August 2003
from __future__ import division, print_function, abs... | bsd-3-clause |
Roboticmechart22/sms-tools | lectures/06-Harmonic-model/plots-code/spectral-peaks.py | 22 | 1161 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import math
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DFT
import utilFunctions as UF
(fs, x) = UF... | agpl-3.0 |
OpenDrift/opendrift | examples/example_model_landmask.py | 1 | 2046 | #!/usr/bin/env python
"""
Model landmask
===============================
Comparing two simulation runs, with landmask from ocean model and GSHHG
"""
from datetime import timedelta
from opendrift.readers import reader_ROMS_native
from opendrift.models.oceandrift import OceanDrift
lon = 14.75; lat = 68.1
o = OceanDr... | gpl-2.0 |
xionzz/earthquake | venv/lib/python2.7/site-packages/numpy/lib/polynomial.py | 35 | 37641 | """
Functions to operate on polynomials.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import re
import warnings
import numpy.core.... | mit |
yehudagale/fuzzyJoiner | old/TripletLossFacenetLSTM-8.20.18.py | 2 | 21235 | import numpy as np
import pandas
import tensorflow as tf
import random as random
import json
from keras import backend as K
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.layers import Dense, Input, Flatten, Dropout, Lambda, GRU, Activation
from keras... | epl-1.0 |
pybel/pybel | tests/test_io/test_spia.py | 1 | 10537 | # -*- coding: utf-8 -*-
"""This module contains tests for the SPIA exporter."""
import unittest
from pandas import DataFrame
from pybel.dsl import activity, composite_abundance, pmod, protein, rna
from pybel.examples.sialic_acid_example import (
cd33, citation, evidence_1, shp1, shp2, sialic_acid_cd33_complex, ... | mit |
detrout/debian-statsmodels | statsmodels/graphics/tests/test_dotplot.py | 1 | 14590 | import numpy as np
from statsmodels.graphics.dotplots import dot_plot
import pandas as pd
from numpy.testing import dec
# If true, the output is written to a multi-page pdf file.
pdf_output = False
try:
import matplotlib.pyplot as plt
import matplotlib
have_matplotlib = True
except ImportError:
have_m... | bsd-3-clause |
ilyes14/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 |
trenton3983/Data_Science_from_Scratch | code-python3/natural_language_processing.py | 12 | 10000 | import math, random, re
from collections import defaultdict, Counter
from bs4 import BeautifulSoup
import requests
def plot_resumes(plt):
data = [ ("big data", 100, 15), ("Hadoop", 95, 25), ("Python", 75, 50),
("R", 50, 40), ("machine learning", 80, 20), ("statistics", 20, 60),
("data science", 6... | unlicense |
ibis-project/ibis | ibis/backends/impala/tests/test_partition.py | 1 | 8063 | from posixpath import join as pjoin
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.util as util
from ibis.backends.impala.compat import ImpylaError
from ibis.tests.util import assert_equal
pytestmark = pytest.mark.impala
@pytest.fixture
def df():
df = pd.DataFrame(
... | apache-2.0 |
ctn-waterloo/nengo_theano | nengo_theano/test/test_learning.py | 1 | 2191 | """This is a test file to test basic learning
"""
import math
import time
import numpy as np
import matplotlib.pyplot as plt
import nengo_theano as nef
neurons = 30 # number of neurons in all ensembles
start_time = time.time()
net = nef.Network('Learning Test')
import random
class TrainingInput(nef.SimpleNode):
... | mit |
openbermuda/karmapi | karmapi/kpi.py | 1 | 1843 | """
karmapi command line interface.
Build and get paths
Ask peers to build.
Get data from peers.
Get stats
Yosser, the builder
"""
import argparse
from datetime import date, datetime, timedelta
from karmapi import base, weather
from matplotlib import pyplot
def get_parser():
parser = argparse.Argument... | gpl-3.0 |
daler/metaseq | doc/example.py | 3 | 3212 | import numpy as np
import os
import metaseq
ip_filename = metaseq.helpers.example_filename(
'wgEncodeHaibTfbsK562Atf3V0416101AlnRep1_chr17.bam')
input_filename = metaseq.helpers.example_filename(
'wgEncodeHaibTfbsK562RxlchV0416101AlnRep1_chr17.bam')
ip_signal = metaseq.genomic_signal(ip_filename, 'bam')
input... | mit |
projectcuracao/projectcuracao | graphprep/solarwindgraph.py | 1 | 3077 | # solar wind graph generation
# filename: solarwindgraph.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... | gpl-3.0 |
polakowo/plnx-grabber | plnxgrabber/__init__.py | 1 | 32357 | # Grabber of trade history from Poloniex exchange
# https://github.com/polakowo/plnx-grabber
#
# Copyright (C) 2017 https://github.com/polakowo/plnx-grabber
# 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 ... | gpl-3.0 |
drummonds/remittance | remittance/utils.py | 1 | 1450 | __author__ = 'Humphrey'
from decimal import Decimal, InvalidOperation
import pandas as pd
from sys import exc_info
one_pence = Decimal('0.01')
def p(value):
"""Convert `value` to Decimal pence implementing AIS rounding (up) or cents"""
# TODO think about Decimal(-0.00) == Decmial(0.00) which is true. Shoul... | mit |
ishanic/scikit-learn | sklearn/ensemble/partial_dependence.py | 251 | 15097 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | bsd-3-clause |
gmsn-ita/vaspirin | scripts/band_offsets.py | 2 | 8803 | #/usr/bin/env python3
# coding: utf-8
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import argparse
import sys
import re
class PyplotConst (object):
"""
Constants for style-plotting with matplotlib.pyplot
"""
lineStyles = ['-', '--', '-.', ':', 'None', ' ', '']
labelFont = {'fontname' : ... | gpl-3.0 |
bthirion/scikit-learn | examples/model_selection/plot_roc_crossval.py | 28 | 3697 | """
=============================================================
Receiver Operating Characteristic (ROC) with cross validation
=============================================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality using cross-validation.
ROC curv... | bsd-3-clause |
kaichogami/scikit-learn | examples/applications/plot_outlier_detection_housing.py | 28 | 5563 | """
====================================
Outlier detection on a real data set
====================================
This example illustrates the need for robust covariance estimation
on a real data set. It is useful both for outlier detection and for
a better understanding of the data structure.
We selected two sets o... | bsd-3-clause |
MalkIPP/openfisca-france-data | openfisca_france_data/sources/utils.py | 4 | 2153 | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify... | agpl-3.0 |
madmax983/h2o-3 | h2o-py/tests/testdir_algos/kmeans/pyunit_DEPRECATED_prostateKmeans.py | 2 | 1068 | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import numpy as np
from sklearn.cluster import KMeans
def prostateKmeans():
# Connect to a pre-existing cluster
# connect to localhost:54321
#Log.info("Importing prostate.csv data...\n")
prostate_h2o = h2o.import_file(pa... | apache-2.0 |
piotroxp/scibibscan | scib/lib/python3.5/site-packages/numpy/core/tests/test_multiarray.py | 9 | 223106 | from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decimal import Decimal
import numpy as... | mit |
GeoscienceAustralia/sifra | tests/test_input_model_excel_file.py | 1 | 11983 | import os
import unittest as ut
import pandas as pd
import logging
rootLogger = logging.getLogger(__name__)
rootLogger.setLevel(logging.CRITICAL)
class TestReadingExcelFile(ut.TestCase):
def setUp(self):
self.project_root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
self.mod... | apache-2.0 |
Vimos/scikit-learn | sklearn/model_selection/tests/test_validation.py | 7 | 42247 | """Test the validation module"""
from __future__ import division
import sys
import warnings
import tempfile
import os
from time import sleep
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.uti... | bsd-3-clause |
B3AU/waveTree | examples/cluster/plot_lena_compress.py | 8 | 2198 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Vector Quantization Example
=========================================================
The classic image processing example, Lena, an 8-bit grayscale
bit-depth, 512 x 512 sized image, is used here to illustrate
how ... | bsd-3-clause |
geledek/mrec | mrec/item_similarity/knn.py | 3 | 3868 | """
Brute-force k-nearest neighbour recommenders
intended to provide evaluation baselines.
"""
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
from recommender import ItemSimilarityRecommender
class KNNRecommender(ItemSimilarityRecommender):
"""
Abstract base class for k-nn recommend... | bsd-3-clause |
DarkEnergyScienceCollaboration/Twinkles | python/desc/twinkles/analyseICat.py | 2 | 1865 | from __future__ import absolute_import, division, print_function
import pandas as pd
import numpy as np
def readPhoSimInstanceCatalog(fname,
names=['obj', 'SourceID', 'RA', 'DEC', 'MAG_NORM',\
'SED_NAME', 'REDSHIFT', 'GAMMA1',\
... | mit |
MMKrell/pyspace | pySPACE/resources/dataset_defs/performance_result.py | 1 | 75741 | """ Tabular listing data sets, parameters and a huge number of performance metrics
Store and load the performance results of an operation from a csv file,
select subsets of this results or for create various kinds of plots
**Special Static Methods**
:merge_performance_results:
Merge result*.csv files when... | gpl-3.0 |
irockafe/revo_healthcare | src/project_fxns/rt_window_prediction.py | 1 | 13555 | import time
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter
from sklearn.metrics import roc_curve, auc
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import StratifiedShuffleSplit
from sklearn.utils import shuffle
from scipy import inte... | mit |
sergiohr/NeuroDB | neurodb/cluster.py | 1 | 16460 | '''
Created on Jul 16, 2015
@author: sergio
'''
import numpy as np
import ctypes
import numpy.ctypeslib as npct
import matplotlib.pyplot as plt
import psycopg2
import time
import neurodb.neodb.core
from math import e, pow
from scipy.optimize import leastsq
import neurodb
import random
from sklearn.cluster import KMea... | gpl-3.0 |
Garrett-R/scikit-learn | sklearn/utils/tests/test_validation.py | 12 | 7588 | """Tests for input validation functions"""
from tempfile import NamedTemporaryFile
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 itertools import product
from sklearn.utils import as_float_ar... | bsd-3-clause |
devanshdalal/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 |
saintdragon2/python-3-lecture-2015 | sinsojael_final/2nd_presentation/8조/Carculator2.py | 1 | 4919 | __author__ = 'winseven'
from pylab import *
from tkinter import *
import math
import numpy as np
import matplotlib.pyplot as plt
#이벤트 처리함수
def enter(btn):
if btn == 'C':
ent.delete(0, END)
elif btn == '=':
ans = eval(ent.get())
ent.delete(0, END)
ent.insert(0, ans)
else:... | mit |
vikashvverma/machine-learning | mlbasic/Supervised/Project/visuals.py | 3 | 5396 | ###########################################
# Suppress matplotlib user warnings
# Necessary for newer version of matplotlib
import warnings
warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib")
#
# Display inline matplotlib plots with IPython
from IPython import get_ipython
get_ipython().run_... | mit |
seckcoder/lang-learn | python/sklearn/examples/decomposition/plot_image_denoising.py | 1 | 5769 | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of Lena using online :ref:`DictionaryLearning` and various transform methods.
The dictionary is fitted on the distorted le... | unlicense |
precedenceguo/mxnet | example/kaggle-ndsb1/training_curves.py | 52 | 1879 | # 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 |
hrjn/scikit-learn | sklearn/neighbors/base.py | 28 | 30649 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Jol... | bsd-3-clause |
kathleenleeper/bibmetrics | genderDistribution.py | 1 | 5038 | # Script calculates the percent of authors in a database with male, female, unisex, or unassigned names. Will count multiple authors once; accuracy of gender assignment has been validated by a (not-particuarly random) set of 100 names. cu
#system functions
from __future__ import division
import os
import sys
from date... | gpl-3.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/sklearn/manifold/tests/test_t_sne.py | 3 | 31389 | import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import scipy.sparse as sp
from sklearn.neighbors import BallTree
from sklearn.neighbors import NearestNeighbors
from sklearn.utils.testing import assert_less_equal
from sklearn.utils.testing import assert_equal
from sklearn.uti... | mit |
imbasimba/astroquery | astroquery/vo_conesearch/conesearch.py | 2 | 17045 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Support VO Simple Cone Search capabilities."""
# STDLIB
import warnings
# THIRD-PARTY
import numpy as np
# ASTROPY
from astropy.io.votable.exceptions import vo_warn, W25
from astropy.utils.console import color_print
from astropy.utils.exceptions impo... | bsd-3-clause |
sgrieve/iverson_2000 | Iverson_funcs.py | 1 | 24546 | from __future__ import print_function
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
import matplotlib.patches as patches
label_size = 8
axis_size = 12
# Set up fonts for plots
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['arial']
rcParams['fon... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/IPython/terminal/ipapp.py | 7 | 13910 | #!/usr/bin/env python
# encoding: utf-8
"""
The :class:`~IPython.core.application.Application` object for the command
line :command:`ipython` program.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import
from __future__ import ... | gpl-3.0 |
mvfcopetti/pySSN | pyssn/core/spectrum.py | 1 | 124124 | """
pySSN is available under the GNU licence providing you cite the developpers names:
Ch. Morisset (Instituto de Astronomia, Universidad Nacional Autonoma de Mexico)
D. Pequignot (Meudon Observatory, France)
"""
import time
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets ... | gpl-3.0 |
datapythonista/pandas | pandas/tests/io/parser/test_dialect.py | 5 | 4104 | """
Tests that dialects are properly handled during parsing
for all of the parsers defined in parsers.py
"""
import csv
from io import StringIO
import pytest
from pandas.errors import ParserWarning
from pandas import DataFrame
import pandas._testing as tm
@pytest.fixture
def custom_dialect():
dialect_name = "... | bsd-3-clause |
sanketloke/scikit-learn | examples/svm/plot_svm_kernels.py | 329 | 1971 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
SVM-Kernels
=========================================================
Three different types of SVM-Kernels are displayed below.
The polynomial and RBF are especially useful when the
data-points are not linearly sep... | bsd-3-clause |
glennq/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 |
raysinensis/tcgaAPP | static/scripts/methyl-sig-pull2.py | 1 | 1225 | ##download data w/ cmd: firehose_get -tasks Clinical_vs_Methylation analyses latest
import os
import tarfile
import csv
import pandas
path=os.getcwd()
cancerlist=os.listdir(".")
#get genes list
folderpath2=path+"/"+"LAML"+"/"
csvpath=folderpath2+"gdac.broadinstitute.org_"+"LAML"+"-TB.Correlate_Clinical_vs_Methylation.... | mit |
rabipanda/tensorflow | tensorflow/examples/learn/text_classification.py | 30 | 6589 | # 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 |
cainiaocome/scikit-learn | sklearn/linear_model/setup.py | 169 | 1567 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... | bsd-3-clause |
gfyoung/pandas | pandas/tests/io/formats/test_format.py | 2 | 118315 | """
Test output formatting for Series/DataFrame, including to_string & reprs
"""
from datetime import datetime
from io import StringIO
import itertools
from operator import methodcaller
import os
from pathlib import Path
import re
from shutil import get_terminal_size
import sys
import textwrap
import dateutil
import ... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/mpl_toolkits/tests/test_axes_grid.py | 5 | 1605 |
from matplotlib.testing.decorators import image_comparison
from mpl_toolkits.axes_grid1 import ImageGrid
import numpy as np
import matplotlib.pyplot as plt
@image_comparison(baseline_images=['imagegrid_cbar_mode'],
extensions=['png'],
remove_text=True)
def test_imagegrid_cbar_mode... | mit |
rucka/coursera-introduction-to-data-science | KaggleCompetitionPeerReview/Tutorial/python/train.py | 1 | 2761 | #import csv as csv
import pandas as pd
import numpy as np
import pylab as P
df = pd.read_csv('../data/train.csv', header=0)
#print df[df.Age > 60][['Sex', 'Pclass', 'Age', 'Survived']]
df['Age'].dropna().hist(bins=16, range=(0,80),alpha = .5)
P.show()
'''
#work on train data
csv_file_object = csv.reader(open('../data... | apache-2.0 |
russel1237/scikit-learn | benchmarks/bench_isotonic.py | 268 | 3046 | """
Benchmarks of isotonic regression performance.
We generate a synthetic dataset of size 10^n, for n in [min, max], and
examine the time taken to run isotonic regression over the dataset.
The timings are then output to stdout, or visualized on a log-log scale
with matplotlib.
This alows the scaling of the algorith... | bsd-3-clause |
mvdbeek/tools-iuc | tools/repmatch_gff3/repmatch_gff3_util.py | 22 | 17958 | import bisect
import csv
import os
import shutil
import sys
import tempfile
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot # noqa: I202,E402
# Graph settings
Y_LABEL = 'Counts'
X_LABEL = 'Number of matched replicates'
TICK_WIDTH = 3
# Amount to shift the graph to make labels fit, [left, right,... | mit |
calebfoss/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_functions_test.py | 6 | 5044 | # 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 |
evanbiederstedt/RRBSfun | trees/chrom_scripts/cll_chr08.py | 1 | 8246 | import glob
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', 50) # print all rows
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files")
cw154 = glob.glob("binary_position_RRBS_cw154*")
trito = glob.glob("binary_position_RRBS_trito_pool*")
print(len(... | mit |
navigator8972/vae_hwmotion | baxter_writer.py | 2 | 13089 | """
A simulated manipulator based upon Baxter robot
to write given letter trajectory
"""
import os
import sys
import copy
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
from baxter_pykdl_revised import baxter_dynamics
import pylqr.pylqr_trajctrl as plqrtc
import pyrbf_funca... | gpl-3.0 |
mrcslws/htmresearch | htmresearch/support/nlp_classification_plotting.py | 9 | 12290 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
grundgruen/zipline | tests/pipeline/test_numerical_expression.py | 1 | 16240 | from operator import (
add,
and_,
ge,
gt,
le,
lt,
methodcaller,
mul,
ne,
or_,
)
from unittest import TestCase
import numpy
from numpy import (
arange,
eye,
float64,
full,
isnan,
zeros,
)
from pandas import (
DataFrame,
date_range,
Int64Index,
... | apache-2.0 |
emd/random_data | random_data/spectra2d.py | 1 | 14055 | '''This module defines a class for estimating the 2-dimensional
autospectral density of a field. Temporal spectral estimates are
obtained through Welch's method of ensemble averaging overlapped,
windowed FFTs (i.e. nonparametric spectral estimation), while
spatial spectral estimates can be obtained through either
nonpa... | gpl-2.0 |
h2educ/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 98 | 20870 | from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.cross_validation import train_test_split
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing impor... | bsd-3-clause |
PanDAWMS/panda-server | pandaserver/daemons/scripts/recover_lost_files_daemon.py | 1 | 4606 | import json
import glob
import time
import os.path
import datetime
import threading
import traceback
from pandacommon.pandalogger.PandaLogger import PandaLogger
from pandacommon.pandalogger.LogWrapper import LogWrapper
from pandaserver.config import panda_config
from pandaserver.dataservice import RecoverLostFilesCore... | apache-2.0 |
justanotherbrain/HebbLearn | objcat-demo.py | 1 | 5010 | import sys
import scipy.ndimage
import os.path
import HebbLearn as hl
import numpy as np
import matplotlib.pyplot as plt
fl = hl.NonlinearGHA()
cat_a = '1' #monkey
cat_b = '2' #truck
def resize(data):
tmp = np.reshape(data, (np.shape(data)[0],96,96,3), order='F')
tmp = np.swapaxes(tmp,0,1)
tmp = np.swapax... | mit |
jakobworldpeace/scikit-learn | sklearn/covariance/robust_covariance.py | 105 | 29653 | """
Robust location and covariance estimators.
Here are implemented estimators that are resistant to outliers.
"""
# Author: Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
from scipy import linalg
from scipy.stats import chi2
from . import empir... | bsd-3-clause |
henrykironde/scikit-learn | sklearn/qda.py | 140 | 7682 | """
Quadratic Discriminant Analysis
"""
# Author: Matthieu Perrot <matthieu.perrot@gmail.com>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import BaseEstimator, ClassifierMixin
from .externals.six.moves import xrange
from .utils import check_array, check_X_y
from .utils.validation import ... | bsd-3-clause |
siva82kb/SPARC | scripts/for_paper.py | 1 | 7687 | """Module for generating plots for the paper."""
import numpy as np
import matplotlib.pyplot as plt
from smoothness import sparc
from smoothness import log_dimensionless_jerk
def sine_rhythmic_movement(T_m, T_r, T_t, ts, skill=1):
# time
t = np.arange(0, T_t, ts)
# Total number of movements
N = int... | isc |
stylianos-kampakis/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 |
lancezlin/ml_template_py | lib/python2.7/site-packages/pandas/computation/ops.py | 7 | 15881 | """Operator classes for eval.
"""
import operator as op
from functools import partial
from datetime import datetime
import numpy as np
from pandas.types.common import is_list_like, is_scalar
import pandas as pd
from pandas.compat import PY3, string_types, text_type
import pandas.core.common as com
from pandas.format... | mit |
Guokr1991/seaborn | setup.py | 6 | 3621 | #! /usr/bin/env python
#
# Copyright (C) 2012-2014 Michael Waskom <mwaskom@stanford.edu>
import os
# temporarily redirect config directory to prevent matplotlib importing
# testing that for writeable directory which results in sandbox error in
# certain easy_install versions
os.environ["MPLCONFIGDIR"] = "."
DESCRIPTIO... | bsd-3-clause |
ucsd-progsys/nate | learning/input.py | 2 | 1922 | import pandas as pd
import numpy as np
def load_csv(path, filter_no_labels=False, balance_labels=True, only_slice=False, no_slice=False):
'''Load feature vectors from a csv file.
Expects a header row with feature columns prefixed with 'F-' and
label columns prefixed with 'L-'.
@param filter_no_labels... | bsd-3-clause |
Cadair/ginga | ginga/cmap.py | 2 | 507866 | #
# cmap.py -- color maps for fits viewing
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
import numpy
from ginga.util.six.moves... | bsd-3-clause |
rtrwalker/geotecha | geotecha/consolidation/smear_zones.py | 1 | 127140 | # geotecha - A software suite for geotechncial engineering
# Copyright (C) 2018 Rohan T. Walker (rtrwalker@gmail.com)
#
# 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 3 of the L... | gpl-3.0 |
AlexanderFabisch/scikit-learn | sklearn/gaussian_process/tests/test_gpr.py | 28 | 11870 | """Testing for Gaussian process regression """
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Licence: BSD 3 clause
import numpy as np
from scipy.optimize import approx_fprime
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels \
import RBF, Constan... | bsd-3-clause |
dankolbman/NumericalAnalysis | Homeworks/HW2/Problem5ii.py | 1 | 3007 | import math
import scipy.interpolate as intrp
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
font = {'fa... | mit |
caseyclements/bokeh | examples/interactions/us_marriages_divorces/us_marriages_divorces_interactive.py | 26 | 3437 | # coding: utf-8
# Plotting U.S. marriage and divorce statistics
#
# Example code by Randal S. Olson (http://www.randalolson.com)
from bokeh.plotting import figure, show, output_file, ColumnDataSource
from bokeh.models import HoverTool, NumeralTickFormatter
from bokeh.models import SingleIntervalTicker, LinearAxis
imp... | bsd-3-clause |
swartn/sam-vs-jet-paper | analysis_plotting/discover_psl_trend_maps_hadslp2r_2004_vs_2011_ending.py | 1 | 3395 | """
Compare maps of HadSLP2r trends over 1951-2004 and 1951-2011.
.. moduleauthor:: Neil Swart <neil.swart@ec.gc.ca>
"""
import h5py
import cmipdata as cd
import os
os.system('rm -f /tmp/cdo*')
import numpy as np
import scipy as sp
from mpl_toolkits.basemap import Basemap, addcyclic
import matplotlib.pyplot as plt
imp... | gpl-2.0 |
pypot/scikit-learn | sklearn/naive_bayes.py | 128 | 28358 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... | bsd-3-clause |
ustroetz/python-osrm | osrm/core.py | 1 | 19119 | # -*- coding: utf-8 -*-
import numpy as np
from polyline.codec import PolylineCodec
from polyline import encode as polyline_encode
from pandas import DataFrame
from . import RequestConfig
try:
from urllib.request import urlopen, Request
from urllib.parse import quote
except:
from urllib2 import urlopen, Re... | mit |
Trigition/MTG-DataScraper | scripts/card_types.py | 1 | 1497 | import pandas as pd
from collections import OrderedDict
def split_type(subtype_string):
subtypes = [x for x in subtype_string.decode('utf8').split(' ')]
return subtypes
def get_all_supertypes(data):
supertypes = [string.encode('utf8') for string in data['supertypes'].unique()]
return sorted(supertypes... | mit |
linan7788626/brut | figures/cluster_confusion.py | 2 | 2014 | import json
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
matplotlib.rcParams['axes.grid'] = False
matplotlib.rcParams['axes.facecolor'] = '#ffffff'
from scipy.ndimage import label
from bubbly.cluster import merge
from bubbly.field import get_field
from ... | mit |
h2educ/scikit-learn | sklearn/preprocessing/tests/test_imputation.py | 213 | 11911 | import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.preprocessing.imputa... | bsd-3-clause |
rerthal/mc886 | proj03/proj03.py | 1 | 4044 | from sklearn.preprocessing import normalize
from sklearn.decomposition import PCA
from sklearn.cross_validation import StratifiedKFold
from sklearn.neighbors import NeighborsClassifier
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
import numpy as np
def print_result(rates):
print ... | gpl-3.0 |
vega/ipython-vega | vega/tests/test_outputs.py | 4 | 1203 | import pytest
import pandas as pd
from .. import Vega, VegaLite
PANDAS_DATA = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]})
JSON_DATA = {
"values": [
{"x": 1, "y": 4},
{"x": 2, "y": 5},
{"x": 3, "y": 6}
]
}
VEGALITE_SPEC = {
"mark": "circle",
"encoding": {
"x": {"fi... | bsd-3-clause |
eriklindernoren/ML-From-Scratch | mlfromscratch/unsupervised_learning/generative_adversarial_network.py | 1 | 5842 | from __future__ import print_function, division
from sklearn import datasets
import math
import matplotlib.pyplot as plt
import numpy as np
import progressbar
from sklearn.datasets import fetch_mldata
from mlfromscratch.deep_learning.optimizers import Adam
from mlfromscratch.deep_learning.loss_functions import CrossE... | mit |
MJuddBooth/pandas | pandas/util/_decorators.py | 1 | 12592 | from functools import wraps
import inspect
from textwrap import dedent
import warnings
from pandas._libs.properties import cache_readonly # noqa
from pandas.compat import PY2, signature
def deprecate(name, alternative, version, alt_name=None,
klass=None, stacklevel=2, msg=None):
"""
Return a n... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.