[ml-completion] python: replace default model with experimental random forest

GitOrigin-RevId: 97deac5e0da0cd39c2606468857c9c78723031fa
This commit is contained in:
Alexey Kalina
2020-10-27 11:14:51 +03:00
committed by intellij-monorepo-bot
parent 7bb41f4bb8
commit de99b68add
2 changed files with 5 additions and 5 deletions

View File

@@ -39,13 +39,13 @@
<orderEntry type="module" module-name="intellij.python.sdk" exported="" />
<orderEntry type="module-library">
<library name="completion-ranking-python" type="repository">
<properties include-transitive-deps="false" maven-id="org.jetbrains.intellij.deps.completion:completion-ranking-python:0.0.11" />
<properties include-transitive-deps="false" maven-id="org.jetbrains.intellij.deps.completion:completion-ranking-python:0.1.3" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/completion/completion-ranking-python/0.0.11/completion-ranking-python-0.0.11.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/completion/completion-ranking-python/0.1.3/completion-ranking-python-0.1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/completion/completion-ranking-python/0.0.11/completion-ranking-python-0.0.11-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/completion/completion-ranking-python/0.1.3/completion-ranking-python-0.1.3-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>

View File

@@ -1,19 +1,19 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.codeInsight.mlcompletion
import com.completion.ranker.model.python.MLCompletionModel
import com.intellij.internal.ml.DecisionFunction
import com.intellij.internal.ml.ModelMetadata
import com.intellij.internal.ml.completion.CompletionRankingModelBase
import com.intellij.internal.ml.completion.JarCompletionModelProvider
import com.intellij.lang.Language
import com.jetbrains.completion.ranker.model.python.MLGlassBox
import com.jetbrains.python.PyBundle
class PythonMLRankingProvider :
JarCompletionModelProvider(PyBundle.message("settings.completion.ml.python.display.name"), "python_features") {
override fun createModel(metadata: ModelMetadata): DecisionFunction {
return object : CompletionRankingModelBase(metadata) {
override fun predict(features: DoubleArray?): Double = MLCompletionModel.makePredict(features)
override fun predict(features: DoubleArray?): Double = MLGlassBox.makePredict(features)
}
}