From d0d971e161c31cb527f2299e76c87557d4597b5f Mon Sep 17 00:00:00 2001 From: GideonKoenig <44088734+GideonKoenig@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:35:35 +0100 Subject: [PATCH] feat: categorize API elements (#1263) ### Summary of Changes Modifies the language stubs in preparation for the Custom Editor/Visualization PR #1243. Defines/Adjusts the DataScienceCategories and assigns them to a sample amount of functions and classes from the Safe-Ds language. --------- Co-authored-by: Lars Reimann --- .../data/image/containers/Image.sdsstub | 19 +++++++++ .../data/image/containers/ImageList.sdsstub | 8 ++++ .../data/tabular/containers/Column.sdsstub | 22 ++++++++++ .../data/tabular/containers/Table.sdsstub | 42 +++++++++++++++++++ .../tabular/plotting/ColumnPlotter.sdsstub | 5 +++ .../tabular/plotting/TablePlotter.sdsstub | 9 ++++ .../FunctionalTableTransformer.sdsstub | 2 + .../KNearestNeighborsImputer.sdsstub | 2 + .../transformation/OneHotEncoder.sdsstub | 2 + .../safeds/lang/ideIntegration.sdsstub | 40 ++++++++++++++---- .../classification/AdaBoostClassifier.sdsstub | 1 + .../classification/Classifier.sdsstub | 6 +++ .../DecisionTreeClassifier.sdsstub | 1 + .../GradientBoostingClassifier.sdsstub | 1 + .../KNearestNeighborsClassifier.sdsstub | 1 + .../classification/LogisticClassifier.sdsstub | 1 + .../RandomForestClassifier.sdsstub | 1 + .../SupportVectorClassifier.sdsstub | 1 + .../regression/AdaBoostRegressor.sdsstub | 1 + .../regression/ArimaRegressor.sdsstub | 3 ++ .../regression/DecisionTreeRegressor.sdsstub | 1 + .../regression/ElasticNetRegressor.sdsstub | 1 + .../GradientBoostingRegressor.sdsstub | 1 + .../KNearestNeighborsRegressor.sdsstub | 1 + .../regression/LassoRegressor.sdsstub | 1 + .../regression/LinearRegressor.sdsstub | 1 + .../regression/RandomForestRegressor.sdsstub | 1 + .../ml/classical/regression/Regressor.sdsstub | 7 ++++ .../regression/RidgeRegressor.sdsstub | 1 + .../regression/SupportVectorRegressor.sdsstub | 1 + .../ml/metrics/ClassificationMetrics.sdsstub | 5 +++ .../ml/metrics/RegressionMetrics.sdsstub | 6 +++ .../nn/layers/AveragePooling2DLayer.sdsstub | 1 + .../ml/nn/layers/Convolutional2DLayer.sdsstub | 1 + .../ConvolutionalTranspose2DLayer.sdsstub | 1 + .../safeds/ml/nn/layers/DropoutLayer.sdsstub | 1 + .../safeds/ml/nn/layers/FlattenLayer.sdsstub | 1 + .../safeds/ml/nn/layers/ForwardLayer.sdsstub | 1 + .../safeds/ml/nn/layers/GRULayer.sdsstub | 1 + .../builtins/safe-ds-annotations.test.ts | 4 +- 40 files changed, 196 insertions(+), 10 deletions(-) diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/Image.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/Image.sdsstub index efc1ecc7b..51d67b3e9 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/Image.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/Image.sdsstub @@ -43,6 +43,7 @@ class Image { */ @Impure([ImpurityReason.FileReadFromParameterizedPath("path")]) @PythonName("from_file") + @Category(DataScienceCategory.DataImport) static fun fromFile( path: String ) -> image: Image @@ -60,6 +61,7 @@ class Image { */ @Impure([ImpurityReason.FileWriteToParameterizedPath("path")]) @PythonName("to_jpeg_file") + @Category(DataScienceCategory.DataExport) fun toJpegFile( path: String ) @@ -77,6 +79,7 @@ class Image { */ @Impure([ImpurityReason.FileWriteToParameterizedPath("path")]) @PythonName("to_png_file") + @Category(DataScienceCategory.DataExport) fun toPngFile( path: String ) @@ -98,6 +101,7 @@ class Image { */ @Pure @PythonName("change_channel") + @Category(DataScienceCategory.DataProcessingQImage) fun changeChannel( channel: Int ) -> newImage: Image @@ -119,6 +123,7 @@ class Image { * } */ @Pure + @Category(DataScienceCategory.DataProcessingQImage) fun resize( @PythonName("new_width") const newWidth: Int, @PythonName("new_height") const newHeight: Int @@ -145,6 +150,7 @@ class Image { */ @Pure @PythonName("convert_to_grayscale") + @Category(DataScienceCategory.DataProcessingQImage) fun convertToGrayscale() -> newImage: Image /** @@ -166,6 +172,7 @@ class Image { * } */ @Pure + @Category(DataScienceCategory.DataProcessingQImage) fun crop( const x: Int, const y: Int, @@ -193,6 +200,7 @@ class Image { */ @Pure @PythonName("flip_vertically") + @Category(DataScienceCategory.DataProcessingQImage) fun flipVertically() -> newImage: Image /** @@ -210,6 +218,7 @@ class Image { */ @Pure @PythonName("flip_horizontally") + @Category(DataScienceCategory.DataProcessingQImage) fun flipHorizontally() -> newImage: Image /** @@ -233,6 +242,7 @@ class Image { */ @Pure @PythonName("adjust_brightness") + @Category(DataScienceCategory.DataProcessingQImage) fun adjustBrightness( const factor: Float ) -> newImage: Image where { @@ -256,6 +266,7 @@ class Image { */ @Pure @PythonName("add_noise") + @Category(DataScienceCategory.DataProcessingQImage) fun addNoise( @PythonName("standard_deviation") const standardDeviation: Float ) -> newImage: Image where { @@ -282,6 +293,7 @@ class Image { */ @Pure @PythonName("adjust_contrast") + @Category(DataScienceCategory.DataProcessingQImage) fun adjustContrast( const factor: Float ) -> newImage: Image where { @@ -308,6 +320,7 @@ class Image { */ @Pure @PythonName("adjust_color_balance") + @Category(DataScienceCategory.DataProcessingQImage) fun adjustColorBalance( const factor: Float ) -> newImage: Image where { @@ -331,6 +344,7 @@ class Image { * } */ @Pure + @Category(DataScienceCategory.DataProcessingQImage) fun blur( const radius: Int ) -> newImage: Image where { @@ -356,6 +370,7 @@ class Image { * } */ @Pure + @Category(DataScienceCategory.DataProcessingQImage) fun sharpen( const factor: Float ) -> newImage: Image where { @@ -377,6 +392,7 @@ class Image { */ @Pure @PythonName("invert_colors") + @Category(DataScienceCategory.DataProcessingQImage) fun invertColors() -> newImage: Image /** @@ -394,6 +410,7 @@ class Image { */ @Pure @PythonName("rotate_right") + @Category(DataScienceCategory.DataProcessingQImage) fun rotateRight() -> newImage: Image /** @@ -411,6 +428,7 @@ class Image { */ @Pure @PythonName("rotate_left") + @Category(DataScienceCategory.DataProcessingQImage) fun rotateLeft() -> newImage: Image /** @@ -428,5 +446,6 @@ class Image { */ @Pure @PythonName("find_edges") + @Category(DataScienceCategory.DataProcessingQImage) fun findEdges() -> newImage: Image } diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/ImageList.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/ImageList.sdsstub index a8caafb29..b62b42fda 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/ImageList.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/image/containers/ImageList.sdsstub @@ -49,6 +49,7 @@ class ImageList { */ @Pure @PythonName("from_images") + @Category(DataScienceCategory.DataImport) static fun fromImages( images: List ) -> imageList: ImageList @@ -64,6 +65,7 @@ class ImageList { */ @Impure([ImpurityReason.FileReadFromParameterizedPath("path")]) @PythonName("from_files") + @Category(DataScienceCategory.DataImport) static fun fromFiles( path: union, String> ) -> imageList: ImageList @@ -77,6 +79,7 @@ class ImageList { */ @Pure @PythonName("get_image") + @Category(DataScienceCategory.UtilitiesQImage) fun getImage( index: Int ) -> image: Image @@ -91,6 +94,7 @@ class ImageList { * @result indices all occurrences of the image */ @Pure + @Category(DataScienceCategory.UtilitiesQImage) fun index( image: Image ) -> indices: List @@ -104,6 +108,7 @@ class ImageList { */ @Pure @PythonName("has_image") + @Category(DataScienceCategory.UtilitiesQImage) fun hasImage( image: Image ) -> hasImage: Boolean @@ -115,6 +120,7 @@ class ImageList { */ @Impure([ImpurityReason.FileWriteToParameterizedPath("path")]) @PythonName("to_jpeg_files") + @Category(DataScienceCategory.DataExport) fun toJpegFiles( path: union, String> ) @@ -126,6 +132,7 @@ class ImageList { */ @Impure([ImpurityReason.FileWriteToParameterizedPath("path")]) @PythonName("to_png_files") + @Category(DataScienceCategory.DataExport) fun toPngFiles( path: union, String> ) @@ -139,6 +146,7 @@ class ImageList { */ @Pure @PythonName("to_images") + @Category(DataScienceCategory.UtilitiesQConversion) fun toImages( indices: List? = null ) -> images: List diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Column.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Column.sdsstub index f67f95904..e40eee3c6 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Column.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Column.sdsstub @@ -15,6 +15,7 @@ from safeds.data.tabular.typing import DataType * val column = Column("test", [1, 2, 3]); * } */ +@Category(DataScienceCategory.BasicElement) class Column( name: String, data: List = [] @@ -130,6 +131,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQGeneral) fun all( predicate: (cell: Cell) -> satisfiesPredicate: Cell, @PythonName("ignore_unknown") ignoreUnknown: Boolean = true, @@ -173,6 +175,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQGeneral) fun any( predicate: (cell: Cell) -> satisfiesPredicate: Cell, @PythonName("ignore_unknown") ignoreUnknown: Boolean = true, @@ -211,6 +214,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQGeneral) fun countIf( predicate: (cell: Cell) -> satisfiesPredicate: Cell, @PythonName("ignore_unknown") ignoreUnknown: Boolean = true, @@ -254,6 +258,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQGeneral) fun none( predicate: (cell: Cell) -> satisfiesPredicate: Cell, @PythonName("ignore_unknown") ignoreUnknown: Boolean = true, @@ -276,6 +281,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataProcessingQColumn) fun rename( @PythonName("new_name") newName: String ) -> renamedColumn: Column @@ -297,6 +303,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataProcessingQColumn) fun transform( transformer: (cell: Cell) -> transformedCell: Cell ) -> transformedColumn: Column @@ -346,6 +353,7 @@ class Column( */ @Pure @PythonName("correlation_with") + @Category(DataScienceCategory.DataExplorationQMetric) fun correlationWith( other: Column ) -> correlation: Float @@ -365,6 +373,7 @@ class Column( */ @Pure @PythonName("distinct_value_count") + @Category(DataScienceCategory.DataExplorationQMetric) fun distinctValueCount( @PythonName("ignore_missing_values") ignoreMissingValues: Boolean = true ) -> distinctValueCount: Int @@ -393,6 +402,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun idness() -> idness: Float /** @@ -407,6 +417,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun max() -> max: T? /** @@ -423,6 +434,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun mean() -> mean: T /** @@ -440,6 +452,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun median() -> median: T /** @@ -454,6 +467,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun min() -> min: T? /** @@ -469,6 +483,7 @@ class Column( */ @Pure @PythonName("missing_value_count") + @Category(DataScienceCategory.DataExplorationQMetric) fun missingValueCount() -> missingValueCount: Int /** @@ -490,6 +505,7 @@ class Column( */ @Pure @PythonName("missing_value_ratio") + @Category(DataScienceCategory.DataExplorationQMetric) fun missingValueRatio() -> missingValueRatio: Float /** @@ -509,6 +525,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun mode( @PythonName("ignore_missing_values") ignoreMissingValues: Boolean = true, ) -> mode: List @@ -531,6 +548,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun stability() -> stability: Float /** @@ -549,6 +567,7 @@ class Column( */ @Pure @PythonName("standard_deviation") + @Category(DataScienceCategory.DataExplorationQMetric) fun standardDeviation() -> standardDeviation: Float /** @@ -566,6 +585,7 @@ class Column( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQMetric) fun variance() -> variance: Float /** @@ -581,6 +601,7 @@ class Column( */ @Pure @PythonName("to_list") + @Category(DataScienceCategory.UtilitiesQConversion) fun toList() -> values: List /** @@ -597,5 +618,6 @@ class Column( */ @Pure @PythonName("to_table") + @Category(DataScienceCategory.UtilitiesQConversion) fun toTable() -> table: Table } diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Table.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Table.sdsstub index bf52981ff..6764389dc 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Table.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/containers/Table.sdsstub @@ -29,6 +29,7 @@ from safeds.data.tabular.typing import Schema * val table = Table({"a": [1, 2, 3], "b": [4, 5, 6]}); * } */ +@Category(DataScienceCategory.BasicElement) class Table( data: Map>? = null ) { @@ -71,6 +72,7 @@ class Table( */ @Pure @PythonName("from_columns") + @Category(DataScienceCategory.UtilitiesQConversion) static fun fromColumns( columns: union> ) -> table: Table @@ -90,6 +92,7 @@ class Table( */ @Impure([ImpurityReason.FileReadFromParameterizedPath("path")]) @PythonName("from_csv_file") + @Category(DataScienceCategory.DataImport) static fun fromCsvFile( path: String, separator: String = "," @@ -110,6 +113,7 @@ class Table( */ @Pure @PythonName("from_dict") + @Category(DataScienceCategory.DataImport) static fun fromMap( data: Map> ) -> table: Table @@ -128,6 +132,7 @@ class Table( */ @Impure([ImpurityReason.FileReadFromParameterizedPath("path")]) @PythonName("from_json_file") + @Category(DataScienceCategory.DataImport) static fun fromJsonFile( path: String ) -> table: Table @@ -146,6 +151,7 @@ class Table( */ @Impure([ImpurityReason.FileReadFromParameterizedPath("path")]) @PythonName("from_parquet_file") + @Category(DataScienceCategory.DataImport) static fun fromParquetFile( path: String ) -> table: Table @@ -171,6 +177,7 @@ class Table( */ @Pure @PythonName("add_columns") + @Category(DataScienceCategory.DataProcessingQTable) fun addColumns( columns: union> ) -> newTable: Table @@ -193,6 +200,7 @@ class Table( */ @Pure @PythonName("add_computed_column") + @Category(DataScienceCategory.DataProcessingQTable) fun addComputedColumn( name: String, computer: (row: Row) -> computedCell: Cell @@ -214,6 +222,7 @@ class Table( */ @Pure @PythonName("get_column") + @Category(DataScienceCategory.UtilitiesQTable) fun getColumn( name: String ) -> column: Column @@ -233,6 +242,7 @@ class Table( */ @Pure @PythonName("get_column_type") + @Category(DataScienceCategory.UtilitiesQTable) fun getColumnType( name: String ) -> type: DataType @@ -252,6 +262,7 @@ class Table( */ @Pure @PythonName("has_column") + @Category(DataScienceCategory.UtilitiesQTable) fun hasColumn( name: String ) -> hasColumn: Boolean @@ -283,6 +294,7 @@ class Table( */ @Pure @PythonName("remove_columns") + @Category(DataScienceCategory.DataProcessingQTable) fun removeColumns( names: union, String>, @PythonName("ignore_unknown_names") ignoreUnknownNames: Boolean = false @@ -304,6 +316,7 @@ class Table( */ @Pure @PythonName("remove_columns_except") + @Category(DataScienceCategory.DataProcessingQTable) fun removeColumnsExcept( names: union, String> ) -> newTable: Table @@ -327,6 +340,7 @@ class Table( */ @Pure @PythonName("remove_columns_with_missing_values") + @Category(DataScienceCategory.DataProcessingQTable) fun removeColumnsWithMissingValues() -> newTable: Table /** @@ -345,6 +359,7 @@ class Table( */ @Pure @PythonName("remove_non_numeric_columns") + @Category(DataScienceCategory.DataProcessingQTable) fun removeNonNumericColumns() -> newTable: Table /** @@ -366,6 +381,7 @@ class Table( */ @Pure @PythonName("rename_column") + @Category(DataScienceCategory.DataProcessingQTable) fun renameColumn( @PythonName("old_name") oldName: String, @PythonName("new_name") newName: String @@ -414,6 +430,7 @@ class Table( */ @Pure @PythonName("replace_column") + @Category(DataScienceCategory.DataProcessingQTable) fun replaceColumn( @PythonName("old_name") oldName: String, @PythonName("new_columns") newColumns: union, Table> @@ -438,6 +455,7 @@ class Table( */ @Pure @PythonName("transform_column") + @Category(DataScienceCategory.DataProcessingQTable) fun transformColumn( name: String, transformer: (cell: Cell) -> transformedCell: Cell @@ -477,6 +495,7 @@ class Table( */ @Pure @PythonName("count_row_if") + @Category(DataScienceCategory.DataExplorationQGeneral) fun countRowIf( predicate: (cell: Row) -> satisfiesPredicate: Cell, @PythonName("ignore_unknown") ignoreUnknown: Boolean = true, @@ -498,6 +517,7 @@ class Table( */ @Pure @PythonName("remove_duplicate_rows") + @Category(DataScienceCategory.DataProcessingQTable) fun removeDuplicateRows() -> newTable: Table /** @@ -518,6 +538,7 @@ class Table( */ @Pure @PythonName("remove_rows") + @Category(DataScienceCategory.DataProcessingQTable) fun removeRows( query: (row: Row) -> shouldRemoveRow: Cell ) -> newTable: Table @@ -541,6 +562,7 @@ class Table( */ @Pure @PythonName("remove_rows_by_column") + @Category(DataScienceCategory.DataProcessingQTable) fun removeRowsByColumn( name: String, query: (cell: Cell) -> shouldRemoveRow: Cell @@ -564,6 +586,7 @@ class Table( */ @Pure @PythonName("remove_rows_with_missing_values") + @Category(DataScienceCategory.DataProcessingQTable) fun removeRowsWithMissingValues( @PythonName("column_names") columnNames: List? = null ) -> newTable: Table @@ -603,6 +626,7 @@ class Table( */ @Pure @PythonName("remove_rows_with_outliers") + @Category(DataScienceCategory.DataProcessingQTable) fun removeRowsWithOutliers( @PythonName("column_names") columnNames: List? = null, @PythonName("z_score_threshold") zScoreThreshold: Float = 3.0 @@ -624,6 +648,7 @@ class Table( */ @Pure @PythonName("shuffle_rows") + @Category(DataScienceCategory.DataProcessingQTable) fun shuffleRows() -> newTable: Table /** @@ -653,6 +678,7 @@ class Table( */ @Pure @PythonName("slice_rows") + @Category(DataScienceCategory.DataProcessingQTable) fun sliceRows( start: Int = 0, length: Int? = null @@ -677,6 +703,7 @@ class Table( */ @Pure @PythonName("sort_rows") + @Category(DataScienceCategory.DataProcessingQTable) fun sortRows( @PythonName("key_selector") keySelector: (row: Row) -> key: Cell, descending: Boolean = false @@ -701,6 +728,7 @@ class Table( */ @Pure @PythonName("sort_rows_by_column") + @Category(DataScienceCategory.DataProcessingQTable) fun sortRowsByColumn( name: String, descending: Boolean = false @@ -731,6 +759,7 @@ class Table( */ @Pure @PythonName("split_rows") + @Category(DataScienceCategory.DataProcessingQTable) fun splitRows( @PythonName("percentage_in_first") percentageInFirst: Float, shuffle: Boolean = true @@ -758,6 +787,7 @@ class Table( */ @Pure @PythonName("add_table_as_columns") + @Category(DataScienceCategory.DataProcessingQTable) fun addTableAsColumns( other: Table ) -> newTable: Table @@ -784,6 +814,7 @@ class Table( */ @Pure @PythonName("add_table_as_rows") + @Category(DataScienceCategory.DataProcessingQTable) fun addTableAsRows( other: Table ) -> newTable: Table @@ -810,6 +841,7 @@ class Table( */ @Pure @PythonName("inverse_transform_table") + @Category(DataScienceCategory.DataProcessingQTable) fun inverseTransformTable( @PythonName("fitted_transformer") fittedTransformer: InvertibleTableTransformer ) -> newTable: Table @@ -833,6 +865,7 @@ class Table( * } */ @Pure + @Category(DataScienceCategory.DataProcessingQTable) fun join( @PythonName("right_table") rightTable: Table, @PythonName("left_names") leftNames: union, String>, @@ -862,6 +895,7 @@ class Table( */ @Pure @PythonName("transform_table") + @Category(DataScienceCategory.DataProcessingQTable) fun transformTable( @PythonName("fitted_transformer") fittedTransformer: TableTransformer ) -> newTable: Table @@ -879,6 +913,7 @@ class Table( */ @Pure @PythonName("summarize_statistics") + @Category(DataScienceCategory.DataExplorationQMetric) fun summarizeStatistics() -> statistics: Table /** @@ -894,6 +929,7 @@ class Table( */ @Pure @PythonName("to_columns") + @Category(DataScienceCategory.UtilitiesQConversion) fun toColumns() -> columns: List /** @@ -912,6 +948,7 @@ class Table( */ @Impure([ImpurityReason.FileWriteToParameterizedPath("path")]) @PythonName("to_csv_file") + @Category(DataScienceCategory.DataExport) fun toCsvFile( path: String ) @@ -930,6 +967,7 @@ class Table( */ @Pure @PythonName("to_dict") + @Category(DataScienceCategory.UtilitiesQConversion) fun toMap() -> map: Map> /** @@ -950,6 +988,7 @@ class Table( */ @Impure([ImpurityReason.FileWriteToParameterizedPath("path")]) @PythonName("to_json_file") + @Category(DataScienceCategory.DataExport) fun toJsonFile( path: String ) @@ -970,6 +1009,7 @@ class Table( */ @Impure([ImpurityReason.FileWriteToParameterizedPath("path")]) @PythonName("to_parquet_file") + @Category(DataScienceCategory.DataExport) fun toParquetFile( path: String ) @@ -1005,6 +1045,7 @@ class Table( */ @Pure @PythonName("to_tabular_dataset") + @Category(DataScienceCategory.UtilitiesQConversion) fun toTabularDataset( @PythonName("target_name") targetName: String, @PythonName("extra_names") extraNames: List? = null @@ -1038,6 +1079,7 @@ class Table( */ @Pure @PythonName("to_time_series_dataset") + @Category(DataScienceCategory.UtilitiesQConversion) fun toTimeSeriesDataset( @PythonName("target_name") targetName: String, @PythonName("window_size") windowSize: Int, diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/ColumnPlotter.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/ColumnPlotter.sdsstub index 321e4dd52..10e2ae604 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/ColumnPlotter.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/ColumnPlotter.sdsstub @@ -13,6 +13,7 @@ from safeds.data.image.containers import Image * val plotter = column.plot; * } */ +@Category(DataScienceCategory.BasicElement) class ColumnPlotter( column: Column ) { @@ -31,6 +32,7 @@ class ColumnPlotter( */ @Pure @PythonName("box_plot") + @Category(DataScienceCategory.DataExplorationQVisualization) fun boxPlot( theme: literal<"dark", "light"> = "light" ) -> plot: Image @@ -50,6 +52,7 @@ class ColumnPlotter( */ @Pure @PythonName("violin_plot") + @Category(DataScienceCategory.DataExplorationQVisualization) fun violinPlot( theme: literal<"dark", "light"> = "light" ) -> plot: Image @@ -69,6 +72,7 @@ class ColumnPlotter( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQVisualization) fun histogram( @PythonName("max_bin_count") const maxBinCount: Int = 10, theme: literal<"dark", "light"> = "light" @@ -92,6 +96,7 @@ class ColumnPlotter( */ @Pure @PythonName("lag_plot") + @Category(DataScienceCategory.DataExplorationQVisualization) fun lagPlot( lag: Int, theme: literal<"dark", "light"> = "light" diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/TablePlotter.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/TablePlotter.sdsstub index 5be93da9b..53c6af37e 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/TablePlotter.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/plotting/TablePlotter.sdsstub @@ -14,6 +14,7 @@ from safeds.data.tabular.containers import Table * val plotter = table.plot; * } */ +@Category(DataScienceCategory.BasicElement) class TablePlotter( table: Table ) { @@ -32,6 +33,7 @@ class TablePlotter( */ @Pure @PythonName("box_plots") + @Category(DataScienceCategory.DataExplorationQVisualization) fun boxPlots( theme: literal<"dark", "light"> = "light" ) -> plot: Image @@ -51,6 +53,7 @@ class TablePlotter( */ @Pure @PythonName("violin_plots") + @Category(DataScienceCategory.DataExplorationQVisualization) fun violinPlots( theme: literal<"dark", "light"> = "light" ) -> plot: Image @@ -70,6 +73,7 @@ class TablePlotter( */ @Pure @PythonName("correlation_heatmap") + @Category(DataScienceCategory.DataExplorationQVisualization) fun correlationHeatmap( theme: literal<"dark", "light"> = "light" ) -> plot: Image @@ -89,6 +93,7 @@ class TablePlotter( * } */ @Pure + @Category(DataScienceCategory.DataExplorationQVisualization) fun histograms( @PythonName("max_bin_count") const maxBinCount: Int = 10, theme: literal<"dark", "light"> = "light" @@ -119,6 +124,7 @@ class TablePlotter( */ @Pure @PythonName("line_plot") + @Category(DataScienceCategory.DataExplorationQVisualization) fun linePlot( @PythonName("x_name") xName: String, @PythonName("y_names") yNames: List, @@ -148,6 +154,7 @@ class TablePlotter( */ @Pure @PythonName("scatter_plot") + @Category(DataScienceCategory.DataExplorationQVisualization) fun scatterPlot( @PythonName("x_name") xName: String, @PythonName("y_names") yNames: List, @@ -177,6 +184,7 @@ class TablePlotter( */ @Pure @PythonName("moving_average_plot") + @Category(DataScienceCategory.DataExplorationQVisualization) fun movingAveragePlot( @PythonName("x_name") xName: String, @PythonName("y_name") yName: String, @@ -208,6 +216,7 @@ class TablePlotter( */ @Pure @PythonName("histogram_2d") + @Category(DataScienceCategory.DataExplorationQVisualization) fun histogram2d( @PythonName("x_name") xName: String, @PythonName("y_name") yName: String, diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/FunctionalTableTransformer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/FunctionalTableTransformer.sdsstub index c59889392..a2e8c3582 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/FunctionalTableTransformer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/FunctionalTableTransformer.sdsstub @@ -19,6 +19,7 @@ class FunctionalTableTransformer( * @result fittedTransformer Returns self, because this transformer is always fitted. */ @Pure + @Category(DataScienceCategory.DataProcessingQTransformer) fun fit( table: Table ) -> fittedTransformer: FunctionalTableTransformer @@ -33,6 +34,7 @@ class FunctionalTableTransformer( */ @Pure @PythonName("fit_and_transform") + @Category(DataScienceCategory.DataProcessingQTransformer) fun fitAndTransform( table: Table ) -> (fittedTransformer: FunctionalTableTransformer, transformedTable: Table) diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/KNearestNeighborsImputer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/KNearestNeighborsImputer.sdsstub index 01c1e2b24..4989b698c 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/KNearestNeighborsImputer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/KNearestNeighborsImputer.sdsstub @@ -34,6 +34,7 @@ class KNearestNeighborsImputer( * @result fittedTransformer The fitted transformer. */ @Pure + @Category(DataScienceCategory.DataProcessingQTransformer) fun fit( table: Table ) -> fittedTransformer: KNearestNeighborsImputer @@ -50,6 +51,7 @@ class KNearestNeighborsImputer( */ @Pure @PythonName("fit_and_transform") + @Category(DataScienceCategory.DataProcessingQTransformer) fun fitAndTransform( table: Table ) -> (fittedTransformer: KNearestNeighborsImputer, transformedTable: Table) diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/OneHotEncoder.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/OneHotEncoder.sdsstub index 329aef5f9..47a61561c 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/OneHotEncoder.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/data/tabular/transformation/OneHotEncoder.sdsstub @@ -61,6 +61,7 @@ class OneHotEncoder( * @result fittedTransformer The fitted transformer. */ @Pure + @Category(DataScienceCategory.DataProcessingQTransformer) fun fit( table: Table ) -> fittedTransformer: OneHotEncoder @@ -77,6 +78,7 @@ class OneHotEncoder( */ @Pure @PythonName("fit_and_transform") + @Category(DataScienceCategory.DataProcessingQTransformer) fun fitAndTransform( table: Table ) -> (fittedTransformer: OneHotEncoder, transformedTable: Table) diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/lang/ideIntegration.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/lang/ideIntegration.sdsstub index 90feeedb2..814d14517 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/lang/ideIntegration.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/lang/ideIntegration.sdsstub @@ -21,38 +21,62 @@ annotation Category(category: DataScienceCategory) /** * A step in the data science process. + * The letter "Q" is used as a separator for subcategories. */ @Experimental enum DataScienceCategory { + /** + * Basic building blocks. + */ + BasicElement + /** * Load your data into the program. */ DataImport /** - * Prepare your data for analysis. + * Save your data for later use. */ - DataPreparation + DataExport - /** + /** * Explore your data. */ - DataExploration + DataExplorationQMetric + DataExplorationQVisualization + DataExplorationQGeneral /** - * Save your data for later use. + * Prepare your data for analysis. */ - DataExport + DataProcessingQColumn + DataProcessingQTable + DataProcessingQImage + DataProcessingQImageList + DataProcessingQTransformer /** * Configure a model and train it on your data. */ - Modeling + ModelingQGeneral + ModelingQClassicalClassification + ModelingQClassicalRegression + ModelingQNeuralNetwork /** * Evaluate the performance of your model. */ - ModelEvaluation + ModelEvaluationQMetric + ModelEvaluationQVisualization + + /** + * Utility iterms for general use and lambda functions + */ + UtilitiesQConversion + UtilitiesQTable + UtilitiesQImage + UtilitiesQString } /** diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/AdaBoostClassifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/AdaBoostClassifier.sdsstub index 723b19fca..3b21127ce 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/AdaBoostClassifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/AdaBoostClassifier.sdsstub @@ -52,6 +52,7 @@ class AdaBoostClassifier( * @result fittedClassifier The fitted classifier. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedClassifier: AdaBoostClassifier diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/Classifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/Classifier.sdsstub index 54273ac88..f43a63c9a 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/Classifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/Classifier.sdsstub @@ -18,6 +18,7 @@ class Classifier sub SupervisedModel { * @result fittedModel The fitted model. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedModel: Classifier @@ -34,6 +35,7 @@ class Classifier sub SupervisedModel { */ @Pure @PythonName("summarize_metrics") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun summarizeMetrics( @PythonName("validation_or_test_set") validationOrTestSet: union, @PythonName("positive_class") positiveClass: Any @@ -52,6 +54,7 @@ class Classifier sub SupervisedModel { * @result accuracy The classifier's accuracy. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) fun accuracy( @PythonName("validation_or_test_set") validationOrTestSet: union ) -> accuracy: Float @@ -71,6 +74,7 @@ class Classifier sub SupervisedModel { */ @Pure @PythonName("f1_score") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun f1Score( @PythonName("validation_or_test_set") validationOrTestSet: union, @PythonName("positive_class") positiveClass: Any @@ -90,6 +94,7 @@ class Classifier sub SupervisedModel { * @result precision The classifier's precision. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) fun precision( @PythonName("validation_or_test_set") validationOrTestSet: union, @PythonName("positive_class") positiveClass: Any @@ -109,6 +114,7 @@ class Classifier sub SupervisedModel { * @result recall The classifier's recall. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) fun recall( @PythonName("validation_or_test_set") validationOrTestSet: union, @PythonName("positive_class") positiveClass: Any diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/DecisionTreeClassifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/DecisionTreeClassifier.sdsstub index 45652b1fc..4239c1256 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/DecisionTreeClassifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/DecisionTreeClassifier.sdsstub @@ -42,6 +42,7 @@ class DecisionTreeClassifier( * @result fittedClassifier The fitted classifier. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedClassifier: DecisionTreeClassifier diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/GradientBoostingClassifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/GradientBoostingClassifier.sdsstub index cdddca560..8ca4569eb 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/GradientBoostingClassifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/GradientBoostingClassifier.sdsstub @@ -46,6 +46,7 @@ class GradientBoostingClassifier( * @result fittedClassifier The fitted classifier. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedClassifier: GradientBoostingClassifier diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/KNearestNeighborsClassifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/KNearestNeighborsClassifier.sdsstub index 28e4d396f..bea8f8a68 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/KNearestNeighborsClassifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/KNearestNeighborsClassifier.sdsstub @@ -38,6 +38,7 @@ class KNearestNeighborsClassifier( * @result fittedClassifier The fitted classifier. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedClassifier: KNearestNeighborsClassifier diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/LogisticClassifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/LogisticClassifier.sdsstub index 25c1316c6..1cf99f74b 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/LogisticClassifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/LogisticClassifier.sdsstub @@ -37,6 +37,7 @@ class LogisticClassifier( * @result fittedClassifier The fitted classifier. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedClassifier: LogisticClassifier diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/RandomForestClassifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/RandomForestClassifier.sdsstub index 86223cd0c..4fde0ce0c 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/RandomForestClassifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/RandomForestClassifier.sdsstub @@ -50,6 +50,7 @@ class RandomForestClassifier( * @result fittedClassifier The fitted classifier. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedClassifier: RandomForestClassifier diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/SupportVectorClassifier.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/SupportVectorClassifier.sdsstub index e10673760..72b4bab4d 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/SupportVectorClassifier.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/classification/SupportVectorClassifier.sdsstub @@ -78,6 +78,7 @@ class SupportVectorClassifier( * @result fittedClassifier The fitted classifier. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalClassification) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedClassifier: SupportVectorClassifier diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/AdaBoostRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/AdaBoostRegressor.sdsstub index 43ab8dfee..669de4a74 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/AdaBoostRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/AdaBoostRegressor.sdsstub @@ -52,6 +52,7 @@ class AdaBoostRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: AdaBoostRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ArimaRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ArimaRegressor.sdsstub index ddc5820bf..7adee667b 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ArimaRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ArimaRegressor.sdsstub @@ -29,6 +29,7 @@ class ArimaRegressor() { * @result fittedArima The fitted ARIMA Model. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("time_series") timeSeries: TimeSeriesDataset ) -> fittedArima: ArimaRegressor @@ -41,6 +42,7 @@ class ArimaRegressor() { * @result prediction A timeseries containing the predicted target vector and a time dummy as time column. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun predict( @PythonName("time_series") timeSeries: TimeSeriesDataset ) -> prediction: Table @@ -54,6 +56,7 @@ class ArimaRegressor() { */ @Pure @PythonName("plot_predictions") + @Category(DataScienceCategory.ModelEvaluationQVisualization) fun plotPredictions( @PythonName("test_series") testSeries: TimeSeriesDataset ) -> image: Image diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/DecisionTreeRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/DecisionTreeRegressor.sdsstub index 297a151bb..dc21ae7c1 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/DecisionTreeRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/DecisionTreeRegressor.sdsstub @@ -43,6 +43,7 @@ class DecisionTreeRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: DecisionTreeRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ElasticNetRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ElasticNetRegressor.sdsstub index 1ad62ce7d..3ea5e48bf 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ElasticNetRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/ElasticNetRegressor.sdsstub @@ -50,6 +50,7 @@ class ElasticNetRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: ElasticNetRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/GradientBoostingRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/GradientBoostingRegressor.sdsstub index 33593c76f..ee1a0e70a 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/GradientBoostingRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/GradientBoostingRegressor.sdsstub @@ -46,6 +46,7 @@ class GradientBoostingRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: GradientBoostingRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/KNearestNeighborsRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/KNearestNeighborsRegressor.sdsstub index 120a1df0f..67101837e 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/KNearestNeighborsRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/KNearestNeighborsRegressor.sdsstub @@ -38,6 +38,7 @@ class KNearestNeighborsRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: KNearestNeighborsRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LassoRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LassoRegressor.sdsstub index 533e9dcb1..d2258f240 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LassoRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LassoRegressor.sdsstub @@ -41,6 +41,7 @@ class LassoRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: LassoRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LinearRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LinearRegressor.sdsstub index cdab823d2..455e81483 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LinearRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/LinearRegressor.sdsstub @@ -87,6 +87,7 @@ class LinearRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: LinearRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RandomForestRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RandomForestRegressor.sdsstub index 13ddfc1b0..d77757c39 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RandomForestRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RandomForestRegressor.sdsstub @@ -50,6 +50,7 @@ class RandomForestRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: RandomForestRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/Regressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/Regressor.sdsstub index f449fbaf9..4be04c691 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/Regressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/Regressor.sdsstub @@ -18,6 +18,7 @@ class Regressor sub SupervisedModel { * @result fittedModel The fitted model. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedModel: Regressor @@ -33,6 +34,7 @@ class Regressor sub SupervisedModel { */ @Pure @PythonName("summarize_metrics") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun summarizeMetrics( @PythonName("validation_or_test_set") validationOrTestSet: union ) -> metrics: Table @@ -64,6 +66,7 @@ class Regressor sub SupervisedModel { */ @Pure @PythonName("coefficient_of_determination") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun coefficientOfDetermination( @PythonName("validation_or_test_set") validationOrTestSet: union ) -> coefficientOfDetermination: Float @@ -84,6 +87,7 @@ class Regressor sub SupervisedModel { */ @Pure @PythonName("mean_absolute_error") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun meanAbsoluteError( @PythonName("validation_or_test_set") validationOrTestSet: union ) -> meanAbsoluteError: Float @@ -108,6 +112,7 @@ class Regressor sub SupervisedModel { */ @Pure @PythonName("mean_directional_accuracy") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun meanDirectionalAccuracy( @PythonName("validation_or_test_set") validationOrTestSet: union ) -> meanDirectionalAccuracy: Float @@ -130,6 +135,7 @@ class Regressor sub SupervisedModel { */ @Pure @PythonName("mean_squared_error") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun meanSquaredError( @PythonName("validation_or_test_set") validationOrTestSet: union ) -> meanSquaredError: Float @@ -150,6 +156,7 @@ class Regressor sub SupervisedModel { */ @Pure @PythonName("median_absolute_deviation") + @Category(DataScienceCategory.ModelEvaluationQMetric) fun medianAbsoluteDeviation( @PythonName("validation_or_test_set") validationOrTestSet: union ) -> medianAbsoluteDeviation: Float diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RidgeRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RidgeRegressor.sdsstub index 6c56feef6..8d833fc44 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RidgeRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/RidgeRegressor.sdsstub @@ -41,6 +41,7 @@ class RidgeRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: RidgeRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/SupportVectorRegressor.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/SupportVectorRegressor.sdsstub index b87c347bb..150574c2b 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/SupportVectorRegressor.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/classical/regression/SupportVectorRegressor.sdsstub @@ -78,6 +78,7 @@ class SupportVectorRegressor( * @result fittedRegressor The fitted regressor. */ @Pure + @Category(DataScienceCategory.ModelingQClassicalRegression) fun fit( @PythonName("training_set") trainingSet: TabularDataset ) -> fittedRegressor: SupportVectorRegressor diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/ClassificationMetrics.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/ClassificationMetrics.sdsstub index d3ea4a408..b20af0919 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/ClassificationMetrics.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/ClassificationMetrics.sdsstub @@ -17,6 +17,7 @@ class ClassificationMetrics { * @result metrics A table containing the classification metrics. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun summarize( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset>, @@ -35,6 +36,7 @@ class ClassificationMetrics { * @result accuracy The calculated accuracy. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun accuracy( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset> @@ -54,6 +56,7 @@ class ClassificationMetrics { */ @Pure @PythonName("f1_score") + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun f1Score( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset>, @@ -73,6 +76,7 @@ class ClassificationMetrics { * @result precision The calculated precision. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun precision( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset>, @@ -92,6 +96,7 @@ class ClassificationMetrics { * @result recall The calculated recall. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun recall( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset>, diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/RegressionMetrics.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/RegressionMetrics.sdsstub index 129382a86..4112972af 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/RegressionMetrics.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/metrics/RegressionMetrics.sdsstub @@ -16,6 +16,7 @@ class RegressionMetrics { * @result metrics A table containing the regression metrics. */ @Pure + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun summarize( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset> @@ -46,6 +47,7 @@ class RegressionMetrics { */ @Pure @PythonName("coefficient_of_determination") + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun coefficientOfDetermination( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset> @@ -65,6 +67,7 @@ class RegressionMetrics { */ @Pure @PythonName("mean_absolute_error") + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun meanAbsoluteError( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset> @@ -88,6 +91,7 @@ class RegressionMetrics { */ @Pure @PythonName("mean_directional_accuracy") + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun meanDirectionalAccuracy( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset> @@ -109,6 +113,7 @@ class RegressionMetrics { */ @Pure @PythonName("mean_squared_error") + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun meanSquaredError( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset> @@ -128,6 +133,7 @@ class RegressionMetrics { */ @Pure @PythonName("median_absolute_deviation") + @Category(DataScienceCategory.ModelEvaluationQMetric) static fun medianAbsoluteDeviation( predicted: union, TabularDataset, TimeSeriesDataset>, expected: union, TabularDataset, TimeSeriesDataset> diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/AveragePooling2DLayer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/AveragePooling2DLayer.sdsstub index 3e28720d4..912b63b8a 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/AveragePooling2DLayer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/AveragePooling2DLayer.sdsstub @@ -11,6 +11,7 @@ from safeds.ml.nn.typing import ModelImageSize * @param padding the padding of the pooling */ @Experimental +@Category(DataScienceCategory.ModelingQNeuralNetwork) class AveragePooling2DLayer( @PythonName("kernel_size") kernelSize: Int, stride: Int = -1, diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/Convolutional2DLayer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/Convolutional2DLayer.sdsstub index 54d88ff23..9049e4e2b 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/Convolutional2DLayer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/Convolutional2DLayer.sdsstub @@ -12,6 +12,7 @@ from safeds.ml.nn.typing import ModelImageSize * @param padding the padding of the convolution */ @Experimental +@Category(DataScienceCategory.ModelingQNeuralNetwork) class Convolutional2DLayer( @PythonName("output_channel") outputChannel: Int, @PythonName("kernel_size") kernelSize: Int, diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ConvolutionalTranspose2DLayer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ConvolutionalTranspose2DLayer.sdsstub index f45f052d3..c81b08ac3 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ConvolutionalTranspose2DLayer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ConvolutionalTranspose2DLayer.sdsstub @@ -13,6 +13,7 @@ from safeds.ml.nn.layers import Convolutional2DLayer * @param outputPadding the output padding of the transposed convolution */ @Experimental +@Category(DataScienceCategory.ModelingQNeuralNetwork) class ConvolutionalTranspose2DLayer( @PythonName("output_channel") outputChannel: Int, @PythonName("kernel_size") kernelSize: Int, diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/DropoutLayer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/DropoutLayer.sdsstub index c8b0b8b1b..b1764f8bc 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/DropoutLayer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/DropoutLayer.sdsstub @@ -8,6 +8,7 @@ from safeds.ml.nn.typing import ModelImageSize * * @param probability The probability that an input element gets zeroed out. */ + @Category(DataScienceCategory.ModelingQNeuralNetwork) class DropoutLayer( probability: Float ) sub Layer { diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/FlattenLayer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/FlattenLayer.sdsstub index 665ca6afd..2c9ea64e7 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/FlattenLayer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/FlattenLayer.sdsstub @@ -7,6 +7,7 @@ from safeds.ml.nn.typing import ModelImageSize * A flatten layer. */ @Experimental +@Category(DataScienceCategory.ModelingQNeuralNetwork) class FlattenLayer() sub Layer { /** * Get the input_size of this layer. diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ForwardLayer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ForwardLayer.sdsstub index 7bef7bf8c..2ad5bc74f 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ForwardLayer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/ForwardLayer.sdsstub @@ -9,6 +9,7 @@ from safeds.ml.nn.layers import Layer * @param activationFunction The activation function used in the forward layer, if not set the activation will be set automatically. */ @Experimental +@Category(DataScienceCategory.ModelingQNeuralNetwork) class ForwardLayer( @PythonName("neuron_count") neuronCount: Int, @PythonName("overwrite_activation_function") activationFunction: literal<"sigmoid", "relu", "softmax", "none", "notset"> = "notset" diff --git a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/GRULayer.sdsstub b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/GRULayer.sdsstub index 75d6edca9..731629b0e 100644 --- a/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/GRULayer.sdsstub +++ b/packages/safe-ds-lang/src/resources/builtins/safeds/ml/nn/layers/GRULayer.sdsstub @@ -7,6 +7,7 @@ from safeds.ml.nn.layers import Layer * * @param neuronCount The number of neurons in this layer */ + @Category(DataScienceCategory.ModelingQNeuralNetwork) class GRULayer( @PythonName("neuron_count") neuronCount: Int ) sub Layer { diff --git a/packages/safe-ds-lang/tests/language/builtins/safe-ds-annotations.test.ts b/packages/safe-ds-lang/tests/language/builtins/safe-ds-annotations.test.ts index f5ce83e7f..5e625936e 100644 --- a/packages/safe-ds-lang/tests/language/builtins/safe-ds-annotations.test.ts +++ b/packages/safe-ds-lang/tests/language/builtins/safe-ds-annotations.test.ts @@ -33,10 +33,10 @@ describe('getCategory', () => { code: ` package test - @Category(DataScienceCategory.DataPreparation) + @Category(DataScienceCategory.ModelEvaluationQVisualization) class Test `, - expected: 'DataPreparation', + expected: 'ModelEvaluationQVisualization', }, ];