Creating a dataset using PyBrain
To create a dataset using PyBrain one is required to use the pybrain.datasets (a dataset package of PyBrain). This dataset package offers the support of dataset classes. For example, it provides support for SequentialDataset, SupervisedDataset, ClassificationDataSet. The dataset that is to be used relies on the machine learning task that the programmer wants to implement. In this example, we are going to use SupervisedDataset. A SupervisedDataset dataset has the following syntax,
Syntax: SupervisedDataSet(input, target)
Where,
- input: A data structure (for example, 2-d array)
- target: The output
Example:
In this example, the input has a size equal to 2 and the target has a size equal to 1.
Python3
# Python program to create a dataset # using PyBrain # Importing SupervisedDataSet from # pybrain.datasets from pybrain.datasets import SupervisedDataSet # Creating SupervisedDataSet supervised_dataset = SupervisedDataSet( 2 , 1 ) # Print print (dataSet) |
Output:
How to create a dataset using PyBrain?
In this article, we are going to see how to create a dataset using PyBrain.
Contact Us