input: Write a python function to preprocess a dataset with specific transformations as shown in the given code.
  assert preprocess_dataset('data.csv').equals(pd.DataFrame({
      'age': [25, 30],
      'job type': [1, 2],
      'region': [1, 2],
      'gender': [1, 0],
      'salary': [2, 3],
      'satisfaction': [1, 0],
      'feedback': ['good', 'bad']
  }))
  assert preprocess_dataset('data.csv').equals(pd.DataFrame({
      'age': [40, 22],
      'job type': [3, 1],
      'region': [3, 4],
      'gender': [0, 1],
      'salary': [1, 1],
      'satisfaction': [0, 1],
      'feedback': ['average', 'excellent']
  }))
output: import pandas as pd
  
  def preprocess_dataset(file_path):
      df = pd.read_csv(file_path)
  
      # Drop unnecessary columns
      df = df.drop(columns=['id', 'date'])
  
      # Encode categorical variables
      df['job type'] = df['job type'].map({'engineer': 1, 'teacher': 2, 'doctor': 3, 'lawyer': 4})
      df['region'] = df['region'].map({'north': 1, 'south': 2, 'east': 3, 'west': 4})
      df['gender'] = df['gender'].map({'male': 1, 'female': 0})
      df['salary'] = df['salary'].map({'low': 1, 'medium': 2, 'high': 3})
      df['satisfaction'] = df['satisfaction'].map({'yes': 1, 'no': 0})
  
      # Fill missing values
      df = df.fillna({
          'age': df['age'].mean(),
          'job type': df['job type'].mode()[0],
          'region': df['region'].mode()[0],
          'gender': df['gender'].mode()[0],
          'salary': df['salary'].mode()[0],
          'satisfaction': df['satisfaction'].mode()[0]
      })
  
      return df