\documentclass{beamer}
% \documentclass[handout]{beamer}

\usetheme{dcc}

\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{url}

\newcommand{\ie}{i.\,e.}
\newcommand{\Ie}{I.\,e.}
\newcommand{\eg}{e.\,g.}
\newcommand{\Eg}{E.\,g.}

\newcommand{\pub}{\hskip2pt\raisebox{-3.5pt}{\pgfuseimage{beamericonarticle}}\hskip1pt}

\definecolor{good}{RGB}{0,153,0}
\definecolor{bad}{RGB}{153,0,0}

\title{Mineração de Dados Aplicada}
\subtitle{Pre-Processes, Visualizations and Statistics with KNIME}

\author{Loïc Cerf}

\date{March, 26th 2025}

\institute
{
  \scriptsize
  DCC -- ICEx -- UFMG
  \bigskip\\
  \includegraphics[width=.334113288\linewidth]{images/dcc}\hfill\includegraphics[width=.5\linewidth]{images/ufmg}
}

\subject{Pre-Processes, Visualizations and Statistics with KNIME}

\keywords{KNIME, platform, pre-processes, visualizations, statistics}

\hypersetup{pdfpagemode=FullScreen}

\AtBeginSection[]
{
  \begin{frame}<beamer>
    \frametitle{Outline}
    \tableofcontents[currentsection]
  \end{frame}
}

\begin{document}

\begin{frame}[plain]
  \titlepage
\end{frame}

\begin{frame}
  \frametitle{Outline}
  \tableofcontents
\end{frame}

\section{Presentation of KNIME}

