?
Solved

Re: Converting variables without relative importance

Posted on 2002-05-07
9
Medium Priority
?
144 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
[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
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
A solution for Fortify Path Manipulation.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

764 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