VOOZH about

URL: https://www.geeksforgeeks.org/python/how-to-import-datasets-using-sklearn-in-pybrain/

⇱ How to import datasets using sklearn in PyBrain - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to import datasets using sklearn in PyBrain

Last Updated : 28 Feb, 2022

In this article, we will discuss how to import datasets using sklearn in PyBrain

Dataset: A Dataset is defined as the set of data that is can be used to test, validate, and train on networks. On comparing it with arrays, a dataset is considered more flexible and easy to use. A dataset resembles a 2-d array. Datasets are used in executing machine learning tasks.

Libraries need to be installed in our system are:

  • sklearn
  • pybrain

Syntax to install these libraries :

pip install sklearn pybrain

Example 1:

In this example, firstly we have imported packages datasets from sklearn library and ClassificationDataset from pybrain.datasets. Then we have loaded the digits dataset. In the next statement, we are defining feature variables and target variables.  Then we are creating a classification dataset model by defining 64 inputs, 1 output, and 15 classes. Then, we have appended data to the created dataset.

Output:

👁 Image

Example 2:

In this example, firstly we have imported packages datasets from sklearn library and ClassificationDataset from pybrain.datasets. Then we have loaded the iris dataset. In the next statement, we are defining feature variables and target variables.  Then we are creating a classification dataset model by defining 4 inputs, 1 output, and 2 classes. Then, we have appended data to the created dataset.

Output:

👁 Image
Comment