Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting threshold to assign real values to class values

Status
Not open for further replies.

themoss1985

Technical User
May 5, 2011
2
IE
Hello folks. I am doing a data mining regression exercise and after getting prediction results which are real values, (e.g. 5.78137) i need to assign these to class values (e.g. 5 or 6 depending on the threshold value I use). I am trying to do this in excel and would logically think that the formula would be something like this: =IF(M2>"*.4","*+1","*"). This obviously isn't the formula but i thought including it here could help convey what i'm trying to do. The * in the formula represents the 5 in the 5.78137. Does anyone have any ideas on how exactly you assign real values to class values based on a threshold value e.g. 0.4. Thanks in advance.
 
Perhaps it is my misunderstanding of your use of the term "class value" but, can you just ROUND() the values?

[tt]
ROUND(1.5,0) = 2
ROUND(1.49999999999, 0) = 1
[/tt]
 
Hi Gruuu,

I need to round a number up if it is above x.975, and down if it is below x.975.

I tried the formula =IFB27>INT(B27)+0.975,ROUNDUP(B27),ROUNDDOWN(B27)
but this formula kicks back an error.

Any ideas??
 
i think all you need to to specify integer to round. try:
=IF((B27-INT(B27)>0.975),ROUNDUP(B27,0),ROUNDDOWN(B27,0))
 
Or just ROUND(A1 - 0.475, 0)

[tt]
ROUND(1.5 - 0.475, 0) = 1
(1.025)

ROUND(1.975 - 0.475, 0) = 2
(1.5)

Round(1.974 - 0.475) = 1
(1.499)
[/tt]

Does that work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top