[2 days left] Whatâ€™s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
Solved

# Re: Converting variables without relative importance

Posted on 2002-05-07
Medium Priority
145 Views
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
Question by:okd
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 3

Expert Comment

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

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

LVL 3

Expert Comment

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

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

Author Comment

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

LVL 3

Expert Comment

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

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

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

next seven days.

girionis
Cleanup Volunteer
0

Accepted Solution

PashaMod earned 0 total points
ID: 8774372
Per Recommendation,

PashaMod
Community Support Moderator @Experts Exchange
0

## Featured Post

Question has a verified solution.

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

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the â€¦
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Javaâ€¦
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Booleâ€¦
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
###### Suggested Courses
Course of the Month13 days, 11 hours left to enroll