feat(ai_eff): AI Effort Prediction API changes#95
Open
SteveDala wants to merge 33 commits into
Open
Conversation
The document still said "documentaion". Nuts. I have also added the doc version number. I defaulted to the version of the branch.
This commit is inspired by PR#87 and PR#85 that attempts to implement the AI Task Effort prediction feature. Co-authored-by: jtalev <jtalev@users.noreply.github.com> Co-authored-by: officialid130-13e13 <officialid130-13e13@users.noreply.github.com>
Also, the addition of the default value to any record that has null values in the column.
officialid130-13e13
left a comment
There was a problem hiding this comment.
I have reviewed the changes and the FastAPI/Sidekiq refactor looks good overall.
The CI build is failing during the TeXLive image build. This is the same issue I hit earlier — the pdfmanagement-testphase package is no longer available. Can you please remove pdfmanagement-testphase from the install list in the texlive-builder Dockerfile. After removing that package, the build should pass again.
- adding an initiator to the job allows the user who enqueued the job to retrieve info about the job to aid in polling for results after initial enqueueing takes place
Co-authored-by: josh.talev <josh.talev@cabinetsbycomputer.com>
…dpoint' into development
* return job ID from prediction endpoint * error handling on prediction job enqueue * add initiator to sidekiq job - adding an initiator to the job allows the user who enqueued the job to retrieve info about the job to aid in polling for results after initial enqueueing takes place * More error handling --------- Co-authored-by: josh.talev <josh.talev@cabinetsbycomputer.com>
* add allow prediction flag on units migration * expose allow_effort_predictions in entity * add allow_effort_prediction to crud endpoints --------- Co-authored-by: josh.talev <josh.talev@cabinetsbycomputer.com>
11 tasks
Development
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background and Context
Currently, the task definition object contained a
weightingfield which, when populated, assisted students in understanding how much of their unit they had completed by finishing the task. This measure is implemented in a visualisation called the Progress Burndown Chart:Unfortunately, weighting is not always filled out accurately or at all by tutors when creating task definitions. This leads to the chart feeling bad for students by way of inconsistency; sometimes submitting a Pass task reduces this Burndown chart by the same amount that a Distinction task does, even if much more effort was put into the distinction task.
The AI effort prediction feature aims to solve this task effort evaluation with an intelligent regressor trained on data from previous Task Definitions in OnTrack.
Description
This pull request introduces the necessary API changes to introduce intelligent effort prediction of tasks to OnTrack.
weightingfield throughout the repo toestimated_hoursto give meaning to the integer value in the task definitionpredicted_effortfield to store the effort predicted by the intelligent regressor service./api/units/:unit_id/task_definitions/:task_def_id/predict_effortendpointType of change
Please delete options that are not relevant.
Dependencies
This PR has no additional dependencies on its own. To test the integration with the intelligent regressor service, the
doubtfire-effort-predictservice will need to be available atML_SERVICE_URL(if configured from the superproject, this will behttp://effort-predictor:8080/)How Has This Been Tested?
If the ML service is running and the ML_SERVICE_URL is defined (easiest setup is to use the superproject in VSCode dev containers), the API can be tested from either the OpenAPI doc page
/api/docsor from therails cconsole.Test A
Open
localhost:3000/api/docs, send this payload to the/api/authendpoint:{ "username": "aadmin", "password": "password" }Retrieve the
auth_tokenfrom the response and note it down. Then, send these parameters (or any alternative that matchesunit_idwithtask_def_id) to the/api/units/:unit_id/task_definitions/:task_def_id/predict_effortendpoint:unit_id: 1task_def_id: 1Username:aadminAuth_Token: (your noted auth token)When the response gives a Sidekiq
job_id, note that ID down. Then send it as a parameter to the/api/sidekiq/{id}endpoint:id: (your noted Sidekiq ID)Username:aadminAuth_Token: (your noted auth token)You should receive a response like the following:
{ "id": (Sidekiq ID), "status": "complete", "pct_complete": null, "message": null, "processed_count": null, "total_count": null, "created_at": null, "updated_at": (Unix timestamp), "job_class": "PredictEffortJob", "result": "{\"predicted_effort\" => (The predicted effort value from the service)}" }Test B
Open Rails console (
rails cfrom the root of the API repo inside the container).Use the following commands to perform a job and get it's status:
Use the following commands to check the
predicted_effortandestimated_hoursfield sagainsttask_def_id= 2:The effort value should match from the above Sidekiq job status.
Checklist: