Importing data

Loading an example dataset

In order to get acquainted with the AdvancedMiner system you may use one of the bundled example datasets. The data can be accessed via the Favorites component.

To connect examples using Favorites component see the movie or follow the step by step instructions below:

  • Open the Favorites component (Ctrl+3 key) if it is not already opened.

  • Add the directory 'AdvancedMiner\Client\scripts\scripts\data\' to your Favorites by clicking the right mouse button inside the Favorites component. This directory contains example datasets stored in scripts. To view the data table before loading open and view the script by double clicking on it.

For quick loading of data into the connected default database see the movie or follow the step by step instructions below:

  • Choose a dataset, for example 'german_credit.py'.

  • Execute script with the chosen dataset by pressing the F6 key or choosing 'Execute' from the context menu. When you execute the script it will put the data table from the script into the database specified by default alias.

If you now check the alias subtree, the loaded dataset should appear there (choose 'Refresh' from the alias context menu if necessary - see the movie).

Note

  • The Favorites component provides direct access to the files stored on the computer and can be used to create a list of links to the most frequently used directories.

  • GDbase refreshes itself automatically. That is why there is no 'Refresh' action. However in the case of doubts or problems with the database it is recommended to use the 'Reconnect' action.

Importing CSV files

It is also possible to import data from a CSV file (in our example it will be 'german_credit.csv'). After determining the location of 'german_credit.csv' in the Favorites component, run CSV import wizard (use the context menu for the CSV file or the use main menu command File | CSV Import).

After opening the CVS import window, accept the default properties and define the target database and a table name.

Figure 1.4. The CSV Import wizard

The CSV Import wizard

Note

If you want to see the CSV file content, open it in the AdvancedMiner text editor by double clicking on the CSV file in the Favorites component.

Copying tables between different databases

When working with more than one database user may easily copy tables from one database to another without importing and transform the data each time.

To copy a table from one database to another follow the instructions:

  • Select the table in the source database, choose the 'Copy' action (Ctrl+C) from the context menu of the table, and then choose the 'Paste' action (Ctrl+V) from the context menu of the destination database (see the picture below).

    or

  • Use the following code:

                                trans 'BAZA_2.iris' <- 'BAZA.iris':
                                pass
                            

    For more information on the trans procedure see the The Table and Trans Procedures chapter.

Figure 1.5. Copying tables from one database to another

Copying tables from one database to another