Skip to content

Commit

Permalink
feat: rename tagged_table parameter of fit to training_set (#71)
Browse files Browse the repository at this point in the history
### Summary of Changes

Rename `tagged_table` parameter of `fit` to `training_set` to match
standard terminology.
  • Loading branch information
lars-reimann authored Mar 24, 2023
1 parent b513454 commit 8655521
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions src/safeds/ml/classification/_ada_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def __init__(self) -> None:
self._classification = sk_AdaBoostClassifier()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand All @@ -32,7 +32,7 @@ def fit(self, tagged_table: TaggedTable) -> None:
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(
self._classification, tagged_table
self._classification, training_set
)

def predict(self, dataset: Table) -> Table:
Expand Down
4 changes: 2 additions & 2 deletions src/safeds/ml/classification/_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

class Classifier(ABC):
@abstractmethod
def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/classification/_decision_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def __init__(self) -> None:
self._classification = sk_DecisionTreeClassifier()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand All @@ -32,7 +32,7 @@ def fit(self, tagged_table: TaggedTable) -> None:
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(
self._classification, tagged_table
self._classification, training_set
)

def predict(self, dataset: Table) -> Table:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def __init__(self) -> None:
self._classification = GradientBoostingClassifier()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand All @@ -32,7 +32,7 @@ def fit(self, tagged_table: TaggedTable) -> None:
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(
self._classification, tagged_table
self._classification, training_set
)

# noinspection PyProtectedMember
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/classification/_k_nearest_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def __init__(self, n_neighbors: int) -> None:
self._classification = KNeighborsClassifier(n_jobs=-1, n_neighbors=n_neighbors)
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand All @@ -36,7 +36,7 @@ def fit(self, tagged_table: TaggedTable) -> None:
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(
self._classification, tagged_table
self._classification, training_set
)

def predict(self, dataset: Table) -> Table:
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/classification/_logistic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def __init__(self) -> None:
self._classification = sk_LogisticRegression(n_jobs=-1)
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand All @@ -32,7 +32,7 @@ def fit(self, tagged_table: TaggedTable) -> None:
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(
self._classification, tagged_table
self._classification, training_set
)

def predict(self, dataset: Table) -> Table:
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/classification/_random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def __init__(self) -> None:
self._classification = RandomForestClassifier(n_jobs=-1)
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand All @@ -31,7 +31,7 @@ def fit(self, tagged_table: TaggedTable) -> None:
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(
self._classification, tagged_table
self._classification, training_set
)

def predict(self, dataset: Table) -> Table:
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_ada_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ def __init__(self) -> None:
self._regression = sk_AdaBoostRegressor()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_decision_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ def __init__(self) -> None:
self._regression = sk_DecisionTreeRegressor()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_elastic_net_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ def __init__(self) -> None:
self._regression = sk_ElasticNet()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down
4 changes: 2 additions & 2 deletions src/safeds/ml/regression/_gradient_boosting_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self) -> None:
self._regression = GradientBoostingRegressor()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Expand All @@ -32,7 +32,7 @@ def fit(self, tagged_table: TaggedTable) -> None:
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

# noinspection PyProtectedMember
def predict(self, dataset: Table) -> Table:
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_k_nearest_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ def __init__(self, n_neighbors: int) -> None:
self._regression = KNeighborsRegressor(n_neighbors)
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_lasso_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ def __init__(self) -> None:
self._regression = sk_Lasso()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ def __init__(self) -> None:
self._regression = sk_LinearRegression(n_jobs=-1)
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ def __init__(self) -> None:
self._regression = RandomForestRegressor(n_jobs=-1)
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down
4 changes: 2 additions & 2 deletions src/safeds/ml/regression/_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

class Regressor(ABC):
@abstractmethod
def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
Expand Down
6 changes: 3 additions & 3 deletions src/safeds/ml/regression/_ridge_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ def __init__(self) -> None:
self._regression = sk_Ridge()
self.target_name = ""

def fit(self, tagged_table: TaggedTable) -> None:
def fit(self, training_set: TaggedTable) -> None:
"""
Fit this model given a tagged table.
Parameters
----------
tagged_table : TaggedTable
training_set : TaggedTable
The tagged table containing the feature and target vectors.
Raises
------
LearningError
If the tagged table contains invalid values or if the training failed.
"""
self.target_name = safeds.ml._util_sklearn.fit(self._regression, tagged_table)
self.target_name = safeds.ml._util_sklearn.fit(self._regression, training_set)

def predict(self, dataset: Table) -> Table:
"""
Expand Down

0 comments on commit 8655521

Please sign in to comment.