This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✗ aws machinelearning create-realtime-endpoint --ml-model-id ml-noV4tkTZgnO | |
{ | |
"MLModelId": "ml-noV4tkTZgnO", | |
"RealtimeEndpointInfo": { | |
"EndpointStatus": "UPDATING", | |
"PeakRequestsPerSecond": 200, | |
"CreatedAt": 1429171982.734, | |
"EndpointUrl": "https://realtime.machinelearning.us-east-1.amazonaws.com" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✗ aws machinelearning describe-ml-models | |
{ | |
"Results": [ | |
{ | |
"Status": "COMPLETED", | |
"SizeInBytes": 5821257, | |
"Name": "ML model: Data3.txt", | |
"TrainingParameters": { | |
"sgd.l2RegularizationAmount": "1e-6", | |
"sgd.maxMLModelSizeInBytes": "104857600", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✗ aws machinelearning predict | |
--ml-model-id ml-noV4tkTZgnO | |
--record | |
'{"lastname":"Simon", "firstname":"Julien", | |
"gender":"M", "state":"Texas","age":"44", | |
"month":"4", "day":"106", "hour":"10", "minutes":"26", | |
"items":"5" }' | |
--predict-endpoint https://realtime.machinelearning.us-east-1.amazonaws.com | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paris -> us-east-1 | |
% time aws machinelearning predict --ml-model-id ml-noV4tkTZgnO --record '{"lastname":"Simon", "firstname":"Julien", "gender":"M", "state":"Texas","age":"44", "month":"4", "day":"106", "hour":"10", "minutes":"26", "items":"5" }' --predict-endpoint https://realtime.machinelearning.us-east-1.amazonaws.com | |
{ | |
"Prediction": { | |
"predictedValue": 752.190185546875, | |
"details": { | |
"PredictiveModelType": "REGRESSION", | |
"Algorithm": "SGD" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% wget https://github.com/aws/aws-cli/archive/develop.zip | |
% unzip develop.zip | |
% cd aws-cli-develop | |
% sudo python setup.py install | |
% aws configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.julien.datastuff; | |
import com.amazonaws.AmazonClientException; | |
import com.amazonaws.services.machinelearning.AmazonMachineLearningClient; | |
import com.amazonaws.services.machinelearning.model.DescribeMLModelsResult; | |
import com.amazonaws.services.machinelearning.model.MLModel; | |
import com.amazonaws.services.machinelearning.model.PredictRequest; | |
import com.amazonaws.services.machinelearning.model.PredictResult; | |
import com.amazonaws.services.machinelearning.model.RealtimeEndpointInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.amazonaws</groupId> | |
<artifactId>aws-java-sdk</artifactId> | |
<version>1.9.31</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model name: ML model: Data3.txt | |
Model id: ml-noV4tkTZgnO | |
Model status: COMPLETED | |
Endpoint URL: https://realtime.machinelearning.us-east-1.amazonaws.com | |
Endpoint status: READY | |
Sending prediction request for: {firstname=Julien, gender=M, month=4, hour=10, minutes=26, state=Texas, day=106, items=5, age=44, lastname=Simon} | |
Predicted value:752.1902 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ec2-user@ip-172-30-1-10 ~]$ java -jar mlsample.jar | |
Model name: ML model: Data3.txt | |
Model id: ml-noV4tkTZgnO | |
Model status: COMPLETED | |
Endpoint URL: https://realtime.machinelearning.us-east-1.amazonaws.com | |
Endpoint status: READY | |
Sending prediction request for: {minutes=26, items=5, age=44, month=4, state=Texas, gender=M, lastname=Simon, hour=10, day=106, firstname=Julien} | |
80 ms | |
Predicted value:752.1902 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 a | |
1 b | |
1 c | |
2 a | |
2 b | |
3 a | |
4 a | |
5 a | |
5 b | |
6 a |