Validation Metrics
- Accuracy: 0.8284240188362744
- R2: 0.63
- MSE: 2428.91
- MAE: 34.33
- RMSE: 49.28
Usage
import numpy as np
from numpy import random
import pandas as pd
import onnxruntime as ort
model_path = "rd2l_forest.onnx"
session = ort.InferenceSession(model_path)
input_name = session.get_inputs()[0].name
output_name = session.get_outputs()[0].name
def prediction(input_data : np.ndarray) -> float
"""
Performs inference on the loaded ONNX model using the provided input data.
Args:
input_data (np.ndarray): An array of size (263,), this represents all of a singular players information
Returns:
float: The predicted cost of the player
"""
input_data = input_data.to_numpy(dtype=np.float32).reshape(1, -1)
predictions = session.run([output_name], {input_name: input_data})
return round(float(predictions[0][0][0]), 2)
sample_df = pd.DataFrame(np.random.rand(263))
prediction(sample_df)
license: mit