\begin{frame}
  \frametitle{KNIME: a platform with a future}
  KNIME is a data mining platform assuming no programming skill:
  \begin{itemize}[<+->]
  \item started in January 2004 and \textcolor{good}{actively
      developed} by the university of Konstanz, Germany and, now,
    \emph{KNIME GmbH} and \textcolor{good}{partners};
  \item distributed under the terms of the \textcolor{good}{GNU
      GPLv3};
  \item with \textcolor{good}{thousands of additional nodes and
      extensions}, some \textcolor{bad}{proprietary};
  \item \textcolor{good}{example workflows, cheat sheets, white
      papers, books, videos, forum, support, offline and online
      trainings, specific developments};
  \item percentage of data miners using KNIME according to the
    \emph{KDNuggets} polls: 5.9\% in 2013, 15\% in 2014, 20\% in 2015,
    18\% in 2016, \textcolor{bad}{21\% in 2017, 12.3\% in 2018, 10.7\%
      in 2019};
  \item \textcolor{good}{``Top-scores in customer satisfaction''}
    according to the \emph{Rexer Analytics 2013 survey} over 1250 data
    mining professionals;
  \item \textcolor{good}{``user community of 300,000+ across all
      industries and in over 60 countries''} according to
    \url{https://www.knime.com/about}.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Framework}
  \begin{itemize}[<+->]
  \item \textcolor{good}{Easily installable} although not in the
    repositories of the distributions;
  \item \textcolor{bad}{$\approx$1.2 GB of disk space (without
      extensions) and slow to start}: KNIME includes (the last
    versions of) Eclipse and the JRE;
  \item \textcolor{bad}{Stability problems};
  % \item \textcolor{bad}{Display glitches};
  \item \textcolor{good}{Rich GUI familiar} to Java developers (based
    on Eclipse);
  \item \textcolor{good}{Self-documented} (à la \texttt{man});
  \item \textcolor{good}{Over 1,000 hierarchically-organized base
      nodes}, but \textcolor{bad}{only ``starter nodes''} in the
    modern UI, by default.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{KNIME's classic UI}
  \begin{center}
    \includegraphics[width=.8\linewidth]{img/GUI}
  \end{center}
\end{frame}

\begin{frame}
  \frametitle{KNIME's modern UI}
  \begin{center}
    \includegraphics[width=\linewidth]{img/modern_GUI}
  \end{center}
\end{frame}

\begin{frame}
  \frametitle{Example of workflow}
  \begin{center}
    \includegraphics[width=.8\linewidth]{img/workflow}
  \end{center}
\end{frame}

\begin{frame}
  \frametitle{Data-flow metaphor}
  \begin{itemize}[<+->]
  \item \textcolor{good}{Great to communicate} (with ability to label
      nodes);
  \item \textcolor{good}{A unified interface to the nodes:
      shape-and-color-identified ``ports'' for data, databases,
      models, etc.};
  \item \textcolor{good}{Meta-nodes};
  \item \textcolor{bad}{Many clicks and drags};
  \item \textcolor{good}{Ability to execute a node, a branch or the
      whole flow};
  \item \textcolor{bad}{Some quirks w.r.t. the domains} (domain
    calculator node);
  \item \textcolor{good}{``Hilite'' is transverse to the flow}.
  \end{itemize}

  \vfill
  \uncover<8>
  {
    However this flow is not a stream, \ie, the \textcolor{bad}{nodes
      on a branch are sequentially
      executed}. \textcolor{good}{Different branches are executed in
      parallel}.
  }
\end{frame}

\begin{frame}
  \frametitle{Programming your own nodes}
  \begin{itemize}[<+->]
  % \item \textcolor{good}{Meta-nodes and components};
  \item \textcolor{good}{Java snippets} with \textcolor{bad}{a strange
      syntax and troubles to debug};
  \item Nodes can be programmed in \textcolor{good}{Java or Python};
  \item \textcolor{good}{A developer guide and a well documented API}.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{A great interoperability}
  The main data structure is the table \texttt{objects} $\times$
  \texttt{attributes}. The attributes are typed (modifiable with the
  nodes ``X To Y'').

  \vfill
  \pause

  Beside its internal formats for tables and models, KNIME can
  read/write:
  \begin{itemize}
  \item \textcolor{good}{CSV} files;
  \item \textcolor{good}{PMML} \textcolor{bad}{4.2} files;
  \item \textcolor{good}{ARFF} files (used by Weka), etc.
  \end{itemize}

  \vfill
  \pause

  KNIME can \textcolor{good}{connect to databases} (\eg, PostgreSQL
  and SQLite) using the related Java classes.
\end{frame}

\begin{frame}
  \frametitle{Pre-pocessing capabilities}
  \begin{itemize}[<+->]
  \item Thought for \textcolor{good}{large amounts of data} (cache and
    parallel execution);
  \item Database-like pre-processing that is \textcolor{bad}{far more
      efficiently done with GNU commands} both in terms of
    ``development'' effort and in terms of efficiency;
  \item \textcolor{bad}{Some lack of homogeneity} (\eg,
    w.r.t. regexp);
  \item \textcolor{good}{Many pre-processes that are specifically
      thought for data mining}: binning, normalizing, processing
    missing values, sampling, etc.
  % \item Tools to pre-process \textcolor{good}{time series}.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Visualization and statistic capabilities}
  \begin{itemize}[<+->]
  \item \textcolor{good}{traditional diagrams}: bar charts,
    histograms, line plots, scatter plots/matrices, (conditional) box
    plots, heatmaps, etc.;
  \item \textcolor{good}{Data mining specific diagrams}: lift charts
    and ROC curves (to visualize the performance of a predictor),
    etc.;
  \item \textcolor{bad}{New, legacy and JavaScript (D3)} diagrams;
  \item Nodes to manage the colors (and shapes and sizes)
    \textcolor{good}{for all the subsequent} diagrams;
  \item Export to PNG (\textcolor{good}{SVG} too, but
    \textcolor{bad}{only for the legacy} diagrams);
  \item \textcolor{bad}{A few statistic tools}: t-tests, ANOVA,
    samplings, linear and rank correlations, (standardized) Cronbach
    Alpha;
  \item \textcolor{good}{The R plugin} to get the power of (one of)
    the best and most feature-full environment for statistics.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Data mining capabilities}
  \begin{itemize}[<+->]
  \item Quite \textcolor{good}{a lot of implemented algorithms} for
    clustering, dimensionality reduction, regression and
    classification (including ensemble learning such as boosting and
    bagging);
  \item \textcolor{good}{Any similarity measure} is definable;
  \item \textcolor{bad}{Clumsy and limited for itemset or association
      rule mining};
  \item \textcolor{bad}{Algorithms to process more structured data}
    (spatio-temporal data, sequences, trees, graphs, etc.) are absent
    from the \textcolor{good}{default} platform;
  \item \textcolor{good}{The Weka plugin} to access the algorithms in
    this platform;
  \item Other \textcolor{good}{plugins for more specialized tasks}
    (\eg, OSM integration, nodes specific to bioinformatics,
    chemistry, image processing and analysis, text mining, etc.).
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Quality measures}
  \begin{itemize}[<+->]
  \item \textcolor{good}{Coefficient of determination and related
      measures};
  \item \textcolor{good}{All classical measures for classification};
  % \item \textcolor{good}{Easy cross-validation} with a meta-node;
  \item \textcolor{bad}{Only the entropy and the silhouette to assess
      a clustering};
  \item \textcolor{bad}{Only classical measures (frequency, confidence
      and lift) to assess an association rule}.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Conclusion}
  KNIME is:
  \begin{itemize}
  \item a rapidly evolving data mining platform that conveniently
    makes available many visualization, statistical and data mining
    tools;
  \item easy to ``jump in'' (workflow metaphor, ports, self-documented
    nodes, etc.);
  \item well designed, greatly interoperable and can be easily
    extended with plugins or with internally developed nodes;
  \item good for interactive work.
  \end{itemize}
