.. index:: Data Matrix

.. _Data_Matrix:

Data Matrix
===========

The data matrix is HUGINs tool for inspecting and manipulating data sets. Data is displayed using a grid like interface very similar to what most users know from Excel, see Figure 1. 
The data matrix is available in places dealing with data files, including the :ref:`learning-<learning_wizard>` and :ref:`EM wizards<EM_wizard>`, the :ref:`data frame functionallity<data_Frame>` and other places dealing with data.

.. figure:: images/datamatrix1.png

	Figure 1: A typical data matrix view

The leftmost column is the row header which display row numbers, first row is 0 as rows are zero-indexed. The top header display column names, when using data with a HUGIN model the columns represent nodes.

Basic Editing
-------------

The data set can be inspected using the data matrix. Although HUGIN is not EXCEL, some basic editing of data items can be performed:

* Use Mouse pointer or cursor-keys to navigate about
* Double-click a cell to edit the data item (see Figure 2)

.. figure:: images/datamatrix2.png

	Figure 2: Editing a cell

* Double-click column header to edit column name (see Figure 3)

.. figure:: images/datamatrix3.png

	Figure 3: Renaming column

* Search and replace values in single column/all columns by right-clicking and selecting Replace values (see Figure 4)

.. figure:: images/datamatrix4.png

	Figure 4: Basic search and replace

* Re-order columns by clicking a column header and dragging the column left or right

Rows and columns can be edited as well:

* Create/delete row by right-clicking row header and selecting *insert- or delete row*
* Create/delete column by right-clicking column header and selecting *insert- or delete column*

Figures 5 and 6 display the options available by right-clicking row header and column.

.. figure:: images/datamatrix5.png

	Figure 5: Right-click the row header - options

.. figure:: images/datamatrix6.png

	Figure 6: Right-click column - options

Advanced Functionallity
-----------------------

Columns containing numerical data, **exclusively**, can be discretized into a set of intervals by launching the discretizer (read more about the :ref:`discretization<discretization>` features):

* Right-click a column containing numerical data and select Discretize values

More elaborate modifications are performed using batch preprocessing (read more about the :ref:`preprocessing (Data Processing)<data_processing>` features):

* Right-click and select the *Data Processing* option

To inspect properties of the data set use the data set analysis functionallity (read more about the :ref:`data analysis<data_analysis>` features):

* Right-click and select the *Analysis* option

To perform analysis of classifier performance (read more about the :ref:`classifier performance<data_classifier_performance>` analysis):

* Right-click and select the *Classifier Performance* option