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)
|