Skip to content

Instantly share code, notes, and snippets.

# É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)
# É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
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
(
builder.Services.AddControllers();
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddDbContext<WebAppContext>(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("WebAppDB"));
});
public virtual ICollection<Utilisateur> Utilisateurs { get; set; } = new List<Utilisateur>();
public virtual Metier? Metier { get; set; }
public virtual ICollection<Utilisateur> Utilisateurs { get; set; } = new List<Utilisateur>();
public partial class Utilisateur
{
[Key]
[Column("UtilisateurID")]
public int UtilisateurId { get; set; }
[StringLength(100)]
[Unicode(false)]
public string? Nom { get; set; }
public partial class Metier
{
[Key]
[Column("MetierID")]
public int MetierId { get; set; }
[StringLength(100)]
[Unicode(false)]
public string? Libelle { get; set; }