Skip to content

Commit

Permalink
docs: update API docs (#1250)
Browse files Browse the repository at this point in the history
### Summary of Changes

* Use operators when working with cells in examples
* Regenerate API docs
  • Loading branch information
lars-reimann authored Nov 1, 2024
1 parent 4820a16 commit 5913a54
Show file tree
Hide file tree
Showing 12 changed files with 430 additions and 183 deletions.
502 changes: 377 additions & 125 deletions docs/api/safeds/data/tabular/containers/Cell.md

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions docs/api/safeds/data/tabular/containers/Column.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ pipeline example {
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.all((cell) -> cell.gt(0)); // true
* val result = column.all((cell) -> cell > 0); // true
* }
*
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.all((cell) -> cell.lt(3)); // false
* val result = column.all((cell) -> cell < 3); // false
* }
*/
@Pure
Expand Down Expand Up @@ -170,13 +170,13 @@ pipeline example {
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.any((cell) -> cell.gt(2)); // true
* val result = column.any((cell) -> cell > 2); // true
* }
*
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.any((cell) -> cell.lt(0)); // false
* val result = column.any((cell) -> cell < 0); // false
* }
*/
@Pure
Expand Down Expand Up @@ -208,13 +208,13 @@ pipeline example {
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.countIf((cell) -> cell.gt(1)); // 2
* val result = column.countIf((cell) -> cell > 1); // 2
* }
*
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.countIf((cell) -> cell.lt(0)); // 0
* val result = column.countIf((cell) -> cell < 0); // 0
* }
*/
@Pure
Expand Down Expand Up @@ -251,13 +251,13 @@ pipeline example {
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.none((cell) -> cell.lt(0)); // true
* val result = column.none((cell) -> cell < 0); // true
* }
*
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.none((cell) -> cell.gt(2)); // false
* val result = column.none((cell) -> cell > 2); // false
* }
*/
@Pure
Expand Down Expand Up @@ -299,7 +299,7 @@ pipeline example {
* @example
* pipeline example {
* val column = Column("test", [1, 2, 3]);
* val result = column.transform((cell) -> cell.mul(2));
* val result = column.transform((cell) -> cell * 2);
* // Column("test", [2, 4, 6])
* }
*/
Expand Down Expand Up @@ -683,13 +683,13 @@ You can instead enable Kleene logic by setting `ignoreUnknown = false`. In this
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.all((cell) -> cell.gt(0)); // true
val result = column.all((cell) -> cell > 0); // true
}
```
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.all((cell) -> cell.lt(3)); // false
val result = column.all((cell) -> cell < 3); // false
}
```

Expand Down Expand Up @@ -742,13 +742,13 @@ You can instead enable Kleene logic by setting `ignoreUnknown = false`. In this
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.any((cell) -> cell.gt(2)); // true
val result = column.any((cell) -> cell > 2); // true
}
```
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.any((cell) -> cell.lt(0)); // false
val result = column.any((cell) -> cell < 0); // false
}
```

Expand Down Expand Up @@ -846,13 +846,13 @@ if the predicate returns null at least once. Otherwise, it still returns how oft
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.countIf((cell) -> cell.gt(1)); // 2
val result = column.countIf((cell) -> cell > 1); // 2
}
```
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.countIf((cell) -> cell.lt(0)); // 0
val result = column.countIf((cell) -> cell < 0); // 0
}
```

Expand Down Expand Up @@ -1246,13 +1246,13 @@ You can instead enable Kleene logic by setting `ignoreUnknown = false`. In this
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.none((cell) -> cell.lt(0)); // true
val result = column.none((cell) -> cell < 0); // true
}
```
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.none((cell) -> cell.gt(2)); // false
val result = column.none((cell) -> cell > 2); // false
}
```

