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
| # Étape 2 : Génération de données factices pour l'exemple | |
| np.random.seed(42) | |
| heures_de_revision = np.random.rand(100, 1) * 10 # Nombre d'heures de révision (variable explicative) | |
| notes_examen = 2 * heures_de_revision + 3 + np.random.randn(100, 1) * 2 # Notes d'examen (variable à prédire) |
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
| # Étape 1 : Importation des bibliothèques nécessaires | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.linear_model import LinearRegression | |
| from sklearn.metrics import mean_squared_error |
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
| var summaries = new[] | |
| { | |
| "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | |
| }; | |
| app.MapGet("/weatherforecast", () => | |
| { | |
| var forecast = Enumerable.Range(1, 5).Select(index => | |
| new WeatherForecast | |
| ( |
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
| builder.Services.AddControllers(); |
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
| var builder = WebApplication.CreateBuilder(args); | |
| // Add services to the container. | |
| builder.Services.AddDbContext<WebAppContext>(options => | |
| { | |
| options.UseSqlServer(builder.Configuration.GetConnectionString("WebAppDB")); | |
| }); |
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
| public virtual ICollection<Utilisateur> Utilisateurs { get; set; } = new List<Utilisateur>(); |
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
| public virtual Metier? Metier { get; set; } |
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
| public virtual ICollection<Utilisateur> Utilisateurs { get; set; } = new List<Utilisateur>(); |
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
| public partial class Utilisateur | |
| { | |
| [Key] | |
| [Column("UtilisateurID")] | |
| public int UtilisateurId { get; set; } | |
| [StringLength(100)] | |
| [Unicode(false)] | |
| public string? Nom { get; set; } |
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
| public partial class Metier | |
| { | |
| [Key] | |
| [Column("MetierID")] | |
| public int MetierId { get; set; } | |
| [StringLength(100)] | |
| [Unicode(false)] | |
| public string? Libelle { get; set; } |