Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

To be able to see the results and work with them, the results from a project needs to be stored. There are different ways of storing data in BellaDati ML Studio - permanently and temporarily. For storing the data permanently, they need to be stored in data set. Temporary storage is available only for current session. Tables and various charts can be used as temporary storage (temporary output). These tables and charts are deleted after end of each session. 

Storing data Permanently in Data Set

To be able to store data in data set, the data set with correct structure (attribute and indicators) needs to be already created. See Creating Data Set for more information.

Function storeDataset is used for storing the data. The function is defined like this:

Code Block
storeDataset(Integer datasetId, InputStream is, Map<Object, Object> params)

Parameters

All parameters are mandatory.

  • datasetID - defines the id of the data set. It can be set by the Code builder or it can be found in the URL of the data set.
  • is - defines the source of data which should be stored. It needs to be in a form of an input stream - see Reading as a stream for more information.
  • params - a Map of parameters which defines mapping and method of storing. 
    • mapping - list of String where each String is a code of a column from target data set. This means, that first column from the source input stream is mapped to first column in the list, second columns from the source input stream is mapped to second column in the list etc.
    • method - defines method of import which will be used for storing. If not defined, the data will be appended to the data already stored in the target data set. If defined as delete_all, all existing data in the target data set will be deleted and data from the input stream will be stored in the data set.
    • fill - optional parameter which can be used for putting the same values to all rows of one column.

Sample usage

