Skip to content

Commit a1a1c92

Browse files
janezdPrimozGodec
andauthored
[ENH] Rename Feature Constructor to Formula (#6549)
* Rename Feature Constructor to Formula * Update widget.json * feature-constructor2-stamped.png - resize and index * Formula documentation: Minor changes * index.rst - fix reference to formula * move accidentally displaced formula.md --------- Co-authored-by: PrimozGodec <p.godec9@gmail.com>
1 parent 0aec15e commit a1a1c92

File tree

8 files changed

+65
-73
lines changed

8 files changed

+65
-73
lines changed

Orange/widgets/data/owfeatureconstructor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,12 @@ def is_valid_item(self, setting, item, attrs, metas):
509509

510510

511511
class OWFeatureConstructor(OWWidget, ConcurrentWidgetMixin):
512-
name = "Feature Constructor"
512+
name = "Formula"
513513
description = "Construct new features (data columns) from a set of " \
514514
"existing features in the input dataset."
515515
category = "Transform"
516516
icon = "icons/FeatureConstructor.svg"
517-
keywords = "feature constructor, function, lambda"
517+
keywords = "feature constructor, function, lambda, calculation"
518518
priority = 2240
519519

520520
class Inputs:

doc/visual-programming/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Data
4848
widgets/data/paintdata
4949
widgets/data/pivot
5050
widgets/data/pythonscript
51-
widgets/data/featureconstructor
51+
widgets/data/formula
5252
widgets/data/editdomain
5353
widgets/data/impute
5454
widgets/data/mergedata

doc/visual-programming/source/widgets/data/featureconstructor.md

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Formula
2+
=======
3+
4+
Add new features to your dataset.
5+
6+
**Inputs**
7+
8+
- Data: input dataset
9+
10+
**Outputs**
11+
12+
- Data: dataset with additional features
13+
14+
**Formula** allows computing new columns by combining the existing ones with a user-defined expression. The resulting column can be categorical, numerical or textual.
15+
16+
For numeric variables, it sufices to provide a name and an expression.
17+
18+
![](images/feature-constructor1-stamped.png)
19+
20+
1. List of constructed variables
21+
2. Add or remove variables
22+
3. New feature name
23+
4. Expression in Python
24+
5. Select a feature
25+
6. Select a function
26+
7. Produce a report
27+
8. Press *Send* to communicate changes
28+
29+
The following example shows construction of a categorical variable: its value is "lower" is "sepal length" is below 6, "mid" if it is at least 6 but below 7, and "higher" otherwise. Note that spaces need to be replaced by underscores (`sepal_length`).
30+
31+
![](images/feature-constructor2-stamped.png)
32+
33+
1. List of variable definitions
34+
2. Add or remove variables
35+
3. New feature name
36+
4. Expression in Python
37+
5. If checked, the feature is put among meta attributes
38+
6. Select a feature to use in expression
39+
7. Select a function to use in expression
40+
8. Optional list of values, used to define their order
41+
9. Press *Send* to compute and output data
42+
43+
Hints
44+
-----
45+
46+
If you are unfamiliar with Python math language, here's a quick introduction.
47+
48+
Expressions can use the following operators:
49+
- `+`, `-`, `*`, `/`: addition, subtraction, multiplication, division
50+
- `//`: integer division
51+
- `%`: remainder after integer division
52+
- `**`: exponentiation (for square root square by 0.5)
53+
- `<`, `>`, `<=`, `>=` less than, greater than, less or equal, greater or equal
54+
- `==` equal
55+
- `!=` not equal
56+
- if-else: *value* `if` *condition* else *other-value* (see the above example
57+
58+
See more [here](http://www.tutorialspoint.com/python/python_basic_operators.htm).
Binary file not shown.
22.2 KB
Loading
Binary file not shown.

doc/widgets.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,15 @@
345345
]
346346
},
347347
{
348-
"text": "Feature Constructor",
349-
"doc": "visual-programming/source/widgets/data/featureconstructor.md",
348+
"text": "Formula",
349+
"doc": "visual-programming/source/widgets/data/formula.md",
350350
"icon": "../Orange/widgets/data/icons/FeatureConstructor.svg",
351351
"background": "#FF9D5E",
352352
"keywords": [
353353
"feature constructor",
354354
"function",
355-
"lambda"
355+
"lambda",
356+
"calculation"
356357
]
357358
},
358359
{

0 commit comments

Comments
 (0)