Solved

Re: Converting variables without relative importance

Posted on 2002-05-07
9
139 Views
Last Modified: 2013-11-24
I have a "subjective variable" called "Stone", which can take 9 values. For example,

Stone:     Fine grained sandstone
           Medium grained sand stone
           Medium to fine grained sand stone
           Coarse to medium grained sandstone
           Coarse grained sandstone
           Conglomerate
           Mudstone
           Coal
           Shale

Now, I want to convert these 9 variables into the range of [0,1] and avoid any relative importance. Can anyone please tell me how can I do this? Thanks.

okd  

0
Comment
Question by:okd
9 Comments
 
LVL 3

Expert Comment

by:daitt
ID: 6995726
I tried to calculate the sum for each value:

Fine grained sandstone = 2155
Medium grained sand stone = 2410
Medium to fine grained sand stone = 3119
Coarse to medium grained sandstone = 3306
Coarse grained sandstone = 2374
Conglomerate = 1248
Mudstone = 847
Coal = 383
Shale = 493

They're distinct .. so I think you can div them by 10000 to have the mapped number.
For example:
Fine grained sandstone --> 0.2155
0
 

Author Comment

by:okd
ID: 6996779
daitt, Can you please tell me the how did you calculate the sum for each value. Thanks.
0
 
LVL 3

Expert Comment

by:daitt
ID: 6997706
I added all the chars of the string:

int sum = 0;
String s = "Shale";
for (int i = 0;i<s.length();i++)
     sum+=s.charAt(i);
System.out.println(sum);
0
 

Author Comment

by:okd
ID: 7001693
Someone told me that use eight dummy variables for nine values of "stone" (instead of one variable of stone). Now for "fine grained sandstone" use 10000000 (meaning fine grained sandstone is present, and others are absent), for "Medium grained sand stone" use 01000000 (meaning fine grained sandstone absent, Medium grained sand stone present, and rest absent), and so on. This way we can avoid relative importance. Because, it will be decided as whether a perticular value is present. But, how to program it and where can I store the last value, meaning for shale, which will be 00000000. Any help in this regard will be highly appreciated. Thanks.  
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:okd
ID: 7012901
Can you provide me a small dummy variable example in java with sample data file? Thanks.
0
 
LVL 3

Expert Comment

by:daitt
ID: 7013088
I think if you compare like this:
if (value.equals("fine grained sand stone")) num = 1000000;
else if (value.equals...)) num = 10000;
then it's relative important
If I'm wrong, please clarify what is relative importantce
0
 

Author Comment

by:okd
ID: 7027762
May be I couldn't communicate with you properly. I didn't mean
num = 1000000. (instead it will be eight differnt dummy variables). Don't you think that if we calculate the sum and divide them by 10000, eventually it will represent the relative strength or whatever.

However, the follwoing is my complete question and possible explanation:

I have a "subjective input parameter" in my neural network (nn) along with other five input parameters. Now, as the neural network can take input [0,1], I have to convert the values of the subjective parameter between 0 and 1. For example, if I have a "subjective parameter" called "x1", which can take 6 values. The values may be as given below:

    x1:   val1
          val2
          val3
          val4
          val5
          val6


Now, since nn can take input between [0,1], I want to convert the six (6) values of the variable (x1) into the range of [0,1] so that there is no relative importance.

I figured out that I can use five (5) dummy variables for these six (6) values of "x1" (instead of one parameter of x1).

Now for "val1", it will be 10000 (meaning val1 is present, and others are absent), for "val2" it will be 01000 (meaning val1 is absent, val2 is present, and rest are absent), and so on. For the last value, i.e, for val6, it will be 00000 (meaning all first five values are absent). This way I can avoid any relative importance. Because, it will be decided as whether a perticular value is present or not.

I can not program it in Java, Can you please help me doing this. How will the training data file look for the above situation, and where can I store the value (00000)for "val6"? If you have any differnt idea, that will be welcome.
 
Any help in this regard will be highly appreciated. Thanks.

okd  
0
 
LVL 35

Expert Comment

by:girionis
ID: 8710062
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 8774372
Per Recommendation,

PashaMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now