From issues-return-2334-archive-asf-public=cust-asf.ponee.io@hivemall.incubator.apache.org Thu Apr 26 10:52:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5A5FF180679 for ; Thu, 26 Apr 2018 10:52:04 +0200 (CEST) Received: (qmail 21817 invoked by uid 500); 26 Apr 2018 08:52:03 -0000 Mailing-List: contact issues-help@hivemall.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hivemall.incubator.apache.org Delivered-To: mailing list issues@hivemall.incubator.apache.org Received: (qmail 21806 invoked by uid 99); 26 Apr 2018 08:52:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2018 08:52:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1948AC0156 for ; Thu, 26 Apr 2018 08:52:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id biw4EGJ045ge for ; Thu, 26 Apr 2018 08:52:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id AB8F85F5B2 for ; Thu, 26 Apr 2018 08:52:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1515EE1215 for ; Thu, 26 Apr 2018 08:52:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7538B21099 for ; Thu, 26 Apr 2018 08:52:00 +0000 (UTC) Date: Thu, 26 Apr 2018 08:52:00 +0000 (UTC) From: "Takeshi Yamamuro (JIRA)" To: issues@hivemall.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVEMALL-181) Plan rewriting rules to filter meaningful training data before feature selections MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVEMALL-181?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Takeshi Yamamuro updated HIVEMALL-181: -------------------------------------- Attachment: fig3.png fig2.png > Plan rewriting rules to filter meaningful training data before feature se= lections > -------------------------------------------------------------------------= -------- > > Key: HIVEMALL-181 > URL: https://issues.apache.org/jira/browse/HIVEMALL-181 > Project: Hivemall > Issue Type: Improvement > Reporter: Takeshi Yamamuro > Assignee: Takeshi Yamamuro > Priority: Major > Labels: spark > Attachments: fig1.png, fig2.png, fig3.png > > > In machine learning and statistics, feature selection is one of useful te= chniques to choose a subset of relevant data in model construction for simp= lification of models and shorter training times, e.g., scikit-learn has som= e APIs for feature selection ([http://scikit-learn.org/stable/modules/featu= re_selection.html]). But, this selection is too time-consuming process if t= raining data have a large number of columns and rows (For example, the numb= er of columns could frequently go over 1,000 in real business use cases). > An objective of this ticket is to implement plan rewriting rules in Spark= Catalyst to filter meaningful training data before feature selection. We a= ssume a workflow below from data extraction to model training; > !fig1.png! > In the example workflow above, one prepares raw training data, R(v1, v2, = v3, v4) in the figure, by joining and projecting input data (R1, R2, and R3= ) in various datasources (HDFS, S3, JDBC, ...), then, to choose a releavant= subset (the red box) of the raw data, sampling and feature selection apply= to them. In real business use cases, it sometimes happens that raw trainin= g data have many meaningless columns because of historical reasons (e.g., r= edundant schema designs). So, if we could filter out these meaningless data= in the phase of data extraction, we should efficiently process the data ex= traction itself and following feature selection. In the example above, we a= ctually need not join the relation R3 because all the columns in the relati= on are filtered out in feature selection. Also, the join processing should = be faster if we could sample data directly in the input data (R1 and R2). T= his optimized workflow is as following; > !fig2.png! > This optimization might be achived by rewriting a plan tree for data extr= action as following; > !fig3.png! > Since Spark already has a pluggable optimizer interface (extendedOperator= OptimizationRules) and a framework to collect data statistics for input dat= a in data sources, the major tasks of this ticket are to add plan rewriting= rules to filter meaningful training data before feature selections. > As a pretty simple task, Spark might have a rule to filter out columns wi= th low variances (This process is corresponding to `VarianceThreshold` in s= cikit-learn) by implicitly adding a `Project` node in the top of an user pl= an. Then, the Spark optimizer might push down this `Project` node into leaf= nodes (e.g., `LogicalRelation`) and the plan execution could be significan= tly faster. Moreover, more sophisticated techniques have been proposed in [= 1, 2]. > I will make pull requests as sub-tasks and put relevant activities (paper= s and other OSS functionalities) in this ticket to track them. > =C2=A0 > References: > [1] Arun Kumar, Jeffrey Naughton, Jignesh M. Patel, and Xiaojin Zhu, To = Join or Not to Join?: Thinking Twice about Joins before Feature Selection, = Proceedings of SIGMOD, 2016. > [2] Vraj Shah, Arun Kumar, and Xiaojin Zhu, Are key-foreign key joins sa= fe to avoid when learning high-capacity classifiers?, Proceedings of the VL= DB Endowment, Volume 11 Issue 3, Pages 366-379, 2017. -- This message was sent by Atlassian JIRA (v7.6.3#76005)