org.apache.ignite.ml.math

## Class Tracer

- java.lang.Object
- - org.apache.ignite.ml.math.Tracer

-     public class Tracer
      extends Object

  Utility methods to support output of `Vector` and `Matrix` instances to plain text or HTML.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `Tracer.ColorMapper` Double to color mapper.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Tracer()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `asAscii(Matrix mtx, String fmt)`
    `static String` | `asAscii(Vector vec, String fmt, boolean showMeta)`
    `static void` | `saveAsCsv(Matrix mtx, String fmt, String filePath)` Saves given matrix as CSV file.
    `static void` | `saveAsCsv(Vector vec, String fmt, String filePath)` Saves given vector as CSV file.
    `static void` | `showAscii(Matrix mtx)`
    `static void` | `showAscii(Matrix mtx, IgniteLogger log, String fmt)`
    `static void` | `showAscii(Matrix mtx, String fmt)`
    `static void` | `showAscii(Vector vec)`
    `static void` | `showAscii(Vector vec, IgniteLogger log)`
    `static void` | `showAscii(Vector vec, IgniteLogger log, String fmt)`
    `static void` | `showAscii(Vector vec, String fmt)`
    `static void` | `showClassificationDatasetHtml(DataStreamGenerator generator, int limit, int xIdx, int yIdx, boolean isLabeled)` Open browser and shows given dataset generator's data on two dimensional plane.
    `static void` | `showClassificationDatasetHtml(String name, DataStreamGenerator generator, int limit, int xIdx, int yIdx, boolean isLabeled)` Open browser and shows given dataset generator's data on two dimensional plane.
    `static void` | `showHtml(Matrix mtx)` Shows given matrix in the browser with D3-based visualization.
    `static void` | `showHtml(Matrix mtx, boolean useAsciiFallback)` Shows given matrix in the browser with D3-based visualization.
    `static void` | `showHtml(Matrix mtx, Tracer.ColorMapper cm)` Shows given matrix in the browser with D3-based visualization.
    `static void` | `showHtml(Matrix mtx, Tracer.ColorMapper cm, boolean useAsciiFallback)` Shows given matrix in the browser with D3-based visualization.
    `static void` | `showHtml(Vector vec)` Shows given vector in the browser with D3-based visualization.
    `static void` | `showHtml(Vector vec, boolean useAsciiFallback)` Shows given vector in the browser with D3-based visualization.
    `static void` | `showHtml(Vector vec, Tracer.ColorMapper cm)` Shows given vector in the browser with D3-based visualization.
    `static void` | `showHtml(Vector vec, Tracer.ColorMapper cm, boolean useAsciiFallback)` Shows given vector in the browser with D3-based visualization.
    `static void` | `showRegressionDatasetInHtml(DataStreamGenerator generator, int limit, int xIdx)` Open browser and shows given dataset generator's data on two dimensional plane.
    `static void` | `showRegressionDatasetInHtml(String name, DataStreamGenerator generator, int limit, int xIdx)` Open browser and shows given dataset generator's data on two dimensional plane.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Tracer

          public Tracer()

  - ### Method Detail

    - #### showAscii

          public static void showAscii(Vector vec,
                                       IgniteLogger log,
                                       String fmt)

      Parameters:
        `vec` - Vector to show.
        `log` - `IgniteLogger` instance for output.
        `fmt` - Format string for vector elements.

    - #### showAscii

          public static void showAscii(Vector vec,
                                       IgniteLogger log)

      Parameters:
        `vec` - Vector to show as plain text.
        `log` - `IgniteLogger` instance for output.

    - #### showAscii

          public static void showAscii(Vector vec,
                                       String fmt)

      Parameters:
        `vec` - Vector to show as plain text.
        `fmt` - Format string for vector elements.

    - #### asAscii

          public static String asAscii(Vector vec,
                                       String fmt,
                                       boolean showMeta)

      Parameters:
        `vec` - Vector to show as plain text.
        `fmt` - Format string for vector elements.
        `showMeta` - Show vector type and size.

    - #### showAscii

          public static void showAscii(Matrix mtx)

      Parameters:
        `mtx` - Matrix to show as plain text.

    - #### showAscii

          public static void showAscii(Matrix mtx,
                                       String fmt)

      Parameters:
        `mtx` - `Matrix` object to show as a plain text.
        `fmt` - Format string for matrix rows.

    - #### asAscii

          public static String asAscii(Matrix mtx,
                                       String fmt)

      Parameters:
        `mtx` - `Matrix` object to show as a plain text.
        `fmt` - Format string for matrix rows.

    - #### showAscii

          public static void showAscii(Matrix mtx,
                                       IgniteLogger log,
                                       String fmt)

      Parameters:
        `mtx` - `Matrix` object to show as a plain text.
        `log` - `IgniteLogger` instance to output the logged matrix.
        `fmt` - Format string for matrix rows.

    - #### showAscii

          public static void showAscii(Vector vec)

      Parameters:
        `vec` - `Vector` object to show as a plain text.

    - #### saveAsCsv

          public static void saveAsCsv(Vector vec,
                                       String fmt,
                                       String filePath)
                                throws IOException

      Saves given vector as CSV file.
      Parameters:
        `vec` - Vector to save.
        `fmt` - Format to use.
        `filePath` - Path of the file to save to.
      Throws:
        `IOException`

    - #### saveAsCsv

          public static void saveAsCsv(Matrix mtx,
                                       String fmt,
                                       String filePath)
                                throws IOException

      Saves given matrix as CSV file.
      Parameters:
        `mtx` - Matrix to save.
        `fmt` - Format to use.
        `filePath` - Path of the file to save to.
      Throws:
        `IOException`

    - #### showHtml

          public static void showHtml(Matrix mtx)
                               throws IOException

      Shows given matrix in the browser with D3-based visualization.
      Parameters:
        `mtx` - Matrix to show.
      Throws:
        `IOException` - Thrown in case of any errors.

    - #### showHtml

          public static void showHtml(Matrix mtx,
                                      boolean useAsciiFallback)
                               throws IOException

      Shows given matrix in the browser with D3-based visualization.
      Parameters:
        `mtx` - Matrix to show.
        `useAsciiFallback` - Use ascii fallback is desktop or browser is unavailable.
      Throws:
        `IOException` - Thrown in case of any errors.

    - #### showHtml

          public static void showHtml(Matrix mtx,
                                      Tracer.ColorMapper cm)
                               throws IOException

      Shows given matrix in the browser with D3-based visualization.
      Parameters:
        `mtx` - Matrix to show.
        `cm` - Optional color mapper. If not provided - red-to-blue (R_B) mapper will be used.
      Throws:
        `IOException` - Thrown in case of any errors.

    - #### showHtml

          public static void showHtml(Matrix mtx,
                                      Tracer.ColorMapper cm,
                                      boolean useAsciiFallback)
                               throws IOException

      Shows given matrix in the browser with D3-based visualization.
      Parameters:
        `mtx` - Matrix to show.
        `cm` - Optional color mapper. If not provided - red-to-blue (R_B) mapper will be used.
        `useAsciiFallback` - Use ascii fallback is desktop or browser is unavailable.
      Throws:
        `IOException` - Thrown in case of any errors.

    - #### showHtml

          public static void showHtml(Vector vec)
                               throws IOException

      Shows given vector in the browser with D3-based visualization.
      Parameters:
        `vec` - Vector to show.
      Throws:
        `IOException` - Thrown in case of any errors.

    - #### showHtml

          public static void showHtml(Vector vec,
                                      boolean useAsciiFallback)
                               throws IOException

      Shows given vector in the browser with D3-based visualization.
      Parameters:
        `vec` - Vector to show.
        `useAsciiFallback` - Use ascii fallback is desktop or browser is unavailable.
      Throws:
        `IOException` - Thrown in case of any errors.

    - #### showRegressionDatasetInHtml

          public static void showRegressionDatasetInHtml(String name,
                                                         DataStreamGenerator generator,
                                                         int limit,
                                                         int xIdx)
                                                  throws IOException

      Open browser and shows given dataset generator's data on two dimensional plane. Label of vectors is used for ordinate representation.
      Parameters:
        `name` - Name of dataset for showing.
        `generator` - Datastream generator.
        `limit` - Count of points that should be taken from dataset.
        `xIdx` - Index of dimension for abscissa representation.
      Throws:
        `IOException` - IOException.

    - #### showRegressionDatasetInHtml

          public static void showRegressionDatasetInHtml(DataStreamGenerator generator,
                                                         int limit,
                                                         int xIdx)
                                                  throws IOException

      Open browser and shows given dataset generator's data on two dimensional plane. Label of vectors is used for ordinate representation.
      Parameters:
        `generator` - Datastream generator.
        `limit` - Count of points that should be taken from dataset.
        `xIdx` - Index of dimension for abscissa representation.
      Throws:
        `IOException` - IOException.

    - #### showClassificationDatasetHtml

          public static void showClassificationDatasetHtml(DataStreamGenerator generator,
                                                           int limit,
                                                           int xIdx,
                                                           int yIdx,
                                                           boolean isLabeled)
                                                    throws IOException

      Open browser and shows given dataset generator's data on two dimensional plane.
      Parameters:
        `generator` - Datastream generator.
        `limit` - Count of points that should be taken from dataset.
        `xIdx` - Index of dimension for abscissa representation.
        `yIdx` - Index of dimension for ordinate representation.
        `isLabeled` - if isLabeled == true then colors will be used for separate different classes on plane.
      Throws:
        `IOException` - IOException.

    - #### showClassificationDatasetHtml

          public static void showClassificationDatasetHtml(String name,
                                                           DataStreamGenerator generator,
                                                           int limit,
                                                           int xIdx,
                                                           int yIdx,
                                                           boolean isLabeled)
                                                    throws IOException

      Open browser and shows given dataset generator's data on two dimensional plane.
      Parameters:
        `name` - Name of dataset for showing.
        `generator` - Datastream generator.
        `limit` - Count of points that should be taken from dataset.
        `xIdx` - Index of dimension for abscissa representation.
        `yIdx` - Index of dimension for ordinate representation.
        `isLabeled` - if isLabeled == true then colors will be used for separate different classes on plane.
      Throws:
        `IOException` - IOException.

    - #### showHtml

          public static void showHtml(Vector vec,
                                      Tracer.ColorMapper cm)
                               throws IOException

      Shows given vector in the browser with D3-based visualization.
      Parameters:
        `vec` - Vector to show.
        `cm` - Optional color mapper. If not provided - red-to-blue (R_B) mapper will be used.
      Throws:
        `IOException` - Thrown in case of any errors.

    - #### showHtml

          public static void showHtml(Vector vec,
                                      Tracer.ColorMapper cm,
                                      boolean useAsciiFallback)
                               throws IOException

      Shows given vector in the browser with D3-based visualization.
      Parameters:
        `vec` - Vector to show.
        `cm` - Optional color mapper. If not provided - red-to-blue (R_B) mapper will be used.
        `useAsciiFallback` - Use ascii fallback is desktop or browser is unavailable.
      Throws:
        `IOException` - Thrown in case of any errors.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022