0

I have been given a new task in my new job, basically, I have to create a "model" to predict future data. I have been told Fuzzy Logic is the best way to do this, and I use Java almost every day, so I would prefer to use it here too.

I have searched for information about Fuzzy Logic and I roughly understand what it is and how it works (Here and Here).

I also have searched for APIs that can help me with this (For example, JFuzzyLogic and JFuzzyLite), but none of this seem to be able to do what I want (Or maybe it is me that I have no idea what I am searching for).

My idea is to dinamically generate "rules" (which together would make a model) based on the data I have. (I have data with different outcomes, this model would tell me if new data belongs to one outcome or another, basic prediction).

Am I approaching the problem in the correct way? Does any Java API have this functionalities?

Please, tell me if I am wrong, I want to learn as much as possible.

Thank you all for reading this (You might need to correct my english mistakes, sorry for that).

EDIT (More information): My data is stored in excels, each has about 5000 rows and 75 columns (column number always the same):

  • All useful values are numbers (float) (I filter the rest).
  • Each row is the data for an specific piece and each column is an attribute (lenght, width, height....and 67 more) .
  • The last column is a code (also float) that says what type of piece it is
    • This is the outcome I want to predict. The idea is to predict what code a piece will have based on the other column values.
Community
  • 1
  • 1
Mayuso
  • 1,291
  • 4
  • 19
  • 41
  • It looks like a classification task. Can you expand a bit more on your exact problem ? What does your data looks like ? Numbers, images, sentences, ... ? And what kind of prediction do you want to make ? – TheWalkingCube Jan 29 '16 at 11:47
  • I added more details, thanks for the suggestion, it was definitely necessary. – Mayuso Jan 29 '16 at 12:00

3 Answers3

1

It looks like a standard regression problem. You want to predict a number from the values of other numbers.

Let's call your last column is Y, and all the others X_i. You want to find a function (your model) that gives you Y based on X. So Y = f(X). Your model can take many form. You should probably start with the simplest one, which is a linear model.

Linear regression will try to find the best W_i such that :

Y = W_0 * X_0 + W_1 * X_1 + ... + W_n * X_n

So what you need is a regression library in Java. A popular one is WEKA, which has a good linear regression class.

Concerning fuzzy logic, I'm not an expert but it doesn't seem very well suited to your problem.

TheWalkingCube
  • 2,036
  • 21
  • 26
  • I know weka, I have worked with it before (With the Interface, not the java API). Now I have to decide, use weka or do what my boss says. Thank you! :) – Mayuso Jan 29 '16 at 12:26
  • I just realised, does linear regresion work when my last column (Y) has to be a specific value. (In our case we have 5 types of pieces, the codes are 3002, 3102, 3202, 3302, 3402). – Mayuso Jan 29 '16 at 12:31
  • In that case it's more a classification problem, where you have 5 class (one per code). You could use a logistic classifier instead, which WEKA also have. – TheWalkingCube Jan 29 '16 at 12:36
0

There is a Java fuzzy matching algorithm, that I found very useful for a similar problem. Where we have a rows of records where each column is a different type of element.

https://github.com/intuit/fuzzy-matcher

For example a list of Users, and having attributes like (name, address, phone) and want to predict which users are similar looking at different formats in which each data is entered.

This library groups similar rows together and gives a probability score of rows being similar (by bubbling up the score of each element being similar)

This library is suited well for String similarity, but could be used to find similarity between numeric data too. I was able to pass in a list of phone number and was able to identify similar phone numbers.

hope this helps

mob
  • 567
  • 5
  • 12
0

You have 74 inputs and 1 output. But my concern is that what type of fuzzy logic you want to use here? like Type-1 fuzzy, type-2 or Intuitionistic fuzzy, or Neutrosophic fuzzy? For the basic fuzzy by Zadeh 1975 which is type-1 fuzzy , you will have only one function for each input parameter and that is membership function. By using Intuitionistic fuzzy, you will have two functions and that are membership and non-membership functions and for Neutrosophic fuzzy, you will have three functions, such as membership, non-membership and indeterminate functions associated with all your input parameters. After this, you will define if-then rules. If-then rules usually are the multiplication of the variable values of the membership function of the input parameters like, if you have three parameters and in type-1 fuzzy then and all the membership functions of the three parameters contains low, medium, and high areas then the maximum number of your rules would be 27 but not all the rules are to be defined. Some rules are of not much use. So in your case you have a lot of rules. Then you will need a defuzzifier to get crisp output. Due to the large number of input parameters, I suggest that you as this is an old question and you had done your work so anyone in the same situation must use Type-1 fuzzy logic.

  • 1
    I am trying to model typical waiter service tip example of fuzzy logic by neutrosophic fuzzy here, [link](https://github.com/alitariqnet/Neutrosophic-Logic) – Ali Tariq Sep 11 '21 at 05:28
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 11 '21 at 07:10