Difference between revisions of "Orange: Create Class"
Onnowpurbo (talk | contribs) (Created page with "Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/createclass.html ==Referensi== * https://docs.biolab.si//3/visual-programming/widgets/data/createclass.htm...") |
Onnowpurbo (talk | contribs) |
||
Line 1: | Line 1: | ||
Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/createclass.html | Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/createclass.html | ||
+ | |||
+ | Create class attribute from a string attribute. | ||
+ | |||
+ | Inputs | ||
+ | |||
+ | Data: input dataset | ||
+ | |||
+ | Outputs | ||
+ | |||
+ | Data: dataset with a new class variable | ||
+ | |||
+ | Create Class creates a new class attribute from an existing discrete or string attribute. The widget matches the string value of the selected attribute and constructs a new user-defined value for matching instances. | ||
+ | |||
+ | ../../_images/CreateClass-stamped.png | ||
+ | |||
+ | The attribute the new class is constructed from. | ||
+ | |||
+ | Matching: | ||
+ | |||
+ | Name: the name of the new class value | ||
+ | |||
+ | Substring: regex-defined substring that will match the values from the above-defined attribute | ||
+ | |||
+ | Instances: the number of instances matching the substring | ||
+ | |||
+ | Press ‘+’ to add a new class value | ||
+ | |||
+ | Name of the new class column. | ||
+ | |||
+ | Match only at the beginning will begin matching from the beginning of the string. Case sensitive will match by case, too. | ||
+ | |||
+ | Produce a report. | ||
+ | |||
+ | Press Apply to commit the results. | ||
+ | |||
+ | ==Contoh== | ||
+ | |||
+ | Here is a simple example with the auto-mpg dataset. Pass the data to Create Class. Select car_name as a column to create the new class from. Here, we wish to create new values that match the car brand. First, we type ford as the new value for the matching strings. Then we define the substring that will match the data instances. This means that all instances containing ford in their car_name, will now have a value ford in the new class column. Next, we define the same for honda and fiat. The widget will tell us how many instance are yet unmatched (remaining instances). We will name them other, but you can continue creating new values by adding a condition with ‘+’. | ||
+ | |||
+ | We named our new class column car_brand and we matched at the beginning of the string. | ||
+ | |||
+ | ../../_images/CreateClass-example.png | ||
+ | |||
+ | Finally, we can observe the new column in a Data Table or use the value as color in the Scatter Plot. | ||
+ | |||
+ | |||
Revision as of 04:54, 11 January 2020
Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/createclass.html
Create class attribute from a string attribute.
Inputs
Data: input dataset
Outputs
Data: dataset with a new class variable
Create Class creates a new class attribute from an existing discrete or string attribute. The widget matches the string value of the selected attribute and constructs a new user-defined value for matching instances.
../../_images/CreateClass-stamped.png
The attribute the new class is constructed from.
Matching:
Name: the name of the new class value
Substring: regex-defined substring that will match the values from the above-defined attribute
Instances: the number of instances matching the substring
Press ‘+’ to add a new class value
Name of the new class column.
Match only at the beginning will begin matching from the beginning of the string. Case sensitive will match by case, too.
Produce a report.
Press Apply to commit the results.
Contoh
Here is a simple example with the auto-mpg dataset. Pass the data to Create Class. Select car_name as a column to create the new class from. Here, we wish to create new values that match the car brand. First, we type ford as the new value for the matching strings. Then we define the substring that will match the data instances. This means that all instances containing ford in their car_name, will now have a value ford in the new class column. Next, we define the same for honda and fiat. The widget will tell us how many instance are yet unmatched (remaining instances). We will name them other, but you can continue creating new values by adding a condition with ‘+’.
We named our new class column car_brand and we matched at the beginning of the string.
../../_images/CreateClass-example.png
Finally, we can observe the new column in a Data Table or use the value as color in the Scatter Plot.