Skip to content

Commit

Permalink
docs: update stdlib docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Apr 3, 2024
1 parent bca46be commit 1909331
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 101 deletions.
57 changes: 0 additions & 57 deletions docs/stdlib/safeds/data/tabular/typing/Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,6 @@ Store column names and corresponding data types for a `Table` or `Row`.
@Pure
@PythonName("to_dict")
fun toDict() -> result1: Map<String, ColumnType>

/**
* Merge multiple schemas into one.
*
* For each type missmatch the new schema will have the least common supertype.
*
* The type hierarchy is as follows:
* * Anything
* * RealNumber
* * Integer
* * Boolean
* * String
*
* @param schemas the list of schemas you want to merge
*
* @result result1 the new merged schema
*/
@Pure
@PythonName("merge_multiple_schemas")
static fun mergeMultipleSchemas(
schemas: List<Schema>
) -> result1: Schema
}
```

Expand Down Expand Up @@ -145,38 +123,3 @@ Return a dictionary that maps column names to column types.
@PythonName("to_dict")
fun toDict() -> result1: Map<String, ColumnType>
```

## `#!sds static fun` mergeMultipleSchemas {#safeds.data.tabular.typing.Schema.mergeMultipleSchemas data-toc-label='mergeMultipleSchemas'}

Merge multiple schemas into one.

For each type missmatch the new schema will have the least common supertype.

The type hierarchy is as follows:
* Anything
* RealNumber
* Integer
* Boolean
* String

**Parameters:**

| Name | Type | Description | Default |
|------|------|-------------|---------|
| `schemas` | [`List<Schema>`][safeds.lang.List] | the list of schemas you want to merge | - |

**Results:**

| Name | Type | Description |
|------|------|-------------|
| `result1` | [`Schema`][safeds.data.tabular.typing.Schema] | the new merged schema |

??? quote "Source code in `schema.sdsstub`"

