Optimizing Electric Vehicle Charging Costs Using Machine Learning

ABSTRACT


INTRODUCTION
Develop the standards that will serve as the foundation for the decision-making model that will be used to regulate the price of Electric Vehicles.In this post, we examine how these variables could be incorporated into a decision-making model to keep the cost of recharging Electric Vehicles under control.A collection of these variables is called an information system [1].Public charging stations are crucial to facilitate EV use, but fluctuations in electricity prices and unpredictable user demand can lead to inefficiencies and high charging costs.This significantly impacts both individual electric vehicle owners and the utility companies that manage the grid.The system uses a combination of public and user-specific data to develop an accurate picture of charging needs and costs.Public data sources include fluctuations in electricity prices throughout the data, historical pattern of energy consumption, local weather data (temperature), and transportation data reflecting typical driving habits of users [2].
An information system (IS) that can sort through real and varied data using Machine Learning (ML) techniques in order to detect trends and make effective judgments in real time.
This would allow us to make decisions more quickly.Examine actual and varied data using machine learning algorithms to find patterns that will subsequently be applied to make realtime decisions successfully [3].One of the ways to build with discrete time intervals of data, such as electricity pricing and demand, is to create a lagged array that may be used to handle several time series variables at the same time.Databases that include information to learn from are a unique feature of datadriven models [4].The criteria for constructing the decisionmaking model to regulate electric vehicle charging costs will include factors such as electricity pricing, demand, and optimization methods, aiming to reduce overall expenses while ensuring efficient charging.
Limited data sources incorporate a wider range of data, including electricity pricing, demand, driving habits, and historical information.Static optimization is a traditional approach that may not adapt to dynamic factors.This system uses real-time data for continuous decision making.Suboptimal algorithms, while Dynamic Programming offers an optimal solution, it might be computationally expensive.The proposed approach explores Q-learning with reinforcement learning for a potentially more scalable solution [5].

LITERATURE REVIEW
Machine learning techniques to analyze real and diverse data, allowing real-time trend detection and effective decisionmaking in the management of electric vehicle charging operations.The development in creating a lagged array of discrete time intervals, incorporating multiple time series variables related to electricity pricing and demand.This approach enables the comprehensive handling of complex factors and facilitates the identification of patterns crucial for informed decision-making [6].Data-driven models used databases rich in relevant information, allowing continuous learning and adaptation.The selection of relevant data for the training process is vital to ensure the effectiveness of the solution in managing electric vehicle charging costs.
The decision model considers factors such as electricity prices, demand, driving habits, and historical data.Public data on electricity pricing, energy consumption, temperature, and transportation habits are used in the analysis [7].Adil et al. [8] proposed machine learning by analyzing various data sources, machine learning algorithms will identify ideal locations for stations, considering factors like traffic patterns, energy demand, and existing infrastructure.The economic framework of Stackelberg game theory models the interaction between charging station operators and electric vehicle users.Allows for the setting of optimal pricing strategies that encourage station usage while maximizing profits for operators.
Azzouz and Hassen [9] proposed that an growing popularity of Electric Vehicles (EVs) introduces a challenge: optimizing charging schedules to minimize costs and strain on the power grid.This paper explores a solution using deep-reinforcement learning (DRL).Unlike centralized approaches, this method offers a decentralized strategy for charging Electric Vehicles.The article investigates how DRL can recommend optimal charging times for individual Electric Vehicles considering factors such as electricity prices, battery levels, and historical data.This approach aims to reduce charging costs for EV owners while providing flexibility and potentially mitigating grid overload issues.

PROPOSED METHODOLOGY
Figure 1 shows the Proposed Architecture.Various publicly available datasets on electricity costs, power demand, residential and business load profiles, temperature, and so on are currently available for use by the public [10].As a result, there are currently only a few real-world data sets that can be used to study vehicle driving habits and no detailed data set that can be used to construct spatio-temporal models connected to the charging of a large EV fleet.
Using data from a variety of surveys, we can compute the amount of energy used, the amount of power needed, the price of electricity, and the price of gasoline.Due to the fact that we do not have all of these databases from the same city and country, since it is preferable to capture these variables in the same location where a vehicle is used, we make the following assumptions: (1) This data set is not affected by the electricity rate.
(2) The price of electricity is closely related to the amount of electricity consumed.
For the same distance driven, gasoline costs more than electricity.

