High PV penetration into the electricity grid can lead to issues such as congestion if PV systems are not integrated effectively. Accurate PV power forecasting helps to address this issue. In recent years machine learning approaches have gotten a lot of attention in PV power forecasting due to their ability to extract complex relationships between different variables. Hyperparameters are a vital part of machine learning models, influencing their structure, learning process and accuracy of the forecast. Choosing the right hyperparameters is often one of the key challenges in developing effective machine learning models and therefore accurate PV power forecasts. These hyper-parameters can be optimized through various methods including grid search and random search. In this study, two machine learning models including KNN and SVR are used to forecast the power of a BIPV system installed in Switzerland, using 6 years of measurements. Then the grid search has been applied to these models for hyperparameters optimization. Afterwards, the performances of the models are evaluated using K-Fold cross-validation. The results of this study show that choosing the right hyperparameters leads to a more accurate forecast, as they influence the structure, learning process and performance of the model.