Taguchi Method Programming Example - arrays

I've been asked to research some programming related to the "Taguchi Method", especially as it relates to Multi-variant testing. This is one of the first subjects I've tried to research that I've found zero, nada, zilch, code examples for, especially considering its mathematical basis.
I've found some books describing the math involved but it looks like I'm going to be doing some math brush up unless I can find some code examples I can relate to.
Is this one of those rare things that once you work out the programming, it's so valuable that no one shares? Or do I just fail at Taguchi + google?

Taguchi designs are the same thing as covering arrays. The basic idea is that if you have F data "fields" and every one can have N different values, it is possible to construct NF different test cases. A covering array is basically a set of test cases that together cover all possible pairwise combinations of two field values, and the idea is to generate as small one as possible. E.g. if F=3 and N=3, you have 27 possible test cases, but it is enough to have nine test cases if you aim for pairwise coverage:
Field A | Field B | Field C
---------------------------
1 1 1
1 2 2
1 3 3
2 1 2
2 2 3
2 3 1
3 1 3
3 2 1
3 3 2
In this table, you can choose any two fields and any two values and you can always find a row that contains the chosen values for the chosen fields.
Generating Taguchi designs in general is a difficult combinatorial problem.
You can generate Taguchi designs by various methods:
Branch and bound
Stochastic search (e.g. tabu search or simulated annealing)
Greedy search
Specific mathematical constructions for some specific structures

Related

Predict probabilities of a recommender system?

I have a dataset where I have a sparse utility matrix (user-product) with binary input: 1 if the user 𝑖 bought the product 𝑗, and 0 if it hasn't.
However it has a different meaning on the test set, 0 means that we don't know if the user bought this product, and 1 means that we're sure that the user bought that given product.
I need to get for each user in each product the probability that a user 𝑖 bought a product 𝑗 in the test set. For this I wish to use different matrix factorization techniques like FunkSVD, NMF or SVD++ , but I'm quite confused:
These techniques would only allow me to get the label (1 or 0) on test set, but I need to compute a probability of getting 1 and not the label in it self.
How can I approach this problem ? Or do I treat it as a classification problem and then use all common classification techniques ?
Okay, One approach that might help based on Recurrent-Knowledge-Graph-Embedding.
Try converting user-item interactions into a knowledge graph and mine the top-n paths in the graph between user_i and item_j. Build an RNN model as described in the paper and its code, to get probabilities.

Determining Number of Outputs for trading type ANN

I am currently trying to implement an ANN that does 1 for 1 Trades with 8 different possible Goods.
I am wondering how I determine the number of outputs necessery for the ANN to perform adequatly.
Should the number of outputs be equivalent to the number of possible trades? Meaning if I have 8 different Goods and can trade each one for each of the 8 Goods does the ANN need 8*8 outputs?
To summarize does an ANN need a number of outputs equal to the number of distinct actions it can perform?
edit: To clarify the goods have worth specific to a situation which is the input given to the ANN. the 8*8 is referring to the number of possible combination of trades one of the goods for any other.
Thank you in advance.
Classification engine
Neural networks (feed forward) are classification engines - they are not necessarily ment for "storing knowledge" such as decision trees and logical knowledge bases.
Though it certainly is possible to store predefined decisions inside a neural network - much like a gigantic if-clause.
Number of outputs
If the different outputs assigns different classes, you should use one outputs signal per classification instance.
If you were to decide to let one output signal imply different classes depending on the output value, you are hinting to the network that a output signal of 10 "is a better class" than one with output -10. Therefore I would strongly recommend to use one output signal per class, although this will require more training (at the advantage of possibly fewer plateaus in the search space).
I am not sure what you are refering to with:
Meaning if I have 8 different Goods and can trade each one for each of
the 8 Goods does the ANN need 8^8 outputs
Are you going to input a set if "stock values" and force the net to output which stocks to buy and sell?

how to solve this with kmeans clustering and use cosine similiraty

can anyone tell to me how k-means clustering working on textmining..
and i using cosine similarity as the distance metric.
nim 310910022 320910044 310910043 310910021
access 0 2 3 5
abdi 1 0 0 0
actual 5 0 0 1
arrow 0 1 1 2
this data is on listview
How can I do that in VB.net? to get any cluster and trending topic of the term ?
Thank in advance
First I would separate the problem into two parts:
Computing the k-means clustering assignments
Getting the data from the GUI (you mention the data is on a listview)
I assume 2 is straight forward and you just need help on 1.
I would start by re-writing the code to just read a TSV text file of the data as you specified. This will make things a lot easier to debug.
Then ask if you want to implement the kmeans algorithm yourself or use a library.
If you want to implement it, here is a link to the pseudo code
http://www.scribd.com/doc/89373376/K-Means-Pseudocode
You can also search up other kmeans pseudocode.
If you want to use a library to just "run" your data against a kmeans algorithm, here is one example in python/scipy.
http://glowingpython.blogspot.com/2012/04/k-means-clustering-with-scipy.html
Regardless of which approach you use, realize that kmeans is non-deterministic and you may get different answers everytime you run it. I would recommend computing against a known validation set to see if the data is roughly what you think it should be.

