Advertisement
hendriawan

day3-02-portingModel-ke-bahasaC-arduino

Nov 29th, 2022
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | Source Code | 0 0
  1. #include "SVMClassifier.h"
  2. Eloquent::ML::Port::SVM svm;
  3. void setup() {
  4.   // put your setup code here, to run once:
  5.   Serial.begin(115200);
  6.  
  7.  
  8. }
  9.  
  10. void loop() {
  11.   // put your main code here, to run repeatedly:
  12.   float input1[4] = {5.1,   3.5,    1.4,    0.2 };  
  13.   float input2[4] = {6.4,   3.2,    4.5,    1.5 };  
  14.   float input3[4] = {4.9,   2.5,    4.5,    1.7 };
  15.  
  16.   Serial.print("Prediction1: ");
  17.   Serial.print(svm.predict(input1));
  18.  
  19.   Serial.print("  Prediction2: ");
  20.   Serial.print(svm.predict(input2));
  21.  
  22.   Serial.print("  Prediction3: ");
  23.   Serial.println(svm.predict(input3));
  24.   delay(3000);
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement