How to create attractive appearance html output from the result of a RapidMiner process using the Freemarker operator?

If you've never used the Freemarker template engine, please find more information on the product site:

http://freemarker.incubator.apache.org/

Data mappings between the RapidMiner ExampleSet and the Freemarker operators Rows and Columns.

Data mappings
Rapidminer data structure Freemarker operator data structure
ExampleSetrows
Examplerow
Example valuesrow.cells
Attributescolumns
Attributecolumn
Attribute namecolumn.name
Attribute typecolumn.type and cell.type
Attribute valuecell.value

Column type mappings:
Rapidminer data type Freemarker operator data type
nominalTEXT
numericalREAL
integerINTEGER
realREAL
textTEXT
binominalTEXT
polynominalTEXT
file_pathTEXT
date_timeDATE
dateDATE
timeDATE

The basic html template (without css and javascript) file main.ftl is the following:

 
    <!DOCTYPE html>
    <html>
      <head>
        <title>${title}</title>
      </head>
      <body>
        <div id="wrapper">
          <H1>${title}</H1>
          
          <table id="keywords" cellspacing="0" cellpadding="0">
            <thead>
              <tr>
              <#list columns as col>
                <th class="header"><span>${col.name}</span></th>
              </#list>
              </tr>
            </thead>
            <tbody>
            <#list rows as row>
              <tr>
              <#list row.cells as cell>
                <td>${cell}</td>
              </#list>
              </tr>
            </#list>
            </tbody>
          </table>
        </div> 
      </body>
    </html>
    

The Rapidminer process to create an example html output with this template.

You can download the following example process here.



Add styling and javascript to the template.

You can download the example main.ftl with styling and javascript table sorting here.

Enjoy it!

Authors and Contributors

In 2015, Karoly Fuzeseri (@fuzeseri), started to work on this projekt.

Support or Contact

Please contact me on the github