Hello. This is Mayuko from the IT Solutions Division.

It's a lie. This is GO☆, an extreme engineer.
★ ☆ ↓GO☆ is now available ★ on Youtube ☆
Recently, I have been receiving power harassment from my boss, saying, "Don't cut that hairstyle because it's interesting, if you cut it, you'll be fired." Dust
Well, this time I will write on behalf of Mayu during summer vacation. Last time I guessed the language, but this time I will try to guess the height.
What makes it different? Before that, let's talk about Categorical models and Regression models. I'm not an expert in statistics, so I'll only write the bare minimum for the Prediction API. Dust
1. Categorical models
The expected result is derived from a specific choice (the value of the first column of the data you input). In other words, it is used when you want to derive an expected outcome, such as "O" or "X", "good" or "fair" or "bad". The last time we used this model for language. If the first column of the analysis data (i.e., the answer) is a string, it will automatically become this model.
2. Regression models
The expected result is derived in numerical terms. I guess it's a regression model because it does regression analysis and gives expected values. Chirichiri This height guess is this model. If the first column of the analysis data (i.e., the answer) is a number, it automatically becomes this model. However, if even one case contains null or a string in the first column, it will be a category model, so be careful.
That's why this time I'm going to predict it with Regression models. Let's put it into practice!
This model predicts your height when you enter your weight, so create a file like the following.
[Height],[Weight]
I created 20,000 using Excel. The weight was randomly generated, and the height was created so that there was a slight variation based on that weight. In other words, there is a correlation between height and weight. Dust
Next is the Prediction API.
1.「 Input data with prediction.trainedmodels.insert and confirm completion with prediction.trainedmodels.get.
There are 20,000 items, but there are only two rows, so it was completed in about 5 minutes. If the completion response returns "modelType": "regression", it is a regression model. By the way, if you get "modelType": "classification", it is a categorical model.
2.「 prediction.trainedmodels.analyze.
Unlike categorical models, "modelDescription" does not contain the analysis results.
"modelDescription": {
"modelinfo": {
"kind": "prediction#training"
}
}
On the other hand, in the "dataDescription" section, in addition to the number of cases (count), there are values for mean (mean) and variance (variance).
"numeric": {
"count": "20000",
"mean": "171.59",
"variance": "450.77"
}
3.「 prediction.trainedmodels.predict".
I will ask you how many centimeters tall you are if you weigh 75 kg.
{
"input": {
"csvInstance": [
"75"
]
}
}
When I asked,
"outputValue": "172.528445"
I got back. In other words, the answer is 172.5 centimeters. Since the decimal point was not included in the analysis data, it is the result of regression analysis. That's it.
Dust
★ ☆ ↓GO☆ is now available ★ on Youtube ☆
*This article is produced under the supervision of "ISAO IT Solution Division Co., Ltd.".