Expand Down Expand Up @@ -1475,7 +1475,7 @@ Return a new column with values transformed by the transformer.
```sds hl_lines="3"
pipeline example {
val column = Column("test", [1, 2, 3]);
val result = column.transform((cell) -> cell.mul(2));
val result = column.transform((cell) -> cell * 2);
// Column("test", [2, 4, 6])
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/api/safeds/data/tabular/containers/Row.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This class cannot be instantiated directly. It is only used for arguments of cal
* @example
* pipeline example {
* val table = Table({"col1": [1, 2], "col2": [3, 4]});
* val result = table.removeRows((row) -> row.getValue("col1").eq(1));
* val result = table.removeRows((row) -> row.getValue("col1") == 1);
* // Table({"col1": [2], "col2": [4]})
* }
*/
Expand Down Expand Up @@ -141,7 +141,7 @@ Get the value of the specified column. This WILL LATER BE equivalent to using th
```sds hl_lines="3"
pipeline example {
val table = Table({"col1": [1, 2], "col2": [3, 4]});
val result = table.removeRows((row) -> row.getValue("col1").eq(1));
val result = table.removeRows((row) -> row.getValue("col1") == 1);
// Table({"col1": [2], "col2": [4]})
}
```
Expand Down
28 changes: 14 additions & 14 deletions docs/api/safeds/data/tabular/containers/Table.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pipeline example {
* @example
* pipeline example {
* val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
* val result = table.addComputedColumn("c", (row) -> row.getValue("a").add(row.getValue("b")));
* val result = table.addComputedColumn("c", (row) -> row.getValue("a") + row.getValue("b"));
* }
*/
@Pure
Expand Down Expand Up @@ -434,7 +434,7 @@ pipeline example {
* @example
* pipeline example {
* val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
* val result = table.transformColumn("a", (cell) -> cell.add(1));
* val result = table.transformColumn("a", (cell) -> cell + 1);
* // Table({"a": [2, 3, 4], "b": [4, 5, 6]})
* }
*/
Expand Down Expand Up @@ -468,13 +468,13 @@ pipeline example {
* @example
* pipeline example {
* val table = Table({"col1": [1, 2, 3], "col2": [1, 3, 3]});
* val result = table.countRowIf((row) -> row.getValue("col1").eq(row.getValue("col2"))); // 2
* val result = table.countRowIf((row) -> row.getValue("col1") == row.getValue("col2")); // 2
* }
*
* @example
* pipeline example {
* val table = Table({"col1": [1, 2, 3], "col2": [1, 3, 3]});
* val result = table.countRowIf((row) -> row.getValue("col1").gt(row.getValue("col2"))); // 0
* val result = table.countRowIf((row) -> row.getValue("col1") > row.getValue("col2")); // 0
* }
*/
@Pure
Expand Down Expand Up @@ -514,7 +514,7 @@ pipeline example {
* @example
* pipeline example {
* val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
* val result = table.removeRows((row) -> row.getValue("a").eq(2));
* val result = table.removeRows((row) -> row.getValue("a") == 2);
* // Table({"a": [1, 3], "b": [4, 6]})
* }
*/
Expand All @@ -537,7 +537,7 @@ pipeline example {
* @example
* pipeline example {
* val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
* val result = table.removeRowsByColumn("a", (cell) -> cell.eq(2));
* val result = table.removeRowsByColumn("a", (cell) -> cell == 2);
* // Table({"a": [1, 3], "b": [4, 6]})
* }
*/
Expand Down Expand Up @@ -673,7 +673,7 @@ pipeline example {
* @example
* pipeline example {
* val table = Table({"a": [2, 1, 3], "b": [1, 1, 2]});
* val result = table.sortRows((row) -> row.getValue("a").^sub(row.getValue("b")));
* val result = table.sortRows((row) -> row.getValue("a") - row.getValue("b"));
* // Table({"a": [1, 2, 3], "b": [1, 1, 2]})
* }
*/
Expand Down Expand Up @@ -1147,7 +1147,7 @@ Return a new table with an additional computed column.
```sds hl_lines="3"
pipeline example {
val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
val result = table.addComputedColumn("c", (row) -> row.getValue("a").add(row.getValue("b")));
val result = table.addComputedColumn("c", (row) -> row.getValue("a") + row.getValue("b"));
}
```

Expand Down Expand Up @@ -1280,13 +1280,13 @@ if the predicate returns null at least once. Otherwise, it still returns how oft
```sds hl_lines="3"
pipeline example {
val table = Table({"col1": [1, 2, 3], "col2": [1, 3, 3]});
val result = table.countRowIf((row) -> row.getValue("col1").eq(row.getValue("col2"))); // 2
val result = table.countRowIf((row) -> row.getValue("col1") == row.getValue("col2")); // 2
}
```
```sds hl_lines="3"
pipeline example {
val table = Table({"col1": [1, 2, 3], "col2": [1, 3, 3]});
val result = table.countRowIf((row) -> row.getValue("col1").gt(row.getValue("col2"))); // 0
val result = table.countRowIf((row) -> row.getValue("col1") > row.getValue("col2")); // 0
}
```

Expand Down Expand Up @@ -1690,7 +1690,7 @@ Return a new table without rows that satisfy a condition.
```sds hl_lines="3"
pipeline example {
val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
val result = table.removeRows((row) -> row.getValue("a").eq(2));
val result = table.removeRows((row) -> row.getValue("a") == 2);
// Table({"a": [1, 3], "b": [4, 6]})
}
```
Expand Down Expand Up @@ -1729,7 +1729,7 @@ Return a new table without rows that satisfy a condition on a specific column.
```sds hl_lines="3"
pipeline example {
val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
val result = table.removeRowsByColumn("a", (cell) -> cell.eq(2));
val result = table.removeRowsByColumn("a", (cell) -> cell == 2);
// Table({"a": [1, 3], "b": [4, 6]})
}
```
Expand Down Expand Up @@ -2044,7 +2044,7 @@ Return a new table with the rows sorted.
```sds hl_lines="3"
pipeline example {
val table = Table({"a": [2, 1, 3], "b": [1, 1, 2]});
val result = table.sortRows((row) -> row.getValue("a").^sub(row.getValue("b")));
val result = table.sortRows((row) -> row.getValue("a") - row.getValue("b"));
// Table({"a": [1, 2, 3], "b": [1, 1, 2]})
}
```
Expand Down Expand Up @@ -2452,7 +2452,7 @@ Return a new table with a column transformed.
```sds hl_lines="3"
pipeline example {
val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]});
val result = table.transformColumn("a", (cell) -> cell.add(1));
val result = table.transformColumn("a", (cell) -> cell + 1);
// Table({"a": [2, 3, 4], "b": [4, 5, 6]})
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Learn a transformation for a set of columns in a `Table` and transform another `

- [`Discretizer`][safeds.data.tabular.transformation.Discretizer]
- [`FunctionalTableTransformer`][safeds.data.tabular.transformation.FunctionalTableTransformer]
- `#!sds Imputer`
- [`InvertibleTableTransformer`][safeds.data.tabular.transformation.InvertibleTableTransformer]
- [`KNearestNeighborsImputer`][safeds.data.tabular.transformation.KNearestNeighborsImputer]
- [`SimpleImputer`][safeds.data.tabular.transformation.SimpleImputer]
Expand Down
2 changes: 0 additions & 2 deletions docs/api/safeds/ml/classical/classification/Classifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ A model for classification tasks.
- [`GradientBoostingClassifier`][safeds.ml.classical.classification.GradientBoostingClassifier]
- [`KNearestNeighborsClassifier`][safeds.ml.classical.classification.KNearestNeighborsClassifier]
- [`LogisticClassifier`][safeds.ml.classical.classification.LogisticClassifier]
- `#!sds LogisticRegressionClassifier`
- [`RandomForestClassifier`][safeds.ml.classical.classification.RandomForestClassifier]
- [`SupportVectorClassifier`][safeds.ml.classical.classification.SupportVectorClassifier]
- `#!sds SupportVectorMachineClassifier`

