Hello! This is Mayuko from the IT Solutions Division.
It's already the second time.
What is machine learning in the first place?

I googled it, but I don't really understand>< Mayuko "Please tell me GO☆ ( ; ∀;)」

GO☆ "Hmm, in other words, the pattern recognition that we are doing unconsciously..."

Mayuko "Yes? I don't know, so I'll look it up myself ( ; ∀;)」
Hmm, if you look at the sites I refer to... http://www.apps-gcp.com/predictionapi-introduction-1/ On this site, we are experimenting with having sentences written in three countries analyzed and having a computer guess the language.
Amazing! It's a dream-like tool for predicting the future! Let's just put it into practice.
- First, prepare the data to be analyzed.
It seems that it is better to have as much information as possible, but this sample data is about 400 items.
↓ Sample data. https://cloud.google.com/prediction/docs/language_id.txt This is text data written in English, French, and Spanish, with layouts such as [language name],[sentence written in each language].
To summarize what to keep in mind when creating a file... Write the "answer" in the first column. In terms of samples, it is "English", "French", and "Spanish". ・From the next column, write information to guide the "answer". It seems that it is okay to have multiple rows. ・Separate the columns with a comma. ・No header required. And that's it.
- Next, upload the file to Google storage.
From here, we will work on a site called Google Developers Console. https://console.developers.google.com/

Mayuko "What is this?" GO☆ "It's a tool for developers that is used when developing in the Google environment. Well, I don't think you'll know until you try it!"
I logged in with my company account, created a project, and turned on Prediction API and Google Cloud Storage. Then create and upload a bucket. I'm proceeding without knowing what I'm doing, but I was able to upload it safely. The upload was a flash.
- And the analysis begins.
From here, use the "Prediction API". Go to a site where the "Prediction API" can be used from your browser. https://developers.google.com/apis-explorer/?&_ga=1.100999174.668741449.1412325898#p/prediction/v1.6/
It's called "APIs Explorer" and makes it easy to try out Google's various APIs in your browser.

GO☆ "Here is the Prediction API, and we will use it to analyze it.
First, input data. Use the "prediction.trainedmodels.insert" in the APIs Explorer. Enter the project (the number paid for the project you just created) and the Request body. Also, don't forget to turn on Authorize requests using OAuth 2.0. You can put this much in the Request body.
{
"id": "arbitrary id"
"storageDataLocation":"bucket name/filename"
}
Then, click the Execute button! Press it. This will start the analysis.
Next, use the prediction.trainedmodels.get in the APIs Explorer to see if the analysis is complete. Put project, id (any id defined in "prediction.trainedmodels.insert"), and click the [Execute] button! Press it. If the Response returns "trainingStatus": "DONE", the analysis is complete. The analysis took less than a minute.
- This is the analysis result!
Did you analyze it well? Use "prediction.trainedmodels.analyze" in APIs Explorer. Put in the project and id and click the [Execute] button! Press it.
The analysis results are like this.
"confusionMatrix": {
〜 1st stage 〜
"English": {
"English": "16.00",
"French": "0.00",
"Spanish": "0.00"
},
〜 2nd stage 〜
"French": {
"English": "0.00",
"French": "14.14",
"Spanish": "0.00"
},
〜 3rd stage 〜
"Spanish": {
"English": "0.43",
"French": "0.14",
"Spanish": "10.29"
}
}

Mayuko "What does this mean? ('o')" GO☆ "It's the result of the so-called answer matching. To put it simply, the first paragraph is for sentences written in "English",
The "Prediction API" is
・I decided that it was English and put "16.00" votes in "English". ・I decided that it was French and put "0.00" votes for "French". ・I judged it to be Spanish and put "0.00" votes in "Spanish".
I guess that's what it means. In other words, all questions are answered correctly.
If you look at the second stage, "French" is also correct in all questions.
The third column is actually "Spanish", but "English" and "French" also have a few votes, so it's a misunderstanding."

Mayuko "I see!! ('o')"
- Finally, let me make a prediction.
"I am Mayuko." I will ask what the sentence is.
Use the prediction.trainedmodels.predict in the APIs Explorer. It's similar to "prediction.hostedmodels.predict", so be careful not to make a mistake.
Enter all columns (in this case, "Sentences in Each Language") except for the first column of the data file (i.e., "Language Name").
*If there are multiple columns, it seems that you can separate them with a comma.
Enter it like this.
{
"input":
{
"csvInstance":
[
"I am Mayuko."
]
}
}
Then I got this answer.
"outputLabel": "English",
It's in English! He replied.

That's the right answer! Yay!♡
*This article is produced under the supervision of "ISAO IT Solution Division Co., Ltd.".