{"id":24736415,"url":"https://github.com/engineering-research-and-development/demeter-estimate-traceability","last_synced_at":"2026-04-11T11:02:17.116Z","repository":{"id":54659556,"uuid":"277473059","full_name":"Engineering-Research-and-Development/demeter-estimate-traceability","owner":"Engineering-Research-and-Development","description":"DEMETER project: machine learning module for milk quality prediction","archived":false,"fork":false,"pushed_at":"2023-10-03T13:48:59.000Z","size":20073,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T17:26:56.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Engineering-Research-and-Development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-06T07:30:57.000Z","updated_at":"2021-12-17T11:53:45.000Z","dependencies_parsed_at":"2022-08-13T23:10:15.566Z","dependency_job_id":null,"html_url":"https://github.com/Engineering-Research-and-Development/demeter-estimate-traceability","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Engineering-Research-and-Development/demeter-estimate-traceability","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Fdemeter-estimate-traceability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Fdemeter-estimate-traceability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Fdemeter-estimate-traceability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Fdemeter-estimate-traceability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Engineering-Research-and-Development","download_url":"https://codeload.github.com/Engineering-Research-and-Development/demeter-estimate-traceability/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Fdemeter-estimate-traceability/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31677819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-27T21:25:20.616Z","updated_at":"2026-04-11T11:02:17.087Z","avatar_url":"https://github.com/Engineering-Research-and-Development.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://portal.ogc.org/files/?artifact_id=92076)\n# Estimate milk quality module\n\nMachine learning module for traceability estimation using _**Random Forest**_ algorithm.\nThe values to predict are a discrete class label such as _**High**_, _**Medium**_ or _**Low**_ milk quality.\nDuring training, it is necessary to provide to the model any historical data that is relevant \nto the problem domain and the true value we want the model learns to predict. \nThe model learns any relationships between the data and the values we want to predict. \nThe decision tree forms a structure, calculating the best questions to ask to make the most accurate estimates possible.\n\n## Table of contents\n* [**Technologies**](#technologies)\n* [**Requirements**](#requirements)\n* [**Setup**](#setup)\n* [**Features**](#features)\n* [**Endpoints**](#endpoints)\n* [**How to use**](#how-to-use)\n* [**Important Notes**](#important-notes)\n* [**Troubleshoot**](#troubleshoot)\n* [**Developers**](#developers)\n* [**Status**](#status)\n* [**License**](#license)\n\n## Technologies\n\n| Description                                      | Language | Version          |\n| :----------------------------------------------  | :------: | :--------------: |\n| [Java SE Development Kit 8][1]                   | Java     | 1.8.0_202        |\n| [Python 3][2]                                    | Python   | 3.7.3            |\n| [Apache Maven 3][3]                              |          | 3.6.3            |\n| [Apache Tomcat 7][4]                             |          | 7.0.104          |\n| [Scikit-learn API][5]                            | Python   | 0.23.2           |\n| [JPY API][6]                                     | Java     | 0.9.0\t\t     |\n| [RESTEasy API][7]                                | Java     | 3.12.1.Final     |\n| [Spring Framework][8]                            | Java     | 4.3.3.RELEASE    |\n| [Json][9]                                        |          | 20200518         |\n| [Log4j][10]                                      |          | 2.16.0           |\n| [Eclipse IDE for Enterprise Java Developers][11] | Java     | 2020-06 (4.16.0) |\n| [PyDev Python IDE for Eclipse][12]               | Python   | 7.6.0            |\n| [Docker Desktop Community][13]                   |          | 2.3.0.4 (46911)  |\n\n[1]: https://www.oracle.com/it/java/technologies/javase/javase-jdk8-downloads.html\n[2]: https://www.python.org/downloads/release/python-383/\n[3]: http://maven.apache.org/ \n[4]: https://tomcat.apache.org/download-70.cgi#7.0.104 \n[5]: https://scikit-learn.org/stable/index.html \n[6]: https://jpy.readthedocs.io/en/latest/intro.html \n[7]: https://resteasy.github.io/ \n[8]: https://spring.io/projects/spring-framework\n[9]: http://www.JSON.org/\n[10]: https://logging.apache.org/log4j/2.x/\n[11]: https://www.eclipse.org/downloads/ \n[12]: http://www.pydev.org/ \n[13]: https://www.docker.com/products/docker-desktop\n\n## Requirements\n\n* Docker\n* Java 1.8\n* Python 3\n* Maven\n* Tomcat 7\n\nThe following components are needed for start using this component:\n\n| Components required                | Description   |\n| :--------------------------------  | :------------ |\n| [pilot4.2-traslator:latest][14]  | AIM traslator |\n\n[14]: https://hub.docker.com/r/demeterengteam/pilot4.2-traslator\n\n## Setup\n\n### Pull the image\n\t\n`docker pull demeterengteam/estimate-milk-quality:latest`\n\n### Run the application\n\nIt's possible to run the application using \u003c!--`docker run` or --\u003e `docker-compose`\n\n\u003c!--\n#### Docker run\n\n`docker run -p 9280:8080 demeterengteam/estimate-milk-quality:latest`\n\nSet the preferred port to use instead of 9280.\n--\u003e\n\n#### Docker-compose\n\nCreate a **docker-compose.yml** file into a folder.\n\n*docker-compose.yml content:*\n\n```\nversion: '3'\n\nservices:\n    milkquality:\n        image: demeterengteam/estimate-milk-quality:latest\n        ports:\n          - '${HOST_PORT}:8080'\n        environment: \n          - MQ_AIM_TRASLATOR_PREDICTION_URL=http://${HOST_IP}:${TRASLATOR_SERVICE_HOST_PORT}/demeter-csvManager/rest/traslator/v1/MilkQualityPrediction\n          - MQ_AIM_TRASLATOR_TRAINING_URL=http://${HOST_IP}:${TRASLATOR_SERVICE_HOST_PORT}/demeter-csvManager/rest/traslator/v1/MilkQualityTraining    \n```\n\nCreate a **.env** file into the same folder of the above docker-compose:\n\n*.env content:*\n```\nHOST_PORT=9280\nHOST_IP=**INSERT HOST IP**\nTRASLATOR_SERVICE_HOST_PORT=**INSERT THE PORT OF THE TRASLATOR COMPONENT*\n```\n\nSet **HOST_PORT** value to the preferred port to use instead of **9280**.\n\nSet **HOST_IP** value with the correct ip of the host machine.\n\nSet **TRASLATOR_SERVICE_HOST_PORT** value equal to the port used for the traslator service component.\n\nFirst run the command `docker-compose up` only for the very first time.\n\nThen simply run `docker-compose start` to start the application and `docker-compose stop` to stop it.\n\nBefore doing any request, you must upload the data as csv file using the [traslator service][14].\n\nOnce started open any REST client (i.e. Postman) and send requests to the application endpoints.\n\n## Features\n\n* **Algorithm Training, Testing and Metrics calculation:** \nReceives a dataset of _training features_ as input to perfom the training, test and metrics calculations. \nReturn an object with the _training result_ that will show all the test records used after the training with the predictions made by the algorithm and the metrics.\n\n* **Predict health condition:** \nReceive a dataset of _prediction features_ as input to perform predictions and return an object with the _prediction result_. \n\n## Endpoints\n\nThe base URL is composed like:\n`http://[HOST]:[HOST_PORT]/EstimateMilkQualityModule/ENDPOINT`\n\nHeaders settings:\n\n| Key          | Value            |\n| :----------- | :--------------- |\n| Content-Type | application/json |\n| Accept       | application/json |\n\nEndpoint informations:\n\n| URL                         | Type    | Used for                                                            | Input | Output                                   |\n| :-------------------------- | :-----: | :------------------------------------------------------------------ | :---- | :--------------------------------------- |\n| `/v1/milkQualityTraininig`  | **GET** | Train the algorithm, calculate the metrics and send the result data |       | AIM Json output data result with metrics |\n| `/v1/milkQualityPrediction` | **GET** | Estimate the health condition and send the result data              |       | AIM Json output data result              |\n\u003c!--\nThe `/v1/milkQualityTraininig` endpoint can be used also to change the **random state** and **estimators** parameters of the algorithm.\nTo accomplish that, just add the following path parameters to the URL:\n\n* `/randomstate/value`\n\n* `/estimators/value`\t\n\nBoth values must be **integers** numbers.\n\nFor instance: \n**http://localhost:9280/EstimateMilkQualityModule/v1/milkQualityTraininig/randomstate/42/estimators/100**\nThis endpoint will first change the values of random state and estimators parameters and then execute the training.\n--\u003e\n## How to use\n**TO DO**\n\n## Important Notes\n\nThe application image don't contains any training data model preloaded, so the first request to execute\nmust be a training one. That will create the models needed for the prediction tasks.\nIsn't necessary to execute another training on next use of the application except for the purpose of improve training accuracy.\n\n## Troubleshoot\n\n### Errors\nThe service provide error messages as response and write the details into logs.\nThere are two different error codes that are useful to identify where the error occured:\n\n* **Code: 1**   - The error occured within the java classes\n* **Code: 2**   - The error occured within the python modules\n\n## Developers\n\n* [Luigi di Corrado](https://github.com/luidicorra) \n\n## Status\nProject is: _in progress_\n\n## License\n\u003c!--- If you're not sure which open license to use see https://choosealicense.com/---\u003e\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineering-research-and-development%2Fdemeter-estimate-traceability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineering-research-and-development%2Fdemeter-estimate-traceability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineering-research-and-development%2Fdemeter-estimate-traceability/lists"}