[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Re: Converting variables without relative importance

Posted on 2002-05-07
9
Medium Priority
?
146 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

830 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