orange-modelmaps / examples / projections.py

from Orange.orng import orngVizRank as vr

import _modelmaps as mm
import time

starttime = time.time()
ROOT = "/home/miha/work/res/modelmaps/"
#ROOT = "/Network/Servers/xgridcontroller.private/lab/mihas/modelmaps/"

build_map = mm.BuildModelMap(ROOT + "tab/zoo.tab")

nfeatures = len(build_map.data_d.domain.features)
features = mm.get_feature_subsets(build_map.data_d.domain, 100)

max_nfeatures_scatterplot = (nfeatures ** 2 - nfeatures) / 2
features_scatterplot = mm.get_feature_subsets_scatterplot(build_map.data_d.domain, max_nfeatures_scatterplot)

models = []
models.extend([build_map.build_projection_model(f, vr.LINEAR_PROJECTION) for f in features])
models.extend([build_map.build_projection_model(f, vr.RADVIZ) for f in features])
models.extend([build_map.build_projection_model(f, vr.KNN_IN_ORIGINAL_SPACE) for f in features])
models.extend([build_map.build_projection_model(f, vr.POLYVIZ) for f in features])
models.extend([build_map.build_projection_model(attrs, vr.SCATTERPLOT) for attrs in features_scatterplot])

smx = build_map.build_model_matrix(models)
table = build_map.build_model_data(models)

build_map.save("%s/_projections_/proj_100_" % ROOT, smx=smx, table=table)
print (time.time() - starttime) / 60
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.