Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.09k stars 106 forks source link

Hi! I have next problem: #362

Closed KirillKurdyukov closed 2 years ago

KirillKurdyukov commented 2 years ago

fun accuracy(lambdas: List<Int>, alpha: Double, n: Int): Double { var averageAccuracy = 0.0 val countParts = 10 for (testPart in 0 until countParts) { val parts = DataFrame(n, MESSAGES_PREFIX).data() val train: List<Message> = (parts.subList(0, testPart) + parts.subList(testPart + 1, countParts)).flatten() val test = parts[testPart] averageAccuracy += NaiveBayesClassifier(train, lambdas, alpha).fit().accuracy(test) } return averageAccuracy / countParts } Backend Internal error: Exception during IR lowering File being compiled: Line_141.jupyter-kts The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50)

KirillKurdyukov commented 2 years ago

a constant from one cell is not visible in another

ileasile commented 2 years ago

Hi! What version of kerenl do you use? Try to install latest dev version, the problem should be fixed there.

pip install -i https://test.pypi.org/simple/ kotlin-jupyter-kernel==0.11.0.73
KirillKurdyukov commented 2 years ago

Kotlin kernel v. 0.11.0.100500, Kotlin v. 1.7.0-dev-1825

ileasile commented 2 years ago

Yes, it's the issue that was fixed in the latest kernel

ileasile commented 2 years ago

Duplicates #360