.. 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

* An entire column can be filled with a single value by right-clicking and selecting Fill with value (see Figure 5)

.. figure:: images/datamatrixFillWithValue.png

    Figure 5: Fill column with values

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 6 and 7 display the options available by right-clicking row header and column.

.. figure:: images/datamatrix5.png

	Figure 6: Right-click the row header - options

.. figure:: images/datamatrix6.png

	Figure 7: 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

It is also possible to plot a single column's data against the row ID's

* Right-click and select the *Plot column* 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