prevision_quantum_nn.dataset.dataset
¶
Dataset module
contains the classes to handle datasets
Module Contents¶
Classes¶
DataSet. |
-
class
prevision_quantum_nn.dataset.dataset.
DataSet
¶ DataSet.
Abstraction to handle user data
-
num_features
¶ number of features in the dataset
- Type
int
-
num_categories
¶ number of categories in the case of multiclassification
- Type
int
-
from_numpy
(self, train_features, train_labels, val_features=None, val_labels=None)¶ Creates a DataSet from a set of numpy arrays.
- Parameters
train_features (numpy array) – array of features for the training phase
train_labels (numpy array) – array of labels for the training phase
val_features (numpy array) – array of features for the validation phase
val_labels (numpy array) – array of labels for the validation phase
- Returns
DataSet
- Return type
a dataset
-
from_pandas
(self, train_data_frame, targets, val_data_frame)¶ Creates a DataSet from a set of pandas dataframes.
- Parameters
train_data_frame (pandas DataFrame) – dataframe for the training phase
targets (list) – list of targets columns in input data frames
val_data_frame (pandas DataFrame) – dataframe for the validation phase
- Returns
DataSet
- Return type
a dataset
-
to_numpy
(self)¶ Returns the dataset in the numpy format.
- Returns
- numpy array
training features
- self.train_labels: numpy array
training labels
- self.val_features: numpy array
validation features
- self.val_labels: numpy array
validation labels
- Return type
self.train_features
-