Figure 1. Proposed architecture
Data on driving habits and electricity prices collected for these studies, while not coming from the same location, provide valuable information about how Electric Vehicles handle charging.The following are the databases that were used in the experiments: We used data available online from the Waterloo Weather Station1 to estimate the outside temperature [11].In the Canadian city of Winnipeg, 17 different conventional vehicle GPS-based usage information was collected.Despite the fact that it does not perfectly reflect the cost of electricity for Ontarians, it is a reliable predictor of the hourly price of electricity.HOD is the total of all hourly loads from the IESOadministered market in Ontario.The HOD is calculated on a daily basis.Last but not least, the Ontario Ministry of Energy publishes weekly averages for the price of normal unleaded gasoline throughout the province.This database can be used to calculate the true cost of gas-powered transportation.

Univariate analysis
Analysis in the frequency domain and other fundamental statistical methods are the subject of univariate analysis.We quantify the central tendency and the dispersion with the mean (the first statistical moment) and the variance (the second statistical moment), respectively.The disproportion between extremes and mean is quantified by the coefficient of skewness of the sample.The histogram is perfectly symmetrical, which indicates that there is no skewness.If the skewness is positive, then more values are below the mean than above it, and if it is negative, then more values are above it.The level of peakiness in a histogram can be quantified by calculating the dimensionless sample coefficient of kurtosis (fourth statistical moment).For this purpose, we will use the number of three, which is the mean of a normal distribution [12].
In Table 1, analysis in the frequency domain and other fundamental statistical methods are the subject of univariate analysis.We quantify the central tendency and dispersion with the mean and variance, respectively.The disproportion between extremes and mean is quantified by the coefficient of skewness of the sample.The histogram is perfectly symmetrical, which indicates that there is no skewness.If the skewness is positive, then more values are below the mean than above it, and if it is negative, then more values are above it.The level of peakiness in a histogram can be quantified by calculating the dimensionless sample coefficient of kurtosis.For this purpose, we will use the number of three, which is the mean of a normal distribution [13].Figure 2 displays the Graph of statistical values of the dataset. of the data set.
(1) Initialize the system and data sources: • Load the data set containing electricity prices, demand, driving habits, and historical data.
• Load public facts on electricity pricing, power use, temperature, and driving behaviours.
The objective is to minimize charging costs, and knowing the real-time or predicted electricity prices is crucial.The DRL model can use these data to identify periods with lower electricity rates and recommend charging during those times.past electricity price trends, user charging habits, and historical demand in the power grid.Analyzing these data helps the DRL model predict future patterns and make informed decisions about charging schedules.It might also include past charging cycles of the specific EV to account for battery degradation and charging efficiency variations.
(2) Perform data pre-processing and analysis: • Perform necessary data preprocessing and feature engineering.
• Normalize or scale the numerical features, if required.
• Partition of the data set into test and training sets.
• Apply univariate and multivariate analysis techniques to investigate data set complexity and gain insight.
• Explore the linear connections and periodicity between trip distances and vehicle energy use.
(3) Select a random forest machine learning algorithm for optimizing the charging strategy: • model = RandomForestRegressor() (4) Initialize the machine learning model with chosen hyperparameters: • Update the model's parameters iteratively to minimize the loss or maximize the objective function.
• Apply gradient descent, backpropagation, or other optimization techniques specific to the chosen algorithm.
(6) Predict the charging strategy: • Use the trained model to predict the optimal charging strategy based on input features such as electricity pricing, demand, driving habits, and historical data.
(7) Apply the The Principal component analysis (PCA): • Use PCA to evaluate the variables of electricity price, demand, temperature, and distance.
• Determine the relevant aspects and preserve the data variance using PCA.• Analyze the clustering results to understand pricing options and seasonal changes.
(9) Apply machine learning algorithms for prediction: • Train machine learning algorithms using the dataset to predict charging trends.
• Evaluate the accuracy of the predictions.(10) Optimize charging techniques and reduce costs: • Utilize the predictions of the machine learning algorithms to optimize charging techniques.
• Adjust the charging strategy based on real-time trends and patterns.
(11) Evaluate the accuracy and efficiency of the system: • Calculate evaluation metrics such as mean squared error, accuracy.
(12) Adapt to changing conditions and enhance charging efficiency: • Utilize electricity costs, power consumption, load profiles, and temperature data to adapt the system to changing conditions.
• Enhance the charging efficiency by adjusting the charging strategy based on the seasonal charging behavior and energy use.
(13) Evaluate the system performance: • Measure the accuracy of the system's predictions and adjustments to seasonal changes.
• Assess the reduction in charging expenses compared to traditional approaches.
Data quality and consistency, data availability and granularity, data relevance, and bias.The algorithm begins by initializing the system and loading the required data sources, including a dataset with electricity prices, demand, driving habits, and historical data, as well as public facts related to electricity prices, power use, temperature, and driving behaviors.Data pre-processing and analysis are then performed, which involves handling missing values, outliers, and categorical variables, as well as normalizing or scaling numerical features [14].The data set is split into training and testing sets, and univariate and multivariate analysis techniques are applied to gain insights into the data set's complexity.The algorithm selects the Random Forest Regressor as the machine learning algorithm for optimizing the charging strategy.The model is initialized with chosen hyperparameters and a grid search is used to tune the hyperparameters.The model is trained on the training data set and the input features and target variable are fed to the model.The model parameters are updated iteratively to minimize loss or maximize the objective function.The trained model is then used to predict the optimal charging strategy based on the input characteristics, considering the price of electricity, demand, driving habits, and historical data.Principle Component Analysis (PCA) is applied to evaluate the variables of electricity price, demand, temperature, and distance and determine their relevance.Univariate analysis probably refers to analyzing each dataset (electricity prices, battery levels, etc.) independently.This can provide valuable information before feeding them into the DRL model.Statistical Significance: Statistical tests can determine whether the observed trends in each data set are statistically significant or simply due to random chance.This helps to identify reliable patterns from which the DRL model can learn.Insights on Individual Variables Analyzing each variable helps to understand its range, distribution, and potential outliers.For example, analyzing historical electricity prices might reveal peak and off-peak hours, informing the DRL model on costeffective charging times.
Clustering techniques are used to identify groupings of data sets and seasonal variations, with a focus on understanding pricing options and seasonal changes [15].Additional machine learning algorithms are trained to predict charging trends and their accuracy is evaluated.The algorithm optimizes charging techniques and reduces costs by taking advantage of predictions from machine learning algorithms and adjusting the charging strategy based on real-time trends and patterns.The system's accuracy and efficiency in sorting and recognizing trends in varied data sources are evaluated using evaluation metrics such as mean squared error and accuracy.
The system adapts to changing conditions and improves charging efficiency by using electricity costs, power consumption, load profiles, and temperature data.The algorithm evaluates the system performance by measuring the accuracy of its predictions and adjustments to seasonal changes, as well as assessing the reduction in charging expenses compared to traditional approaches [16].The algorithm provides a comprehensive framework for developing and evaluating a machine learning-based charging strategy optimization system.Overall, the algorithm encompasses the necessary steps to build and evaluate a machine learning-based charging strategy optimization system.It uses data analysis, machine learning algorithms, hyperparameter tuning, and evaluation metrics to improve charging efficiency and reduce costs in real-world scenarios.

