from model.snoopers import loading_dataset
file_name = './data/BrixTDSphDataSet_over.csv'
table = loading_dataset(file_name)
table.head(3)
b | greenbean name | fin time | fin bean tem | brix | tds | ph | time/temperature | |
---|---|---|---|---|---|---|---|---|
0 | 81 | 에디오피아 예가체프 G2 81 | 174 | 197 | 1.601 | 1.2808 | 4.940 | 0.883249 |
1 | 71 | 에디오피아 예가체프 G2 71 | 196 | 207 | 1.601 | 1.2808 | 4.934 | 0.946860 |
2 | 82 | 에디오피아 예가체프 G2 82 | 200 | 187 | 1.607 | 1.2856 | 4.934 | 1.069519 |
file1 = "./model/predict_ph.model"
file2 = "./model/predict_brix.model"
from model.snoopers import loading_model
model_brix, model_ph = loading_model(file1, file2)
feacture : -1.0892247354198625 bias : 6.989671895125806 LinearRegression() Pipeline(steps=[('polynomial', PolynomialFeatures(degree=5)), ('modal', LinearRegression())])
%matplotlib inline
from model.snoopers import predict_model
table_predict = predict_model(table, model_ph, model_brix)
table_predict.head(3)
R2 Score : 0.8667100746914103 MSE Score : 0.001352366822621339 RMSE Score : 0.03677454041346185
R2 Score : 0.8998287880365746 MSE Score : 0.0013400321517410725 RMSE Score : 0.03660644959212888
b | greenbean name | fin time | fin bean tem | brix | tds | ph | time/temperature | ph_predict | brix_predict | tds_predict | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 81 | 에디오피아 예가체프 G2 81 | 174 | 197 | 1.601 | 1.2808 | 4.940 | 0.883249 | 4.913951 | 1.608902 | 1.287121 |
1 | 71 | 에디오피아 예가체프 G2 71 | 196 | 207 | 1.601 | 1.2808 | 4.934 | 0.946860 | 4.935368 | 1.615437 | 1.292350 |
2 | 82 | 에디오피아 예가체프 G2 82 | 200 | 187 | 1.607 | 1.2856 | 4.934 | 1.069519 | 4.961284 | 1.615437 | 1.292350 |
# CSV 파일로 저장하기
file_csv = 'ph_brix.csv'
table_predict.to_csv(file_csv, index=None)
print(f"결과값을 {file_csv} 파일로 저장하였습니다.")