I introduce two useful tools, website and software, for sketching and testing online an Automaton DFA, NFA, eNFA or a regex.

1-

`http://ivanzuzak.info/noam/webapps/fsm_simulator/`

2-

`http://www.jflap.org/`

3- comparison

If you know more please complete me.

A curated list of amazingly awesome PHP libraries, resources and shiny things.

A curated list of awesome Python frameworks, libraries, software and resources.

I want to introduce a feature that can make your Git experience simpler, easier, and more familiar: aliases or shorthands

Git doesn’t automatically infer your command if you type it in partially. If you don’t want to type the entire text of each of the Git commands, you can easily set up an alias for each command using `git config`

. Here are a couple of examples you may want to set up:

`$ git config --global alias.co checkout`

$ git config --global alias.br branch

$ git config --global alias.ci commit

$ git config --global alias.st status

**Quick note:**

On unix, use single quotes if the alias has a…

**Issue:**

If you encounter such error when launching jupyter using Anaconda:

`no such file or directory: Users/my_name/opt/anaconda3/bin/jupyter_mac.command`

and while for ZSH you are using the plugin Oh-My-Zsh and also iTerm for terminal,

**Solution:**

The solution is only open iTerm and then **upgrade it**.

For Catalina read this.

I am going to explain how to obtain equation (2) of the paper “Exercises in EM” by:

Flury, Bernard and Zoppe, Alice. Exercises in EM. The American Statistician, Vol. 54, №3, August 2000.

In equation (2) of the paper, we see the **Expected value** for two cases (two categories of lamps (light bulbs) ) are obtained as:

We know exponential distribution as the :

*exp*(-λ*t*)

Where

`λ`

is the rate or the probability of “failing/expiring” lamps over the unit of time, and

*exp*(- λ*t*)

is the probability of a lamp to be alive until time *t**.*

So we can say the probability of expiring a lamp at time** t**

**Attention:** All the below arrays are numpy arrays.

Imagine we have a 3d array (A) with this shape:

`A.shape = (a,b,c)`

Now we want to convert it to a 2d array (B) with this shape:

`B.shape = (a*b, c)`

The rule is:

`B = A.reshape(-1,c)`

When we use **-1** in reshape() method, it means we multiply the first two dimensions.

`D = A.reshape(a,-1)`

result is a 2d array with this shape:

`D.shape = (a, b*c)`

If we want to have a 2d array (E) with the shape:

`E.shape = (c, a*b)`

From the 3d array (A), where its shape is

`A.shape =…`

Models can have many hyperparameters and finding the best combination of parameters can be treated as a search problem.

Although there are many hyperparameter optimization/tuning algorithms now, this post shows a simple strategy which is grid search. Read more here

In scikit learn, there is **GridSearchCV** method which easily finds the optimum hyperparameters among the given values.

**As an example:**

mlp_gs= MLPClassifier(max_iter=100)parameter_space = {

'hidden_layer_sizes': [(10,30,10),(20,)],

'activation': ['tanh', 'relu'],

'solver': ['sgd', 'adam'],

'alpha': [0.0001, 0.05],

'learning_rate': ['constant','adaptive'],

}from sklearn.model_selection importGridSearchCVclf =GridSearchCV(mlp_gs, parameter_space, n_jobs=-1, cv=5)

clf.fit(X, …

To change the default of sklearn metrics package we should do:

fig,ax= plt.subplots(figsize=(20, 20))plot_confusion_matrix(clf, X_test, y_test, cmap=plt.cm.Blues,ax=ax)plot.show()

example:

from sklearn.metrics import plot_confusion_matrixfig, ax = plt.subplots(figsize=(15, 15))

plot_confusion_matrix(slf_4, X_test, y_test, normalize='true', cmap=plt.cm.Blues, ax=ax)

plt.show()

To get the mean value, you first need to know that **axis 1** is assumed as row and **axis 0** is assumed as column.

**a** is an array, so:

`np.mean(a, axis=0)`

or

`np.mean(a, axis=1)`

depending on what axis you want to average on.

example:

About