can you modify below code to incorporate with 8 input features for prediction and in conversion to onnx format ?

import pickle
import os
from skl2onnx import convert_sklearn
from skl2onnx.common.data_types import FloatTensorType
import numpy as np

def convert_pickle_to_onnx():
    """
    Converts a scikit-learn model saved as a pickle file to ONNX format compatible with BigQuery.
    
    Steps:
    1. Load the scikit-learn model from a pickle file.
    2. Define sample input data to determine the input shape and type.
    3. Convert the model to ONNX format with a targeted operatorset version.
    4. Save the ONNX model to a specified file path.
    """

    # -------------------------
    # Configuration Parameters
    # -------------------------

    # Path to the input pickle file containing the scikit-learn model
    pickle_path = 'C:\\dsprojects_folder_jupyter\\Discharge-Prediction\\EPIC_REG1.pkl'  # <-- Replace with your pickle file path

    # Path where the ONNX model will be saved
    onnx_path = 'bins_model1.onnx'    # <-- Replace with your desired ONNX file path

    # Sample input data to define the input shape and type
    # Modify this based on the number of features your model expects
    sample_input = [0,33.0,13,0,0,0,146,20,10]  # Example for a model expecting 4 features

    # Target opset version compatible with BigQuery (IR version 8)
    target_opset = 8
    
    # -------------------------
    # Conversion Process
    # -------------------------

    # Check if the pickle file exists
    if not os.path.exists(pickle_path):
        raise FileNotFoundError(f"Pickle file not found: {pickle_path}")

    # Load the scikit-learn model from the pickle file
    with open(pickle_path, 'rb') as file:
        model = pickle.load(file)
    print(f"Loaded model from {pickle_path}")

    # Prepare the sample input for determining input types
    sample_input_np = np.array([sample_input], dtype=np.float32)  # Shape: (1, n_features)
 
    # Define the initial type based on the sample input
   # initial_type = [('input', FloatTensorType([None, sample_input_np.shape[1]]))]
    initial_types = [
       ('Gender', FloatTensorType([None, 1])),
       ('AgeAtAdmission', FloatTensorType([None, 1])),
       ('LevelOfCare', FloatTensorType([None, 1])),
       ('ICDProcedureID', FloatTensorType([None, 1])),
       ('AdmitType', FloatTensorType([None, 1])),
       ('SurgicalCaseFlag', FloatTensorType([None, 1])),
       ('AdmittingDiagnosisCode', FloatTensorType([None, 1])),
       ('PatService', FloatTensorType([None, 1])),
    ]
    # Convert the scikit-learn model to ONNX format with target operatorset version
    try:
        onnx_model = convert_sklearn(
            model, 
            initial_types=initial_types, 
            target_opset=target_opset,
            options = {'zipmap': False}
        )
        print(f"Model successfully converted to ONNX format with target_opset={target_opset}.")
    except Exception as e:
        print(f"Error during conversion: {e}")
        return

    # Save the ONNX model to the specified file
    try:
        with open(onnx_path, "wb") as f:
            f.write(onnx_model.SerializeToString())
        print(f"ONNX model saved at: {onnx_path}")
    except Exception as e:
        print(f"Error saving ONNX model: {e}")

def verify_onnx_model(onnx_path, sample_input):
    """
    Verifies the ONNX model by loading it and performing a test inference.
    
    Parameters:
        onnx_path (str): Path to the ONNX model file.
        sample_input (list or np.ndarray): Sample input data for verification.
    """
    import onnx
    import onnxruntime as ort

    # Load the ONNX model
    try:
        model = onnx.load(onnx_path)
        onnx.checker.check_model(model)
        print(f"ONNX model at {onnx_path} is valid.")
    except Exception as e:
        print(f"Invalid ONNX model: {e}")
        return

    # Initialize ONNX Runtime session
    try:
        session = ort.InferenceSession(onnx_path)
        print("ONNX Runtime session initialized.")
    except Exception as e:
        print(f"Failed to initialize ONNX Runtime session: {e}")
        return

    # Prepare input data
    input_name = session.get_inputs()[0].name
    input_data = np.array([sample_input], dtype=np.float32)

    # Perform inference
    try:
        result = session.run(None, {input_name: input_data})
        print("Inference result:", result)
    except Exception as e:
        print(f"Error during inference: {e}")

# -------------------------
# Execute the Conversion
# -------------------------

if __name__ == "__main__":
    try:
        convert_pickle_to_onnx()
        
        # Optional: Verify the converted ONNX model
        # Replace with actual paths and sample inputs as needed
        onnx_model_path = 'path/to/save_model.onnx'  # Ensure this matches 'onnx_path' in conversion
        sample_input = [5.1, 3.5, 1.4, 0.2]  # Must match the sample_input used during conversion
        verify_onnx_model(onnx_model_path, sample_input)
        
    except Exception as e:
        print(f"An error occurred: {e}")