Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MSc Data Science and Advanced Computing

CSMDM21 - Data Analytics and Mining

Practical 1: KNIME Basic I/O

A: Data Input

1.   Create  a  KNIME  workflow  and  use  the node File Reader to  read the  data  file  directly from the URL: http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data

B: Adding Column Headers

The .data file does not contain column headers, which can be found in the corresponding files with extension .names: http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.names

It  is  a good practice to   add  column headers to  make  data  exploration more user friendly. This can be achieved in different ways.

1.   The simplest method is to change the column headers directly in the node File Reader.

2.   Another  simple  way  is  to  use the node  Column Rename,  which  is  specifically meant  for this purpose. However, in both cases the process is tedious as the data contains many (15) attributes.

3.   An  advanced method is to build and use  a dictionary to  change the column headers  of a table to the desired values. Create a text file with the list of desired column headers  (one header per line) or download adult_headers.txt from Blackboard. Read the column header file  in  the workflow  and use  it  to  create  a  dictionary  old_name  vs new_name   for  the column headers. For thistask you can use the nodes: Extract Column Header, Transpose, RowID, Joiner, and Insert Column Header.

C: Result Output

1.   Use the node Interactive Table (local) to view the result table.

2.   Use the node CSV Writer to write the result table to a new file.

Solutions:

Sample solutions to these exercises are available on Blackboard (Bb) in two forms: images of the workflows and the  actual KNIME workflows (as a  single zip archive). You  should first try to build your  own workflows for each  exercise.  During   the  practical  session,  you  may  use   the  images  to   see  the  proposed   solutions   and  to reconstruct them. During or at the end of the practical  session, the archives with the actual KNIME workflows will be made available for you to import and test them. These are KNIME archives (file extension ". knwf ") that can be imported in KNIME. Note that after importing the KNIME  archives, you may need to  change the  file locations of the source data file and the output file destination folder.