Setting the n_estimators argument using **kwargs (Scikit Learn)
<p>I am trying to follow <a href="http://blog.yhat.com/posts/predicting-customer-churn-with-sklearn.html" rel="nofollow">this</a> tutorial to learn the machine learning based prediction but I have got two questions on it?</p>

<p>Ques1. How to set the <code>n_estimators</code> in the below piece of code, otherwise it will always assume the default value.</p>

<pre><code>from sklearn.cross_validation import KFold

def run_cv(X,y,clf_class,**kwargs):
# Construct a kfolds object
kf = KFold(len(y),n_folds=5,shuffle=True)
y_pred = y.copy()

# Iterate through folds
for train_index, test_index in kf:
    X_train, X_test = X[train_index], X[test_index]
    y_train = y[train_index]
    # Initialize a classifier with key word arguments
    clf = clf_class(**kwargs)
    clf.fit(X_train,y_train)
    y_pred[test_index] = clf.predict(X_test)
return y_pred
</code></pre>

<p>It is being called as:</p>

<p><code>from sklearn.svm import SVC
 print "%.3f" % accuracy(y, run_cv(X,y,SVC))</code></p>

<p>Ques2: How to use the already trained model file (e.g. obtained from SVM) so that I can use it to predict more (test) data which I didn't used for training?</p>