A good "hello world" program for drools planner

I am trying to implement Drools Planner for allocating timetables. At the moment, my proficiency in Java and JavaBean design pattern is low and I need something simple to practice on.
Is there an AI optimization problem that
known to be solved very well with 'X' algorithm
the data model lends itself to be expressed in JavaBean design pattern in a simple manner
uses fewest number of extra features (like planning entity difficulty)
Such a problem would be good to cut my teeth on Drools Planner.
I am trying N-Queens problem right now which seems the simplest of these. So I am looking for something of this league.
Update: See CloudBalancingHelloWorld.java in optaplanner-examples (Drools Planner is renamed to OptaPlanner).
You could also try implementing the ITC2007 curriculum course scheduling yourself and then compare it with the source code of the example in Drools Planner.
If you want to keep it simple but get decent results too, follow this recipe and go for First Fit followed by Tabu Search.
Another good idea, is to join the ITC2011 scheduling competition: it's still open till 1-MAY-2012 and very similar to the curriculum course scheduling example.
I am trying 2X2 Sudoku (generating and solving) as something simple. You can model it on Nqueens code. While 2x2 sudokus are solved easily, 3x3 sudokus may get stuck. So you can implement swap moves.
Another interesting problem would be bucket sums. Given 10 buckets, each able to contain 5 numbers each, and 50 numbers; make a program to allocate the numbers so that the sum of numbers in each bucket are more or less even.
Bucket Bucket0 3 6 19 16 11 =55
Bucket Bucket1 8 2 5 25 15 =55
...
Bucket Bucket7 3 25 4 16 8 =56
Bucket Bucket8 12 20 12 9 2 =55
Bucket Bucket9 4 9 11 12 20 =56
This has practical implications, such as evenly distributing tasks of varying toughness throughout the week.
A collection of some problems: http://eclipseclp.org/examples/index.html

Determining which inputs to weigh in an evolutionary algorithm

I once wrote a Tetris AI that played Tetris quite well. The algorithm I used (described in this paper) is a two-step process.
In the first step, the programmer decides to track inputs that are "interesting" to the problem. In Tetris we might be interested in tracking how many gaps there are in a row because minimizing gaps could help place future pieces more easily. Another might be the average column height because it may be a bad idea to take risks if you're about to lose.
The second step is determining weights associated with each input. This is the part where I used a genetic algorithm. Any learning algorithm will do here, as long as the weights are adjusted over time based on the results. The idea is to let the computer decide how the input relates to the solution.
Using these inputs and their weights we can determine the value of taking any action. For example, if putting the straight line shape all the way in the right column will eliminate the gaps of 4 different rows, then this action could get a very high score if its weight is high. Likewise, laying it flat on top might actually cause gaps and so that action gets a low score.
I've always wondered if there's a way to apply a learning algorithm to the first step, where we find "interesting" potential inputs. It seems possible to write an algorithm where the computer first learns what inputs might be useful, then applies learning to weigh those inputs. Has anything been done like this before? Is it already being used in any AI applications?
In neural networks, you can select 'interesting' potential inputs by finding the ones that have the strongest correlation, positive or negative, with the classifications you're training for. I imagine you can do similarly in other contexts.
I think I might approach the problem you're describing by feeding more primitive data to a learning algorithm. For instance, a tetris game state may be described by the list of occupied cells. A string of bits describing this information would be a suitable input to that stage of the learning algorithm. actually training on that is still challenging; how do you know whether those are useful results. I suppose you could roll the whole algorithm into a single blob, where the algorithm is fed with the successive states of play and the output would just be the block placements, with higher scoring algorithms selected for future generations.
Another choice might be to use a large corpus of plays from other sources; such as recorded plays from human players or a hand-crafted ai, and select the algorithms who's outputs bear a strong correlation to some interesting fact or another from the future play, such as the score earned over the next 10 moves.
Yes, there is a way.
If you choose M selected features there are 2^M subsets, so there is a lot to look at.
I would to the following:
For each subset S
run your code to optimize the weights W
save S and the corresponding W
Then for each pair S-W, you can run G games for each pair and save the score L for each one. Now you have a table like this:
feature1 feature2 feature3 featureM subset_code game_number scoreL
1 0 1 1 S1 1 10500
1 0 1 1 S1 2 6230
...
0 1 1 0 S2 G + 1 30120
0 1 1 0 S2 G + 2 25900
Now you can run some component selection algorithm (PCA for example) and decide which features are worth to explain scoreL.
A tip: When running the code to optimize W, seed the random number generator, so that each different 'evolving brain' is tested against the same piece sequence.
I hope it helps in something!

Resources