Weather casting with Machine Learning (SVM and SRNN).
Dependencies: EthernetInterface GraphicHandler NTPClient SRNN SVM SensorModule mbed-rtos mbed
Revision 6:29d393d430d0, committed 2015-02-22
- Comitter:
- yukari_hinata
- Date:
- Sun Feb 22 01:06:19 2015 +0000
- Parent:
- 5:b61f3f5b0fc8
- Commit message:
- add svm sample data
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dat/SVM_ALPH.txt Sun Feb 22 01:06:19 2015 +0000 @@ -0,0 +1,720 @@ +2.109783 +2.448523 +0.819051 +2.202695 +3.759624 +0.628449 +4.882550 +2.693510 +4.845541 +1.383613 +0.332399 +1.872055 +8.077840 +3.681240 +3.340540 +3.743216 +3.514637 +6.881532 +1.269273 +3.223413 +2.346300 +2.364051 +1.376783 +4.420950 +5.791318 +4.503433 +0.000000 +2.705683 +2.666814 +3.521677 +5.659596 +0.959177 +5.520159 +0.000000 +2.497153 +0.587878 +3.894704 +4.910476 +1.408921 +0.176158 +1.603907 +5.781517 +6.462094 +3.299150 +0.327609 +1.369519 +5.685025 +6.428631 +3.276522 +3.660737 +4.550578 +3.245415 +4.077550 +0.202908 +2.112712 +3.129097 +4.464257 +0.607686 +3.944200 +1.485952 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.313306 +0.097616 +0.000000 +0.039446 +0.220142 +0.115453 +1.395565 +0.000000 +0.000000 +0.479572 +0.118179 +0.000000 +3.597359 +0.000000 +0.618199 +4.713907 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.397213 +0.000000 +0.000000 +0.000000 +0.110351 +0.000000 +0.132785 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.392933 +0.044516 +0.000000 +0.000000 +0.000000 +0.236464 +0.441709 +0.000000 +0.413774 +3.196465 +0.500930 +0.000000 +0.315108 +0.010449 +0.736227 +0.000000 +0.000000 +0.086378 +3.016521 +2.268288 +0.284320 +0.135841 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.138581 +4.744803 +1.976859 +0.309640 +0.122098 +7.420785 +0.000000 +1.169937 +0.000000 +0.738354 +4.878536 +4.441170 +0.325818 +0.000000 +5.930561 +1.612155 +0.000000 +0.000000 +0.000000 +0.000000 +0.141799 +0.936972 +0.558279 +0.000000 +0.080069 +0.000000 +4.008354 +2.006725 +2.610116 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +1.176992 +0.137366 +0.001727 +2.008077 +5.704114 +2.424221 +0.000000 +3.290150 +0.018950 +0.000000 +0.334829 +0.000000 +2.282371 +0.466669 +1.232544 +0.120856 +0.024729 +1.487759 +6.069277 +0.000000 +0.000000 +2.998102 +3.191450 +1.329698 +6.456969 +2.662279 +0.000000 +0.000000 +0.431218 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +4.803913 +0.000000 +3.083043 +0.266350 +2.679164 +0.000000 +0.000000 +1.853472 +4.910760 +0.873799 +0.680045 +0.000000 +0.429082 +3.020699 +2.953373 +0.000000 +0.000000 +0.000000 +0.000000 +1.047303 +0.417355 +0.000000 +3.901268 +0.403883 +1.276058 +0.000000 +4.032842 +0.000000 +0.000000 +0.000000 +1.398895 +1.400740 +1.079774 +1.331837 +2.207005 +0.000000 +0.000000 +0.143539 +0.340010 +0.000000 +2.724442 +1.053641 +0.000000 +1.388106 +0.294361 +3.596330 +0.727780 +1.552989 +4.764237 +2.647532 +0.686626 +0.000000 +6.214519 +1.455728 +0.171845 +0.000000 +0.000000 +0.000000 +1.197014 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.401749 +0.000000 +0.004264 +1.878250 +0.941090 +0.000000 +0.000000 +0.000000 +0.364719 +0.000000 +2.018849 +0.000000 +2.251242 +0.000000 +0.000000 +0.000000 +2.114679 +0.000000 +0.000000 +0.000000 +0.410070 +0.195779 +0.000000 +0.353926 +6.810455 +0.000000 +0.000000 +2.396405 +0.067726 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.545209 +0.086428 +0.135527 +0.397509 +1.826249 +1.764855 +0.000000 +0.000000 +0.090585 +0.854097 +0.465806 +0.520585 +2.153959 +0.160655 +0.000000 +0.774033 +0.494486 +0.000000 +0.254475 +0.785956 +0.411876 +2.083329 +0.000000 +0.455265 +3.293637 +1.400079 +0.627338 +0.000000 +0.326731 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.000000 +0.687782 +0.000000 +1.000665 +0.000000 +0.000000 +0.473843 +0.037951 +0.000000 +0.404202 +0.392332 +0.000000 +0.000000 +0.216424 +0.510550 +0.001230 +0.000000 +0.000000 +2.385254 +0.243399 +0.036141 +2.764172 +0.175525 +0.000000 +0.000000 +0.000000 +1.044235 +0.000000 +0.426484 +1.189726 +0.000000 +0.211970 +0.000000 +0.567266 +0.000000 +2.053051 +1.035225 +0.341831 +0.000000 +0.000000 +0.668528 +0.000000 +0.000000 +0.000000 +0.000000 +0.072223 +0.000000 +0.000000 +0.257317 +0.000000 +0.531673 +0.297146 +0.000000 +0.000000 +0.767326 +0.198421 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dat/SVM_SAMP.txt Sun Feb 22 01:06:19 2015 +0000 @@ -0,0 +1,121 @@ +weather,temperture,air pressure,humidity +shiny,22.7,1004.4,46 +shiny,2.3,1015.4,49 +shiny,6.2,1023.7,61 +shiny,26.6,1007.8,54 +shiny,5.9,1013.3,36 +shiny,-1.4,1022.5,73 +shiny,12.7,1019,72 +shiny,8,1012.8,56 +shiny,17.5,1017.5,57 +shiny,6.7,1008.2,31 +shiny,-5.5,1020,71 +shiny,3.4,1019.5,55 +shiny,22.4,1010.8,74 +shiny,15.9,1015.3,59 +shiny,-6.4,1013.1,69 +shiny,8.3,1019.9,79 +shiny,15,1015,60 +shiny,20.9,1013.9,65 +shiny,13.4,1012.2,57 +shiny,12.7,1014.8,60 +shiny,25.1,1012.1,53 +shiny,6.8,1022.1,64 +shiny,15,1001.5,50 +shiny,9.9,1015.2,61 +shiny,24.8,1007.3,64 +shiny,14.4,1017.8,64 +shiny,-7,1017.7,64 +shiny,5.9,1021.6,64 +shiny,4.5,1019.6,48 +shiny,18,1014.9,53 +cloudy,9.6,1019.5,65 +cloudy,24.8,1011.6,83 +cloudy,14,1018.5,53 +cloudy,11,1010.3,77 +cloudy,5.4,1017.2,67 +cloudy,12.8,995.9,77 +cloudy,24.1,1009.3,65 +cloudy,16.9,1015.7,63 +cloudy,20.1,1011.6,77 +cloudy,25,999.9,86 +cloudy,21.7,1016.5,71 +cloudy,3.8,1013,37 +cloudy,18.6,1014.8,52 +cloudy,5.3,1018.1,67 +cloudy,19.1,1003.5,81 +cloudy,14,1013.5,78 +cloudy,15.9,1013.2,63 +cloudy,7,1017.5,51 +cloudy,19.8,1014.9,65 +cloudy,17.6,1016.4,67 +cloudy,10.7,1018.6,73 +cloudy,20.8,999.9,50 +cloudy,25.3,1011.5,63 +cloudy,23.7,1003.4,85 +cloudy,27.2,1000.5,57 +cloudy,-6.1,1011.5,75 +cloudy,21.9,1011.3,62 +cloudy,23.6,1007.2,84 +cloudy,5.3,1015.5,61 +cloudy,27.5,1007.2,78 +rainy,6.1,1005.8,84 +rainy,8.4,1012.8,81 +rainy,21.8,1006.6,88 +rainy,8.1,1001.2,83 +rainy,25.5,996.2,89 +rainy,6.4,1005.4,77 +rainy,8.2,1000.8,91 +rainy,6.1,1010.4,93 +rainy,16.8,1012.7,85 +rainy,21.6,1004.6,90 +rainy,23.8,988.4,78 +rainy,20.6,993.9,76 +rainy,17.6,1003.5,87 +rainy,18.6,993.6,97 +rainy,10.1,1020.3,82 +rainy,7.5,1014.4,82 +rainy,23.5,1000.1,87 +rainy,25.7,992.8,78 +rainy,25.5,1007.3,93 +rainy,23.6,1009.5,84 +rainy,18.7,1008.4,84 +rainy,24.9,996.2,90 +rainy,5.3,1014.6,86 +rainy,21.8,1012.3,79 +rainy,8.2,1016.9,81 +rainy,4.8,1004.5,79 +rainy,25.2,991.5,91 +rainy,6.9,1007.1,87 +rainy,11.1,1010.9,85 +rainy,20.2,1003.6,88 +snowy,1.6,1007.3,74 +snowy,-5.7,1005.9,65 +snowy,0.5,995.7,56 +snowy,1.1,1011.9,91 +snowy,0,1016.9,69 +snowy,2.8,1018.3,50 +snowy,1.5,1018.1,71 +snowy,0.7,1002.5,77 +snowy,-3.7,1019.7,73 +snowy,1.7,1011.6,89 +snowy,1.8,1009.5,74 +snowy,1.1,989.9,78 +snowy,-2.4,1007.1,88 +snowy,-5.7,1013.9,75 +snowy,1.4,1021.8,83 +snowy,0.7,1025.6,78 +snowy,-4.8,1004.1,74 +snowy,1.1,1009.8,66 +snowy,0.3,1024,77 +snowy,-7.6,1017.1,63 +snowy,-2.9,1010.1,77 +snowy,-4.2,1005,73 +snowy,2.9,1009.1,50 +snowy,-0.1,1023.7,65 +snowy,2,1029.8,75 +snowy,4.4,1020.8,56 +snowy,-6.5,1017.2,78 +snowy,0.1,1012,72 +snowy,0.7,998.2,81 +snowy,0.1,990,81 \ No newline at end of file
--- a/main.cpp Thu Feb 19 19:21:16 2015 +0000 +++ b/main.cpp Sun Feb 22 01:06:19 2015 +0000 @@ -208,7 +208,7 @@ now_time = time(NULL); local_time_p = localtime(&now_time); // センサ読み込み, 機械学習, 予測データセット - read_task(NULL); + //read_task(NULL); ml_task(NULL); write_predict_task(NULL); ml_flag = 0;
--- a/setup.cpp Thu Feb 19 19:21:16 2015 +0000 +++ b/setup.cpp Sun Feb 22 01:06:19 2015 +0000 @@ -12,6 +12,7 @@ int* svm_tmp_sample_label = new int[MCSVM_NUM_SAMPLES]; float* svm_tmp_mc_alpha = new float[MCSVM_NUM_SAMPLES * NUM_WEATHERS * (NUM_WEATHERS - 1) / 2]; + // You can use /dat/SVM_SAMP.txt svm_setup_fp = fopen( "/local/SVM_SAMP.CSV" , "r" ); if( svm_setup_fp == NULL ) { fprintf( stderr, "Error in svm setup : sample file cannot open. \r \n" ); @@ -42,6 +43,8 @@ // Thank you freopen. // Here, we should not use fclose -> fopen + + // You can use /dat/SVM_ALPH.txt svm_setup_fp = freopen("/local/SVM_ALPH.CSV", "r", svm_setup_fp ); fflush( svm_setup_fp ); // required. @@ -192,7 +195,7 @@ printf("SVM ...OK \r\n"); srnn_setup(); printf("SRNN ...OK \r\n"); - sensor_setup(); + //sensor_setup(); printf("SENSOR ...OK \r\n"); // network_setup(); jst_setup(2015, 2, 20, 4, 0);