human
What is a the Python program you requested given the following:
I am working on the file "Luigi_airflow_006.ipynb".
The first task is:
Training
Can you write Python program for it?
assistant
#Here is the Python program you requested.

estimator_RFC = ensemble.RandomForestClassifier()

best_parameters

class Trainer():
    def __init__(self, X_train, y_train, best_params):
        self.X_train = X_train
        self.y_train = y_train
        self.X_test = X_test
        self.y_test = y_test
        self.estimator = None
        self.best_params = best_params

    def build_best_estimator(self):
        params = self.best_params
        model = ensemble.RandomForestClassifier(**params)
        self.estimator = model.fit(self.X_train,self.y_train)
        return self.estimator

    def score_estimator_train(self):
        return self.estimator.score(self.X_train,self.y_train)

    def score_estimator_test(self):
        return self.estimator.score(self.X_test,self.y_test)
    
    def combiner_pipeline(self):
        self.estimator = self.build_best_estimator()
        score_train = self.score_estimator_train()
        score_test = self.score_estimator_test()
        return self.estimator, score_train, score_test
        
    

train = Trainer(X_train, y_train, best_parameters)
estimator, score_train, score_test = train.combiner_pipeline()
print (estimator, score_train, score_test)