You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by Tommaso Teofili <to...@gmail.com> on 2013/06/17 15:08:44 UTC

[ML] Cost function API

Hi all,

looking at the nice multi layer perceptron feature I realized we have
different APIs for defining a cost function.
In the regression package we have
http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/CostFunction.java

while in perception (shouldn't it be perceptron?) we have:
http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/CostFunction.java

then for a logistic regression model (which encapsulates a logistic cost
function) in regression we have:
http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/LogisticCostFunction.java

while in perception we have:
http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/LogisticCostFunction.java

so I think it'd be good if we can abstract and define a unified API for
cost function, models, etc. in the machine learning package.

What do you think?

Thanks,
Tommaso

Re: [ML] Cost function API

Posted by Yexi Jiang <ye...@gmail.com>.
Yes, I totally agree with you, currently I am working on the Vector/Matrix,
and these two classes also need a DoubleFunction so that it can be applied
to each element of the Vector/Matrix.

I wonder can we define a hierarchy that each special function can be
treated as a descendant of an abstract Function class?


2013/6/17 Tommaso Teofili <to...@gmail.com>

> 2013/6/17 Tommaso Teofili <to...@gmail.com>
>
> > Hi all,
> >
> > looking at the nice multi layer perceptron feature I realized we have
> > different APIs for defining a cost function.
> > In the regression package we have
> >
> >
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/CostFunction.java
> >
> > while in perception (shouldn't it be perceptron?) we have:
> >
> >
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/CostFunction.java
> >
> > then for a logistic regression model (which encapsulates a logistic cost
> > function) in regression we have:
> >
> >
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/LogisticCostFunction.java
> >
>
> sorry here's the correct link:
>
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LogisticRegressionModel.java
>
>
>
> >
> > while in perception we have:
> >
> >
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/LogisticCostFunction.java
> >
> > so I think it'd be good if we can abstract and define a unified API for
> > cost function, models, etc. in the machine learning package.
> >
> > What do you think?
> >
> > Thanks,
> > Tommaso
> >
>



-- 
------
Yexi Jiang,
ECS 251,  yjian004@cs.fiu.edu
School of Computer and Information Science,
Florida International University
Homepage: http://users.cis.fiu.edu/~yjian004/

Re: [ML] Cost function API

Posted by Tommaso Teofili <to...@gmail.com>.
2013/6/17 Tommaso Teofili <to...@gmail.com>

> Hi all,
>
> looking at the nice multi layer perceptron feature I realized we have
> different APIs for defining a cost function.
> In the regression package we have
>
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/CostFunction.java
>
> while in perception (shouldn't it be perceptron?) we have:
>
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/CostFunction.java
>
> then for a logistic regression model (which encapsulates a logistic cost
> function) in regression we have:
>
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/LogisticCostFunction.java
>

sorry here's the correct link:
http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/LogisticRegressionModel.java



>
> while in perception we have:
>
> http://svn.apache.org/repos/asf/hama/trunk/ml/src/main/java/org/apache/hama/ml/perception/LogisticCostFunction.java
>
> so I think it'd be good if we can abstract and define a unified API for
> cost function, models, etc. in the machine learning package.
>
> What do you think?
>
> Thanks,
> Tommaso
>