[ 
https://issues.apache.org/jira/browse/SPARK-15194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15280563#comment-15280563
 ] 

praveen dareddy commented on SPARK-15194:
-----------------------------------------

Hi All,
After going through ml and mllib api's,It seems MultivariateGaussian in scala 
uses breeze library for linear algebra.
So, are we implementing the same in Python using numpy or using  a wrapper to 
Scala MultivariateGaussian?

I have tried using JavaWrapper class in 
https://github.com/apache/spark/blob/master/python/pyspark/ml/wrapper.py
as wrapper solution. But I am getting constructor errors.( need to pass Vector 
and DenseMatrix to MultivariateGaussian).

Are there any other Wrapper API's i am missing?
Kindly, help me out.

Thanks,
Praveen

Here is my code,

from pyspark.ml.wrapper import JavaWrapper
__all__ = ['MultivariateGaussian']

class MultivariateGaussian(JavaWrapper):

    #@keyword_only
    def __init__(self, mu,sigma):
        super(MultivariateGaussian, self).__init__()
        self._java_obj = self._new_java_obj(
            
"org.apache.spark.ml.stat.distribution.MultivariateGaussian",(mu,sigma) )
        self.mu=mu
        self.sigma=sigma
        

> Add Python ML API for MultivariateGaussian
> ------------------------------------------
>
>                 Key: SPARK-15194
>                 URL: https://issues.apache.org/jira/browse/SPARK-15194
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML, PySpark
>            Reporter: holdenk
>            Priority: Minor
>
> We have a PySpark API for the MLLib version but not the ML version. This 
> would allow Python's  `GaussianMixture` to more closely match the Scala API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to