I imagine compiler supported lazy functions that memorizes last value of return , then never computes it again until an input variable changes , maybe keeps states of input vars. This may help to reduce computation , when reads are more frequent than writes . A flag could be set if there is any write to specified vars
Friday, December 21, 2012
Thursday, December 20, 2012
Thursday, December 13, 2012
Saturday, November 24, 2012
R normalize data into 0-1 Interval
function normalize(data)
{
maxvalues = apply(data,2,max)
minvalues = apply(data,2,min)
sweep(data,2,minvalues,"-")
sweep(data,2,maxvalues-minvalues,"/")
}
Monday, November 05, 2012
R hold plot
There is no hold function R instead lines or points are used for that purpose :
plot(method1,type="l", main="Accuracy vs Number of Training samples",
xlab="Number of samples", ylab="Accuracy",
xlim=c(0, 30), ylim=c(0, 1))
lines(method2,col="blue")
plot(method1,type="l", main="Accuracy vs Number of Training samples",
xlab="Number of samples", ylab="Accuracy",
xlim=c(0, 30), ylim=c(0, 1))
lines(method2,col="blue")
Friday, November 02, 2012
Thursday, November 01, 2012
Wednesday, October 24, 2012
Possible Extensions for State of the Art Machine Learning Methods
-Relax the assumptions
-Put in a hierarchy
-Semi,hybrid version
-Active,online version
-Better performance
-Relation with other methods
-More efficient
-A more general version
-Application on more realistic problem or different domain
-Put in a hierarchy
-Semi,hybrid version
-Active,online version
-Better performance
-Relation with other methods
-More efficient
-A more general version
-Application on more realistic problem or different domain
Monday, October 22, 2012
Evalution metrics using Javascript
function getEvaluationMetrics(tp,fp,tn,fn){
precision=(tp/(tp+fp));
recall=(tp/(tp+fn));
f1=2*(precision*recall/(precision+recall));
var m= new Array(3); m[0]=precision; m[1]=recall; m[2]=f1;
return m;
}
precision=(tp/(tp+fp));
recall=(tp/(tp+fn));
f1=2*(precision*recall/(precision+recall));
var m= new Array(3); m[0]=precision; m[1]=recall; m[2]=f1;
return m;
}
Monday, October 15, 2012
Paradox
nothing is exactly true -> Altough we observe many things that is not perfect , this hypothesis could not be true for any hypothesis set.
Friday, October 12, 2012
Thursday, October 11, 2012
R/Matlab Anonymous functions
R for variable X:
means <- function(x) rnorm(1,x)
Matlab
means = @(x) x+randn(1)
means <- function(x) rnorm(1,x)
Matlab
means = @(x) x+randn(1)
Stationary distribution , probability flow analogy
In page rank we are multiplying Transpose Adjacency matrix with current page rank vector. If the result is stationary distribution it means it will converge and all values will stay same. We can think this as incoming probability to a node is equal to outgoing probability.
For detailed balance condition T(x'->x)P(x') = T(x->x')P(x) if the graph is undirected
So total flow of x' times fraction of flow to x T(x'->x) is equal to total flow of x times the fraction of flow from x to x' is equal means incoming and outgoing probability flow in the full duplex edge.
It is possible that, this concept is already originating from real physical phenomena such as fluid flow or air flow.
For detailed balance condition T(x'->x)P(x') = T(x->x')P(x) if the graph is undirected
So total flow of x' times fraction of flow to x T(x'->x) is equal to total flow of x times the fraction of flow from x to x' is equal means incoming and outgoing probability flow in the full duplex edge.
It is possible that, this concept is already originating from real physical phenomena such as fluid flow or air flow.
Friday, October 05, 2012
Bayesian F1
Decision theory considers the posterior probability to decide which class to chose , or weight using a cost function. However in this setting its objective is the accuracy. Most often we are more interested in more balanced measures such as F1 due to skewed classes. How would be F1 maximizer Bayesian decision mechanism if the distribution is exactly known ? I guess this is already implemented in somewhere , however I didn't face it yet.
Thursday, October 04, 2012
Latex 2 column figure
\begin{figure*}[ht]
\vskip 0.2in
\begin{center}
\centerline{\includegraphics[width=2\columnwidth]{NAME}}
\caption{NAME}
\end{center}
\vskip -0.2in
\end{figure*}
Wednesday, October 03, 2012
More appealing
Novel, hierarchical , jointly learning , hybrid , semi supervised , hyper-parameters , large data , distributed , active , cost sensitive.
Wednesday, September 19, 2012
Training , Validation , Test set , A more general case
A regular practice is dividing training data into tree parts to evaluate the performance of the algorithm. Training set is used to train parameters of the model. Validation set is used to "train" hyper parameters of the model and test set is used to evaluate the model.
For more general sense what if I divide my training set into n part and use first set to bottom level parameters for the tree (One can use topological sort in graphical model) of the parameters. Than iterate next upper level training upper level parameters in next set. At the end we would have no parameters above the top which corresponds to a test set. Basically , make the distinction between parameters and hyper parameters fuzzy.
For more general sense what if I divide my training set into n part and use first set to bottom level parameters for the tree (One can use topological sort in graphical model) of the parameters. Than iterate next upper level training upper level parameters in next set. At the end we would have no parameters above the top which corresponds to a test set. Basically , make the distinction between parameters and hyper parameters fuzzy.
Polynomial multiplication , base x
For representing polynomials we can use base notation , it will make some operation easier.
for example 1+x+x^2 = (111)_x
For multiplication (x+1) * (x+1) = x^2 + 2x + 1
We can represent as (11)_x + (11)_x = (121)_x
It becomes like a regular multiplication if it does not excess 10 for one digit , but if it does than we need to seperate number e.g. (1,13,1)_x = x^2 + 13x + 1
We can assume at this point x > R (all real numbers) in base notation.
for example 1+x+x^2 = (111)_x
For multiplication (x+1) * (x+1) = x^2 + 2x + 1
We can represent as (11)_x + (11)_x = (121)_x
It becomes like a regular multiplication if it does not excess 10 for one digit , but if it does than we need to seperate number e.g. (1,13,1)_x = x^2 + 13x + 1
We can assume at this point x > R (all real numbers) in base notation.
Robot Particles Display:
Current display devices can show any image for a very cheap price. But it will be very intresting if someone tries to implement display using multiple robots. For example each robot will have fixed color and will stay in rectengular area. After input comes the positions of the robots will change to approximate the given image input. If this could be done in 2D in Earth. It could be extentable 3D in space since gravity no longer becomes a problem. That will result real 3D display using robotic particles. A good science finction scenario :).
Friday, September 14, 2012
Power Law
What is the relation between power law behavior and TF.Idf frequencies. They are supporting each other.
Saturday, September 08, 2012
Arbitrary Complexity PageRank-Prestige
A
Page Rank:
A + A_f
Hub - Authority : |
HITS algorithm - Incoming -> Authority , Outgoing -> Hub
Hub Authority + Unknown L class if pointed by Hubs the more the L it is and if A pointed by L the more the Authority it is (Or maybe having too many Hubs makes L strong). You can define anything.
The question is for a real world scoring could we find a optimum score graph given a large data ? Since no true score value exist for arbitrary model there is no criteria for evaluation yet.
Thursday, August 30, 2012
KNN
KNN comes from very basic idea. "Look at the closer samples", the science behind this classifier how it is proven to be useful. I mean , If you just come up with an heuristic which is not proven it does not have big impact.
Sunday, August 12, 2012
Javascript Infinity loop
I don't want to forget this :
I used for loop in my recursive calls using i variable
function recursive(param)
{
//Some stuff
for (i=0;i
}
It was creating infinity loop. The problem that I realized is i is behaving like and global variable , thus creating an infinity loop.
Fix by :
for (var i=0;i</*A Value*/;i++)
Wednesday, August 01, 2012
Sunday, April 22, 2012
Prime Graphs:
There are some efficent algorithms for restricted set of graphs for NP hard problems. It gives me the intuition that there are core graph of those restricted set which divides all elements in their set (Altough division is not defined yet). In this sense there exist an algorithm which solves this restricted set efficiently by solving its core problem. These core's are called prime graphs which is analogous to prime numbers where prime number has their unique divisors. Division means that there is polynomial algorithm that can convert problem into solution or core problem.
To solve those prime graphs an machine need to be started to solve and store them. Then anyone who needs a solution to their problem need to find a conversion to prime graph and query from already solved graphs.
This is different from polynomial time conversion from one problem type to another. This time the iteration held on graphs as similar to numbers.
Friday, March 23, 2012
Ubuntu install VTK:
Required packages :
sudo apt-get install nvidia-current cmake libglu1-mesa-dev python-vtk g++ libxt-dev
Download VTK :
tar -zxvf vtk.tar.gz VTK
cmake VTK/.
I got error like iostream.h not found,
than I removed whole build directory and reopen archive again.
This time it seems working.
Required packages :
sudo apt-get install nvidia-current cmake libglu1-mesa-dev python-vtk g++ libxt-dev
Download VTK :
tar -zxvf vtk.tar.gz VTK
cmake VTK/.
I got error like iostream.h not found,
than I removed whole build directory and reopen archive again.
This time it seems working.
Friday, February 24, 2012
Old Casette Players
Nowadays no body using cassette player. I bought a cassette to listen music from my smartphone . It would be good if we can build an equipment to replace cassette player and allows user to connect his smartphone directly to this equipment. Than smartphone could be used as GPS, television or music player.
Nowadays no body using cassette player. I bought a cassette to listen music from my smartphone . It would be good if we can build an equipment to replace cassette player and allows user to connect his smartphone directly to this equipment. Than smartphone could be used as GPS, television or music player.
Wednesday, February 22, 2012
Wrong Normal Assumption on Linear Classifiers;
Normal assumption on weight vectors regularizes the by some precision matrix gamma. However normal distribution takes Mahalonobis distance , thus it fails to capture scaled version of weight vector.Also, If weight vectors assumed to be unit vectors than they will be distributed on unit hyper-sphere. It may worth to use von-misses distribution , but I think it will not differ too much.
Normal assumption on weight vectors regularizes the by some precision matrix gamma. However normal distribution takes Mahalonobis distance , thus it fails to capture scaled version of weight vector.Also, If weight vectors assumed to be unit vectors than they will be distributed on unit hyper-sphere. It may worth to use von-misses distribution , but I think it will not differ too much.
Tuesday, January 24, 2012
Old value of the variable
It is very common to create another variable to store old value of the variable. There could be some option to have .old of each object that stores old value of that object. An object oriented language can have this property to save time while debugging and writing programs.
It is very common to create another variable to store old value of the variable. There could be some option to have .old of each object that stores old value of that object. An object oriented language can have this property to save time while debugging and writing programs.
Monday, January 02, 2012
Comparative Debug;
Sometimes it is not clear which algorithm is best for your program. Thus , it will be useful if there is something that allows to compare two alternative codes easily. People mostly preferring comments to do this. But I think there should be some support in IDE. For example some key combination assigns code partition to first version of execution where another key combination assigns code partition to second version.
Karsilastirmali debug islemi IDE'ler tarafindan desteklenseydi faydali olurdu. Cogu zaman hangi kodun daha iyi oldugunu bilmiyoruz comment in comment out yaparak denemeler yapiyoruz. Bunun yerine IDE bazi tus kombinasyonlari ile degisik kod versiyonlari olusturup bunlari karsilikli calistirmaya izin verseydi guzel olurdu. Bu version control sistemlerindeki branch olayinin kucuk bir hali olarak dusunulebilir.
Sometimes it is not clear which algorithm is best for your program. Thus , it will be useful if there is something that allows to compare two alternative codes easily. People mostly preferring comments to do this. But I think there should be some support in IDE. For example some key combination assigns code partition to first version of execution where another key combination assigns code partition to second version.
Karsilastirmali debug islemi IDE'ler tarafindan desteklenseydi faydali olurdu. Cogu zaman hangi kodun daha iyi oldugunu bilmiyoruz comment in comment out yaparak denemeler yapiyoruz. Bunun yerine IDE bazi tus kombinasyonlari ile degisik kod versiyonlari olusturup bunlari karsilikli calistirmaya izin verseydi guzel olurdu. Bu version control sistemlerindeki branch olayinin kucuk bir hali olarak dusunulebilir.
Subscribe to:
Posts (Atom)
AI
Despite the benefits of AI we are starving for humanity.
-
It is difficult to create robot that cleans our arbitrary dirty dishes. However , if we put some digital information on dishes (special des...
-
Our parents were arranging their schedule according to sunrise and sunset. They are still consistent in their habit. However, in our generat...
-
Robot Particles Display: Current display devices can show any image for a very cheap price. But it will be very intresting if someone tr...