Code Block
languagejava
table('temptable', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')
storeDataset(16, streamTable('temptable'), ["mapping": "M_COLUMN_1,M_COLUMN_2","method" : "delete_all"])

This code will first create a temporary table 'temptable' and then store in data set with ID 16. First column of the table is mapped to indicator with code M_COLUMN_1, second column is mapped to indicator with code M_COLUMN_2. Method delete_all is used and therefore all existing data in the target data set will be deleted before storing data from the table.

Code Block
languagejava
table('temptable2', [ 1,2,3,4], 'Column 1');
storeDataset(17, streamTable('temptable'), ["mapping": "M_COLUMN_1","method" : "delete_all",  fill : "M_COLUMN_2=10"])

This code will first create a temporary table 'temptable2' with one column and then store in data set with ID 17. The column of the table is mapped to indicator with code M_COLUMN_1. Second column with code M_COLUMN_2 will be filled with number 10 (all rows). Method delete_all is used and therefore all existing data in the target data set will be deleted before storing data from the table. 

Storing Data Temporarily

Data can temporarily stored (displayed) as:

  • Table 
  • Bar Chart
  • Box Plot Chart.

Storing data in table

Temporary table can be used for displaying results in a form of rows and columns. List of tables is displayed in control sidebar on left side of the screen in section Tables. The table itself is displayed in the right sidebar. It is also available to download it as a CSV file.

Function table is used for storing the data in table. The function is defined like this:

Code Block
languagejs
table(String id, Object data, String... columns)

Parameters

Parameter data is mandatory, parameters id and columns are optional.

  • id - defines the id (name) of the table
  • data - defines the content of the table
  • columns - defines the names of columns. It is possible to define names for some columns only.

Sample usage

Code Block
languagejs
table('first', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')
table([ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column A',)

This code will create two tables with the same content. The first table has defined its name and names of both columns. Second table does not have its name defined and therefore it will be named as table_2. It also has defined name only for the first column. The second will be named automatically as 1.

Displaying data in bar chart

It is possible to display results in a form of a bar chart. List of charts is displayed in control sidebar on left side of the screen in section Charts. The chart itself is displayed in the right sidebar.

Function barChart is used for displaying the data as a bar chart. The function is defined like this:

Code Block
languagejs
barChart(String id, Object data, Map<Object, Object> params, String... columns)

Parameters

Parameter data is mandatory, parameters id, params and columns are optional.

  • id - defines the id (name) of the chart
  • data - defines the content of the chart
  • params - defines additional parameters of the chart, such as color.
  • columns - defines the legend on X axis.

Sample usage

Code Block
languagejs
barChart('bar chart',[1, 2, 3, 2, 1],["color":"#09DDCC"],'Results')

This code will create a bar chart with the name "bar chart", with five columns, cyan color and label "Results" on X axis.

Displaying data in box plot chart

Another option is to display results in a form of a box plot chart. List of charts is displayed in control sidebar on left side of the screen in section Charts. The chart itself is displayed in the right sidebar.

Function boxPlotChart is used for displaying the data as a box plot chart. The function is defined like this:

Code Block
languagejs
boxPlotChart(String id, Object data, Map<Object, Object> params, String... columns)

Parameters

Parameter data is mandatory, parameters id, params and columns are optional.

  • id - defines the id (name) of the chart
  • data - defines the content of the chart. Six values need to be defined, in this order:
    • min

    • max

    • avg

    • median

    • first quartile

    • third quartile.

  • params - defines additional parameters of the chart, such as color, start etc.
    • start - defines which number (column) should be used as first value (starting from 0). Example: there are 7 values defined, the user does not want to use the first value -> "start":1.
    • color - defines color of the chart.
    • labels - defines which column contains labels
    • scale - defines scaling of the chart
      • possible values: "relative"
  • columns - defines the legend on X axis.

Sample usage

Code Block
languagejs
 boxPlotChart([[ 1,3, 10, 5, 6, 3.2, 7]] , ["start":1, "color": "lightblue"] )

Code Block
languagejs
data = [ [ 'First', 1, 10, 5, 6, 3.2, 7 ], [ 'Second', 4, 14, 9, 10, 6.2, 10 ], [ 'Third', 4, 14, 9, 10, 6.2, 10 ] ]
boxPlotChart(data, [ "start": 1, "labels": 0, "color": "purple", "scale": "relative"] )

 


table('temptable', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')storeDataset(16, streamTable('temptable'), ["mapping": "M_COLUMN_1,M_COLUMN_2","method" : "delete_all"])

Sv translation
languageja

結果を確認できるように、プロジェクトからの結果が保存される必要があります。

BellaDati ML Studioには、永続的且つ一時的にデータを保存するさまざまな方法があります。

永続的にデータを保存するように、それらはデータセットに保存する必要があります。

 

一時保存には現行のセッションだけで使用可能です。テーブルや各種グラフは一時保存(一時出力)として使用することができます。それらのテーブルや各種グラフは各セッションの終了後に削除されます。 

データセットへの永続データの保存

データセットにデータを保存できるように、正しい構造(属性とインジケータ)を持つデータセットを既に作成しておく必要があります。 詳細については、データセットの作成を参照する。storeDatasetの関数の目的はデータを保存する為です。この関数は以下のように定義されます。

Code Block
storeDataset(Integer datasetId, InputStream is, Map<Object, Object> params)

パラメータ

全てのパラメータは必須です。

  • datasetID - データセットのIDを定義します。コードビルダーで設定することも、データセットのURLに見つかることもできます。
  • is - 保存対象データのソースを定義します。それは入力ストリームの形式に従う必要があります。詳細は「ストリームとしての読込」をご参照ください。
  • paramsマッピングと保存方法を定義するパラメータのマップです。
    • mapping - l各文字列が対象データセットからのコラムのコードに一致する文字列一覧です。つまり、ソース入力ストリームからの先頭コラムがリストの先頭コラムに一致します。順にソース入力ストリームからの二番目コラムがリストの二番目コラムに一致します。
    • method保存用インポートメソッドを定義します。メソッドを定義しなければ、対象データセットに保存したデータに付与されます。delete_allと定義する場合、対象データセットの全ての既存データが削除され、入力ストリースからのデータはデータセットに保存されます。
    • fill一つのコラムの全ての列に同じな値を詰める任意パラメータです。

使用例

Code Block
languagejava
table('temptable', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')
storeDataset(16, streamTable('temptable'), ["mapping": "M_COLUMN_1,M_COLUMN_2","method" : "delete_all"])

このコードは、最初に'temptable' の'一時テーブル'を作成し、ID 16のデータセットに保存します。テーブルの先頭コラムは、コードM_COLUMN_1のインジケータに一致されます。二番目コラムは、コードM_COLUMN_2のインジケータに一致されます。メソッドdelete_allが使用できるように、テーブルからデータを保存する前に対象データセットの既存の全データは削除されます。

Code Block
languagejava
table('temptable2', [ 1,2,3,4], 'Column 1');
storeDataset(17, streamTable('temptable'), ["mapping": "M_COLUMN_1","method" : "delete_all",  fill : "M_COLUMN_2=10"])

このコードは、一つのコラムを持つ'temptable2'の一時テーブルを作成し、ID 17のデータセットに保存します。テーブルのコラムは、コードM_COLUMN_1のインジケータに一致されます。コード「M_COLUMN_2」で二番目コラムは、全ての列に10を詰めます。メソッドdelete_allが使用できるように、テーブルからデータを保存する前に対象データセットの既存の全データは削除されます。

データの一時保存

一時保存対象データは以下の通りです。

  • テーブル 
  • グラフバー
  • 箱ひげ図

テーブルへのデータの保存

一時テーブルは列及びコラムを持つフォームに結果を表示するのに用いられます。テーブルのリストは、セクションテーブルの画面の左側のコントロールサイドバーに表示されます。テーブル自体は右側のサイドバーに表示されます。また、CSVファイルとしてダウンロードすることもできます。

Image Added

tableの関数の目的はテーブルへデータを保存する為です。この関数は以下のように定義されます。

Code Block
languagejs
table

To be able to see the results and work with them, the results from a project needs to be stored. There are different ways of storing data in BellaDati ML Studio - permanently and temporarily. For storing the data permanently, they need to be stored in data set. Temporary storage is available only for current session. Tables and various charts can be used as temporary storage (temporary output). These tables and charts are deleted after end of each session. 

Storing data Permanently in Data Set

To be able to store data in data set, the data set with correct structure (attribute and indicators) needs to be already created. See Creating Data Set for more information.

Function storeDataset is used for storing the data. The function is defined like this:

Code Block
storeDataset(Integer datasetId, InputStream is, Map<Object, Object> params)

Parameters

All parameters are mandatory.

  • datasetID - defines the id of the data set. It can be set by the Code builder or it can be found in the URL of the data set.
  • is - defines the source of data which should be stored. It needs to be in a form of an input stream - see Reading as a stream for more information.
  • params - a Map of parameters which defines mapping and method of storing. 
    • mapping - list of String where each String is a code of a column from target data set. This means, that first column from the source input stream is mapped to first column in the list, second columns from the source input stream is mapped to second column in the list etc.
    • method - defines method of import which will be used for storing. If not defined, the data will be appended to the data already stored in the target data set. If defined as delete_all, all existing data in the target data set will be deleted and data from the input stream will be stored in the data set.
    • fill - optional parameter which can be used for putting the same values to all rows of one column.

Sample usage

Code Block
languagejava
table('temptable', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')
storeDataset(16, streamTable('temptable'), ["mapping": "M_COLUMN_1,M_COLUMN_2","method" : "delete_all"])

This code will first create a temporary table 'temptable' and then store in data set with ID 16. First column of the table is mapped to indicator with code M_COLUMN_1, second column is mapped to indicator with code M_COLUMN_2. Method delete_all is used and therefore all existing data in the target data set will be deleted before storing data from the table.

Code Block
languagejava
table('temptable2', [ 1,2,3,4], 'Column 1');
storeDataset(17, streamTable('temptable'), ["mapping": "M_COLUMN_1","method" : "delete_all",  fill : "M_COLUMN_2=10"])

This code will first create a temporary table 'temptable2' with one column and then store in data set with ID 17. The column of the table is mapped to indicator with code M_COLUMN_1. Second column with code M_COLUMN_2 will be filled with number 10 (all rows). Method delete_all is used and therefore all existing data in the target data set will be deleted before storing data from the table. 

Storing Data Temporarily

Data can temporarily stored (displayed) as:

  • Table 
  • Bar Chart
  • Box Plot Chart.

Storing data in table

Temporary table can be used for displaying results in a form of rows and columns. List of tables is displayed in control sidebar on left side of the screen in section Tables. The table itself is displayed in the right sidebar. It is also available to download it as a CSV file.

Image Removed

Function table is used for storing the data in table. The function is defined like this:

Code Block
languagejs
table(String id, Object data, String... columns)

Parameters

Parameter data is mandatory, parameters id and columns are optional.

  • id - defines the id (name) of the table
  • data - defines the content of the table
  • columns - defines the names of columns. It is possible to define names for some columns only.

Sample usage

Code Block
languagejs
table('first', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')
table([ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column A',)

This code will create two tables with the same content. The first table has defined its name and names of both columns. Second table does not have its name defined and therefore it will be named as table_2. It also has defined name only for the first column. The second will be named automatically as 1.

Image Removed

Displaying data in bar chart

It is possible to display results in a form of a bar chart. List of charts is displayed in control sidebar on left side of the screen in section Charts. The chart itself is displayed in the right sidebar.

Image Removed

Function barChart is used for displaying the data as a bar chart. The function is defined like this:

Code Block
languagejs
barChart(String id, Object data, Map<Object, Object> params, String... columns)
Parameters

パラメータ

Parameter data is mandatory, parameters id, params and columns are optional.

  • id - defines the id (name) of the chart
  • data - defines the content of the chart
  • params - defines additional parameters of the chart, such as color.
  • columns - defines the legend on X axis.

Sample usage

Code Block
languagejs
barChart('bar chart',[1, 2, 3, 2, 1],["color":"#09DDCC"],'Results')

This code will create a bar chart with the name "bar chart", with five columns, cyan color and label "Results" on X axis.

Image Removed

Displaying data in box plot chart

Another option is to display results in a form of a box plot chart. List of charts is displayed in control sidebar on left side of the screen in section Charts. The chart itself is displayed in the right sidebar.

Function boxPlotChart is used for displaying the data as a box plot chart. The function is defined like this:

パラメータ「data」は必須ですが、パラメータ「id」及び「columns」は任意です。

  • idテーブルのID(名称)を定義します。
  • dataテーブルの中身を定義します。
  • columnsコラム名を定義します。幾つかのコラムだけに名称を定義できます。

使用例

Code Block
languagejs
table('first', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')
table([ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column A',)

このコードは同一な中身で二つのテーブルを作成することができます。 

第一テーブルは自体のテーブル名と二つのコラム名を定義します。第二テーブルの名称がまだ定義されていないので、第二テーブルの名称に「table_2」を付与します。その名称は一コラム目に定義されます。 

二コラム目の名称は自動的に1付加されます。

Image Added

バーグラフのデータ表示

バーグラフの形式で結果も表示することができます。グラフリストは、画面のセクションの左側のコントロールサイドバーに表示されます。グラフ自体は右側のサイドバーに表示されます。

Image Added

barChartの関数の目的はバーグラフとしてデータを表示する為です。この関数は以下のように定義されます。

Code Block
languagejs
barChart(String id, Object data, Map<Object, Object> params, String... columns)

パラメータ

パラメータ「data」は必須ですが、パラメータ「id」、「params」及び「columns」は任意です。

  • id - グラフのID(名称)を定義します。
  • data - グラフの中身を定義します
  • params色などのグラフの追加パラメータを定義します。
  • columns - 横軸上の凡例を定義します。

使用例

Code Block
languagejs
boxPlotChartbarChart(String id, Object data, Map<Object, Object> params, String... columns)

Parameters

Parameter data is mandatory, parameters id, params and columns are optional.

  • id - defines the id (name) of the chart
  • data - defines the content of the chart. Six values need to be defined, in this order:
    • min

    • max

    • avg

    • median

    • first quartile

    • third quartile.

  • params - defines additional parameters of the chart, such as color, start etc.
    • start - defines which number (column) should be used as first value (starting from 0). Example: there are 7 values defined, the user does not want to use the first value -> "start":1.
    • color - defines color of the chart.
    • labels - defines which column contains labels
    • scale - defines scaling of the chart
      • possible values: "relative"
  • columns - defines the legend on X axis.
'bar chart',[1, 2, 3, 2, 1],["color":"#09DDCC"],'Results')

このコードは横軸上にシアンの色、「結果」ラベルで5コラムを含むバーグラフを作成します。

Image Added

箱ひげ図でのデータ表示

箱ひげ図の形式で結果も表示することができます。グラフリストは、画面のセクションの左側のコントロールサイドバーに表示されます。グラフ自体は右側のサイドバーに表示されます。

boxPlotChart の関数の目的は箱ひげ図としてデータを表示する為です。

この関数は以下のように定義されます。

Code Block
languagejs
boxPlotChart(String id, Object data, Map<Object, Object> params, String... columns)

パラメータ

パラメータ「data」は必須ですが、パラメータ「id」、「 params」、「columns」は任意です。

  • id - グラフのID(名称)を定義します。
  • data - グラフの中身を定義します。下記の6値を順に定義する必要があります。
    • 最小値

    • 最大値

    • 平均値

    • 中央値

    • 第1四分位点

    • 第3四分位点

  • params - 色、開始の値などのグラフの追加パラメータを定義します。
    • start - 最初の値(0から始まる)としての利用対象数値を定義します。
      例えば、7値は定義されていますが、ユーザーが最初の値を利用したなくので、開始の値が1になります。
    • color - グラフの色を定義します。
    • labels - ラベルを含むコラムを定義します。
    • scale - グラフのスケーリングを定義します。
      • 可能な値:"相対"
  • columns - 横軸上の凡例を定義します。

使用例

Sample usage

Code Block
languagejs
 boxPlotChart([[ 1,3, 10, 5, 6, 3.2, 7]] , ["start":1, "color": "lightblue"] )

Code Block
languagejs
data = [ [ 'First', 1, 10, 5, 6, 3.2, 7 ], [ 'Second', 4, 14, 9, 10, 6.2, 10 ], [ 'Third', 4, 14, 9, 10, 6.2, 10 ] ]
boxPlotChart(data, [ "start": 1, "labels": 0, "color": "purple", "scale": "relative"] )

 


table('temptable', [ [ 1, 2 ], [ 2, 3], [ 3, 4] , [ 4, 5] ], 'Column 1','Column 2')storeDataset(16, streamTable('temptable'), ["mapping": "M_COLUMN_1,M_COLUMN_2","method" : "delete_all"])