def main(): """ Just runs some example code. """ """ Plots a dataset. """ # setup the flow helper.print_title("Plot dataset") iris = helper.get_data_dir() + os.sep + "iris.arff" flow = Flow(name="plot dataset") filesupplier = FileSupplier() filesupplier.config["files"] = [iris] flow.actors.append(filesupplier) loaddataset = LoadDataset() flow.actors.append(loaddataset) branch = Branch() flow.actors.append(branch) seq = Sequence(name="matrix plot") branch.actors.append(seq) mplot = MatrixPlot() mplot.config["percent"] = 50.0 mplot.config["wait"] = False seq.actors.append(mplot) seq = Sequence(name="line plot") branch.actors.append(seq) copy = Copy() seq.actors.append(copy) flter = Filter() flter.config["setup"] = filters.Filter( classname="weka.filters.unsupervised.attribute.Remove", options=["-R", "last"]) flter.config["keep_relationname"] = True seq.actors.append(flter) lplot = LinePlot() lplot.config["percent"] = 50.0 lplot.config["wait"] = True seq.actors.append(lplot) # run the flow msg = flow.setup() if msg is None: print("\n" + flow.tree + "\n") msg = flow.execute() if msg is not None: print("Error executing flow:\n" + msg) else: print("Error setting up flow:\n" + msg) flow.wrapup() flow.cleanup()
def main(): """ Just runs some example code. """ """ Displays a dataset as matrixplot. """ # setup the flow helper.print_title("Matrix plot") iris = helper.get_data_dir() + os.sep + "iris.arff" flow = Flow(name="matrix plot") filesupplier = FileSupplier() filesupplier.config["files"] = [iris] flow.actors.append(filesupplier) loaddataset = LoadDataset() flow.actors.append(loaddataset) plot = MatrixPlot() plot.config["percent"] = 50.0 flow.actors.append(plot) # run the flow msg = flow.setup() if msg is None: print("\n" + flow.tree + "\n") msg = flow.execute() if msg is not None: print("Error executing flow:\n" + msg) else: print("Error setting up flow:\n" + msg) flow.wrapup() flow.cleanup()