Package parsimony :: Package datasets :: Package classification :: Module dice5
[hide private]
[frames] | no frames]

Module dice5

source code

Created on Tue Mar 18 10:56:04 2014

Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved.


Author: Edouard Duchesnay

License: BSD 3-clause.

Functions [hide private]
 
load(n_samples=100, shape=(30, 30, 1), snr=2.0, sigma_logit=5.0, random_seed=None, **kwargs)
Generate classification samples (images + target variable) and beta.
source code
Variables [hide private]
  __package__ = 'parsimony.datasets.classification'
Function Details [hide private]

load(n_samples=100, shape=(30, 30, 1), snr=2.0, sigma_logit=5.0, random_seed=None, **kwargs)

source code 
Generate classification samples (images + target variable) and beta.
Call make_regression_struct then apply the logistic function:
proba = 1. / (1 + exp(-(X * beta + noise)), then
y = 1 if proba >= 0.5 else 0

Parameters
----------
See datasets.regression.dice5.

Returns
-------
X3d : Numpy array of shape [n_sample, shape]. The input features.

y : Numpy array of shape [n_sample, 1]. The target variable.

beta3d : Float array of shape [shape]. It is the beta such that
        y = 1. / (1 + exp(-(X * beta + noise)).

proba : Numpy array of shape [n_sample, 1]. Samples posterior
        probabilities.

See also
--------
regression.dice5.load()

Examples
--------
>>> import numpy as np
>>> np.random.seed(42)
>>> import matplotlib.pyplot as plot
>>> from  parsimony import datasets
>>> X3d, y, beta3d, proba = datasets.classification.dice5.load(
...     n_samples=100, shape=(11, 11, 1), random_seed=1)