Optimization
When an electric vehicle is plugged in, the smart charging optimization process decides what to do at when times (e.g., every 15 minutes) to maximize efficiency and minimize the owner's energy bill.Optimization is conducted using reinforcement learning.Optimization using Q learning implementation.By integrating reinforcement learning with Q learning, we can optimize the charging judgments of Electric Vehicles (EVs) at a charging station.In this scenario, the environment is the EV charging station and the agent (EV) learns when to charge to minimize costs and maximize efficiency.The goal is to determine the optimal charging policy that minimizes the cost of charging an electric vehicle (EV), taking into consideration the time-of-use electricity pricing structure and the state of charge (SoC) of the EV battery [17,18].
State (s): The SoC of the EV's battery and the current time interval can represent the system's state.
Action (a):The action represents the charging rate or the amount of energy the electric vehicle will absorb during the current time interval.
Reward (R):The reward can be a function of the charging cost, the battery state (such as preventing overcharging or undercharging), and any other relevant factors.
Q-value function (Q(s, a)):The Q-value function represents the anticipated cumulative reward the agent will receive by taking action 'a' in state's' and subsequently adhering to the optimal policy.
Using the Q-learning update formula, the Q-value function can be updated.
-Q(s, a) represents the Q value for state s' and action a'.
-is the learning rate, which determines how frequently the agent revises the Q-value in light of new experiences.It is a numeric value between 0 and 1.
-R is the immediate recompense the EV receives for performing action a in state's.
-The discount factor that determines the value of future rewards is.It is a numeric value between 0 and 1.
-max(Q(s', a')) returns the maximum Q-value for the next state's' (s') across all potential actions a.
-Q(s', a') is the Q-value for the next state's' (s') and action a' that the agent chooses in accordance with its policy.

Exploration-extraction technique
An epsilon-greedy strategy is utilized to strike a balance between investigating new charging strategies and utilizing current knowledge.The agent chooses the action with the highest Q-value with a probability of (1 -) (exploitation) and a random action with a probability of (exploration).As the agent gains more experience and acquires more knowledge, can be lowered over time to gradually transition from protection to exploitation.

Agent
During numerous charging sessions or episodes, the agent (EV) interacts with the station's environment.Throughout each episode, the agent updates its Q values based on the environment's rewards.As training progresses, the agent progressively uses the learned Q values to make better charging decisions.Initially, the agent explores various charging strategies, but as training progresses, the agent increasingly uses the learned Q-values to make better charging decisions.

Optimization algorithm
(1) Initialize the Q value function Q(s, a) with random values.
(3) Select an action a using the epsilon-greedy strategy.
(4) Execute action a in the charging station environment and observe the reward 'R' and the next state's'.
(5) Update the Q-value using the Q-learning update formula.(6) Set the current state 's' to the next state 's'.(7) Repeat steps 3 to 6 for multiple charging sessions.Using reinforcement learning, Q-learning, and an exploration-exploitation strategy, an electric vehicle (EV) can learn an optimal charging policy that minimizes costs and maximizes efficiency over time [19,20].This enables the electric vehicle to adapt to fluctuating electricity prices and charging demands, allowing it to make better charging judgements in real-world situations.

EXPERIMENTAL AND RESULTS
The cost goal factor is a mathematical equation that tells you what to do when the vehicle is connected to a charging station (Sc) and when it is not (Su).The cost function is expressed as follows when the vehicle is connected: where, b(t) is the decision variable representing the charging action at time t (1 for charging, 0 for standby).C(t) is the cost factor, which at time t may include the price of electricity, the demand, or other pertinent parameters.
The charging rate may vary according to the current state of the battery.
Represents the efficacy of the charging process, ranging from 0 to 1.The discount factor modifies the cost function to accommodate for special circumstances.The equation represents the cost incurred when the vehicle is turned in, taking into consideration the charging decision, electricity cost, energy supplied to the battery, charging efficiency, and any other relevant factors.It can be modified by designating specific values or incorporating additional terms in accordance with the problem's specific context and requirements.In our approach, we suggest using a straightforward threshold-based rule (TBR) that considers the electricity price and the current charge level.The threshold is computed using a sigmoid function: where, x represents the current charge level.a and b are parameters that can be optimized using the CMA-ES method or any other optimization technique.exp[] denotes the exponential function.The sigmoid function helps to determine the threshold on the basis of the present level of charge.The sigmoid function transitions between 0 and 1 as the charge level (x) approaches the value of the parameter b, allowing a progressive change in the decision based on the electricity price.Taking into account the objective function to be optimized, the optimized values of parameters a and b can be obtained using any applicable optimization algorithm.
Using the formula, we define a threshold rule that adapts to the current charge level and electricity price, enabling us to make decisions based on the sigmoidal relationship between these variables.
where, Cel(t) represents the normalized electricity price at time t.x represents the state of charge, SoC(t).f(x, a, b) is the sigmoid function defined as: In this formulation, if the normalized electricity price, Cel(t), is less than or equal to the threshold calculated using the sigmoid function f(x, a, b), the decision variable a(t) is set to 1, indicating that the vehicle should be in the charging mode.Otherwise, if Cel(t) is greater than the threshold, a(t) is set to 0, indicating that the vehicle should be in standby mode.The decision rule allows adaptive charging decisions based on the interaction, enabling efficient management of the charging process.Figure 3 discusses about Total and maximum distance traveled.Table 2 shows the total and maximum one-way distance traveled by vehicles during the evaluation window (in kilometers).Table 3 summarizes the 17 vehicles' average improvement (in percentage) over the standard 10-bins scheme at each t during the summer and winter training periods.

Q Learning
Dynamic programming enables optimal decisions to be made on historical datasets because all vehicle and There is a historical record of environmental information, including projected values.Agent: the DRL model acts as the agent, making decisions about charging schedules.State (S): current situation, including factors such as battery level, electricity price, and time of day.Action (A): the possible charging decisions the agent can make, such as "charge now," "charge later," or "don't charge.Reward (R): the numerical feedback signal the agent receives based on the outcome of its action.A positive reward signifies a good decision (for example, charging during off-peak hours), while a negative reward indicates an undesirable outcome (for example, charging during peak hours).Value Q (Q (S, A)): the future estimated reward the agent expects to receive by taking action A in state S. The DRL model learns and updates these Q-values over time.Research applies dynamic programming to the tagging of historical databases in the state-space format described above.These annotated data, along with standard supervised learning algorithms, can be used to make decisions in real time, such as the optimal time to charge a car.
Figure 4 explained both summer and winter training, the average cost per bin.

Pseudocode:
Initialize Q(S, A) for all states (S) and actions (A) with a small value (e.g., 0) Loop: Observe the current state (S)

Dynamic programming
To formulate the Dynamic Programming (DP) model for optimizing electric vehicle (EV) charging, we define the decision model's hyperparameters.The objective is to maximize the cost savings achieved by the AC model compared to the gas-only strategy.Electric Vehicles (EVs) have gained increasing popularity due to their eco-friendly nature and potential cost savings over traditional gas-powered vehicles.Efficient charging of Electric Vehicles can significantly impact cost reduction and energy utilization.To address this challenge, we employ the dynamic programming (DP) model, a powerful technique for solving complex optimization problems.
The objective of the DP model is to maximize the cost savings achieved by employing an Always Charge (AC) strategy for EV charging.We compare this strategy with a gasonly approach, which serves as the baseline.The AC model charges the EV when parked and the battery is not full, considering electricity prices and vehicle-specific characteristics.The DP model represents the charging process as a sequence of discrete time steps.Each time step is associated with a State of Charge (SoC), which represents the battery's current energy level.The DP algorithm selects actions at each time step, determining when and how much to charge the EV, to optimize cost savings.• Define a distance metric, such as the Euclidean distance, to quantify the degree of similarity between states.Smaller distances indicate greater similarity between governments.
• Create the training dataset, which consists of pairs (S_i, A_i) in which S_i represents the state and A_i is the action conducted in that state.Using dynamic programming to determine the optimal charging decisions for various states yields the training dataset.
• Given a new state S, using the defined distance metric, locate the k nearest neighbors in the training data set.The k nearest neighbors are the k states in the training data set with the shortest distance from the newly introduced state S.
• Determine the action A for the new state S based on the majority vote of its k closest neighbors.If the preponderance of the k closest neighbors are in charging mode, the new state S will be assigned to the charging action.If not, it will be delegated to the standby action.
Through cross-validation, the optimal number of neighbors k for the k-NN algorithm is determined.Cross-validation is a technique used to evaluate the performance of an algorithm by dividing training and test datasets into numerous subsets.
Deriving k-NN for EV Charging Optimization: The k-NN algorithm for EV charging optimization is derived from the classification principles underlying the dynamic programming approach to charging decisions.Using the results of dynamic programming to construct the training dataset, the k-NN algorithm capitalizes on the knowledge of optimal charging actions for various states.
When encountering a new state S, the k-NN algorithm identifies its k nearest neighbours in the training data set.These neighbouring states have exhibited comparable taxation practices in the past.The algorithm allocates the new state to the most probable charging action by taking the majority vote of the charge/standby actions of these neighbours.
Then cross-validation is used to evaluate the efficacy of the k-NN algorithm and determine the optimal value of k.Crossvalidation identifies the optimal k-value for optimal charging decisions and the overall optimization of electric vehicle charging operations by evaluating the algorithm in different subsets of the training data set.

Small neural network with clustering and feature selection
In our approach to optimize Electric Vehicle (EV) charging decisions, we suggest a two-layer SNN that takes advantage of both clustering and feature selection.The output layer is linear, while the hidden layer uses a sigmoid transfer function.The network is taught to function by employing the Levenberg-Marquardt algorithm.
We start by using clustering to pick a small but fairly representative subset of the data in the data set.The clustering method collects data points that share similarities and then reduces the resulting dataset, making it easier to train the neural network.
To further improve the SNN's performance, we employ a sequential step-by-step procedure called Backward Greedy Selection to eliminate variables (features) that either degrade or do not substantially improve the neural network's performance.The goal of this feature selection procedure is to keep only those characteristics useful for making a price determination.
First, the sigmoid transfer function () is defined for the SNN's hidden layer as follows: Here, x represents the input to the hidden layer, which is the weighted sum of the inputs from the previous layer.

Linear output function
The linear output function preserves the weighted sum of the inputs from the hidden layer without applying any activation function, making it suitable for regression tasks.

Levenberg-Marquardt Algorithm
The Levenberg-Marquardt algorithm is used to train the SNN.It is an optimization algorithm commonly employed for nonlinear least-squares problems.The algorithm minimizes the difference between the predicted network output and the actual target output by adjusting the weights during training.
The Backward Greedy Selection is a feature selection method that iteratively removes less informative features from the data set to enhance the performance of the neural network.The process involves the following steps: • Start with the complete set of features.
• Train the SNN on the dataset with all the features included.
• Remove the least significant feature (based on some performance metric) from the dataset.
• Retrain the SNN with the reduced set of features.
• Repeat steps 3 to 5 until the desired level of performance improvement is achieved or a stopping criterion is met.

DNN to optimize the charging of Electric Vehicles
DNN offer the advantage of learning a hierarchical representation of the data, in contrast to shallow neural networks SNN Learning complicated associations from a wide range of interdependent variables is made possible by the hierarchical structure represented by a deep neural network's layers of neurons.Due to the high correlational strength, DNNs are particularly suited to investigate the strong correlation found in our complex dataset, which includes data from all cars.
A total of 508 input neurons, four hidden layers of 256, 96, 64, and 32 neurons, and a single output neuron representing the charging action (a(t)) make up the DNN architecture.Activation Functions: Each layer's activation function is the Exponential Linear Unit (ELU), except for the output layer, which uses the softmax function.The ELU activation function is selected due to its ability to effectively manage negative inputs and mitigate the vanishing gradient problem during training, thereby enabling faster and more stable convergence.
Batch Normalization: To further promote convergence and prevent internal covariate shift, after each entirely connected layer, a batch normalization operation is added.By normalizing each batch's input during training, batch normalization stabilizes the training process and enables the network to acquire knowledge more efficiently.
The DNN is trained using the adaptive stochastic gradient descent (Adagrad) method.During training, Adagrad modifies the learning rate for each parameter based on the historical gradients of that parameter.This adaptability enables Adagrad to enhance and accelerate convergence, particularly when working with sparse data.
The ELU is a unit of length that is proportional to the exponent.
For a given input x, the activation function of the ELU is defined as follows: () = ,   ≥ 0,   < 0 (7) x is a hyperparameter that determines the function's slope for negative inputs.
The softmax function is used to convert the logits (raw outputs) of the previous layer into a probability distribution in the output layer.The softmax function for a given vector z is defined as The output of the i-th neuron in the output layer is represented by z_i.exp denotes the exponential function.z_i is the i-th element of the input vector z.
The sum in the denominator runs over all elements z_j of the input vector z.

Always charge model
The research compares the cost savings achieved by three distinct charging strategies for Electric Vehicles: an AC model (Assumption: Vehicle charges when parked and battery is not full), an optimal charging strategy using DP and a gas-only strategy.The results are summarized in Table 4, which shows the cost of each vehicle in each of the three scenarios and the savings in relation to the cost of petroleum.Summer Cost Savings: The AC model achieves considerable cost savings in the summer, ranging from 28% to 74% across vehicles.
The simple AC strategy demonstrates remarkable efficiency, obtaining median gains of 68% in the summer and 56% in the winter, respectively.Low electricity prices on the market significantly reduce the total energy cost of Electric Vehicles, rendering the AC strategy cost-effective even when charging during peak electricity prices.The DP-based optimal charging strategy obtains impressive summer and winter median gains of 95% and 88%, respectively.This indicates that additional improvements can be made to close the disparity between AC and DP strategies, bringing the cost savings closer to the optimal benchmark.The article concludes by highlighting the potential for significant cost savings in electric vehicle charging via the AC paradigm, particularly during the summer months.However, to match the efficacy of the DP-based optimal charging strategy, further development is required.Implementing more advanced optimization techniques could result in greater cost savings and a more efficient use of available energy resources for Electric Vehicles.Supervised learning models are highly dependent on the quality and relevance of training data.Reinforcement learning can be computationally expensive and might require extensive training time.

Machine learning models
In this article, we compare the optimal pricing decisions acquired by dynamic programming (DP) with those obtained via several machine learning (ML) models.Figure 5 shows the ratio of ML model savings to DP model savings, with values close to 1 reflecting efficiency levels that are comparable to the global optimum achieved with DP.Performance of ML Models: The DP-based optimal charging method is the global optimum, but it is unworkable in practice since it demands perfect knowledge of the future.On the other hand, ML models offer effective pricing choices even when no further data is available.Metrics like the Mean Squared Error (MSE) can assess the accuracy of predicted charging schedules compared to actual optimal schedules (known from simulations or historical data).Additional metrics might include cost savings achieved, reduction in peak grid demand, and user satisfaction for a more holistic evaluation.method achieves outstanding results, with a gain ratio of 0.95 being typical.The DNN model is promising for optimizing EV charging, as it can be easily implemented in practical, realworld circumstances.Promising Actors: The average ratios for the summer and winter sessions are 0.88 and 0.80, respectively, demonstrating the efficacy of other methods such as shallow neural networks (SNN).This demonstrates that even a lowcapacity model may be efficiently implemented with a thorough preselection of input variables, allowing the creation of driving habits and regular driving schedules, which are Set the model's hyperparameters learning rate.Define the hyperparameters to tune and their possible values.param_grid = 'n_estimators': [50, 100, 200], 'max_depth': [None, 5, 10], min_samples_split': [2, 5, 10], 'min_samples_leaf': [1, 2, 4] (5) Train the machine learning model: • Fit the chosen algorithm on the training dataset.• Adjust hyperparameters using grid search techniques.Grid_search = GridSearchCV(estimator=model, param_grid=param_grid, cv=5) grid_search.fit(X_train,y_train) • Feed the input features (X_train) and target variable (y_train) to the model.

Figure 3 .
Figure 3.Total and Maximum distance travelled

Figure 4 .
Figure 4.For both summer and winter training, the average cost per bin

Figure 5 .
Figure 5. Model gain for two seasons (a) Summer (b) Winter DNN performs better: The Deep Neural Network (DNN)method achieves outstanding results, with a gain ratio of 0.95 being typical.The DNN model is promising for optimizing EV charging, as it can be easily implemented in practical, realworld circumstances.Promising Actors: The average ratios for the summer and winter sessions are 0.88 and 0.80, respectively, demonstrating the efficacy of other methods such as shallow neural networks (SNN).This demonstrates that even a lowcapacity model may be efficiently implemented with a thorough preselection of input variables, allowing the creation of driving habits and regular driving schedules, which are

Table 1 . Statistical values of datasets Mean Standard Deviation Skewness Kurtosis Minimal Median Maximum
Figure 2. Graph of dataset statistical values (8) Perform clustering: • Apply clustering techniques to reveal data set groupings and seasonal variations.

Table 2 .
Total and maximum one-way distance traveled by vehicles during the evaluation window (in kilometers)

Table 3 .
The 17 vehicles' average improvement (in percentage) of the 17 vehicles over the standard 10-bin scheme at each t during the summer and winter training periods