Solved

Re: Converting variables without relative importance

Posted on 2002-05-07
9
138 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IT Company 5 69
computer science syllabus 3 52
Modeling a class in java 5 31
advertisement module in core php 4 81
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
The viewer will learn how to implement Singleton Design Pattern in Java.

708 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

13 Experts available now in Live!

Get 1:1 Help Now