How to create a new data table in Orange?

I use Orange (in Python) for some data mining tasks. More specifically for clustering. Although I went through the tutorial and read most of the documentation, I still have a problem. All examples in documents and textbooks suggest that I have a table with tab delimiters with data in it. However, there is nothing to say about how you can create a new table from scratch. For example, I want to create a table for word frequencies in different documents.

Maybe I missed something, so if anyone can understand that it will be appreciated.

Thanks George

EDIT:

This is how I create the table

#First construct the domain object (top row) vars = [] for var in variables: vars.append(Orange.data.variable.Continuous(str(var))) domain = Orange.data.Domain(vars, classed) #The second argument indicated that the last attr must not be a class #Add data rows assuming we have a matrix t = Orange.data.Table(domain, matrix) 
+4
source share
2 answers

It took me hours to understand. In python do the following:

 Import Orange List, Of, Column, Variables = [Orange.feature.Discrete(x) for x in ['What','Theyre','Called','AsStrings']] Domain = Orange.data.Domain([List, Of, Column, Variables]) Table = Orange.data.Table(Domain) Table.save('NewTable.tab') 

I would tell you what every bit of code does, but at the moment I'm not sure. It's funny that such a powerful toolkit should have such hard-to-understand documentation, but I suspect because the entire database has doctorates.

+5
source

The documentation is really inadequate if you ask me. This may not be the answer to the question, but it may be useful to someone else. For several hours I tried to create a table using constructors and Domains, and what wasnโ€™t, only for the task of developing join rules, and finally I found out that the easiest way to create a table is to simply write your data to a file with the extension .tab or .basket and create a table from this.

 Orange.data.Table("yourFile.basket") 

Of course, the file structure must be correct. See the provided sample files located in the Orange directory inside the datasets /

+2
source

Source: https://habr.com/ru/post/1392677/


All Articles