Source

orange-modelmaps / examples / projections.py

Full commit
import orngVizRank as vr

import Orange.modelmaps as mm

ROOT = "/home/miha/work/res/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, 120)

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(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" % ROOT, smx=smx, table=table)