```sds linenums="67"
@Pure
@PythonName("merge_multiple_schemas")
static fun mergeMultipleSchemas(
schemas: List<Schema>
) -> result1: Schema
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Ada Boost classification.

??? quote "Source code in `ada_boost.sdsstub`"

```sds linenums="16"
```sds linenums="15"
class AdaBoostClassifier(
learner: Classifier = DecisionTreeClassifier(),
@PythonName("maximum_number_of_learners") const maximumNumberOfLearners: Int = 50,
Expand Down Expand Up @@ -90,7 +90,7 @@ This classifier is not modified.

??? quote "Source code in `ada_boost.sdsstub`"

```sds linenums="46"
```sds linenums="45"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Decision tree classification.

??? quote "Source code in `decision_tree.sdsstub`"

```sds linenums="10"
```sds linenums="9"
class DecisionTreeClassifier() sub Classifier {
/**
* Create a copy of this classifier and fit it with the given training data.
Expand Down Expand Up @@ -44,7 +44,7 @@ This classifier is not modified.

??? quote "Source code in `decision_tree.sdsstub`"

```sds linenums="20"
```sds linenums="19"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gradient boosting classification.

??? quote "Source code in `gradient_boosting.sdsstub`"

```sds linenums="15"
```sds linenums="14"
class GradientBoostingClassifier(
@PythonName("number_of_trees") const numberOfTrees: Int = 100,
@PythonName("learning_rate") const learningRate: Float = 0.1
Expand Down Expand Up @@ -78,7 +78,7 @@ This classifier is not modified.

??? quote "Source code in `gradient_boosting.sdsstub`"

```sds linenums="40"
```sds linenums="39"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ K-nearest-neighbors classification.

??? quote "Source code in `k_nearest_neighbors.sdsstub`"

```sds linenums="13"
```sds linenums="12"
class KNearestNeighborsClassifier(
@PythonName("number_of_neighbors") const numberOfNeighbors: Int
) sub Classifier where {
Expand Down Expand Up @@ -65,7 +65,7 @@ This classifier is not modified.

??? quote "Source code in `k_nearest_neighbors.sdsstub`"

```sds linenums="32"
```sds linenums="31"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Regularized logistic regression.

??? quote "Source code in `logistic_regression.sdsstub`"

```sds linenums="10"
```sds linenums="9"
class LogisticRegressionClassifier() sub Classifier {
/**
* Create a copy of this classifier and fit it with the given training data.
Expand Down Expand Up @@ -44,7 +44,7 @@ This classifier is not modified.

??? quote "Source code in `logistic_regression.sdsstub`"

```sds linenums="20"
```sds linenums="19"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Random forest classification.

??? quote "Source code in `random_forest.sdsstub`"

```sds linenums="12"
```sds linenums="11"
class RandomForestClassifier(
@PythonName("number_of_trees") const numberOfTrees: Int = 100
) sub Classifier where {
Expand Down Expand Up @@ -65,7 +65,7 @@ This classifier is not modified.

??? quote "Source code in `random_forest.sdsstub`"

```sds linenums="31"
```sds linenums="30"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Support vector machine.

??? quote "Source code in `support_vector_machine.sdsstub`"

```sds linenums="13"
```sds linenums="12"
class SupportVectorMachineClassifier(
const c: Float = 1.0,
kernel: SupportVectorMachineClassifier.Kernel = SupportVectorMachineClassifier.Kernel.RadialBasisFunction
Expand Down Expand Up @@ -104,7 +104,7 @@ This classifier is not modified.

??? quote "Source code in `support_vector_machine.sdsstub`"

```sds linenums="64"
```sds linenums="63"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand All @@ -117,7 +117,7 @@ The kernel functions that can be used in the support vector machine.

??? quote "Source code in `support_vector_machine.sdsstub`"

```sds linenums="22"
```sds linenums="21"
enum Kernel {
/**
* A linear kernel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Ada Boost regression.

??? quote "Source code in `ada_boost.sdsstub`"

```sds linenums="16"
```sds linenums="15"
class AdaBoostRegressor(
learner: Regressor = DecisionTreeRegressor(),
@PythonName("maximum_number_of_learners") const maximumNumberOfLearners: Int = 50,
Expand Down Expand Up @@ -90,7 +90,7 @@ This regressor is not modified.

??? quote "Source code in `ada_boost.sdsstub`"

```sds linenums="46"
```sds linenums="45"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Decision tree regression.

??? quote "Source code in `decision_tree.sdsstub`"

```sds linenums="10"
```sds linenums="9"
class DecisionTreeRegressor() sub Regressor {
/**
* Create a copy of this regressor and fit it with the given training data.
Expand Down Expand Up @@ -44,7 +44,7 @@ This regressor is not modified.

??? quote "Source code in `decision_tree.sdsstub`"

```sds linenums="20"
```sds linenums="19"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Elastic net regression.

??? quote "Source code in `elastic_net_regression.sdsstub`"

```sds linenums="14"
```sds linenums="13"
class ElasticNetRegressor(
const alpha: Float = 1.0,
@PythonName("lasso_ratio") const lassoRatio: Float = 0.5
Expand Down Expand Up @@ -79,7 +79,7 @@ This regressor is not modified.

??? quote "Source code in `elastic_net_regression.sdsstub`"

```sds linenums="40"
```sds linenums="39"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gradient boosting regression.

??? quote "Source code in `gradient_boosting.sdsstub`"

```sds linenums="15"
```sds linenums="14"
class GradientBoostingRegressor(
@PythonName("number_of_trees") const numberOfTrees: Int = 100,
@PythonName("learning_rate") const learningRate: Float = 0.1
Expand Down Expand Up @@ -78,7 +78,7 @@ This regressor is not modified.

??? quote "Source code in `gradient_boosting.sdsstub`"

```sds linenums="40"
```sds linenums="39"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ K-nearest-neighbors regression.

??? quote "Source code in `k_nearest_neighbors.sdsstub`"

```sds linenums="13"
```sds linenums="12"
class KNearestNeighborsRegressor(
@PythonName("number_of_neighbors") const numberOfNeighbors: Int
) sub Regressor where {
Expand Down Expand Up @@ -65,7 +65,7 @@ This regressor is not modified.

??? quote "Source code in `k_nearest_neighbors.sdsstub`"

```sds linenums="32"
```sds linenums="31"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
4 changes: 2 additions & 2 deletions docs/stdlib/safeds/ml/classical/regression/LassoRegressor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Lasso regression.

??? quote "Source code in `lasso_regression.sdsstub`"

```sds linenums="12"
```sds linenums="11"
class LassoRegressor(
const alpha: Float = 1.0
) sub Regressor where {
Expand Down Expand Up @@ -65,7 +65,7 @@ This regressor is not modified.

??? quote "Source code in `lasso_regression.sdsstub`"

```sds linenums="31"
```sds linenums="30"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Linear regression.

??? quote "Source code in `linear_regression.sdsstub`"

```sds linenums="10"
```sds linenums="9"
class LinearRegressionRegressor() sub Regressor {
/**
* Create a copy of this regressor and fit it with the given training data.
Expand Down Expand Up @@ -44,7 +44,7 @@ This regressor is not modified.

??? quote "Source code in `linear_regression.sdsstub`"

```sds linenums="20"
```sds linenums="19"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Random forest regression.

??? quote "Source code in `random_forest.sdsstub`"

```sds linenums="12"
```sds linenums="11"
class RandomForestRegressor(
@PythonName("number_of_trees") const numberOfTrees: Int = 100
) sub Regressor where {
Expand Down Expand Up @@ -65,7 +65,7 @@ This regressor is not modified.

??? quote "Source code in `random_forest.sdsstub`"

```sds linenums="31"
```sds linenums="30"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
4 changes: 2 additions & 2 deletions docs/stdlib/safeds/ml/classical/regression/RidgeRegressor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Ridge regression.

??? quote "Source code in `ridge_regression.sdsstub`"

```sds linenums="12"
```sds linenums="11"
class RidgeRegressor(
const alpha: Float = 1.0
) sub Regressor where {
Expand Down Expand Up @@ -65,7 +65,7 @@ This regressor is not modified.

??? quote "Source code in `ridge_regression.sdsstub`"

```sds linenums="31"
```sds linenums="30"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Support vector machine.

??? quote "Source code in `support_vector_machine.sdsstub`"

```sds linenums="13"
```sds linenums="12"
class SupportVectorMachineRegressor(
const c: Float = 1.0,
kernel: SupportVectorMachineRegressor.Kernel = SupportVectorMachineRegressor.Kernel.RadialBasisFunction
Expand Down Expand Up @@ -104,7 +104,7 @@ This regressor is not modified.

??? quote "Source code in `support_vector_machine.sdsstub`"

```sds linenums="64"
```sds linenums="63"
@Pure
fun fit(
@PythonName("training_set") trainingSet: TaggedTable
Expand All @@ -117,7 +117,7 @@ The kernel functions that can be used in the support vector machine.

??? quote "Source code in `support_vector_machine.sdsstub`"

```sds linenums="22"
```sds linenums="21"
enum Kernel {
/**
* A linear kernel.
Expand Down
Loading

0 comments on commit 1909331

Please sign in to comment.