From notifications-return-401-archive-asf-public=cust-asf.ponee.io@nemo.apache.org Wed Mar 27 15:36:39 2019 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 C7CBA180648 for ; Wed, 27 Mar 2019 16:36:38 +0100 (CET) Received: (qmail 73821 invoked by uid 500); 27 Mar 2019 15:36:37 -0000 Mailing-List: contact notifications-help@nemo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nemo.apache.org Delivered-To: mailing list notifications@nemo.apache.org Received: (qmail 73805 invoked by uid 99); 27 Mar 2019 15:36:37 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Mar 2019 15:36:37 +0000 From: GitBox To: notifications@nemo.apache.org Subject: [GitHub] [incubator-nemo] wynot12 commented on a change in pull request #203: [NEMO-360] Implementing an 'XGBoostPolicy' Message-ID: <155370099736.29853.15713426046977637847.gitbox@gitbox.apache.org> Date: Wed, 27 Mar 2019 15:36:37 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit wynot12 commented on a change in pull request #203: [NEMO-360] Implementing an 'XGBoostPolicy' URL: https://github.com/apache/incubator-nemo/pull/203#discussion_r269601965 ########## File path: ml/nemo_xgboost_optimization.py ########## @@ -0,0 +1,377 @@ +#!/usr/bin/python3 +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +import getopt +import json +import sys +from pathlib import Path + +import numpy as np +import psycopg2 as pg +import xgboost as xgb +from sklearn import preprocessing + + +# import matplotlib.pyplot as plt + +# ######################################################## +# METHODS +# ######################################################## +def format_row(duration, inputsize, jvmmemsize, totalmemsize, vertex_properties, edge_properties): + duration_in_sec = int(duration) // 1000 + inputsize_in_10kb = int(inputsize) // 10240 # capable of expressing upto around 20TB with int range + jvmmemsize_in_mb = int(jvmmemsize) // 1048576 + totalmemsize_in_mb = int(totalmemsize) // 1048576 + return f'{duration_in_sec} 0:{inputsize_in_10kb} 1:{jvmmemsize_in_mb} 2:{totalmemsize_in_mb} {vertex_properties} {edge_properties}' + + + +# ######################################################## +def load_data_from_db(tablename): + conn = None + + try: + host = "nemo-optimization.cabbufr3evny.us-west-2.rds.amazonaws.com" Review comment: You don't consider the case that data is in local db saved by `saveOptimizationMetricsToLocal`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services