-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add custom editor / visualizer to vscode extension #1243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GideonKoenig
wants to merge
84
commits into
main
Choose a base branch
from
custom-editor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
261b87c
add custom editor to package.json
GideonKoenigJukabo 29f6501
feat: Add CustomEditorProvider
GideonKoenigJukabo f701ce0
feat: hide menu item command when in custom editor
GideonKoenigJukabo cb9b61b
initialize svelte webview
GideonKoenigJukabo 0c2f360
create svelte project with tailwind
GideonKoenigJukabo 39be0b5
add settings for custom-editor submodule
GideonKoenigJukabo fac0bdf
add dynamic css file import
GideonKoenigJukabo 36c606e
improve dx - setup watch command
GideonKoenigJukabo 1a2a10f
ignore custom editor devtools in eslint
GideonKoenigJukabo f5c2e5e
change custom-editor bundle migration target fild
GideonKoenigJukabo 6fa703d
add tailwind and shadcn to svelte project
GideonKoenigJukabo cca3c79
create base message structure
GideonKoenigJukabo 1e31930
create test message from webview to extension
GideonKoenigJukabo 11cc564
add MessageHandler to Extension and Webview components
GideonKoenigJukabo 8ecdfa5
establish communication with language server
GideonKoenigJukabo c7b38f9
refine language server message definition
GideonKoenigJukabo c8ea001
refine language server message definition
GideonKoenigJukabo 974fd58
use shared types for language server communication
GideonKoenigJukabo 6b3388d
change device
GideonKoenigJukabo 38f592f
priamry sidebar cleanup, initialize grid
GideonKoenigJukabo 5aba7d3
feat: tooltip trait
GideonKoenigJukabo bc8c8aa
refine tooltip (add pointer) | add Parameter to statement node | make…
GideonKoenigJukabo df1f7de
add placeholder node
GideonKoenigJukabo 9877413
refactor assets | modify placeholder name placement | start expressio…
GideonKoenigJukabo e6fce0e
add extension node
GideonKoenig 419fa72
add expression node | rework port structure
GideonKoenig 1980c70
Merge branch 'main' into custom-editor
GideonKoenig 151b6ce
move message registration in safe-ds-lang
GideonKoenig 3ff8ad5
eod | primary sidebar
GideonKoenig 16841cd
exchange expression icon
GideonKoenig 9dd689f
switch device
GideonKoenig 3cb4d04
add skip button to error page
GideonKoenig 4a3c76f
yeah, these are really not helpful ... this is a lot of progress in o…
GideonKoenig 99d64f2
yeah, this is way to big
GideonKoenig dab358b
refactor: define extractors as classes
GideonKoenig ffc2d96
some more stuff
GideonKoenig e6e44e5
update
GideonKoenig f430994
Merge branch 'main' into custom-editor
GideonKoenig ebea553
complete merge
GideonKoenig ddea65c
new ast parser
GideonKoenig b195e62
get the ast to the frontend
GideonKoenig 9993f8f
something
GideonKoenig 4c6826b
tmp commit
GideonKoenig 03f757e
second try
GideonKoenig c26ee8d
HELL YES
GideonKoenig 13073ce
upate call, ge and placeholder nodes
GideonKoenig 2954743
looks good now
GideonKoenig c3f56fe
change device
GideonKoenig a369070
layout test
GideonKoenig b4f8da9
to much again
GideonKoenig ba4d0da
fix: sidebar sections dont respect parent width
GideonKoenig f469a55
feat: add globalRefernces to sidebar and search capability
GideonKoenig 821d4e5
fix: wrong style for search bar
GideonKoenig 9a0fe52
fix: placeholder statusindicator vanishes after highlighting
GideonKoenig 8d1bd6c
refactor: overhaul type parsing
GideonKoenig f5ac2b7
fix: remove old generic expression icon
GideonKoenig 36f00bd
refactor: rework placeholder node
GideonKoenig 1911f82
fix: statusbar of placehoders shines through
GideonKoenig 29a3c5e
fix: minor placeholder style issue
GideonKoenig 92355b8
eof
GideonKoenig 5a61e0f
eof
GideonKoenig 9045582
feat: basic segment implementation
GideonKoenig 4d8f632
feat: segments
GideonKoenig 8702e35
change device
GideonKoenig edcbc4f
feat: sync, but to much sync
GideonKoenig d1adbee
feat: sync events
GideonKoenig 056f4e8
change device
GideonKoenig 30067d8
feat: add processing animation
GideonKoenig 76e05f9
fix: several smaller issues
GideonKoenig b69b410
Merge branch 'main' into custom-editor
GideonKoenig 1ca78e6
feat: finish sidebar-elements
GideonKoenig 13f104c
feat: vertical processing animation and filtered global references
GideonKoenig fc8866b
fix: missing linux build dependency
GideonKoenig 40ab1f4
fix: spelling mistake, and missing test adjustment
GideonKoenig 85a7ee5
fix: ignore lint rules for tailwind.css
GideonKoenig 14dfda4
fix: a bunch of linter issues
GideonKoenig 707bcb3
fix: more lint issues
GideonKoenig cafa613
style: apply automated linter fixes
megalinter-bot 62fa1e4
Merge branch 'main' into custom-editor
GideonKoenig 034fa77
fix: formatting issue
GideonKoenig aa6d5b9
fix: formatting issue
GideonKoenig 9382a64
fix: more formatting issues
GideonKoenig f85738b
meta: swap device
GideonKoenig ea2a468
Merge branch 'main' into custom-editor
GideonKoenig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "recommendations": ["svelte.svelte-vscode"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "files.associations": { | ||
| "*.css": "tailwindcss" | ||
GideonKoenig marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "printWidth": 100, | ||
| "tabWidth": 4, | ||
| "useTabs": false, | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "jsxSingleQuote": false, | ||
| "quoteProps": "as-needed", | ||
| "trailingComma": "all", | ||
| "bracketSpacing": true, | ||
| "jsxBracketSameLine": false, | ||
| "arrowParens": "always", | ||
| "requirePragma": false, | ||
| "insertPragma": false, | ||
| "proseWrap": "preserve", | ||
| "htmlWhitespaceSensitivity": "css", | ||
| "vueIndentScriptAndStyle": true, | ||
| "endOfLine": "lf", | ||
| "embeddedLanguageFormatting": "auto", | ||
| "overrides": [ | ||
| { | ||
| "files": ["*.yaml", "*.yml"], | ||
| "options": { "tabWidth": 2 } | ||
| } | ||
| ], | ||
| "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "$schema": "https://shadcn-svelte.com/schema.json", | ||
| "style": "new-york", | ||
| "tailwind": { | ||
| "config": "tailwind.config.js", | ||
| "css": "src/global.css", | ||
| "baseColor": "slate" | ||
| }, | ||
| "aliases": { | ||
| "components": "$src/components", | ||
| "utils": "$pages/utils" | ||
| }, | ||
| "typescript": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import fs from 'fs-extra'; | ||
| import path from 'path'; | ||
| import { fileURLToPath } from 'url'; | ||
| import { dirname } from 'path'; | ||
|
|
||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = dirname(__filename); | ||
|
|
||
| const sourceDir = path.join(__dirname, '..', 'dist'); | ||
| const distDir = path.join(__dirname, '..', '..', 'safe-ds-vscode', 'dist'); | ||
| const targetDir = path.join(distDir, 'custom-editor'); | ||
|
|
||
| console.log(`Removing old files from <safe-ds-vscode>...`); | ||
| fs.ensureDirSync(distDir); | ||
| fs.emptyDirSync(targetDir); | ||
|
|
||
| console.log(`Copying webview from <safe-ds-editor> to <safe-ds-vscode>...`); | ||
| fs.copy(sourceDir, targetDir, { overwrite: true }) | ||
| .then(() => console.log('Done')) | ||
| .catch((err) => { | ||
| console.error('Error during copying:', err); | ||
| process.exit(1); | ||
| }); | ||
|
|
||
| // npm run watch script: "watch": "concurrently -n Vite,Nodemon -c blue,red \"vite build --watch\" \"npx nodemon --quiet --watch dist migrationTools/copyToExtension.js\"", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| { | ||
| "name": "@safe-ds/custom-editor", | ||
| "private": true, | ||
| "version": "0.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "vite build && node migrationTools/copyToExtension.js", | ||
| "watch": "concurrently -n Vite,Nodemon -c blue,red \"vite build --watch\" \"npx nodemon --quiet --watch dist migrationTools/copyToExtension.js\"", | ||
| "preview": "vite preview", | ||
| "check": "svelte-check --tsconfig ./tsconfig.json", | ||
| "clean": "shx rm -rf dist", | ||
| "build:clean": "npm run clean && npm run build", | ||
| "copyToExtension": "node migrationTools/copyToExtension.js" | ||
| }, | ||
| "devDependencies": { | ||
| "@magidoc/plugin-svelte-marked": "^6.1.0", | ||
| "@safe-ds/lang": ">=0.3.0", | ||
| "@sveltejs/vite-plugin-svelte": "^3.0.2", | ||
| "@tsconfig/svelte": "^5.0.2", | ||
| "autoprefixer": "^10.4.17", | ||
| "bits-ui": "^0.21.16", | ||
| "clsx": "^2.1.0", | ||
| "concurrently": "^8.2.2", | ||
| "fs-extra": "^11.2.0", | ||
| "nodemon": "^3.0.3", | ||
| "postcss": "^8.4.33", | ||
| "prettier-plugin-svelte": "^3.2.1", | ||
| "prettier-plugin-tailwindcss": "^0.5.11", | ||
| "radix-icons-svelte": "^1.2.1", | ||
| "svelte": "^4.2.9", | ||
| "svelte-check": "^3.6.3", | ||
| "svelte-preprocess": "^5.1.3", | ||
| "svelte-radix": "^1.1.1", | ||
| "svelte-svg": "^0.0.7", | ||
| "tailwind-merge": "^2.2.1", | ||
| "tailwind-variants": "^0.1.20", | ||
| "tailwindcss": "^3.4.1", | ||
| "terser": "^5.28.1", | ||
| "tslib": "^2.6.2", | ||
| "typescript": "^5.3.3", | ||
| "vite": "^5.0.12" | ||
| }, | ||
| "dependencies": { | ||
| "@xyflow/svelte": "^0.1.13", | ||
| "elkjs": "^0.9.3", | ||
| "flatten": "^1.0.3", | ||
| "marked": "^14.0.0", | ||
| "paneforge": "^0.0.5" | ||
| }, | ||
| "optionalDependencies": { | ||
| "@rollup/rollup-linux-x64-gnu": "^4.24.2" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export default { | ||
| plugins: { | ||
| tailwindcss: {}, | ||
| autoprefixer: {}, | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| package evaluation | ||
|
|
||
| pipeline ensemblingStacking { | ||
| // Bug -> Indentation of Comment is wrong | ||
|
|
||
| val trainDataPre1 = Table.fromCsvFile("./train.csv"); | ||
| val testDataPre1 = Table.fromCsvFile("./test.csv"); | ||
|
|
||
| val _t1Heatmap = trainDataPre1.plot.correlationHeatmap(); | ||
| val _t1Boxplot = testDataPre1.plot.boxPlots(); | ||
|
|
||
| val imputerEmpty = SimpleImputer( | ||
| SimpleImputer.Strategy.Constant(""), | ||
| "Cabin" | ||
| ); | ||
|
|
||
| _, val trainDataPre = imputerEmpty.fitAndTransform(trainDataPre1); | ||
| _, val testDataPre = imputerEmpty.fitAndTransform(testDataPre1); | ||
|
|
||
|
|
||
| val trainName = trainDataPre.getColumn("Name").rename("Name_length"); | ||
| val testName = testDataPre.getColumn("Name").rename("Name_length"); | ||
|
|
||
| val trainNameLength = trainName.transform((cell) -> cell.str.length()); | ||
| val testNameLength = testName.transform((cell) -> cell.str.length()); | ||
|
|
||
| val trainCabin = trainDataPre.getColumn("Cabin").rename("Cabin_length"); | ||
| val testCabin = testDataPre.getColumn("Cabin").rename("Cabin_length"); | ||
|
|
||
| val trainHasCabin = trainCabin.transform((cell) -> cell.str.length() > 0); | ||
| val testHasCabin = testCabin.transform((cell) -> cell.str.length() > 0); | ||
|
|
||
| // Bug -> multiple entries in array lack auto complete | ||
| val trainDataNoTransform = trainDataPre.addColumns( | ||
| [trainNameLength, trainHasCabin] | ||
| ); | ||
| val testDataNoTransform = testDataPre.addColumns( | ||
| [testNameLength, testHasCabin] | ||
| ); | ||
|
|
||
| val trainDataT1 = trainDataNoTransform.addComputedColumn("FamilySize", (row) -> row["SibSp"] + row["Parch"]); | ||
| val testDataT1 = testDataNoTransform.addComputedColumn("FamilySize", (row) -> row["SibSp"] + row["Parch"]); | ||
|
|
||
| val trainDataT2 = trainDataT1.addComputedColumn("IsAlone", (row) -> row["FamilySize"] == 1); | ||
| val testDataT2 = testDataT1.addComputedColumn("IsAlone", (row) -> row["FamilySize"] == 1); | ||
|
|
||
| val _t2Heatmap = trainDataT2.plot.correlationHeatmap(); | ||
| val _t2Boxplot = testDataT2.plot.boxPlots(); | ||
|
|
||
| val imputerEmbark = SimpleImputer( | ||
| SimpleImputer.Strategy.Constant("S"), | ||
| "Embarked" | ||
| ); | ||
| _, val trainDataT3 = imputerEmbark.fitAndTransform(trainDataT2); | ||
| _, val testDataT3 = imputerEmbark.fitAndTransform(testDataT2); | ||
|
|
||
| val imputerFare = SimpleImputer( | ||
| SimpleImputer.Strategy.Median, | ||
| ["Fare", "Age"] | ||
| ); | ||
| _, val trainDataT4 = imputerFare.fitAndTransform(trainDataT3); | ||
| _, val testDataT4 = imputerFare.fitAndTransform(testDataT3); | ||
|
|
||
| val discretizerFare = Discretizer( | ||
| 4, | ||
| ["Fare"] | ||
| ); | ||
| _, val trainDataT5 = discretizerFare.fitAndTransform(trainDataT4); | ||
| _, val testDataT5 = discretizerFare.fitAndTransform(testDataT4); | ||
|
|
||
| val discretizerAge = Discretizer( | ||
| 5, | ||
| ["Age"] | ||
| ); | ||
| _, val trainDataT6 = discretizerAge.fitAndTransform(trainDataT5); | ||
| _, val testDataT6 = discretizerAge.fitAndTransform(testDataT5); | ||
|
|
||
| val _t6Heatmap = trainDataT6.plot.correlationHeatmap(); | ||
| val _t6Boxplot = testDataT6.plot.boxPlots(); | ||
|
|
||
| val trainDataT7 = trainDataT6.addComputedColumn("Rare", (row) { | ||
| yield rareTitleDetected = row["Name"].str.contains("Lady") or row["Name"].str.contains("Countess") or row["Name"].str.contains("Capt") or row["Name"].str.contains("Col") or row["Name"].str.contains("Don") or row["Name"].str.contains("Dr") or row["Name"].str.contains("Major") or row["Name"].str.contains("Rev") or row["Name"].str.contains("Sir") or row["Name"].str.contains("Jonkheer") or row["Name"].str.contains("Dona"); | ||
| }); | ||
| val testDataT7 = testDataT6.addComputedColumn("Rare", (row) { | ||
| yield rareTitleDetected = row["Name"].str.contains("Lady") or row["Name"].str.contains("Countess") or row["Name"].str.contains("Capt") or row["Name"].str.contains("Col") or row["Name"].str.contains("Don") or row["Name"].str.contains("Dr") or row["Name"].str.contains("Major") or row["Name"].str.contains("Rev") or row["Name"].str.contains("Sir") or row["Name"].str.contains("Jonkheer") or row["Name"].str.contains("Dona"); | ||
| }); | ||
|
|
||
| val subsetTrain = trainDataT7.removeColumnsExcept( | ||
| ["Sex", "Embarked"] | ||
| ); | ||
| val subsetTest = testDataT7.removeColumnsExcept( | ||
| ["Sex", "Embarked"] | ||
| ); | ||
| val combinedSex = subsetTrain.addTableAsRows(subsetTest); | ||
|
|
||
| val labelEncoderSex = LabelEncoder("Sex").fit(combinedSex); | ||
| val trainDataT8 = labelEncoderSex.transform(trainDataT7); | ||
| val testDataT8 = labelEncoderSex.transform(testDataT7); | ||
|
|
||
| val labelEncoderEmbarked = LabelEncoder("Embarked").fit(combinedSex); | ||
| val trainDataT9 = labelEncoderEmbarked.transform(trainDataT8); | ||
| val testDataT9 = labelEncoderEmbarked.transform(testDataT8); | ||
|
|
||
| val trainDataT10 = trainDataT9.removeColumns( | ||
| ["Ticket", "Cabin", "SibSp"] | ||
| ); | ||
| val testDataT10 = testDataT9.removeColumns( | ||
| ["Ticket", "Cabin", "SibSp"] | ||
| ); | ||
|
|
||
| val _t10Heatmap = trainDataT10.plot.correlationHeatmap(); | ||
| val _t10Boxplot = trainDataT10.plot.boxPlots(); | ||
|
|
||
| val trainTagged = trainDataT10.toTabularDataset( | ||
| "Survived", | ||
| ["PassengerId"] | ||
| ); | ||
|
|
||
| val rf = RandomForestClassifier(500).fit(trainTagged); | ||
| val ab = AdaBoostClassifier(maxLearnerCount = 500, learningRate = 0.75).fit(trainTagged); | ||
| val gb = GradientBoostingClassifier(500).fit(trainTagged); | ||
| val svm = SupportVectorClassifier( | ||
| 0.025, | ||
| kernel = SupportVectorClassifier.Kernel.Linear | ||
| ).fit(trainTagged); | ||
|
|
||
| val _rfAccuracy = rf.accuracy(testDataT10); | ||
| val _abAccuracy = ab.accuracy(testDataT10); | ||
| val _gbAccuracy = gb.accuracy(testDataT10); | ||
| val _svmAccuracy = svm.accuracy(testDataT10); | ||
|
|
||
| val rfResult = rf.predict(testDataT10).toTable().removeColumnsExcept( | ||
| ["PassengerId", "Survived"] | ||
| ).renameColumn("Survived", "Survived_RF"); | ||
| val abResult = rf.predict(testDataT10).toTable().removeColumnsExcept( | ||
| ["PassengerId", "Survived"] | ||
| ).renameColumn("Survived", "Survived_AB"); | ||
| val gbResult = rf.predict(testDataT10).toTable().removeColumnsExcept( | ||
| ["PassengerId", "Survived"] | ||
| ).renameColumn("Survived", "Survived_GB"); | ||
| val svmResult = rf.predict(testDataT10).toTable().removeColumnsExcept( | ||
| ["PassengerId", "Survived"] | ||
| ).renameColumn("Survived", "Survived_SVM"); | ||
|
|
||
| val collection = rfResult.join( | ||
| abResult, | ||
| "PassengerId", | ||
| "PassengerId" | ||
| ).join( | ||
| gbResult, | ||
| "PassengerId", | ||
| "PassengerId" | ||
| ).join( | ||
| svmResult, | ||
| "PassengerId", | ||
| "PassengerId" | ||
| ); | ||
|
|
||
| collection.toCsvFile("./result.csv"); | ||
| trainDataT10.toCsvFile("./trainDataset.csv"); | ||
| testDataT10.toCsvFile("./testDataset.csv"); | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package segmentTest | ||
|
|
||
| segment doStuff( | ||
| inputPath: String, | ||
| ouputPath: String, | ||
| sliceSize: Int | ||
| ) -> (score: Float) { | ||
| val labeledImages = Table.fromCsvFile(inputPath); | ||
| val subsetImages = labeledImages.sliceRows(0, sliceSize); | ||
| val train, val validate = subsetImages.splitRows(0.8); | ||
|
|
||
| val modelUntrained = SupportVectorClassifier(); | ||
| val modelTrained = modelUntrained.fit( | ||
| train.toTabularDataset(targetName = "target") | ||
| ); | ||
| yield score = modelTrained.accuracy(validate); | ||
|
|
||
| val testdata = Table.fromCsvFile("beginner_classification/test.csv"); | ||
| val testdataTransformed = testdata.transformColumn("pixel0", (row) -> row.add(1)); | ||
| val resultTable = modelTrained.predict(testdataTransformed); | ||
|
|
||
| resultTable.toTable().toCsvFile(ouputPath); | ||
| } | ||
|
|
||
| pipeline smallTest { | ||
|
|
||
| val path = "beginner_classification/train.csv"; | ||
| val score = doStuff( | ||
| path, | ||
| "output/beginner_classification.csv", | ||
| 5000 | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.