Difference between revisions of "Orange: Feature Constructor"

From OnnoWiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/featureconstructor.html
 
Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/featureconstructor.html
  
Add new features to your dataset.
+
Widget Feature Constructor menambahkan feature baru ke dataset.
  
Inputs
 
  
    Data: input dataset
+
==Input==
  
Outputs
+
Data: input dataset
  
    Data: dataset with additional features
+
==Output==
  
The Feature Constructor allows you to manually add features (columns) into your dataset. The new feature can be a computation of an existing one or a combination of several (addition, subtraction, etc.). You can choose what type of feature it will be (discrete, continuous or string) and what its parameters are (name, value, expression). For continuous variables you only have to construct an expression in Python.
+
Data: dataset with additional features
  
[[File:Feature-constructor1-stamped.png|center|200px|thumb]]
+
Widget Feature Constructor memungkinkan kita untuk menambahkan fitur (kolom) secara manual ke dalam dataset. Fitur baru dapat berupa perhitungan yang sudah ada atau kombinasi beberapa (penambahan, pengurangan, dll.). Kita dapat memilih jenis fitur apa yang akan (diskrit, kontinu atau string) dan apa parameternya (nama, nilai, ekspresi). Untuk variabel kontinu, kita hanya perlu membuat ekspresi dengan Python.
  
    List of constructed variables
+
[[File:Feature-constructor1-stamped.png|center|400px|thumb]]
  
    Add or remove variables
+
Daftar variabel yang pakai untuk mengkonstruksi
    New feature name
 
    Expression in Python
 
    Select a feature
 
    Select a function
 
    Produce a report
 
    Press Send to communicate changes
 
  
For discrete variables, however, there’s a bit more work. First add or remove the values you want for the new feature. Then select the base value and the expression. In the example below, we have constructed an expression with ‘if lower than’ and defined three conditions; the program ascribes 0 (which we renamed to lower) if the original value is lower than 6, 1 (mid) if it is lower than 7 and 2 (higher) for all the other values. Notice that we use an underscore for the feature name (e.g. petal_length).
+
* Add or remove variables
 +
* New feature name
 +
* Expression in Python
 +
* Select a feature
 +
* Select a function
 +
* Produce a report
 +
* Press Send to communicate changes
  
[[File:Feature-constructor2-stamped.png|center|200px|thumb]]
+
Penggunaan Widget Feature Constructor, untuk variabel diskrit, ada sedikit pekerjaan. Pertama-tama tambahkan atau hapus nilai yang kita inginkan untuk fitur baru. Kemudian pilih nilai dasar dan ekspresi. Dalam contoh di bawah ini, kita telah membuat ekspresi dengan ‘if lower than’ dan mendefinisikan tiga kondisi; program menganggap 0 (yang kita beri nama lower) jika nilai aslinya lebih rendah dari 6, 1 (mid) jika lebih rendah dari 7 dan 2 (higher) untuk semua nilai lainnya. Perhatikan bahwa kita menggunakan garis bawah untuk nama fitur (mis. Petal_length).
  
    List of variable definitions
+
[[File:Feature-constructor2-stamped.png|center|600px|thumb]]
  
    Add or remove variables
+
Daftar definisi variabel
    New feature name
+
 
    Expression in Python
+
* Add or remove variables
    Select a feature
+
* New feature name
    Select a function
+
* Expression in Python
    Assign values
+
* Select a feature
    Produce a report
+
* Select a function
    Press Send to communicate changes
+
* Assign values
 +
* Produce a report
 +
* Press Send to communicate changes
  
 
==Contoh==
 
==Contoh==
  
With the Feature Constructor you can easily adjust or combine existing features into new ones. Below, we added one new discrete feature to the Titanic dataset. We created a new attribute called Financial status and set the values to be rich if the person belongs to the first class (status = first) and not rich for everybody else. We can see the new dataset with Data Table widget.
+
Dengan widget Feature Constructor kita dapat dengan mudah menyesuaikan atau menggabungkan fitur yang ada ke yang baru. Di bawah ini, kita menambahkan satu fitur diskrit baru ke dataset Titanic. Kita membuat atribut baru yang disebut Financial status dan menetapkan nilai menjadi rich jika orang tersebut termasuk first class (status = first) dan not rich untuk semua orang. Kita bisa melihat dataset baru dengan widget Data Table.
  
[[File:FeatureConstructor-Example.png|center|200px|thumb]]
+
[[File:FeatureConstructor-Example.png|center|600px|thumb]]
  
 +
==Hints==
  
