Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class ANFIS Metaheuristic Time Series Forecasting #4: Optimizing ANFIS Parameters with PSO and Genetic Algorithm”.
Other ways we can help with Python.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Multi-Objective Optimization Course: NSGA-II, MOPSO & Hybrid Algorithms (Python)

ECG Arrhythmia Classification Course with Wavelet & Deep Learning (PyTorch)

ANFIS + PSO/GA Course for Non-Linear Time Series Forecasting (Python)
Have it built for you
No time to learn Python? Our team can do the project for you.

Python Machine Learning — Prediction Models, Customer Segmentation, Fraud Detection & AI Apps

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
This is the final result, the ANVIS membership function parameters found by PSO and genetic algorithm. On Mackey Glass, ANVIS is 22% more accurate than gradient descent. On sunspot results are more varied, an important lesson for research. Let's get started. Hello, welcome to episode four of the ANVIS Meta Heuristics series for time series forecasting. Gradient descent can get stuck in local minima and depends on learning rate. Meta Heuristics like PSO and genetic algorithm search globally without gradient. Today we combine it with ANVIS intelligently.
Create file optimasi underscore anvis.py The ANVIS fitness function receives a 16 parameter vector premis, builds ANVIS, calculates the consequent with list scores on 80% training data, then returns RMSI on the remaining 20% as validation data. So Meta Heuristics only searches for 16 parameter premis, and 80 consequents are solved analytically. The PSO function is Standard Particles Swarm Optimization with inertia 0.7. The GA function is real-number genetic algorithm, tournament selection, BLX-alpha crossover that produces offspring around the range of the two parents, gaussian mutation, and elitism of the two best individuals. For each series, we train ANVIS with gradient descent as a reference,
then run PSO and GA with 20 individuals for 40 iterations. Center bounds from -0.2 to 1.2 and width from 0.05 to 1. The best parameters are saved to a JSON file for the next episode. Run. On Mackie Glass, ANVIS PSO achieves RMSI UG 0,0029, ANVIS GA 0,0025, and gradient descent 0,0032. On Sunspot, ANVIS PSO 0,1251, slightly better than gradient descent 0,1265, but ANVIS GA 0,1303, slightly worse although RMSI validation is the smallest. Continue with the convergence fitness graph and RMSI UG comparison.
Let's see the graph. The fitness curve drops quickly in the first 10 iterations. On Sunspot, the model with the best validation is not always the best on the test data, because the validation data is small and the test data contains higher cycles. This is the reason why honest research must choose a model based on validation, not test data.
Done. We have optimized the premise parameters of ANVIS with PSO and genetic algorithm, with consequents still solved list scores, and analyzed the results honestly. In the next episode, we will compare with LSTM and ARIMA. Currently working on a thesis, dissertation, or research in the field of forecasting and artificial intelligence? Cerdas Inovasi Digital helps implement forecasting models, from Sugeno fuzzy systems and ANVIS, parameter optimization with PSO and genetic algorithms, up to LSTM and ARIMA comparisons and Diebold-Mariano tests, as well as opening Python programming courses for engineering. Want to master the entire series, from chaotic time series to statistical evaluation? All six episodes, complete with step-by-step PDF guides, data sets, and source code, are available to premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or pay once Rp999.000 for lifetime access. Want just one class? Buy single classes with lifetime access. Subscribe now at the premium page cerdasinovasidigital.com. Contact our WhatsApp, or visit cerdasinovasidigital.com. Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →