@@ -192,12 +192,13 @@ public function labelType() : ?int
192192 }
193193
194194 /**
195- * Map labels to their new values .
195+ * Map labels to their new valuesa dn return self for method chaining .
196196 *
197197 * @param callable $callback
198198 * @throws \RuntimeException
199+ * @return self
199200 */
200- public function transformLabels (callable $ callback ) : void
201+ public function transformLabels (callable $ callback ) : self
201202 {
202203 $ labels = array_map ($ callback , $ this ->labels );
203204
@@ -209,6 +210,8 @@ public function transformLabels(callable $callback) : void
209210 }
210211
211212 $ this ->labels = $ labels ;
213+
214+ return $ this ;
212215 }
213216
214217 /**
@@ -445,7 +448,7 @@ public function filterByLabel(callable $callback) : self
445448 * @param bool $descending
446449 * @return self
447450 */
448- public function sortByColumn (int $ index , bool $ descending = false )
451+ public function sortByColumn (int $ index , bool $ descending = false ) : self
449452 {
450453 $ order = $ this ->column ($ index );
451454
@@ -463,9 +466,9 @@ public function sortByColumn(int $index, bool $descending = false)
463466 * Sort the dataset in place by its labels.
464467 *
465468 * @param bool $descending
466- * @return \Rubix\ML\Datasets\Dataset
469+ * @return self
467470 */
468- public function sortByLabel (bool $ descending = false ) : Dataset
471+ public function sortByLabel (bool $ descending = false ) : self
469472 {
470473 array_multisort (
471474 $ this ->labels ,
0 commit comments