Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C6C9C200B9D for ; Thu, 8 Sep 2016 03:31:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C57B9160AC1; Thu, 8 Sep 2016 01:31:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1E759160ACF for ; Thu, 8 Sep 2016 03:31:21 +0200 (CEST) Received: (qmail 81375 invoked by uid 500); 8 Sep 2016 01:31:21 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 81338 invoked by uid 99); 8 Sep 2016 01:31:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2016 01:31:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0BD9C2C1B7B for ; Thu, 8 Sep 2016 01:31:21 +0000 (UTC) Date: Thu, 8 Sep 2016 01:31:21 +0000 (UTC) From: "Hadoop QA (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SPARK-17400) MinMaxScaler.transform() outputs DenseVector by default, which causes poor performance MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 08 Sep 2016 01:31:23 -0000 [ https://issues.apache.org/jira/browse/SPARK-17400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15472382#comment-15472382 ] Hadoop QA commented on SPARK-17400: ----------------------------------- [ https://issues.apache.org/jira/browse/SPARK-17400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Frank Dai updated SPARK-17400: ------------------------------ Description: MinMaxScaler.transform() outputs DenseVector by default, which will cause poor performance and consume a lot of memory. The most important line of code is the following: https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala#L195 I suggest that the code should calculate the number of non-zero elements in advance, if the number of non-zero elements is less than half of the total elements in the matrix, use SparseVector, otherwise use DenseVector Or we can make it configurable by adding a parameter to was: MinMaxScaler.transform() outputs DenseVector by default, which will cause poor performance and consume a lot of memory. The most important line of code is the following: https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala#L195 I suggest that the code should calculate the number of non-zero elements in advance, if the number of non-zero elements is less than half of the total elements in the matrix, use SparseVector, otherwise use DenseVector -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org > MinMaxScaler.transform() outputs DenseVector by default, which causes poor performance > -------------------------------------------------------------------------------------- > > Key: SPARK-17400 > URL: https://issues.apache.org/jira/browse/SPARK-17400 > Project: Spark > Issue Type: Improvement > Components: ML, MLlib > Affects Versions: 1.6.1, 1.6.2, 2.0.0 > Reporter: Frank Dai > > MinMaxScaler.transform() outputs DenseVector by default, which will cause poor performance and consume a lot of memory. > The most important line of code is the following: > https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala#L195 > I suggest that the code should calculate the number of non-zero elements in advance, if the number of non-zero elements is less than half of the total elements in the matrix, use SparseVector, otherwise use DenseVector > Or we can make it configurable by adding a parameter to MinMaxScaler.transform(), for example MinMaxScaler.transform(isDense: Boolean), so that users can decide whether their output result is dense or sparse. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org