Ajout de la documentation et de la configuration Backstage.io

This commit is contained in:
spham 2025-06-08 00:14:36 +02:00
parent 02009174b3
commit f19e81964f
6 changed files with 160 additions and 0 deletions

18
catalog-info.yaml Normal file
View File

@ -0,0 +1,18 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: streamlit-score-predictor
description: A Streamlit application for predicting test scores based on study hours
annotations:
github.com/project-slug: streamlit-score-predictor
backstage.io/techdocs-ref: dir:./docs
tags:
- streamlit
- python
- machine-learning
- education
spec:
type: website
lifecycle: experimental
owner: education-team
system: ml-services

30
docs/application-guide.md Normal file
View File

@ -0,0 +1,30 @@
# Application Guide
## Using the Streamlit Application
The Streamlit Score Predictor is a simple web application that allows users to predict test scores based on the number of hours studied.
### Interface Overview
The application consists of:
1. A title and description
2. A number input field for entering hours studied
3. A "Predict" button
4. A results section that displays the predicted test score
### Making Predictions
1. Enter the number of hours studied in the input field
- Use the up/down arrows or type directly in the field
- The minimum value is 0
- You can increment by 1.0 hour using the arrows
2. Click the "Predict" button
3. View the predicted test score
- The prediction will appear below the button
- The score is displayed with two decimal places
### Error Handling
If there is an issue with the prediction (e.g., invalid input or model error), an error message will be displayed.

44
docs/getting-started.md Normal file
View File

@ -0,0 +1,44 @@
# Getting Started
## Prerequisites
- Python 3.7+
- Streamlit
- Scikit-learn
- Joblib
## Installation
1. Clone the repository
2. Install dependencies:
```bash
pip install -r requirements.txt
```
## Running the Application
Run the Streamlit application with:
```bash
streamlit run streamlit.py
```
The application will open in your default web browser, typically at http://localhost:8501.
## Development
To modify the application:
1. Edit the `streamlit.py` file to change the UI or functionality
2. The application will automatically reload when you save changes
## Deployment
Streamlit applications can be deployed in several ways:
1. **Streamlit Sharing**: A free hosting service for Streamlit apps
2. **Heroku**: Deploy using a Procfile and requirements.txt
3. **Docker**: Containerize the application for deployment anywhere
For deployment, ensure that the model and scaler files are included with the application code.

25
docs/index.md Normal file
View File

@ -0,0 +1,25 @@
# Streamlit Score Predictor
## Overview
This is a Streamlit application that predicts test scores based on the number of hours studied. The application uses a pre-trained linear regression model to make predictions.
## Features
- Simple, user-friendly web interface built with Streamlit
- Test score prediction based on study hours
- Interactive input controls
- Immediate prediction results
## Architecture
The application is built using:
- Streamlit for the web interface
- Scikit-learn for the machine learning model (Linear Regression)
- Joblib for model loading
## Documentation
- [Application Guide](application-guide.md)
- [Model Information](model-info.md)
- [Getting Started](getting-started.md)

31
docs/model-info.md Normal file
View File

@ -0,0 +1,31 @@
# Model Information
## Overview
The Streamlit Score Predictor uses a Linear Regression machine learning model trained to predict test scores based on the number of hours studied.
## Model Details
- **Model Type**: Linear Regression
- **Features Used**:
- Hours Studied: Number of hours a student studied
- **Output**: Predicted test score
- **Model File**: `linear_regression_model.pkl`
- **Scaler File**: `scaler.pkl`
## Dataset
The model was trained on a dataset containing information about students' study hours and their corresponding test scores.
## Model Performance
The model demonstrates a strong correlation between hours studied and test scores, with typical metrics showing:
- R² score: ~0.95
- Mean Absolute Error: ~2-3 points
## Limitations
- The model assumes a linear relationship between study hours and test scores
- The model may not account for other factors that influence test performance (quality of study, prior knowledge, etc.)
- Predictions for very low or very high study hours may be less reliable
- The model is intended for educational purposes and should not be used for critical decision-making

12
mkdocs.yml Normal file
View File

@ -0,0 +1,12 @@
site_name: 'Streamlit Score Predictor'
nav:
- Home: index.md
- Application Guide: application-guide.md
- Model Information: model-info.md
- Getting Started: getting-started.md
plugins:
- techdocs-core
markdown_extensions:
- admonition
- pymdownx.highlight
- pymdownx.superfences