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 project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.

In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.

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

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

Use the Adult Income dataset to predict whether income exceeds 50K yr based on
census data.

In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.