<?xml version="1.0" encoding="UTF-8"?>
		<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom">
      <channel xmlns:sxp="blogs.technet.microsoft.com/cloudplatform/rssfeeds/dataplatform" xmlns:sxpMd="http://sxpdata.microsoft.com/metadata">
        <title>Category Name</title>
        <description>Category Name</description>
        <copyright>Copyright (c) 2017 Microsoft</copyright>
        <link>https://blogs.technet.microsoft.com/cloudplatform</link>
        <a10:link href="blogs.technet.microsoft.com/cloudplatform/rssfeeds/dataplatform" rel="self" type="application/rss+xml" />

				
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/subway-maps-to-scale.html</guid>
						<pubDate>Fri, 09 Jun 2017 20:59:59 +0000</pubDate>
						<relativeTime>2 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Because it&#8217;s Friday: Subway maps to scale]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/subway-maps-to-scale.html</link>
						<description><![CDATA[<p>Many subway maps are masterpieces of information design, but inevitably make compromises in geographic fidelity for clarity. Inspired by a <a href="https://www.reddit.com/r/dataisbeautiful/comments/6baefh/berlin_subway_map_compared_to_its_real_geography/">viral post</a> on Reddit, you can now find a <a href="http://twistedsifter.com/2017/05/subway-maps-compared-to-their-actual-geography/">collection of subway maps from around the world</a>, morphing from their map format to their real-world layout. Here, for example, is London's:&nbsp;</p>
<p></p>
<p>London's tube map &mdash; in map form &mdash; has always been lovely and clear, and you can easily see how much it deviates from geographic truth (and how much better it is for doing so). Compare it with New York's map:</p>
<p></p>
<p>I've always found the NYC subway map one of the most confusing to use as a traveler, and the fact that it hews so closely to geography probably has a lot to do with it.</p>
<p>That's all from us for this week. Have a great weekend, and we'll be back on Monday!&nbsp;</p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/subway-maps-to-scale.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/user2017-schedule.html</guid>
						<pubDate>Fri, 09 Jun 2017 19:17:33 +0000</pubDate>
						<relativeTime>2 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Schedule for useR!2017 now available]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/user2017-schedule.html</link>
						<description><![CDATA[<p>The full <a href="https://user2017.sched.com/">schedule of talks</a> for <a href="https://user2017.brussels/">useR!2017</a>, the global R user conference, has now been posted. The conference will feature <a href="https://user2017.sched.com/overview/type/Tutorial">16 tutorials</a>, <a href="https://user2017.sched.com/overview/type/Invited+Talk">6 keynotes</a>, <a href="https://user2017.sched.com/overview/type/Talk">141 full talks</a>, and <a href="https://user2017.sched.com/overview/type/Lightning+Talk">86 lightning talks</a>&nbsp;starting on July 5 in Brussels. That's a lot to fir into 4 days, but I'm especially looking forward to the keynote presentations:</p>
<ul><li><a href="https://user2017.sched.com/event/Ay06/keynote-20-years-of-cran">20 years of CRAN</a> (Uwe Ligges)</li>
<li><a href="https://user2017.sched.com/event/Ay04/keynote-parallel-computation-in-r-what-we-want-and-how-we-might-get-it">Parallel Computation in R: What We Want, and How We (Might) Get It</a> (Norm Matloff)</li>
<li><a href="https://user2017.sched.com/event/Ay00/keynote-structural-equation-modeling-models-software-and-stories">Structural Equation Modeling: models, software and stories</a>&nbsp;(Yves Roseel)</li>
<li><a href="https://user2017.sched.com/event/Ay01/keynote-teaching-data-science-to-new-users">Teaching data science to new useRs</a> (Mine Cetinkaya-Rundel)</li>
<li><a href="https://user2017.sched.com/event/Ay02/keynote-dose-response-analysis-considering-dose-both-as-qualitative-factor-and-quantitative-covariate-using-r">Dose-response analysis: considering dose both as qualitative factor and quantitative covariate using R</a> (Ludwig Hothorn)</li>
<li><a href="https://user2017.sched.com/event/Ay05/keynote-r-tools-for-the-analysis-of-complex-heterogeneous-data">R tools for the analysis of complex heterogeneous data</a> (Isabella Gollini)</li>
</ul><p>I'm also pleased to be attending with several of my Microsoft colleagues. You can find our talks below.</p>
<ul><li><a href="https://user2017.sched.com/event/Axq3/can-you-keep-a-secret">Can you keep a secret?</a>&nbsp;(Andrie deVries and Gabor Csardi) [A new package <a href="https://user2017.sched.com/event/Axq3/can-you-keep-a-secret">secret</a> allows you to encrypt secrets using public key encryption.]&nbsp;</li>
<li><a href="https://user2017.sched.com/event/AxrU/recommendations-for-coworker-collaborators-using-r-and-the-office-graph-api">Recommendations for coworker collaborators using R and the Office Graph API</a> (David Smith) [Graph theory, R and Power BI]</li>
<li><a href="https://user2017.sched.com/event/Axqb/deep-learning-for-natural-language-processing-in-r">Deep Learning for Natural Language Processing in R</a> (Angus Taylor) [Using the mxnet package to apply deep learning to text]</li>
</ul><p>I hope you can attend too! <a href="https://user2017.brussels/registration/">Registration is still open</a> if you'd like to join in. You can find the complete schedule linked below.</p>
<p>Sched: <a href="https://user2017.sched.com/">useR!2017</a></p>
<p>&nbsp;</p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/user2017-schedule.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/06/09/what-is-plan-regression-in-sql-server/</guid>
						<pubDate>Fri, 09 Jun 2017 13:02:10 +0000</pubDate>
						<relativeTime>2 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[What is plan regression in SQL Server?]]></title>
						<link>https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/06/09/what-is-plan-regression-in-sql-server/</link>
						<description><![CDATA[<p>Plan regression happens when SQL Server starts using the sub-optimal SQL plan to execute some T-SQL query. Usually you will see that some T-SQL query is executing really fast, but then it gets slower without any obvious reason. In this post you will see how can plan regression happen.</p>
<p><span></span></p>
<h2>Setup</h2>
<p>First I&rsquo;m going to create&nbsp;a simple table that will be used for the test:</p>
<pre>drop table if exists flgp; 
create table flgp (
&nbsp; &nbsp; &nbsp; &nbsp;type int,
&nbsp; &nbsp; &nbsp; &nbsp;name nvarchar(200),
       index ncci nonclustered columnstore (type),
       index ix_type(type)
);</pre>
<p>This table has two columns, one classic B-tree index, and one COLUMNSTORE index. B-tree index is better for the queries that need a limited set of rows, while the columnstore index is better for queries that will scan most of the rows in the table.</p>
<p>I will populate this table with non-uniformly distributed data:</p>
<ul><li>One row that has type = 1</li>
<li>999.999 rows that have type = 2</li>
</ul><pre>insert into flgp(type, name)
values (1, 'Single')

insert into flgp(type, name)
select TOP 999999 2 as type, o.name
from sys.objects, sys.all_columns o</pre>
<p>Plan regression will be demonstrated on this data set.</p>
<h2>Why we have different plans for the same T-SQL query?</h2>
<p>Every T-SQL query can have different plans. Let&rsquo;s look at the following query:</p>
<pre><span>SELECT COUNT(*) FROM flgp WHERE type = @type</span></pre>
<p>If we pass a parameter with the value 1, the query would need to take one row. Therefore, the optimal plan would be a plan that uses B-Tree index that seeks into the table, takes one row using the reference from the index and returns number 1 as a result. B-tree indexes are perfect for very selective seeks/lookups.&nbsp;Let&rsquo;s look at this query:</p>
<pre>ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE;
EXECUTE sp_executesql @stmt = N'SELECT COUNT(*) FROM flgp WHERE type = @type', @params = N'@type int', @type = 1</pre>
<p>This query will produce plan with B-Tree INDEX SEEK that is optimal for parameter 1. with the following execution statistics:</p>
<pre>SQL Server Execution Times:
 CPU time = 0 ms, elapsed time = 7 ms.
</pre>
<p><span>If we pass parameter value 2, the query would need to read almost the whole table. The optimal plan would be the plan that uses columnstore index that <strong>scans</strong> the table, takes all&nbsp;rows from the index and counts them. Let&rsquo;s try to execute this query:</span></p>
<pre>ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE;
EXECUTE sp_executesql @stmt = N'SELECT COUNT(*) FROM flgp WHERE type = @type', @params = N'@type int', @type = 2</pre>
<p>Execution statistics for this query might be:</p>
<pre> SQL Server Execution Times:
 CPU time = 312 ms, elapsed time = 400 ms.</pre>
<p>Depending on the parameter value, SQL Server will choose one or another plan. The second plan is slower, but this is expected because it needs to count million of rows.</p>
<p>In both cases I have cleared the cache before I executed the query using <strong>ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE</strong>, because I want SQL Server to recompile the query and create the new plan.</p>
<h2>How plan regression happens?</h2>
<p>When SQL Server creates a plan for a query, the plan will be cached and reused when the same query comes again. The plan is retained&nbsp;in the cache and reused for some time.Now, let&rsquo;s see what would happen if I execute the query that will put a plan with index seek into the cache, and then I execute second query that reuses that plan:</p>
<pre>ALTER DATABASE&nbsp;SCOPED CONFIGURATION&nbsp;CLEAR&nbsp;PROCEDURE_CACHE; 
EXECUTE sp_executesql @stmt = N'SELECT COUNT(*) FROM flgp WHERE type = @type', @params = N'@type int', @type = 1
-- this query will reuse plan cached from previous query:
EXECUTE sp_executesql @stmt = N'SELECT COUNT(*) FROM flgp WHERE type = @type', @params = N'@type int', @type = 2</pre>
<p>If we look at the execution statistics for the second query we might see something like:</p>
<pre> SQL Server Execution Times:
 CPU time = 719 ms, elapsed time = 721 ms.</pre>
<p>Both CPU and elapsed time for the second query is doubled (from 300-400ms to 700ms) because the second query used the plan that was optimal for the first query. The cause of regression is plan caching in this case.</p>
<p>&nbsp;</p>
<h3>Conclusion</h3>
<p>Plan regression happens when SQL Server starts using sub-optimal plan, which increases CPU time and duration. One way to mitigate this is to recompile query with OPTION(RECOMPILE) if you find this problem. <strong>Do not clear procedure cache on production system because&nbsp;it will affect all queries!</strong></p>
<p>Another option would be to use <a href="https://docs.microsoft.com/en-us/sql/relational-databases/automatic-tuning/automatic-tuning">automatic plan choice correction</a> in SQL Server 2017 that will look at the history of plans and force SQL Server to use last known good plan if plan regression is detected.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></description>
						<author>Jovan Popovic (MSFT)</author>
						<source url="https://blogs.msdn.microsoft.com/sqlserverstorageengine/feed/">SQL Server Database Engine Blog</source>
						<comments>https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/06/09/what-is-plan-regression-in-sql-server/feed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/doazureparallel-updated.html</guid>
						<pubDate>Thu, 08 Jun 2017 22:41:11 +0000</pubDate>
						<relativeTime>3 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Run massive parallel R jobs cheaply with updated doAzureParallel package]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/doazureparallel-updated.html</link>
						<description><![CDATA[<p>At the EARL conference in San Francisco this week, JS Tan from Microsoft gave an update (<a href="http://blog.revolutionanalytics.com/downloads/doAzureParallel%20presentation.pdf">PDF slides here</a>) on the <a href="https://github.com/Azure/doAzureParallel">doAzureParallel package</a>&nbsp;. As we've noted&nbsp;<a href="http://blog.revolutionanalytics.com/2017/03/doazureparallel.html">here before</a>, this package allows you to easily&nbsp;distribute parallel R computations to an Azure cluster. The package was&nbsp;<a href="https://azure.microsoft.com/en-us/blog/run-massive-r-jobs-in-azure-directly-from-r-studio-at-a-fraction-of-the-price">recently updated</a> to support using automatically-scaling <a href="https://azure.microsoft.com/en-us/services/batch/">Azure Batch clusters</a>&nbsp;with low-priority nodes, which can be used at a <a href="https://azure.microsoft.com/en-us/pricing/details/batch/">discount of up to 80%</a> compared to the price of regular high-availability VMs.</p>
<blockquote>
<p dir="ltr" lang="en">JS Tan using doAzureParallel <a href="https://twitter.com/hashtag/rstats?src=hash">#rstats</a> package to run simulation on a cluster of 20 low-priority Azure VMs. Total cost: $0.02 <a href="https://twitter.com/hashtag/EARLConf2017?src=hash">#EARLConf2017</a> <a href="https://t.co/Mpl3IUa9zY">pic.twitter.com/Mpl3IUa9zY</a></p>
&mdash; David Smith (@revodavid) <a href="https://twitter.com/revodavid/status/872589986490482688">June 7, 2017</a></blockquote>
<p><a href="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d28ace3d970c-pi"><img alt="Azurepool" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d28ace3d970c-200wi" title="Azurepool"></a>Using the doAzureParallel package is simple. First, you need to define the cluster you're going to use <a href="https://github.com/Azure/doAzureParallel/blob/master/README.md#configuration-json-files">as a JSON file</a>. (You can see an example on the right.) Here, you'll specify your Azure credentials, the size of the cluster, and the type of nodes (CPUs and memory) to use in the cluster. You can also specify here R packages (from CRAN and/or Github) to be pre-loaded onto each node, and the maximum number of simultaneous tasks to run on each node (for within-node parallelism).</p>
<p>New to this update, the <a href="https://github.com/Azure/doAzureParallel/blob/master/docs/11-autoscale.md">poolSize option</a> allows you to specify the number of dedicated (standard) VM nodes to use, in addition to a number of low-priority nodes to use. Low-priority nodes can be pre-empted by the Azure system at any time, but are much cheaper to use. (Even if a node is pre-empted your parallel computation will be continue; it will just take a little longer with the reduced capacity.) You can even specify a minimum and maximum number of nodes of each class to use, in which case the cluster will <strong>automatically scale</strong> up and down according to either (your choice) the workload or the time of day (e.g. only expand the low-priority part of the cluster on weekends, when pre-emption is less likely).&nbsp;</p>
<p><a href="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d28ac4a6970c-pi"><img alt="Azurebatch" border="0" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d28ac4a6970c-800wi" title="Azurebatch"></a><br>Once you've defined the parameters of your cluster, all you need to do is declare the cluster as a backend for the <a href="https://mran.microsoft.com/package/foreach/">foreach package</a>. The body of the <code>foreach</code> loop runs just like a <code>for</code> loop, except that multiple iterations run in parallel on the remote cluster. Here are the key parts of the <a href="https://github.com/Azure/doAzureParallel/blob/master/samples/montecarlo_pricing_simulation.R">option price simulation</a> example JS presented at the conference.</p>
<p>This same approach can be used for any "embarrassingly parallel" iteration in R, and you can use any R function or package within the body of the loop. For example, you could use a cluster to reduce the time required for&nbsp;<a href="http://github.com/Azure/doAzureParallel/blob/master/samples/caret_example.R" title="">parameter tuning and cross-validation with the caret package,</a>&nbsp;or speed up <a href="https://github.com/Azure/doAzureParallel/blob/master/samples/plyr_example.R">data preparation tasks when using the dplyr package</a>.</p>
<p>In addition to support for auto-scaling clusters, this update to doAzureParallel also includes a few other new features. You'll also find new utility functions for managing multiple&nbsp;<a href="http://github.com/Azure/doAzureParallel#long-running-jobs--job-management" title="">long-running R jobs,</a>&nbsp;functions to read data from and write data to <a href="http://github.com/Azure/doAzureParallel/blob/master/samples/sas_resource_files_example.R" title="">Azure Blob storage</a>, and the ability to <a href="https://github.com/Azure/doAzureParallel/blob/master/docs/21-distributing-data.md#pre-loading-data-into-the-cluster">pre-load data into the cluster</a> by specifying resource files.</p>
<p>The doAzureParallel package is available for download now from Github, under the open-source MIT license. For details on how to use the package, check out the <a href="https://github.com/Azure/doAzureParallel/blob/master/README.md">README</a> and the&nbsp;<a href="https://github.com/Azure/doAzureParallel/tree/master/docs">doAzureParallel guide</a>.</p>
<p>Github (Azure): <a href="https://github.com/azure/doazureparallel">doAzureParallel</a></p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/doazureparallel-updated.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/how-to-create-dot-density-maps-in-r.html</guid>
						<pubDate>Wed, 07 Jun 2017 20:17:44 +0000</pubDate>
						<relativeTime>4 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[How to create dot-density maps in R]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/how-to-create-dot-density-maps-in-r.html</link>
						<description><![CDATA[<p><a href="http://blog.revolutionanalytics.com/2015/08/following-uo-on-the-news-with-choroplether-and-r.html">Choropleths</a> are a common approach to visualizing data on geographic maps. But choropleths &mdash; by design or necessity &mdash; aggregate individual data points into a single geographic region (like a country or census tract), which is all shaded a single colour. This can introduce interpretability issues (are we seeing changes in the variable of interest, or just population density?) and can fail to express the richness of the underlying data.</p>
<p>For an alternative approach, take a look at the recent Culture of Insight blog post which provides a tutorial on <a href="http://blog.cultureofinsight.com/2017/06/building-dot-density-maps-with-uk-census-data-in-r/">creating dot-density maps in R</a>. The chart below is based on UK Census data. Each point represents 10 London residents, with the colour representing one of five ethnic categories. Now, the UK census only reports ethnic ratios on a borough-by-borough basis, so the approach here is to simulate the individual resident data (which is not available) by randomly distributing points across the borough following the reported distribution. In a way, this is suggesting a level of precision which isn't available in the source data, but it does provide a visualization of London's ethnic diversity that isn't confounded with the underlying population distribution.&nbsp;</p>
<p><a href="http://blog.cultureofinsight.com/2017/06/building-dot-density-maps-with-uk-census-data-in-r/"><img alt="London ethnicity" border="0" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c9004a77970b-800wi" title="London ethnicity"></a></p>
<p>Follow the link below to the detailed blog post, which includes R code (in both base and ggplot2 graphics) for creating density dot-charts like these. Also be sure to check out the zoomable version of the chart at the top of the page, which used Microsoft's <a href="https://www.microsoft.com/en-gb/download/details.aspx?id=24819">Deep Zoom Composer</a>&nbsp;in conjunction with <a href="http://openseadragon.github.io/" rel="noopener" target="_blank">OpenSeadragon</a>&nbsp;to provide the zooming capability.</p>
<p>Culture of Insight:&nbsp;<a href="http://blog.cultureofinsight.com/2017/06/building-dot-density-maps-with-uk-census-data-in-r/">Building Dot Density Maps with UK Census Data in R</a></p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/how-to-create-dot-density-maps-in-r.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">https://blogs.technet.microsoft.com/machinelearning/2017/06/07/announcing-microsoft-machine-learning-library-for-apache-spark/</guid>
						<pubDate>Wed, 07 Jun 2017 16:00:54 +0000</pubDate>
						<relativeTime>4 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Announcing Microsoft Machine Learning Library for Apache Spark]]></title>
						<link>https://blogs.technet.microsoft.com/machinelearning/2017/06/07/announcing-microsoft-machine-learning-library-for-apache-spark/</link>
						<description><![CDATA[<p><span><em>This post is authored by Roope Astala, Senior Program Manager, and Sudarshan Raghunathan, Principal Software Engineering Manager, at Microsoft.<br></em></span></p>
<p><span>We&rsquo;re excited to announce the Microsoft Machine Learning library for Apache Spark &ndash; a library designed to make data scientists more productive on Spark, increase the rate of experimentation, and leverage cutting-edge machine learning techniques &ndash; including deep learning &ndash; on very large datasets.<br></span></p>
<h4><span>Simplifying Data Science for Apache Spark<br></span></h4>
<p><span>We&rsquo;ve learned a lot by working with customers using <a href="http://spark.apache.org/docs/latest/ml-guide.html">SparkML</a>, both internal and external to Microsoft. Customers have found Spark to be a powerful platform for building scalable ML models. However, they struggle with low-level APIs, for example to index strings, assemble feature vectors and coerce data into a layout expected by machine learning algorithms. Microsoft Machine Learning for Apache Spark (MMLSpark) simplifies many of these common tasks for building models in PySpark, making you more productive and letting you focus on the data science.<br></span></p>
<p><span>The library provides simplified consistent APIs for handling different types of data such as text or categoricals. Consider, for example, a DataFrame that contains strings and numeric values from the <a href="https://archive.ics.uci.edu/ml/datasets/Adult">Adult Census Income dataset</a>, where &ldquo;income&rdquo; is the prediction target.<br></span></p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060617_2243_AnnouncingM1.png"><span><br></span></p>
<p><span>To featurize and train a model for this data using vanilla SparkML, you would have to tokenize strings, convert them into numerical vectors, assemble the numerical vectors together and index the label column. These operations result in substantial amounts of code that is not modular, as it depends on the data layout and the chosen ML algorithm. However, in MMLSpark, you can simply pass the data to the model, while the library takes care of the rest. Furthermore, you can easily change the feature space and algorithm without having to re-code your pipeline.<br></span></p>
<p><span><em>model = mmlspark.TrainClassifier(model=LogisticRegression(), labelCol=&rdquo; income&rdquo;).fit(trainData)<br>
predictions = model.transform(testData)<br></em></span></p>
<p><span>MMLSpark uses DataFrames as its core datatype and integrates with SparkML pipelines for composability and modularity. It is implemented as Python bindings over Scala APIs, ensuring native JVM performance.<br></span></p>
<h4><span>Deep Learning and Computer Vision at Scale<br></span></h4>
<p><span>Deep Neural Networks (DNNs) are a powerful technique and can yield near-human accuracy for tasks such as image classification, speech recognition and more. But building and training DNN models from scratch often requires special expertise, expensive compute resources and access to very large datasets. An additional challenge is that DNN libraries are not easy to integrate with SparkML pipelines. The data types and APIs are not readily compatible, requiring custom UDFs which introduce additional code complexity and data marshalling overheads.<br></span></p>
<p><span>With MMLSpark, we provide easy-to-use Python APIs that operate on Spark DataFrames and are integrated into the SparkML pipeline model. By using these APIs, you can rapidly build image analysis and computer vision pipelines that use the cutting-edge DNN algorithms. The capabilities include:<br></span></p>
<ul><li><span><em>DNN featurization: </em>Using a pre-trained model is a great approach when you&rsquo;re constrained by time or the amount of labeled data. You can use pre-trained state-of-the-art neural networks such as ResNet to extract high-order features from images in a scalable manner, and then pass these features to traditional ML models, such as logistic regression or decision forests.<br></span></li>
<li><span><em>Training on a GPU node: </em>Sometimes, your problem is so domain specific that a pre-trained model is not suitable, and you need to train your own DNN model. You can use Spark worker nodes to pre-process and condense large datasets prior to DNN training, then feed the data to a GPU VM for accelerated DNN training, and finally broadcast the model to worker nodes for scalable scoring.<br></span></li>
<li><span><em>Scalable image processing pipelines:</em> For a complete end-to-end workflow for image processing, DNN integration is not enough. Typically, you have to pre-process your images so they have the correct shape and normalization, before passing them to DNN models. In MMLSpark, you can use OpenCV-based image transformations to read in and prepare your data.<br></span></li>
</ul><p><span>Consider, for example, using a neural network to classify a collection of images. With MMLSpark, you can simply initialize a pre-trained model from <a href="https://www.microsoft.com/en-us/cognitive-toolkit/">Microsoft Cognitive Toolkit (CNTK)</a> and use it to featurize images with just few lines of code. We perform transfer learning by using a DNN to extract features from images, and then pass them to traditional ML algorithms such as logistic regression.<br></span></p>
<p><span><em>cntkModel = CNTKModel().setInputCol(&ldquo;images&rdquo;).setOutputCol(&ldquo;features&rdquo;).setModelLocation(resnetModel).setOutputNode(&ldquo;z.x&rdquo;)<br>
featurizedImages = cntkModel.transform(imagesWithLabels).select([&lsquo;labels&rsquo;,&rsquo;features&rsquo;])<br>
model = TrainClassifier(model=LogisticRegression(),labelCol=&rdquo;labels&rdquo;).fit(featurizedImages)<br></em></span></p>
<p><span>Note that the CNTKModel is a SparkML PipelineStage, so you can compose it with any SparkML transformations and estimators in scalable manner. For more examples, see our <a href="https://github.com/Azure/mmlspark/tree/master/notebooks/samples">Jupyter notebooks for image classification</a>.<br></span></p>
<h4><span>Open Source<br></span></h4>
<p><span>To make Spark better for everyone, we&rsquo;ve released MMLSpark as an Open Source project on GitHub &ndash; and we would welcome your contributions. For example, you can:<br></span></p>
<ul><li><span>Provide feedback as GitHub issues, to request features and report bugs.<br></span></li>
<li><span>Contribute documentation and examples.<br></span></li>
<li><span>Contribute new features and bug fixes, and participate in code reviews.<br></span></li>
</ul><h4><span>Getting Started<br></span></h4>
<p><span>You can quickly get started by installing the library on your local computer as a container from <a href="https://hub.docker.com/r/microsoft/mmlspark/">Docker Hub</a> using this one-line command:<br></span></p>
<p><span><em>docker run -it -p 8888:8888 -e ACCEPT_EULA=yes microsoft/mmlspark<br></em></span></p>
<p><span>Then, when you&rsquo;re ready to take your model to scale, you can install the library on your cluster as a Spark package. The library can be installed on any Spark 2.1 cluster, including on-premises, Azure HDInsight, and a Databricks cluster.<br></span></p>
<p><span>Take a look at our <a href="https://github.com/Azure/mmlspark">GitHub repository</a> for installation instructions, links to <a href="http://azuremlbuild.blob.core.windows.net/pysparkapi/index.html">documentation</a>, and <a href="https://github.com/Azure/mmlspark/tree/master/notebooks/samples">example Jupyter Notebooks</a>.<br></span></p>
<p><span>Roope &amp; Sudarshan<br></span></p>
<p><span><em>Apache&reg;, Apache Spark, and Spark&reg; are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.</em><br></span></p>]]></description>
						<author>Cortana Intelligence and ML Blog Team</author>
						<source url="https://blogs.technet.microsoft.com/machinelearning/feed/">Cortana Intelligence and Machine Learning Blog</source>
						<comments>https://blogs.technet.microsoft.com/machinelearning/2017/06/07/announcing-microsoft-machine-learning-library-for-apache-spark/feed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/in-case-you-missed-it-may-2017-roundup.html</guid>
						<pubDate>Tue, 06 Jun 2017 19:33:04 +0000</pubDate>
						<relativeTime>5 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[In case you missed it: May 2017 roundup]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/in-case-you-missed-it-may-2017-roundup.html</link>
						<description><![CDATA[<p>In case you missed them, here are some articles from May of particular interest to <a href="https://mran.microsoft.com/documents/what-is-r/" target="_self">R</a> users.</p>
<p>Many interesting <a href="http://blog.revolutionanalytics.com/2017/05/watch-rfinance-2017.html">presentations recorded at the R/Finance 2017 conference</a> in Chicago are now available to watch.</p>
<p>A review of some of the <a href="http://blog.revolutionanalytics.com/2017/05/runconf17.html">R packages and projects implemented at the 2017 ROpenSci Unconference</a>.</p>
<p>An example of applying <a href="http://blog.revolutionanalytics.com/2017/05/who-is-the-caretaker.html">Bayesian Learning with the "bnlearn" package</a> to challenge stereotypical assumptions</p>
<p>Data from the Billboard Hot 100 chart used to find the <a href="http://blog.revolutionanalytics.com/2017/05/love-is-all-around.html">most popular words in the titles of pop hits</a>.</p>
<p><a href="http://blog.revolutionanalytics.com/2017/05/microsoft-r-open-340-now-available.html">Microsoft R Open 3.4.0</a> is now available for Windows, Mac and Linux.</p>
<p>How to <a href="http://blog.revolutionanalytics.com/2017/05/tweenr.html">use the "tweenr" package to create smooth transitions</a> in data animations.&nbsp;</p>
<p>A preview of some of the companies and R applications to be presented at the <a href="http://blog.revolutionanalytics.com/2017/05/preview-of-earl-san-francisco.html">EARL conference in San Francisco</a>.</p>
<p>The <a href="http://blog.revolutionanalytics.com/2017/05/azuredsvm-a-new-r-package-for-elastic-use-of-the-azure-data-science-virtual-machine.html">AzureDSVM package</a> makes it easy to spawn and manage clusters of the Azure Data Science Virtual Machine.</p>
<p>An online&nbsp;<a href="http://blog.revolutionanalytics.com/2017/05/cdrc-spatial-course.html">course on spatial data analysis in R</a>, from the Consumer Data Research Centre in the UK.</p>
<p>Video and slides of Lixun Zhang's presentation "<a href="http://blog.revolutionanalytics.com/2017/05/r-in-financial-services-presentation.html">R in Financial Services: Challenges and Opportunity</a>" from the New York R Conference.</p>
<p>Visual Studio 2017 now features built-in support for both <a href="http://blog.revolutionanalytics.com/2017/05/r-and-python-support-now-built-in-to-visual-studio-2017.html">R and Python development</a>.</p>
<p>Quantifying the <a href="http://blog.revolutionanalytics.com/2017/05/analyzing-the-home-advantage-in-english-soccer-with-r.html">home-field advantage in English Premier League football</a>.</p>
<p>Using the new <code>CRAN_package_db</code> function to <a href="http://blog.revolutionanalytics.com/2017/05/analyzing-data-on-cran-packages.html">analyze data about CRAN packages</a>.</p>
<p>Stack Overflow Trends tracks the <a href="http://blog.revolutionanalytics.com/2017/05/stack-overflow-trends.html">trajectory of questions about R and Python</a>.</p>
<p>A recorded webinar on <a href="http://blog.revolutionanalytics.com/2017/05/hospital-length-of-stay.html">using Microsoft R to predict length of stay in hospitals</a>.</p>
<p>The new <a href="http://blog.revolutionanalytics.com/2017/05/real-time-scoring-with-mrs-91.html">"Real-Time Scoring" capability in Microsoft R Server</a> creates a service to generate predictions from certain models in milliseconds.</p>
<p>"<a href="http://blog.revolutionanalytics.com/2017/05/technical-foundations-of-informatics.html">Technical Foundations of Informatics</a>" is an open course guide on data analysis and visualization with R with a modern slant.</p>
<p>The <a href="http://blog.revolutionanalytics.com/2017/05/the-datasaurus-dozen.html">Datasaurus Dozen</a> generalizes Anscombe's Quartet with a process to create datasets of any shape with (nearly) the same summary statistics.</p>
<p>CareerCast ranks <a href="http://blog.revolutionanalytics.com/2017/05/best-job-i2017-statistican.html">Statistician as the best job to have in 2017</a>.</p>
<p>You can now <a href="http://blog.revolutionanalytics.com/2017/05/using-microsoft-r-with-alteryx.html">use Microsoft R within Alteryx Designer</a>.</p>
<p>How to clean messy data in Excel by <a href="http://blog.revolutionanalytics.com/2017/05/clean-messy-data-by-providing-examples-in-excel.html">providing just a few examples of transformations</a>.</p>
<p>And some general interest stories (not necessarily related to R):</p>
<ul><li><a href="http://blog.revolutionanalytics.com/2017/05/because-its-friday-history-of-australia.html">The history of Australia's states</a></li>
<li><a href="http://blog.revolutionanalytics.com/2017/05/the-history-of-the-universe-in-20-minutes.html">An amusingly animated history of the Universe</a></li>
<li><a href="http://blog.revolutionanalytics.com/2017/05/because-its-friday-video-projection.html">A Neural Network predicts a movie from just one frame</a></li>
<li><a href="http://blog.revolutionanalytics.com/2017/05/becasue-its-friday-bayesian-trap.html">The Bayesian Trap, explained</a></li>
</ul><p>As always, thanks for the comments and please send any suggestions to me at <a href="mailto:davidsmi@microsoft.com">davidsmi@microsoft.com</a>. Don't forget you can follow the blog using an RSS reader, via&nbsp;<a href="http://blogtrottr.com/" target="_self">email using blogtrottr</a>, or by following me on Twitter (I'm <a href="http://twitter.com/revodavid">@revodavid</a>). You can find roundups of previous months&nbsp;<a href="http://blog.revolutionanalytics.com/roundups/">here</a>.</p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/in-case-you-missed-it-may-2017-roundup.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">https://blogs.technet.microsoft.com/machinelearning/2017/06/06/introducing-the-new-data-science-virtual-machine-on-windows-server-2016/</guid>
						<pubDate>Tue, 06 Jun 2017 16:00:38 +0000</pubDate>
						<relativeTime>5 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Introducing the new Data Science Virtual Machine on Windows Server 2016]]></title>
						<link>https://blogs.technet.microsoft.com/machinelearning/2017/06/06/introducing-the-new-data-science-virtual-machine-on-windows-server-2016/</link>
						<description><![CDATA[<p><span><em>This post is authored by Udayan Kumar, Software Engineer at Microsoft.<br></em></span></p>
<p><span>We are excited to offer a <a href="https://aka.ms/dsvm/win2016">Windows Server 2016 version</a> of our very popular Microsoft Azure Data Science Virtual Machine (DSVM). This new DSVM version is based on the latest <a href="https://www.microsoft.com/en-us/cloud-platform/windows-server-comparison">Windows Server 2016 Data Center</a> edition. We&rsquo;ve added new tools and upgraded existing tools to the latest versions as part of this release. Highlights of these new additions include:<br></span></p>
<p><span>1. Windows Server 2016 with Docker container support, to run and design Windows containers. You can refer to the getting started guide <a href="https://docs.microsoft.com/en-us/virtualization/windowscontainers/index">here</a>.</span></p>
<p><span>2. Microsoft Office Pro-Plus with shared activation, including Excel, Word, OneNote, and PowerPoint. More Information about Microsoft Office Pro-Plus is <a href="https://products.office.com/en-us/business/office-365-proplus-business-software">here</a>. An Office 365 subscription or Office license is required.<br></span></p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060617_0018_Introducing1.gif"></p>
<p><span>3. Unified support for Deep Learning on GPU or CPU-only based virtual machines. Earlier, Windows DSVM users had to install the GPU based deep learning capabilities via an extension script on the Windows Server 2012 version of the DSVM. With this release, we are <em>pre-installing</em> the GPU Nvidia drivers, CUDA toolkit 8.0, and cuDNN library in the image. Along with it, we have also installed the latest GPU versions (these will also work with CPU-only machines) of the following popular deep learning frameworks: <a href="https://www.microsoft.com/en-us/cognitive-toolkit/">Microsoft Cognitive toolkit (CNTK)</a>, <a href="https://www.tensorflow.org/">TensorFlow</a>, <a href="http://mxnet.io/">Mxnet</a>.<br></span></p>
<div>
<table border="0"><colgroup><col></colgroup><tbody valign="top"><tr><td><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060617_0018_Introducing2.gif"></td>
</tr><tr><td><img width="551" height="245" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/DSVM-WS2016-v2.png"></td>
</tr></tbody></table></div>
<p><span><em>Note:</em> Compute GPUs based on NVidia Tesla K80 are offered as NC class virtual machines and are currently available in the South Central US, East US, West US 2, West Europe and South East Asia locations in Azure.</span><span><br></span></p>
<p><span>4. An upgrade to the latest Microsoft R Server 9.1. Major changes in this include cognitive models such as <a href="https://blogs.technet.microsoft.com/dataplatforminsider/2017/04/19/introducing-microsoft-r-server-9-1-release/">sentiment analysis &amp; image featurizers</a> as well as <a href="https://blogs.msdn.microsoft.com/rserver/2017/04/19/whats-new-in-r-server-9-1-operationalization/">enterprise-grade operationalization with real-time scoring and dynamic scaling of VMs</a>.</span></p>
<p><span>A complete list of available tools available on DSVM is <a href="https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-data-science-virtual-machine-overview">here</a>.<br></span></p>
<h4><span>Why DSVM<br></span></h4>
<ol><li><span><em>Because time is money. </em>DSVM allows users to get a data science desktop in the cloud without worrying about installation, configuration and maintenance. Since this environment is repeatable, you can destroy the machine as soon as you are done (of course, after saving your data on persistent storage).<br></span></li>
<li><span><em>Scale. </em>Leveraging the benefits of the cloud, DSVM also allows users to scale the machine as needed. For instance, if you&rsquo;re regularly using an 8GB RAM machine and you have a workload that needs more RAM or a GPU, you can elastically resize the machine into the desired configuration. Once again, once you&rsquo;re done, you can scale down or even shutdown the VM, reducing your compute costs.<br></span></li>
<li><span><em>Standardized work environment. </em>With the DSVM, all the users of an organization get the exact same standardized setup. No more &ldquo;but it works on my machine&rdquo; problem to deal with!<br></span></li>
</ol><h4><span>Get Started Today<br></span></h4>
<p><span>We invite you to explore the new <a href="https://aka.ms/dsvm/win2016">Windows Server 2016 based DSVM</a> for your machine learning, deep neural network, and data science projects. It&rsquo;s available on the <a href="https://aka.ms/dsvm/win2016">Azure Marketplace</a> today, to run on either CPU-only or GPU-based VMs. We also offer the DSVM in both <a href="http://aka.ms/dsvm/ubuntu">Ubuntu</a> and <a href="http://aka.ms/dsvm/centos">CentOS-based</a> Linux. <a href="http://azure.com/free">Free Azure credits</a> are available to help get you started.<br></span></p>
<p><span>Udayan<br></span></p>]]></description>
						<author>Cortana Intelligence and ML Blog Team</author>
						<source url="https://blogs.technet.microsoft.com/machinelearning/feed/">Cortana Intelligence and Machine Learning Blog</source>
						<comments>https://blogs.technet.microsoft.com/machinelearning/2017/06/06/introducing-the-new-data-science-virtual-machine-on-windows-server-2016/feed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">https://blogs.technet.microsoft.com/machinelearning/2017/06/05/microsoft-ai-now-serving-critical-care-patients-water-insecure-populations-in-africa-bank-customers-in-new-zealand-many-more/</guid>
						<pubDate>Mon, 05 Jun 2017 16:04:12 +0000</pubDate>
						<relativeTime>6 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Microsoft AI – Now Serving Critical Care Patients, Water-Insecure Populations in Africa, Bank Customers in New Zealand &#038; Many More]]></title>
						<link>https://blogs.technet.microsoft.com/machinelearning/2017/06/05/microsoft-ai-now-serving-critical-care-patients-water-insecure-populations-in-africa-bank-customers-in-new-zealand-many-more/</link>
						<description><![CDATA[<p><span><em>New customers are benefiting from Microsoft&rsquo;s Artificial Intelligence offerings at a record pace <span>&nbsp;&ndash; </span>here&rsquo;s a look at some of the latest.<br></em></span></p>
<h4><span>Saving the Lives of Patients in Critical Care<br></span></h4>
<p><span>A large part of our current healthcare system is geared towards treating patients only after they have fallen quite sick. While it would clearly be very desirable to proactively prevent debilitating medical incidents, doing so has been a formidable challenge.<br></span></p>
<p><span>Consider, for instance, a patient who has recently undergone major surgery, and whose condition might deteriorate rapidly, even fatally, within minutes because of a risk of multi-organ failure following that surgery. Even though the human body signals this type of failure in advance, such signals can be very subtle (e.g. momentary heart fluctuations, short episodes of breathing difficulty, profuse sweating that stops after a few minutes, etc.). The signals are also transient, so nurses and doctors may not catch them during their routine checks on the patient. However, medical sensors can detect and stream such signals in real-time to centralized monitoring systems which can then alert healthcare providers before something bad happens.<br></span></p>
<p><a href="http://kensci.com/"><span>KenSci</span></a><span> began as a collaboration between the University of Washington and Microsoft Research. Their unique team, comprised mostly of doctors and data scientists, share a passion around applying AI to help people live longer, healthier lives. KenSci is pioneering the use of machine learning in predictive healthcare risk management. By identifying which patients will get sick, when, how sick they&rsquo;ll get, and what can be done to help them, their solutions are helping patients, doctors, nurses, and other participants in our healthcare ecosystem.<br></span></p>
<p><span>KenSci uses data from electronic medical records and claims, as well as psychosocial, operational, and patient-generated data to align payers and providers around value-based care initiatives. The KenSci Risk Prediction platform, built on <a href="https://www.microsoft.com/en-us/cloud-platform/cortana-intelligence-suite">Microsoft&rsquo;s cloud and data technologies</a>, including <a href="https://azure.microsoft.com/en-us/services/machine-learning/">Azure Machine Learning</a>, is powered by over 150 prebuilt ML models, and predicts care and cost risks for 17 million patients today. These ML algorithms can identify patterns that indicate serious health deterioration in patients, sometimes as many as eight hours in advance.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/kensci-health-azure"><span>Read more about the KenSci story here</span></a><span> &ndash; it&rsquo;s a testimonial to how AI, IoT and cloud computing are coming together to save the lives of patients in critical care.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/kensci-health-azure"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060317_0026_MicrosoftAI1.png" border="0"></a><span><br></span></p>
<h4><span>Addressing Water Security in Kenya<br></span></h4>
<p><span>Millions of people around the globe live in a state of &ldquo;water insecurity&rdquo;, in the constant fear of not having enough water on a given day. The time spent finding and carrying water, if local wells are not reliable, steals precious time away from farming, making a living or going to school, and water issues are closely tied to a cycle of poverty.<br></span></p>
<p><span>The <a href="http://reachwater.org.uk/about-reach/">REACH initiative</a> is hoping to break this vicious cycle. Funded by the UK government, REACH is using the expertise of professors and machine learning experts from the University of Oxford and, in partnership with UNICEF and other organizations, working towards the goal of making five million poor people water-secure in Africa and Asia.<br></span></p>
<p><span>The team has developed sensors such as the ones that go into our smartphones or fitness bands and putting them inside water pump handles on rural wells. These sensors are used to monitor groundwater level and to improve the pace of repairs that may be needed to fix broken pumps. Their accelerometer and gyroscope record the motion and vibration of pump handles and, by applying machine learning techniques on this data, predicts whether the water is coming from a deep or a shallow source, and how much remains underground. These models were developed on a desktop computer but the team was able to accelerate their work by using the Azure cloud, including R and Python in <a href="https://azure.microsoft.com/en-us/services/machine-learning/">Azure Machine Learning</a>, which helped them go straight from lab to production.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/reach"><span>Learn more about the REACH story here</span></a><span>. Their solution is now getting ready for widespread deployment across Kenya, and they hope to bring similar benefits to water-insecure populations elsewhere.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/reach"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060317_0026_MicrosoftAI2.png" border="0"></a><span><br></span></p>
<h4><span>Providing Best-in-Class Banking to New Zealand Customers (by Switching from SAS to Microsoft)<br></span></h4>
<p><a href="https://www.heartland.co.nz/"><span>Heartland Bank</span></a><span> has served businesses, households, and the rural sector in New Zealand since 1875. To stay competitive with larger banks and newer internet payment services while still staying true to their customer-focused roots, the bank decided to adopt a data-driven approach that would lead to more business agility, innovation and growth.<br></span></p>
<p><span>There are specific product niches where Heartland is strong, each with its own requirements, such as around analyzing risk, evaluating credit lines, understanding cash flows etc., and it was increasingly critical for the bank to be proactive, providing early warnings when things were changing in any one of these areas. Heartland found it very labor-intensive and time-consuming to change financial models on their earlier SAS system. What&rsquo;s more, these analytics tools were expensive, being licensed on a per-user basis, thus limiting their access to only a small group of IT staff.<br></span></p>
<p><span>What Heartland needed was a flexible solution that would evolve and scale with the company. They wanted an analytics platform to support future innovation, with sophisticated predictive analytics capabilities. To support their growth strategy, the bank decided to replace their existing SAS system with a platform based on <a href="https://www.microsoft.com/en-us/cloud-platform/r-server">Microsoft R Server</a> and <a href="https://www.microsoft.com/en-us/sql-server/sql-server-2016">SQL Server 2016</a>. R Server uses the powerful, open source R statistical programming language which would enable Heartland to take advantage of a broad range of analytics, including big data statistics, predictive modeling, and machine learning. The bank also had the confidence that they could tap into a global community of millions of R developers.<br></span></p>
<p><span>The changes they made have sparked a new attitude towards data at Heartland. Business users across the bank can directly work with the new data models, rather than having to rely on IT to produce reports. Employees have direct access to real-time information and no longer need to wait for overnight batch processing. The expanded access to critical information has resulted in employees seeking answers to more complex questions and thus more sophisticated analytics. Bank employees are now able to get answers to questions such as &ldquo;What would happen to our deposits if we increased our six-month deposit rate by 20 basis points over the next three months?&rdquo; Many more exciting opportunities are on the horizon, such as using cognitive services for facial recognition, for instance, to compare the image on photo IDs with loan applicants, as an added layer of security.<br></span></p>
<p><span>You can <a href="http://customers.microsoft.com/en-us/story/heartlandbank">learn about the Heartland Bank story here</a>. Their partnership with Microsoft is helping them provide innovative, best-in-market products to customers across New Zealand.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/heartlandbank"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060317_0026_MicrosoftAI3.png" border="0"></a><span><br></span></p>
<h4><span>Boosting the ROI on Marketing Campaigns (by Switching from AWS to Azure)<br></span></h4>
<p><span>Silicon Valley startup <a href="http://www.trackrevenue.com/">Track Revenue</a> offers powerful marketing analytics software-as-a-service. Track Revenue helps advertisers optimize their return on investment (ROI) on online ads.<br></span></p>
<p><span>Although Track Revenue initially hosted their service on Amazon Web Services (AWS), when they were looking to launch the next generation of their service, after extensive evaluation, they decided to switch to Azure. Aside from unique technology advantages that the team could find only in Azure, Track Revenue also got strong engineering collaboration and support from Microsoft, as well as support for all their open source technology (which, as they discovered, was as good as or better than AWS, depending on the software). In many cases, they got comparable or better performance than AWS, and for significantly lower cost (for instance, with their use of Mongo virtual machines).<br></span></p>
<p><span>A key technology advantage they found in Azure was <a href="https://www.microsoft.com/en-us/cloud-platform/cortana-intelligence-suite">Cortana Intelligence</a>, a fully managed suite that delivers state of the art big data and AI capabilities on Azure. The suite, which includes <a href="https://azure.microsoft.com/en-us/services/machine-learning/">Azure Machine Learning</a>, helped Track Revenue transform customer data into intelligent action. When a user clicks on an ad, for instance, a set of data points are sent to the Cortana Intelligence Suite, and predictions based on those data points get sent back to Track Revenue. The Track Revenue service then serves the most appropriate landing page or offer to the potential buyer, with the entire process getting completed in milliseconds. This has helped Track Revenue optimize conversions and revenues, and in near real-time. Aside from making machine learning very easy, Cortana Intelligence also supported extensive custom configuration options, and proved to be a big win for Track Revenue, right out of the gate.<br></span></p>
<p><span>The interoperability between services was another factor that tipped the scales in Azure&rsquo;s favor. For example, Track Revenue is able to take advantage of streaming analytics, Event Hubs, Azure SQL Database, Azure SQL Data Warehouse, Redis Cache, Table Storage and more.<br></span></p>
<p><span>Based on tens of thousands of campaigns that are using their service, Track Revenue on Azure has boosted customers&rsquo; ROI by 15 percent, conversion rate by 12 percent, and earnings-per-click (EPC) by 38 percent (with some customers seeing EPC soar by as much as 47 percent). What&rsquo;s more, Track Revenue shaved months off the development of its new service by taking advantage of Azure, rather than their former cloud platform. In the end, Track Revenue wasn&rsquo;t content to move just their flagship service to Azure, they did a complete migration of their entire infrastructure to the Microsoft cloud service.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/this-maverick-moved-from-amazon-to-azure-and-boosted-customer-revenue-per-click-by-38-percent"><span>Learn more about Track Revenue here</span></a><span>. By betting on Azure, they&rsquo;ve successfully released a next-generation version of their service, one that extensively optimizes customers&rsquo; marketing campaigns.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/this-maverick-moved-from-amazon-to-azure-and-boosted-customer-revenue-per-click-by-38-percent"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060317_0026_MicrosoftAI4.png" border="0"></a><span><br></span></p>
<h4><span>Delivering Optimal Airline Seat Pricing, Blazing Fast<br></span></h4>
<p><span>The price of airline seats depends on thousands of factors that change very rapidly because of the dynamics of supply and demand. There can be tens of millions of price inquiries per hour and prices are affected by competitor prices, flight availability, weather changes, and network demand.<br></span></p>
<p><span>When airline companies &ndash; as well as top retailers and manufacturers &ndash; need competitive up-to-the-minute pricing, they turn to <a href="http://www.pros.com/">PROS</a>. PROS runs lightning-fast analytics on billions of records to deliver the right prices at the right time to their customers.<br></span></p>
<p><span>Until a few years ago, PROS software was deployed on-premises, either at the customer sites or in PROS&rsquo; private cloud. This naturally required large capital investments for hardware infrastructure, either on the part of PROS or their customers. If customers were to scale down or end their service subscription, they would be left with tons of unused hardware. Each datacenter also required a lot of manpower attached to it. Furthermore, when PROS acquired a couple of SaaS companies, they further saw how they could benefit by consolidating their infrastructure at a cloud provider.<br></span></p>
<p><span>PROS decided to move their operations to the <a href="https://azure.microsoft.com/en-us/">Azure cloud</a> and get out of the business of buying and managing hardware. In doing so, they found they could substantially lower their infrastructure costs. They also took advantage of <a href="https://www.microsoft.com/en-us/sql-server/sql-server-r-services">SQL Server 2016 with R Services</a>, which allows the same ML used by data scientists in their research to be used in production. Furthermore, R Services in SQL Server also brought scalable, R-based analytics into the very place where PROS&rsquo; data is generated, helping them improve database process performance by a factor of 100x. The company turned to <a href="https://azure.microsoft.com/en-us/solutions/data-lake/">Azure Data Lake</a> (ADL) to store unstructured data, running processes in ADL to interpret customer behavior, mine insights and determine the right price for the customer, while also helping their clients gain incremental revenue. With operations in the cloud, scaling is easy, and the company is now able to grow with the accelerating pace of demand.<br></span></p>
<p><span>You can read more about the <a href="http://customers.microsoft.com/en-us/story/pros">PROS case study here</a>. Using the power of the Azure intelligent cloud, PROS is able to deliver state of the art software-as-a-service (SaaS) solutions that run complex calculations on numerous data sources, and establish optimized prices with great speed, precision and consistency &ndash; and at a lower cost.<br></span></p>
<p><a href="http://customers.microsoft.com/en-us/story/pros"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060317_0026_MicrosoftAI5.png" border="0"></a><span><br></span></p>
<p><span>CIML Blog Team</span></p>]]></description>
						<author>Cortana Intelligence and ML Blog Team</author>
						<source url="https://blogs.technet.microsoft.com/machinelearning/feed/">Cortana Intelligence and Machine Learning Blog</source>
						<comments>https://blogs.technet.microsoft.com/machinelearning/2017/06/05/microsoft-ai-now-serving-critical-care-patients-water-insecure-populations-in-africa-bank-customers-in-new-zealand-many-more/feed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/power-bi-free-e-book.html</guid>
						<pubDate>Mon, 05 Jun 2017 13:51:36 +0000</pubDate>
						<relativeTime>6 days ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Powe[R] BI: Free e-book on using R with Power BI]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/power-bi-free-e-book.html</link>
						<description><![CDATA[<p>A new (and free!) <a href="https://www.blue-granite.com/power-bi-ebook">e-book on extending the capabilities of Power BI with R</a> is now available for download, from analytics consultancy BlueGranite. The introduction to the book explains why R and Power BI are a great match together:&nbsp;</p>
<p><a href="https://www.blue-granite.com/power-bi-ebook"><img alt="BlueGranite cover" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d2899403970c-200wi" title="BlueGranite cover"></a></p>
<blockquote>
<p>As a specialized, open source statistical environment, R represents the primary analysis language for a large number of data scientists and statisticians. In recent years, R has also undergone a significant shift in user base by gaining wider adoption in the business world.</p>
<p>By extending Power BI with R, Microsoft has opened up numerous opportunities to enhance your Business Intelligence solutions. In addition to its versatility for data science, R is a great language and ecosystem for work related to both data visualization and data processing. By incorporating R into its products, Microsoft has signaled a strong commitment from Microsoft not only to data science, but the R platform in general.</p>
</blockquote>
<p>The book provides a step-by-step guide to using R within Power BI, including:</p>
<ul><li>How to find, install and use pre-built custom visuals based on R withing Power BI</li>
<li>How to create your own&nbsp;R Visuals using the R language, and use them in both Power BI Desktop and the cloud-based&nbsp;Power BI Service</li>
<li>How to perform custom data processing with R scripts</li>
</ul><p>The e-book is available for download at the link below (free registration required). For more links to Power BI resources, you might also want to check out the blog post, "<a href="http://blog.revolutionanalytics.com/2016/08/powerbi-and-r.html">R with Power BI</a>".</p>
<p>BlueGranite: <a href="https://www.blue-granite.com/power-bi-ebook">Power[R] BI:&nbsp;Enhance Your Microsoft Power BI Experience</a>&nbsp;(<a href="https://dataveld.wordpress.com/2017/06/02/free-ebook-power-bi-enhance-your-microsoft-power-bi-experience-with-r/">via</a> David Eldersveld)</p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/power-bi-free-e-book.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/because-its-friday-disappearing-dots.html</guid>
						<pubDate>Fri, 02 Jun 2017 18:40:28 +0000</pubDate>
						<relativeTime>1 week ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Because it&#8217;s Friday: Disappearing Dots]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/because-its-friday-disappearing-dots.html</link>
						<description><![CDATA[<p>It's been <a href="http://blog.revolutionanalytics.com/2016/09/peripheral-illusions.html">a while</a> since we posted an optical illusion, and this one (<a href="https://twitter.com/galka_max/status/870371371590791168">via</a> Max Galka) jis ust too good to pass up. Here are the instructions, from <a href="https://whyevolutionistrue.wordpress.com/2014/09/02/why-do-the-dots-disappear/">the source</a>:</p>
<blockquote>
<div>First, look at any yellow dot as the figure moves. The yellow dot remains present and stationary. If you concentrate on all&nbsp;<em>three</em> yellow dots, they&nbsp;remain there as well.</div>
<div>&nbsp;</div>
<div>But now concentrate on the <em>central green dot</em>. You will see one or more of the yellow dots disappearing and then reappearing sporadically. They are not&mdash;this is an optical illusion. The dots remain and your brain simply <em>doesn&rsquo;t register their presence</em> from time to time. Weird, eh?</div>
</blockquote>
<p><img src="http://blog.revolutionanalytics.com/downloads/dots%20illusion.gif" width="500"></p>
<p>It's a bit of a puzzle why this one works. Why, for instance, is the rotating grid necessary? The mind works in mysterious ways.</p>
<p>That's all for us for this week. We'll be back on Monday, when we'll be checking in from the <a href="https://earlconf.com/sanfrancisco/">EARL Conference in San Francisco</a>. See you then, and have a great weekend!</p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/because-its-friday-disappearing-dots.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/teach-kids-about-r-with-minecraft.html</guid>
						<pubDate>Fri, 02 Jun 2017 15:19:42 +0000</pubDate>
						<relativeTime>1 week ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Teach kids about R with Minecraft]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/teach-kids-about-r-with-minecraft.html</link>
						<description><![CDATA[<p>As I <a href="http://blog.revolutionanalytics.com/2017/05/runconf17.html">mentioned</a> earlier this week, I was on a team at the ROpenSci Unconference (with&nbsp;<a href="https://github.com/geanders">Brooke Anderson</a>,&nbsp;<a href="https://github.com/kbroman">Karl Broman</a>,&nbsp;<a href="https://github.com/daroczig">Gergely Dar&oacute;czi</a>, and my Microsoft colleagues&nbsp;<a href="https://github.com/inchiosa">Mario Inchiosa</a>&nbsp;and&nbsp;<a href="https://github.com/revodavid"></a><a href="https://github.com/akzaidi">Ali Zaidi</a>) to work on a project to interface the <a href="https://mran.microsoft.com/documents/what-is-r/">R language</a> with <a href="https://minecraft.net/en-us/">Minecraft</a>. The resulting R package, <a href="https://github.com/ropenscilabs/miner">miner</a>, is now available to install from Github. The goal of the package is to introduce budding programmers to the R language via their interest in Minecraft, and to that end there's also a book (<a href="https://ropenscilabs.github.io/miner_book/index.html">R Programming with Minecraft</a>) and associated R package (<a href="https://github.com/ROpenSciLabs/craft">craft</a>) under development to provide lots of fun examples of manipulating the Minecraft world with R.</p>
<div><a href="https://ropenscilabs.github.io/miner_book/rendering-the-r-logo-in-minecraft.html"><img alt="Rlogo_minecraft" src="http://a2.typepad.com/6a0105360ba1c6970c01bb09a19c32970d-450wi" title="Rlogo_minecraft"></a>
<div>Create objects in Minecraft with R functions</div>
</div>
<p>If you're a parent you're probably already aware of the Minecraft phenomenon, but if not: it's kinda like the Lego of the digital generation. Kids (and kids-and-heart) enter a virtual 3-D world composed of cubes representing ground, water, trees and other materials, and use those cubes to build their own structures, which they can then explore with their friends using their in-game avatars. Inspired by the&nbsp;Python-focused book "<a href="https://www.nostarch.com/programwithminecraft">Learn to program with Minecraft</a>", Karl had the brilliant idea of building a similar interface around R.&nbsp;</p>
<p>The miner package provides just a few simple functions to manipulate the game world: find or move a player's position;&nbsp;add or remove blocks in the world; send a message to all players in the world. The functions are deliberately simple, designed to be used to build more complex tasks. For example, you could write a function to detect when a player is standing in a hole. It uses the <code>getPlayerIds</code> and <code>getPlayerPos</code> functions to find the ID and locations of all players in the world, and the <code>getBlocks</code> function to check if the player is surrounded by blocks that are not code <code>0</code> (air).</p>
<p>The&nbsp;package also provides are also a couple of "listener" functions: you can detect player chat messages, or when players strike a block with their sword. You can then use to write functions to react to player actions. For example, you can write a <a href="https://ropenscilabs.github.io/miner_book/number-guess-chat-bot-in-minecraft.html">chat-bot to play a game with the player</a>, create an <a href="https://ropenscilabs.github.io/miner_book/random-walks-in-the-minecraft-world.html">AI to solve an in-game maze</a>, or give the player the power's of Elsa from <a href="http://www.imdb.com/title/tt2294629/">Frozen</a> to <a href="https://github.com/ropenscilabs/craft/blob/master/R/elsafy.R">freeze water by walking on it</a>:&nbsp;</p>
<p></p>
<p>To get started with the miner package, you'll need to <a href="https://minecraft.net/en-us/store/?ref=m">purchase a copy of Minecraft</a>&nbsp;for Windows, Mac or Linux if you don't have one already. (Note: the Windows 10 version from the Microsoft Store isn't compatible with the miner package.) This is what you'll use to explore the world managed by the Minecraft server, which you'll also need to install along with <a href="https://dev.bukkit.org/projects/raspberryjuice">RaspberryJuice</a> plugin. You can find setup details in the <a href="https://github.com/ropenscilabs/miner/blob/master/vignettes/miner.Rmd">miner package vignette</a>. We installed the open-source&nbsp;<a href="https://www.spigotmc.org/">Spigot</a>&nbsp;server on a Ubuntu VM running in Azure; you might find this <a href="https://github.com/ropenscilabs/miner/blob/master/extra_vignettes/Dockerfile">Dockerfile</a> helpful if you're trying something similar.</p>
<p>The miner package and craft package available to install from Github at the link below. The packages are a work-in-progress: comments, suggestions, pull-requests and additional examples for the <a href="https://ropenscilabs.github.io/miner_book/index.html">R Programming with Minecraft book</a>&nbsp;are most welcome!</p>
<p>Github (ROpenSci labs): <a href="https://github.com/ROpenSciLabs/miner">miner</a> and <a href="https://github.com/ropenscilabs/craft">craft</a></p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/teach-kids-about-r-with-minecraft.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">https://blogs.msdn.microsoft.com/sqlcat/2017/06/02/performance-impact-of-memory-grants-on-data-loads-into-columnstore-tables/</guid>
						<pubDate>Fri, 02 Jun 2017 15:10:23 +0000</pubDate>
						<relativeTime>1 week ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Performance impact of memory grants on data loads into Columnstore tables]]></title>
						<link>https://blogs.msdn.microsoft.com/sqlcat/2017/06/02/performance-impact-of-memory-grants-on-data-loads-into-columnstore-tables/</link>
						<description><![CDATA[<p><strong><em>Reviewed by:</em></strong><em> Dimitri Furman, Sanjay Mishra, Mike Weiner, Arvind Shyamsundar, Kun Cheng, Suresh Kandoth</em></p>
<h2>Background</h2>
<p>Some of the best practices when bulk inserting into a clustered Columnstore table are:</p>
<ul><li>Specifying a batch size close to 1048576 rows, or at least greater than 102400 rows, so that they land into compressed row groups directly.</li>
<li>Using concurrent bulk loads if you want to reduce the time to load.</li>
</ul><p>For additional details, see the blog post titled <a href="https://blogs.msdn.microsoft.com/sqlcat/2015/03/11/data-loading-performance-considerations-with-clustered-columnstore-indexes/">Data Loading performance considerations with Clustered Columnstore</a><span> indexes,</span> specifically the Concurrent Loading section.</p>
<h2>Customer Scenario</h2>
<p>I was working on a customer engagement SQL Server 2017 CTP 2.0 on Linux with a Columnstore implementation, where the speed of the load process was of critical importance to the customer.</p>
<ul><li>Data was being loaded concurrently from 4 jobs, each one loading a separate table.</li>
<li>Each job spawned 15 threads, so in total there were 60 threads concurrently bulk loading data into the database.</li>
<li>Each thread specified the commit batch size to be 1048576.</li>
</ul><h2>Observations</h2>
<p>When we tested with 1 or 2 jobs, resulting in 15 or 30 concurrent threads loading, performance was great. Using the concurrent approach, we had greatly reduced the load time. However, when we increased the number of jobs to 4 jobs running concurrently, or 60 concurrent threads loading, the overall load time more than doubled.</p>
<h2>Digging into the problem</h2>
<p>Just like in any performance troubleshooting case, we checked physical resources, but found no bottleneck in CPU, Disk IO, or memory at the server level. &nbsp;CPU on the server was hovering around 30% for the 60 concurrent threads, and that was almost the same as with 30 concurrent threads. Mid-way into job execution, we also checked DMVs such as sys.dm_exec_requests and sys.dm_os_wait_stats, and saw that INSERT BULK statements were executing, but there was no predominant wait. Periodically, there was LATCH contention, which made little sense &ndash; given the ~1 million batch sizes, data from each bulk insert session should have landed directly in its own compressed row group.</p>
<p>Then we spot checked the row group physical stats DMVs, and observed that despite the batch size specified, the rows were landing in the delta , and not into the compressed row groups directly, as we expected they would.</p>
<p><em>Below is an example of what we observed from sys.dm_db_column_store_row_group_physical_stats:</em></p>
<pre>
select row_group_id, delta_store_hobt_id,state_desc,total_rows,trim_reason_desc
from sys.dm_db_column_store_row_group_physical_stats
where object_id = object_id('MyTable')
</pre>
<p><a href="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg1.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg1.png" alt="" width="707" height="57"></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>As you may recall from the previously referenced blog, inserting into the delta store, instead of into compressed row groups directly, can significantly impact performance. This also explained the latch contention we saw since we were inserting from many threads into the same btree.&nbsp; At first, we suspected that the code was setting the batch size incorrectly, but then we ran an XEvent session and observed the batch size of 1 million specified as expected, so that wasn&rsquo;t a factor. I didn&rsquo;t know of any factors that caused a bulk insert to revert to delta store when it was supposed to go to compressed row groups. Hence, we collected a full set of diagnostics for a run using <a href="https://github.com/Microsoft/DiagManager/wiki/Running-PSSDiag">PSSDIAG</a><span>,</span> and did some post analysis.</p>
<h2>Getting closer&hellip;</h2>
<p>We found that only at the beginning of the run, there was contention on memory grants (RESOURCE_SEMAPHORE waits), for a short period of time. After that and later into the process, we could see some latch contention on regular data pages, which we didn&rsquo;t expect as each thread was supposed to insert into its own row group. You would also see this same data by querying sys.dm_exec_requests live, if you caught it within the first minute of execution, as displayed below.</p>
<p></p><div><a href="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg2.jpg" alt="" width="1294" height="476"></a><p><strong>&nbsp;Figure 1</strong>: Snapshot of sys.dm_exec_requests</p></div>
<p><strong><em></em></strong>Looking at the memory grant DMV <a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-query-memory-grants-transact-sql">sys.dm_exec_query_memory_grants</a>, we observed that at the beginning of the data load, there was memory grant contention. Also, interestingly, each session had a grant of ~5GB (granted_memory_kb), but was using only ~1GB (used_memory_). When loading data from a file, the optimizer doesn&rsquo;t have knowledge of number of rows in the file and memory grant is estimated based on the schema of the table, taking into account maximum length of variable length columns defined. In this specific case, this server was commodity hardware with 240 GB of memory. Memory grants of 5 GB per thread across 60 threads exceeded the total memory on the box. If this were a larger machine, this situation would not arise. You can also observe multiple sessions that have requested memory, but memory has not yet been granted (second and third rows in the snapshot in <strong><em>Figure 2</em></strong>). See additional details on memory grants <a href="https://blogs.msdn.microsoft.com/sqlqueryprocessing/2010/02/16/understanding-sql-server-memory-grant/">here</a>.</p>
<p></p><div><a href="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg3.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg3.jpg" alt="" width="1331" height="171"></a><p><strong>Figure 2:</strong> Snapshot of sys.dm_exec_query_memory_grants</p></div>
<h2>Root cause discovered!</h2>
<p>We still didn&rsquo;t know the reason for reverting into delta store, but armed with the knowledge that there was some kind of memory grant contention, we created an extended event session on the query_memory_grant_wait_begin and query_memory_grant_wait_end events, to see if there were some memory grant timeouts that caused this behavior. This XE session did strike gold; we were able to see several memory grants time out after 25 seconds and could correlate these session_ids to the same session_ids that were doing the INSERT BULK commands.</p>
<p></p><div><a href="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg4.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg4.jpg" alt="" width="933" height="455"></a><p><strong>Figure 3:</strong> Output of Extended event collection. Duration of wait is the difference between the query_memory_grant_wait_end and query_memory_grant_wait_begin time for that specific session.</p></div>
<p>Collecting a stack on the query_memory_grant_wait_begin extended event and with some source code analysis, we found out the root cause for this behavior. For every bulk insert we first determine whether it can go into a compressed row group directly based on batch size. If it can, we request a memory grant &nbsp;with a timeout of 25 seconds. If we cannot acquire the memory grant in 25 seconds, that bulk insert reverts to the delta store instead of compressed row group.</p>
<h2>Working around the issue</h2>
<p>Given our prior dm_exec_query_memory_grants diagnostic data, you could also observe from <strong><em>Figure 2 </em></strong>that we asked for a 5GB grant, but used only 1GB. There was room to reduce the grant size, to avoid memory grant contention, and still maintain performance. Therefore, we created and used&nbsp;a resource governor workload group that reduced the grant percent parameter to allow greater concurrency during data load. We then tied this workload group via a classifier function for just the login that the data load jobs were executed under. We first lowered the grant percentage to 10% from the default %, but even at that level, we couldn&rsquo;t sustain 60 sessions concurrently bulk loading due to RESOURCE_SEMAPHORE waits, as each memory grant requested was still 5 GB. We iterated on the grant percentage a couple times, lowering it until we landed at 2% for this specific data load. Setting it to 2% means that we are preventing a query from being able to get a memory grant greater than 2% of the target_memory_kb value in the DMV <a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-query-resource-semaphores-transact-sql">sys.dm_exec_query_resource_semaphores</a>. Binding the specific login that was only used for data load jobs to the workload group prevented this configuration from affecting the rest of the workload. Only load queries ended up in the workload group with the 2% limit on memory grants, while the rest of the workload used the default workload group configuration. At 2%, the memory grant requested for each thread was around 1GB, and allowed the level of concurrency we were looking for.</p>
<pre>
-- Create a Workload group for Data Loading
CREATE WORKLOAD GROUP DataLoading
WITH (REQUEST_MAX_MEMORY_GRANT_PERCENT = 2)

-- If the Login is DataLoad it will go to workload group DataLoading
DROP FUNCTION IF EXISTS DBO.CLASSIFIER_LOGIN
GO
CREATE FUNCTION CLASSIFIER_LOGIN ()
RETURNS SYSNAME WITH SCHEMABINDING
BEGIN
DECLARE @val varchar(32) = 'default';
IF 'DataLoad' = SUSER_SNAME()
SET @val = 'DataLoading';
RETURN @val;
END
GO
-- Make function known to the Resource Governor as its classifier
ALTER RESOURCE GOVERNOR WITH (CLASSIFIER_FUNCTION = dbo.CLASSIFIER_LOGIN)
GO
</pre>
<p><strong>Note:</strong> Usually with memory grants, you can often use <a href="https://blogs.msdn.microsoft.com/psssql/2016/06/09/new-memory-grant-query-hint-min_grant_percent-came-to-rescue/">query level hints</a> MAX_GRANT_PERCENT and MIN_GRANT_PERCENT. In this case given it was an ETL workflow there wasn&rsquo;t a user defined query to add the hint for example in the case of an SSIS package.</p>
<h2>Final Result</h2>
<p>Once we did that, our 4 Jobs could execute in parallel (60 threads loading data simultaneously) in the same timeframe that our prior 2 Jobs, reducing total data load time significantly. Running 4 jobs in parallel in almost the same interval of time allowed us to load twice the amount of data, increasing our data load throughput.</p>
<table width="979"><tbody><tr><td width="86"><strong>Concurrent Load Jobs</strong></td>
<td width="66"><strong>Tables Loaded</strong></td>
<td width="64"><strong>Threads loading data</strong></td>
<td width="282"><strong>RG Configuration</strong></td>
<td width="126"><strong>Data Load Elapsed Time &nbsp;(sec)</strong></td>
</tr><tr><td width="86">2</td>
<td width="66">2</td>
<td width="64">30</td>
<td width="282">Default</td>
<td width="126">2040</td>
</tr><tr><td width="86">4</td>
<td width="66">4</td>
<td width="64">60</td>
<td width="282">Default</td>
<td width="126">4160</td>
</tr><tr><td width="86">4</td>
<td width="66">4</td>
<td width="64">60</td>
<td width="282">REQUEST_MAX_MEMORY_GRANT_PERCENT = 2</td>
<td width="126">1040</td>
</tr></tbody></table><p>We could drive CPU to almost 100% now, compared to 30% before the Resource Governor changes.</p>
<p></p><div><a href="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg5.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2017/06/memgrantimg5.jpg" alt="" width="500" height="252"></a><p><strong>Figure 4:</strong> CPU Utilization Chart</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>Concurrently loading data into clustered Columnstore indexes requires some considerations including memory grants. Use the techniques outlined in this article to identify if you are running into similar bottlenecks related to memory grants, and if so use the Resource Governor to adjust the granted memory to allow for higher concurrency. We hope you enjoyed reading this as much as we enjoyed bringing it to you! Feedback in the Comments&nbsp;welcome.</p>]]></description>
						<author>Denzil Ribeiro</author>
						<source url="https://blogs.msdn.microsoft.com/sqlcat/feed/">SQL Server Customer Advisory Team</source>
						<comments>https://blogs.msdn.microsoft.com/sqlcat/2017/06/02/performance-impact-of-memory-grants-on-data-loads-into-columnstore-tables/feed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">http://blog.revolutionanalytics.com/2017/06/python-and-r-top-2017-kdnuggets-rankings.html</guid>
						<pubDate>Thu, 01 Jun 2017 21:30:03 +0000</pubDate>
						<relativeTime>1 week ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[Python and R top 2017 KDnuggets rankings]]></title>
						<link>http://blog.revolutionanalytics.com/2017/06/python-and-r-top-2017-kdnuggets-rankings.html</link>
						<description><![CDATA[<p>The <a href="http://www.kdnuggets.com/2017/05/poll-analytics-data-science-machine-learning-software-leaders.html">results of KDnuggets' 18th annual poll of data science software usage</a>&nbsp;are in, and for the first time in three years Python has edged out R as the most popular software. While R increased its share of usage from 45.7% in last year's poll to 52.1% this year, Python's usage among data scientists increased even more, from 36.6% of users in 2016 to 52.6% of users this year.</p>
<p><a href="http://www.kdnuggets.com/2017/05/poll-analytics-data-science-machine-learning-software-leaders.html"><img alt="KDnuggets2017" border="0" src="http://a3.typepad.com/6a0105360ba1c6970c01bb09a1646b970d-800wi" title="KDnuggets2017"></a></p>
<p>There were some interesting moves in the long tail, as well. Several tools&nbsp;entered the KDNuggets chart for the first time,&nbsp;including Keras (9.5% of users), PyCharm (9.0%) and Microsoft R Server (4.3%). And several returning tools saw big jumps in usage, including Microsoft Cognitive Toolkit (3.4% of users), Tensorflow (20.2%) and Power BI (10.2%). Microsoft SQL Server increased its share to 11.6% (up from 10.8%), whereas SAS (7.1%) and Matlab (7.4%) saw declines. Julia, somewhat surprisingly, remained flat at 1.1%.</p>
<p>For the complete results and analysis of the 2017 KDnuggets data science software poll, follow the link below.</p>
<p>KDnuggets: <a href="http://www.kdnuggets.com/2017/05/poll-analytics-data-science-machine-learning-software-leaders.html/">New Leader, Trends, and Surprises in Analytics, Data Science, Machine Learning Software Poll</a></p>]]></description>
						<author>David Smith</author>
						<source url="http://blog.revolutionanalytics.com/atom.xml">Revolutions</source>
						<comments>http://blog.revolutionanalytics.com/2017/06/python-and-r-top-2017-kdnuggets-rankings.htmlfeed</comments>
					</item>
        
					<item>
						<guid isPermaLink="true">https://blogs.technet.microsoft.com/machinelearning/2017/06/01/announcing-ga-of-cognitive-toolkit-2-0-microsofts-open-source-enterprise-ready-tensorflow-outperforming-ai-offering/</guid>
						<pubDate>Thu, 01 Jun 2017 18:15:16 +0000</pubDate>
						<relativeTime>1 week ago</relativeTime>
						<channelId>DataPlatform</channelId>
						<title><![CDATA[GA of Cognitive Toolkit 2.0 – Microsoft’s Open Source, Enterprise-Ready, TensorFlow-Outperforming AI Toolkit]]></title>
						<link>https://blogs.technet.microsoft.com/machinelearning/2017/06/01/announcing-ga-of-cognitive-toolkit-2-0-microsofts-open-source-enterprise-ready-tensorflow-outperforming-ai-offering/</link>
						<description><![CDATA[<p><span><em>Re-posted from the Microsoft Next blog and the Cognitive Toolkit blog.<br></em></span></p>
<p><span>We&rsquo;re excited to announce the general availability of <a href="https://github.com/Microsoft/CNTK">Cognitive Toolkit 2.0</a>, Microsoft&rsquo;s open source, enterprise-ready, production-grade AI offering. Cognitive Toolkit allows users to create, train, and evaluate their own neural networks that can then scale efficiently across multiple GPUs and machines on massive data sets. Cognitive Toolkit is being used extensively by companies worldwide with a need to deploy deep learning at scale, and by a wide variety of Microsoft products as well as students and academics worldwide.&nbsp;</span><span>Key upgrades in this new version of the toolkit (which was formerly known as CNTK) include:<br></span></p>
<ul><li><span>A preview of Keras support natively running on Cognitive Toolkit.<br></span></li>
<li><span>Java bindings and Spark support for model evaluation.<br></span></li>
<li><span>Model compression to increase the speed of evaluating a trained model on CPUs.<br></span></li>
<li><span>Hundreds of additional features and fixes since our beta was introduced.<br></span></li>
<li><span>Performance improvements that make it the <strong>fastest deep learning framework</strong>. </span>
<ul><li><span>Cognitive Toolkit ranked #1 in a performance benchmark against other similar platforms, as seen in the results of the independently run performance tests below. </span><span>This particular test was on a single GPU; on multiple GPUs, the performance gets even better with scale, more information is available at the <a href="https://www.microsoft.com/en-us/cognitive-toolkit/blog/2017/06/microsofts-high-performance-open-source-deep-learning-toolkit-now-generally-available/">original post here</a>.<br></span></li>
</ul></li>
</ul><p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060117_1758_Announcingt1.png"><br><span><em>Source: <a href="http://dlbench.comp.hkbu.edu.hk/">http://dlbench.comp.hkbu.edu.hk/</a>&nbsp;</em></span></p>
<p><span>To cite one customer example, the <a href="http://chesapeakeconservancy.org/">Chesapeake Conservancy</a> is using the toolkit to train a neural network to speed up the creation of one-meter resolution land cover datasets, to be used in prioritizing restoration and protection efforts in the Chesapeake Bay, an area spanning 64,000 square miles in six states and Washington, D.C. Learn more <a href="https://blogs.microsoft.com/next/2017/06/01/microsoft-releases-open-source-toolkit-to-accelerate-deep-learning/">here</a>.<br></span></p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/060117_1758_Announcingt2.jpg"><br><span><em>The Chesapeake Conservancy uses Cognitive Toolkit to create land cover datasets that are used to monitor restoration and protection initiatives throughout the Chesapeake Bay. (Photo credit: Chesapeake Conservancy.)</em></span></p>
<p><span>You can learn more about this latest release of Cognitive Toolkit from the <a href="https://blogs.microsoft.com/next/2017/06/01/microsoft-releases-open-source-toolkit-to-accelerate-deep-learning/">original announcement here</a> or this <a href="https://www.microsoft.com/en-us/cognitive-toolkit/blog/2017/06/microsofts-high-performance-open-source-deep-learning-toolkit-now-generally-available/">developer-friendly blog post</a>. </span><span>We&rsquo;ve even compiled a set of compelling reasons <a href="https://github.com/Microsoft/CNTK/wiki/Eight-Reasons-to-Switch-from-TensorFlow-to-CNTK">why data scientists and developers using other frameworks should switch to Cognitive Toolkit today</a>. </span></p>
<p><span>Go ahead and get started on building cool AI apps right away, Cognitive Toolkit 2.0 is available on <a href="https://github.com/Microsoft/CNTK">GitHub</a>.<br></span></p>
<p><span>CIML Blog Team</span></p>]]></description>
						<author>Cortana Intelligence and ML Blog Team</author>
						<source url="https://blogs.technet.microsoft.com/machinelearning/feed/">Cortana Intelligence and Machine Learning Blog</source>
						<comments>https://blogs.technet.microsoft.com/machinelearning/2017/06/01/announcing-ga-of-cognitive-toolkit-2-0-microsofts-open-source-enterprise-ready-tensorflow-outperforming-ai-offering/feed</comments>
					</item>
        			</channel>
		</rss>
  