==Hints==
+
Jika anda tidak terbiasa dengan bahasa matematika Python, inilah pengantar singkat.
  
If you are unfamiliar with Python math language, here’s a quick introduction.
+
+  to add
 +
-  to subtract
 +
*  to multiply
 +
/  to divide
 +
%  to divide and return the remainder
 +
** for exponent (for square root square by 0.5)
 +
// for floor division
 +
<  less than
 +
>  greater than
 +
<= less or equal
 +
>= greater or equal
 +
== for equal
 +
!= for not equal
  
  +, - to add, subtract
+
Sebagai contoh:
  * to multiply
 
  / to divide
 
  % to divide and return the remainder
 
  ** for exponent (for square root square by 0.5)
 
  // for floor division
 
  <, >, <=, >= less than, greater than, less or equal, greater or equal
 
  == for equal
 
  != for not equal
 
  
As in the example: (value) if (feature name) < (value), else (value) if (feature name) < (value), else (value)
+
(value) if (feature name) < (value), else (value) if (feature name) < (value), else (value)
  
 
[Use value 1 if feature is less than specified value, else use value 2 if feature is less than specified value 2, else use value 3.]
 
[Use value 1 if feature is less than specified value, else use value 2 if feature is less than specified value 2, else use value 3.]
Line 67: Line 73:
 
See more here.
 
See more here.
  
 +
==YOUTUBE==
  
 
+
* [https://www.youtube.com/watch?v=WpTAYL0AoJ0 ORANGE: Feature Constructor]
  
  

Latest revision as of 10:40, 17 April 2020

Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/featureconstructor.html

Widget Feature Constructor menambahkan feature baru ke dataset.


Input

Data: input dataset

Output

Data: dataset with additional features

Widget Feature Constructor memungkinkan kita untuk menambahkan fitur (kolom) secara manual ke dalam dataset. Fitur baru dapat berupa perhitungan yang sudah ada atau kombinasi beberapa (penambahan, pengurangan, dll.). Kita dapat memilih jenis fitur apa yang akan (diskrit, kontinu atau string) dan apa parameternya (nama, nilai, ekspresi). Untuk variabel kontinu, kita hanya perlu membuat ekspresi dengan Python.

Feature-constructor1-stamped.png

Daftar variabel yang pakai untuk mengkonstruksi

  • Add or remove variables
  • New feature name
  • Expression in Python
  • Select a feature
  • Select a function
  • Produce a report
  • Press Send to communicate changes

Penggunaan Widget Feature Constructor, untuk variabel diskrit, ada sedikit pekerjaan. Pertama-tama tambahkan atau hapus nilai yang kita inginkan untuk fitur baru. Kemudian pilih nilai dasar dan ekspresi. Dalam contoh di bawah ini, kita telah membuat ekspresi dengan ‘if lower than’ dan mendefinisikan tiga kondisi; program menganggap 0 (yang kita beri nama lower) jika nilai aslinya lebih rendah dari 6, 1 (mid) jika lebih rendah dari 7 dan 2 (higher) untuk semua nilai lainnya. Perhatikan bahwa kita menggunakan garis bawah untuk nama fitur (mis. Petal_length).

Feature-constructor2-stamped.png

Daftar definisi variabel

  • Add or remove variables
  • New feature name
  • Expression in Python
  • Select a feature
  • Select a function
  • Assign values
  • Produce a report
  • Press Send to communicate changes

Contoh

Dengan widget Feature Constructor kita dapat dengan mudah menyesuaikan atau menggabungkan fitur yang ada ke yang baru. Di bawah ini, kita menambahkan satu fitur diskrit baru ke dataset Titanic. Kita membuat atribut baru yang disebut Financial status dan menetapkan nilai menjadi rich jika orang tersebut termasuk first class (status = first) dan not rich untuk semua orang. Kita bisa melihat dataset baru dengan widget Data Table.

FeatureConstructor-Example.png

Hints

Jika anda tidak terbiasa dengan bahasa matematika Python, inilah pengantar singkat.

+  to add
-  to subtract
*  to multiply
/  to divide
%  to divide and return the remainder
** for exponent (for square root square by 0.5)
// for floor division
<  less than
>  greater than
<= less or equal
>= greater or equal
== for equal
!= for not equal

Sebagai contoh:

(value) if (feature name) < (value), else (value) if (feature name) < (value), else (value)

[Use value 1 if feature is less than specified value, else use value 2 if feature is less than specified value 2, else use value 3.]

See more here.

YOUTUBE


Referensi

Pranala Menarik