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 |
|---|---|---|---|---|---|
seaotterman/tensorflow | tensorflow/examples/learn/iris_run_config.py | 86 | 2087 | # 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 |
sinhrks/expandas | pandas_ml/skaccessors/test/test_svm.py | 2 | 2995 | #!/usr/bin/env python
import pytest
import numpy as np
import sklearn.datasets as datasets
import sklearn.svm as svm
import pandas_ml as pdml
import pandas_ml.util.testing as tm
class TestSVM(tm.TestCase):
def test_objectmapper(self):
df = pdml.ModelFrame([])
self.assertIs(df.svm... | bsd-3-clause |
arahuja/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 |
vybstat/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
scipy/scipy | scipy/signal/bsplines.py | 12 | 19509 | from numpy import (logical_and, asarray, pi, zeros_like,
piecewise, array, arctan2, tan, zeros, arange, floor)
from numpy.core.umath import (sqrt, exp, greater, less, cos, add, sin,
less_equal, greater_equal)
# From splinemodule.c
from .spline import cspline2d, sepfir2d... | bsd-3-clause |
mmaraya/nd101 | ch02/lesson04/and.perceptron.py | 1 | 1065 | #!/usr/bin/env python
import pandas as pd
# Set weight1, weight2, and bias
weight1 = 0.5
weight2 = 0.5
bias = -1.0
# DON'T CHANGE ANYTHING BELOW
# Inputs and outputs
test_inputs = [(0, 0), (0, 1), (1, 0), (1, 1)]
correct_outputs = [False, False, False, True]
outputs = []
# Generate and check output
for test_input,... | mit |
mahak/spark | python/pyspark/pandas/base.py | 3 | 55960 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
moutai/scikit-learn | examples/model_selection/plot_confusion_matrix.py | 47 | 2495 | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | bsd-3-clause |
sppalkia/weld | python/grizzly/grizzly/seriesweld.py | 3 | 19541 | import pandas as pd
import grizzly_impl
from lazy_op import LazyOpResult, to_weld_type
from weld.weldobject import *
import utils
class SeriesWeld(LazyOpResult):
"""Summary
Attributes:
column_name (TYPE): Description
df (TYPE): Description
dim (int): Description
expr (TYPE): ... | bsd-3-clause |
PMitura/smiles-neural-network | baselines/sicho_svm_uni_feature_sel.py | 1 | 8481 | #! /usr/bin/env python
import db
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from rdkit import Chem
from rdkit.Chem import Descriptors
from sklearn.feature_selection import VarianceThreshold
import pylab
data = db.getTarget_206_1977()
duplicates = {}
for datum in data:
i... | bsd-3-clause |
rs2/pandas | pandas/tests/indexes/multi/test_drop.py | 2 | 4428 | import numpy as np
import pytest
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import Index, MultiIndex
import pandas._testing as tm
def test_drop(idx):
dropped = idx.drop([("foo", "two"), ("qux", "one")])
index = MultiIndex.from_tuples([("foo", "two"), ("qux", "one")])
d... | bsd-3-clause |
evgchz/scikit-learn | sklearn/neural_network/rbm.py | 15 | 11957 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
KeithYue/StockTrading | utility.py | 1 | 4059 | # coding=utf-8
# utility function of stock
import os
import pandas as pd
import numpy as np
import logging
# config the logging system
logging.basicConfig(level=logging.DEBUG)
# define Stock class
class Stock():
'''
the stock class
'''
def __init__(self, code):
self.code=code
# search ... | apache-2.0 |
Sentient07/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
nkoukou/University_Projects_Year_3 | EDM_Assembly/base_class.py | 1 | 11366 | '''
Defines the base class of an electric potential grid.
'''
import numpy as np
import matplotlib as mpl
import matplotlib.pylab as plt
from numba import jit
# Global dimensions (used for plots)
sqc_x = (2., 'cm') # unit length for SquareCable
sqc_u = (10., 'V') # unit potential for SquareCable
edm_x = (10., 'mm')... | mit |
victor-prado/broker-manager | environment/lib/python3.5/site-packages/pandas/tests/frame/test_mutate_columns.py | 7 | 7831 | # -*- coding: utf-8 -*-
from __future__ import print_function
from pandas.compat import range, lrange
import numpy as np
from pandas import DataFrame, Series, Index
from pandas.util.testing import (assert_series_equal,
assert_frame_equal,
assertRaise... | mit |
bikong2/scikit-learn | sklearn/tests/test_random_projection.py | 79 | 14035 | from __future__ import division
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import euclidean_distances
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import gaussian_random_matrix
from sklearn.random_projection import sparse_random_matrix
from... | bsd-3-clause |
evidation-health/pymc3 | setup.py | 1 | 2670 | #!/usr/bin/env python
from setuptools import setup
import sys
DISTNAME = 'pymc3'
DESCRIPTION = "PyMC3"
LONG_DESCRIPTION = """Bayesian estimation, particularly using Markov chain Monte Carlo (MCMC), is an increasingly relevant approach to statistical estimation. However, few statistical software packages implement ... | apache-2.0 |
cgrohman/ponies | hypo1.py | 1 | 4172 | import numpy as np
import pandas as pd
from horse import Horse
from race import Race
import pdb
from sklearn.preprocessing import Imputer, StandardScaler, OneHotEncoder
from sklearn.model_selection import train_test_split
#------------------------------------------------------------------------------
def main():
da... | gpl-3.0 |
vberthiaume/vblandr | src/silenceTest.py | 1 | 3381 | import subprocess as sp
import scikits.audiolab
import numpy as np
from scipy.fftpack import fft, ifft
from scipy.io import wavfile
import bisect
import matplotlib.pyplot as plt
import time
plt.rcParams['agg.path.chunksize'] = 10000
#--CONVERT MP3 TO WAV------------------------------------------
#song_path = '/home/g... | apache-2.0 |
End of preview. Expand in Data Studio
- Downloads last month
- 4