MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# Generate a generic 2D Gaussian like array?

# Generate a generic 2D Gaussian like array?

Generate a generic 2D Gaussian like array

So this recipe is a short example on how to generate a generic 2D Gaussian-like array. Let's get started.

```
import numpy as np
```

Let's pause and look at these imports. Numpy is generally helpful in data manipulation while working with arrays. It also helps in performing mathematical operation.

```
x, y = np.meshgrid(np.linspace(-1,1,10), np.linspace(-1,1,10))
d = np.sqrt(x*x+y*y)
sigma, mu = 1.0, 0.0
g = np.exp(-( (d-mu)**2 / ( 2.0 * sigma**2 ) ) )
```

Let's have a loop at each step one by one. One first step, we have created two, 2D arrays, using meshgrid and linespace function. Meshgrid basically creates a rectangular grid out of two given one-dimensional array. Linespace returns number spaces evenly w.r.t interval. In 2nd step, we are calculating the square-roots of squares of s and y. Finally, using exp function, we are genearating the guassian array.

```
print(g)
```

Simply using print function, we have print our gaussian array.

Once we run the above code snippet, we will see:

Scroll down to the ipython file below to visualize the output.

In this machine learning churn project, we implement a churn prediction model in python using ensemble techniques.

Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

In this ensemble machine learning project, we will predict what kind of claims an insurance company will get. This is implemented in python using ensemble machine learning algorithms.

In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

Machine Learning Project - Work with KKBOX's Music Recommendation System dataset to build the best music recommendation engine.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.