To Return Function with Function in Python

Advertisements

Map/Reduce in Python with Quick Function Examples

We have map and reduce functions in Python. They both take two inputs, a function and a list/tuple. Map can apply the function on multiple elements within the list/tuple. Reduce can apply the function with the first two elements, get the result, and apply the function with the result and the 3rd element. To convert… Continue reading Map/Reduce in Python with Quick Function Examples

Notes for List, Tuple, Set and Dict in Python with Functions

Syntax set: ([]), dict: {}, list:[],  tuple:() Only List is mutable. To insert python code into wordpress with original Tab Space, we have to go to HTML version to edit the code The following is a quick example of higher order function(or compound function) The following is a quick example of list with format checking(or… Continue reading Notes for List, Tuple, Set and Dict in Python with Functions

Quick Example of Parallel Computation in R for SVM/Random Forest, with MNIST and Credit Data

It is generally acknowledged that SVM algorithm is relatively slow to train, even with tuning parameters such as cost and kernel. The general way to boost the speed is to apply packages of "parallel" "do parallel" "doSNOW" and for each function. Data and background: Data and background: https://charleshsliao.wordpress.com/2017/02/24/svm-tuning-based-on-mnist/ It is not ensured that we can increase… Continue reading Quick Example of Parallel Computation in R for SVM/Random Forest, with MNIST and Credit Data

Two Ways of Visualization of MNIST with R

Background: https://charleshsliao.wordpress.com/2017/02/24/svm-tuning-based-on-mnist/ To load data of MNIST and visualize it would be significant for future exploration, and here are two ways to do it. 1.Load data first, visualize single digit as necessity. 1.1 Load Data build histograms to see the distribution of digits: 1.2Visualize 2. Visualize certain number of digits to have a big picture of… Continue reading Two Ways of Visualization of MNIST with R