Hi .. i am on last stage for my project. I want to ask that how to add the formula in my program to eliminate those not fulfill the condition.
for example:
Now, my item and support values is like this
item support
1: 13
3: 13
4: 13
2: 7
5: 1
after i add in my minimum support from Rich text box, is 3% .Those items that cannot fulfill 3% will be eliminate from the item and support values.
I tried many times already.
But its doesn't work for my program and my program can not run.
Hope someone can help me....thanks you.
here is the coding for my item and support value
var v = from k in SingleI.Keys
orderby SingleI[k] descending
select k;
SingleSupport.Clear();
foreach (var k in v)
{
SingleItemValue.AppendText(k + ":" + SingleI[k] + "\r\n");
hs1.Add(k);
}
Loading
VulpesPosted Apr 12, 2011, 12:09 PM
As it's an easy fix, it's worth trying before looking for anything more elaborate. You'll need to replace:
Sin YeePosted Apr 11, 2011, 5:21 PM
1: 13
3: 13
4: 13
2: 7
5: 1
VulpesPosted Apr 11, 2011, 3:52 PM
Sin YeePosted Apr 11, 2011, 1:08 PM
the list are:
1 2:1
1 2 3:1
1 2 3 4:1
1 2 4:1
1 3:4
1 3 4:4
1 4:4
2 3:1
2 3 4:1
2 4:1
2 5:1
3 4:4
this is the content of the itemS
the SingleI , i didn't use already..
VulpesPosted Apr 11, 2011, 9:45 AM
No promises, but I might be able to figure something out from there.
Sin YeePosted Apr 10, 2011, 9:11 PM
the expected result i want is like this
if is eliminate item 5
1 2:1
1 3 2:1
1 3 4 2:1
1 4 2:1
1 3:3
1 4 3:3
1 4:3
3 2:1
3 4 2:1
4 2:1
2 :1
3 4:3
but now is like this
1 2:1
1 3 2:1
1 3 4 2:1
1 4 2:1
1 3:3
1 4 3:3
1 4:3
3 2:1
3 4 2:1
4 2:1
2 3:1
4:3
* the '3' is goes up to fill the '5' which is eliminate already..
VulpesPosted Apr 10, 2011, 4:21 PM
Sin YeePosted Apr 10, 2011, 1:34 PM
Sin YeePosted Apr 9, 2011, 8:40 PM
Sin YeePosted Apr 9, 2011, 7:29 PM
Sin YeePosted Apr 9, 2011, 7:23 PM
VulpesPosted Apr 9, 2011, 5:41 PM
Although you're not using SingleI again, perhaps 'hs1' will now be out of step with the other lists you're using - I can't be sure as I don't know where and how you populated them all to start with.
Do you have to remove these elements at this stage or could you remove them later when you've done all the other manipulations?
Sin YeePosted Apr 9, 2011, 4:29 PM
The result will like this:
2 3:1
2 3 4:1
2 4 2 3:1
3 4 4: 1
3 2: 3
3 4 2:3
4 2:3
2 5:1
3 4:1
:1
:1
:3
All the place are not correct
VulpesPosted Apr 9, 2011, 4:18 PM
double minSupport = double.Parse(MinSupp.Text);
The double.Parse method will ignore any leading or trailing whitespace so there's no need to trim the string first.
Of course, the number has to be the only thing in the RTB, Frankly an ordinary single-line TextBox would have been better for this sort of input.
Sin YeePosted Apr 9, 2011, 4:10 PM
VulpesPosted Apr 9, 2011, 4:06 PM
If they enter 'three percent' for example, we have no chance!
Sin YeePosted Apr 9, 2011, 4:04 PM
VulpesPosted Apr 9, 2011, 4:03 PM
Sin YeePosted Apr 9, 2011, 3:57 PM
VulpesPosted Apr 9, 2011, 3:46 PM
Sin YeePosted Apr 9, 2011, 11:03 AM
i do not know why like this:
The result will like this:
2 3:1
2 3 4:1
2 4 2 3:1
3 4 4: 1
3 2: 3
3 4 2:3
4 2:3
2 5:1
3 4:1
:1
:1
:3
this is not what i wanted.
the expected result i want is like this
if is eliminate item 5
1 2:1
1 2 3:1
1 2 3 4:1
1 2 4:1
1 3:3
1 3 4:3
1 4:3
2 3:1
2 3 4:1
2 4:1
2 :1
3 4:3
here is my code:
Sin YeePosted Apr 9, 2011, 10:20 AM
I think what i think is not similar with your concept. I think cannot use 1/13 *100. when the item is 5 and support value is 1 the answer will be 500. That is not correct.
i think what i want is like this:
each support value / total support value * 100%
i need to count each of the item support value. if that item support value in percent cannot fulfill the minsupport that the user enter will be eliminated.
For example:
for the item 1
13/47 *100 = 27.7%
the 13 is support value for the item 1 and 47 is the total support value for all the items.
VulpesPosted Apr 9, 2011, 8:54 AM
VulpesPosted Apr 9, 2011, 8:33 AM
The most obvious way to get a percentage for each item would be to divide the item by its support value and multiply the result by 100. The first item would generate a percentage on this basis of : 1 / 13 x 100 = 7 % (to lower integer).
So, is this what you mean?
Sin YeePosted Apr 9, 2011, 5:59 AM