Commits

Aleš Erjavec committed f9c6521

Register 'ScoreEarthImportance' with 'OWRank' widget.

Comments (0)

Files changed (2)

orangecontrib/earth/widgets/__init__.py

 intersphinx = (
     ("{DEVELOP_ROOT}/docs/build/html/", None),
 )
+
+from Orange.OrangeWidgets.Data import OWRank
+from .. import earth
+
+
+def earth_score_measure():
+    if not hasattr(OWRank, "SCORES") or earth.ScoreEarthImportance in \
+            [m.score for m in OWRank.SCORES]:
+        return None
+
+    params = [
+        {"name": "t",
+         "type": int,
+         "display_name": "Num. models.",
+         "range": (1, 20),
+         "default": 10,
+         "doc": "Number of models to train for feature scoring."},
+        {"name": "terms",
+         "type": int,
+         "display_name": "Max. num of terms",
+         "range": (3, 200),
+         "default": 10,
+         "doc": "Maximum number of terms in the forward pass"},
+        {"name": "degree",
+         "type": int,
+         "display_name": "Max. term degree",
+         "range": (1, 3),
+         "default": 2,
+         "doc": "Maximum degree of terms included in the model."}
+    ]
+
+    return OWRank.score_meta(
+        name="Earth Importance",
+        shortname="Earth imp.",
+        score=earth.ScoreEarthImportance,
+        params=params,
+        supports_regression=True,
+        supports_classification=True,
+        handles_discrete=True,
+        handles_continuous=True,
+    )
+
+EARTH_SCORE = earth_score_measure()
     ),
     "orange.canvas.help": (
         "intersphinx = orangecontrib.earth.widgets:intersphinx",
+    ),
+    "orange.widgets.feature_score": (
+        "_ = orangecontrib.earth.widgets:EARTH_SCORE",
     )
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.