\end{frame}

\section{Pre-processes, visualizations and statistics in KNIME}

\begin{frame}
  \frametitle{The bear dataset}
  \url{http://dcc.ufmg.br/~lcerf/bears.csv}.

  \vfill

  \begin{exampleblock}{Context}
    143 wild bears were anesthetized, and their bodies were measured
    and weighed. One goal of the study was to make a table (or perhaps
    a set of tables) for hunters, so they could estimate the weight of
    a bear based on other measurements. This would be used because in
    the forest it is easier to measure the length of a bear, for
    example, than it is to weigh it.
  \end{exampleblock}

  \vfill

  \pub Dataset supplied by Gary Alt. Entertaining references in
  Reader's Digest April, 1979, and Sports Afield September, 1981.
\end{frame}

\begin{frame}
  \frametitle{The attributes of the bears}
  The nine attributes are:

  \vfill

  \begin{tabular}{l|l}
    \texttt{Age} & Bear's age, in months. Estimated by an expert.\\
    \hline
    \texttt{Month} & Month when the measurement was made.\\
    & 1 = Jan., 2 = Feb., \dots, 12 = Dec.\\
    \hline
    \texttt{Sex} & 1 = male, 2 = female\\
    \hline
    \texttt{Headlen} & Length of the head, in inches\\
    \hline
    \texttt{Headwth} & Width of the head, in inches\\
    \hline
    \texttt{Neck} & Girth of (distance around) the neck, in inches\\
    \hline
    \texttt{Length} & Body length, in inches\\
    \hline
    \texttt{Chest} & Girth of (distance around) the chest, in inches\\
    \hline
    \texttt{Weight} & Weight of the bear, in pounds
  \end{tabular}
\end{frame}

\begin{frame}
  \frametitle{Practicing KNIME on \texttt{bears.csv}}
  \begin{itemize}
  \item Check the types of the attributes and convert them if
    necessary (try converting the sex into
    \texttt{male}/\texttt{female});
  \item Compute the body mass index ($\frac{\text{mass
        (lb)}}{(\text{height (in)})^2} \times 703$);
  \item Compute some statistics on the different attributes;
  \item Identify (globally and per sex) outliers on the different
    attributes and on the different pairs of attributes;
  \item Remove some of them;
  \item Fit a regression model predicting the weight;
  \item Based on when the sex distinction becomes apparent, tag the
    bears as \texttt{young}/\texttt{adult};
  \item Coloring the bears w.r.t. their sex, identify and derive more
    relevant attributes to predict the sex of adults;
  % \item Normalize the attributes.
  \end{itemize}
\end{frame}

\section*{}

\begin{frame}
  \frametitle{License}
  \begin{block}{\copyright 2012--2025 Loïc Cerf}
    \includegraphics[height=1.5ex]{img/licenses/cc-by-sa}\hskip1pt
    These slides are licensed under the Creative Commons
    Attribution-ShareAlike 4.0 International License.
  \end{block}
\end{frame}

\end{document}