Skip to content
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

Bug while Executing SupportVectorMachineRegressor #1146

Open
TellemHD opened this issue May 3, 2024 · 0 comments
Open

Bug while Executing SupportVectorMachineRegressor #1146

TellemHD opened this issue May 3, 2024 · 0 comments
Labels
bug 🪲 Something isn't working

Comments

@TellemHD
Copy link
Contributor

TellemHD commented May 3, 2024

Describe the bug

The Error Message accures because of the SupportVectorMachineRegressor:

2024-05-03 16:17:21.636 [debug] [Client Services] [Runner] [a3256b9f-e847-4661-b1f1-00df5764c1c9] Error occurred while learning: Unknown label type: continuous. Maybe you are trying to fit a classifier, which expects discrete classes on a regression target with continuous values.
	at c:\Users\TimLocke\AppData\Roaming\Code\User\globalStorage\safe-ds.safe-ds\runnerVenv\Lib\site-packages\safeds_runner\server\_pipeline_manager.py line 216
	at <frozen runpy> line 226
	at <frozen runpy> line 98
	at <frozen runpy> line 88
	at admissionPredictBug/gen_BUg_admissionPredictPipeline line 4
	at admissionPredictBug/gen_BUg line 106 (mapped to 'BUg.sds' line 9)
	at admissionPredictBug/gen_BUg line 17 (mapped to 'BUg.sds' line 14)
	at admissionPredictBug/gen_BUg line 54 (mapped to 'BUg.sds' line 28)
	at c:\Users\TimLocke\AppData\Roaming\Code\User\globalStorage\safe-ds.safe-ds\runnerVenv\Lib\site-packages\safeds_runner\server\_pipeline_manager.py line 353
	at c:\Users\TimLocke\AppData\Roaming\Code\User\globalStorage\safe-ds.safe-ds\runnerVenv\Lib\site-packages\safeds_runner\memoization\_memoization_map.py line 177
	at c:\Users\TimLocke\AppData\Roaming\Code\User\globalStorage\safe-ds.safe-ds\runnerVenv\Lib\site-packages\safeds\ml\classical\regression\_support_vector_machine.py line 221
	at c:\Users\TimLocke\AppData\Roaming\Code\User\globalStorage\safe-ds.safe-ds\runnerVenv\Lib\site-packages\safeds\ml\classical\_util_sklearn.py line 76

To Reproduce


pipeline admissionPredictPipeline {

    val rawData = Table.fromCsvFile("data/Admission_Predict.csv")
        .removeColumns(["Serial No."])
        .shuffleRows();

    val output = fitForManyRegressors(rawData);
}

segment fitForManyRegressors(data:Table) -> (output:Table) {
  val regressor11 = SupportVectorMachineRegressor(1.0);
  val a11, val b11 = fitAndMeasureModel(data, regressor11);

  val result = Table.fromMap({
                                      "Name": ["SupportVectorMachine"],
                                      "Training Error": [b11],
                                      "Result": [a11],
                                      });
  yield output=result;
}

segment fitAndMeasureModel(data:Table, regressor:Regressor) -> (output:Float, trainingError: Float) {
  val training, val test = data.splitRows(0.8);
  val trainingTable = training.toTabularDataset("Chance of Admit ");
  val testTable = test.toTabularDataset("Chance of Admit ");
  val fittedRegressor = regressor.fit(trainingTable);

  val resultAbsolute = fittedRegressor.meanAbsoluteError(testTable);
  val resultTrainingAbsolute = fittedRegressor.meanAbsoluteError(trainingTable);

  yield output=resultAbsolute;
  yield trainingError = resultTrainingAbsolute;
}

Expected behavior

The SUpportVectorMachine should work and calculate and get fitted and...

Screenshots (optional)

No response

Additional Context (optional)

No response

@TellemHD TellemHD added the bug 🪲 Something isn't working label May 3, 2024
@lars-reimann lars-reimann added this to DSL May 3, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DSL May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant