Suppose we have an image of a wave:

This wave is inverse transformed to one in the frequency coordinates. To do so, use short time fourier transform. Here we use method signal.stft from scipy:

where fs is the sampling frequency. Then plot it

Last year I wrote a blog article regarding decision tree. I’ve put relating code here.

simple_salesforce allows us to do it

API simple_salesforce allows us to access Salesforce. And we can use it to post a message to Salesforce’s Chatter.

Then access to Salesforce is provided by username, password, and security token. (We can access Salesforce using username, password, and organizationId as well.)

Then, we use restful method and json to post a message to Chatter.

Here user_id is the id of the user whom we send a message.

Get a basic insight

In python pandas, axis=0 means that a dataframe (table) is processed in the way that a row is a building block. For instance, you use pandas.concat to stack rows:

An easy code to carry out LDA

First we import the following libraries:

Here, MeCab is a library to tokenize Japanese texts. Then, using CountVectorizer, we make a table to count the number of appearance for each word.

Suppose a neural network consists of 3 layers: input, hidden and output layers. Each layers are linked to each other via a neuron-like object, and the information propagates from the input layer to the output.

Each layer has parameters, and in this case parameters are V, W, b, c. What the neural network learns means that the parameters are optimized such that the error is minimized. The optimization is done through iteration. This is the main process of deep learning.

Bag-of-words (BoW) is a simple way to represent a collection of documents under the assumption that each document is represented by a distribution of words. In the model, the number of times that words appear in each document of a collection is counted. BoW is often used in document classification.

And its implementation is easy; you only use scikit-learn and nltk (provided the word set is in English.) First, you use nltk to have:

Secondly, you use scikit-learn to have:

Suppose you use Tableau on macOS & try to connect to a data source (eg .xlsx file). And if you get an error message like

then you can solve the problem in a simple way (although the solution is not permanent).

The solution is to start Tableau from a terminal: for example if you use Tableau Public, you type:

Then you can connect to a data source.

Error: nltk resource not found

When you start to use nltk module, you need to download and install the data relating to the module. For example

Then, if you have the error messages like

T Miyamoto

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store