Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Can Programming By Example concept be applied to datasets
Shrihari
<div>Consider a dataset(emp.csv) with some 1000 records .Get 20 records after randomizing them.</div>
<div>The user selects few rows and columns(say checkboxes are provided for selection) of his interest among the 20.</div>
<div>Based on his selection can "SELECT" queries be predicted.</div>
<div>Basically, can "PROGRAMMING BY EXAMPLE" concept be used to suggest query in a brute-force manner. </div>
<div> </div>
<div>Employee</div>
<div>id<span> </span>first_name<span> </span>last_name<span> </span>email<span> </span>gender<span> </span>mobile<span> </span>salary</div>
Find more posts tagged with
Comments
Clement Wong
<p>Sorry, I'm not complete sure about the requirements. I understand the first two sentences, but not clear about the prediction part or about machine learning. You'll might be able to do this in a scripted data source or a POJO data source.</p>
Shrihari
<p>Could you please provide means for coming up the first two statements atleast, or whatever you have understood.Thanks a lot.</p>
Clement Wong
<p>There are many options here and one of them would be to first use a Flat File Data Source to read in your CSV. Then for the Data Set, create a Computed Column, an aggregate for a running count. In the Data Set's <em>beforeOpen </em>event, you can create your array of 20 random numbers. In the Data Set's Filter option, you can match those 20 chosen numbers to select those random rows.</p>
<p> </p>
<p>In the example, the CSV has only 10 rows and I'm choosing 3 random rows so the <em>beforeOpen </em>event looks like:</p>
<pre class="_prettyXprint _lang-">
// Generate an array of 3 values from 1 to 10
arr = []
while(arr.length < 3){
var randomnumber = Math.ceil(Math.random()*10)
if(arr.indexOf(randomnumber) > -1) continue;
arr[arr.length] = randomnumber;
}
</pre>
<p>Attached are two examples, both with random rows, one without check boxes and one with check boxes. The sample.csv should be placed at the root of your Project's folder. These reports were tested in both OS BIRT 4.6.0, and iHub 3.1.1.</p>