??? quote "Stub code in `Classifier.sdsstub`"

Expand Down
2 changes: 0 additions & 2 deletions docs/api/safeds/ml/classical/regression/Regressor.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ A model for regression tasks.
- [`GradientBoostingRegressor`][safeds.ml.classical.regression.GradientBoostingRegressor]
- [`KNearestNeighborsRegressor`][safeds.ml.classical.regression.KNearestNeighborsRegressor]
- [`LassoRegressor`][safeds.ml.classical.regression.LassoRegressor]
- `#!sds LinearRegressionRegressor`
- [`LinearRegressor`][safeds.ml.classical.regression.LinearRegressor]
- [`RandomForestRegressor`][safeds.ml.classical.regression.RandomForestRegressor]
- [`RidgeRegressor`][safeds.ml.classical.regression.RidgeRegressor]
- `#!sds SupportVectorMachineRegressor`
- [`SupportVectorRegressor`][safeds.ml.classical.regression.SupportVectorRegressor]

??? quote "Stub code in `Regressor.sdsstub`"
Expand Down
2 changes: 1 addition & 1 deletion docs/api/safeds/ml/nn/NeuralNetworkClassifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A NeuralNetworkClassifier is a neural network that is used for classification ta

| Name | Type | Description | Default |
|------|------|-------------|---------|
| `inputConversion` | `#!sds InputConversion<D, F>` | to convert the input data for the neural network | - |
| `inputConversion` | [`InputConversion<D, F>`][safeds.ml.nn.converters.InputConversion] | to convert the input data for the neural network | - |
| `layers` | [`List<Layer>`][safeds.lang.List] | a list of layers for the neural network to learn | - |

**Type parameters:**
Expand Down
2 changes: 1 addition & 1 deletion docs/api/safeds/ml/nn/NeuralNetworkRegressor.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A NeuralNetworkRegressor is a neural network that is used for regression tasks.

| Name | Type | Description | Default |
|------|------|-------------|---------|
| `inputConversion` | `#!sds InputConversion<D, F>` | to convert the input data for the neural network | - |
| `inputConversion` | [`InputConversion<D, F>`][safeds.ml.nn.converters.InputConversion] | to convert the input data for the neural network | - |
| `layers` | [`List<Layer>`][safeds.lang.List] | a list of layers for the neural network to learn | - |

**Type parameters:**
Expand Down
Loading

0 comments on commit 5913a54

Please sign in to comment.