#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 22 11:03:13 2022

@author: bertelsl
"""

# evaluate random forest algorithm for classification
from numpy import mean
from numpy import std
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import RepeatedStratifiedKFold
from sklearn.ensemble import RandomForestClassifier
# define dataset -> X en y worden de input_data en de output labels voor elk gewas-koppel
X, y = ...
# define the model
model = RandomForestClassifier()
# Run 5-fold cross validation and compute accuary and F1
scores = cross_validate(model, X, y, cv=5, scoring=('accuracy', 'f1'))
# report performance
print('Accuracy: %.3f (%.3f)' % (mean(scores['test_accuracy']), std(scores['test_accuracy'])))
print('F1: %.3f (%.3f)' % (mean(scores['test_f1']), std(scores['test_f1'])))

