<commit_before>import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from ossml.utils import Dataset
from sklearn.externals import joblib


def feature_columns(dataset):
    return [f.name for f in dataset.query_features] + [f.name for f in dataset.shard_features] + ['BID']


def train_payoffs(dataset):
    clf = RandomForestRegressor()
    training_data = dataset.load()
    X = np.array(training_data[feature_columns(dataset)])
    y = np.array(training_data['payoff'])
    clf.fit(X, y)
    return clf


def predict_payoffs(dataset, model):<commit_msg>Verbose learning and no. jobs equal no. cores<commit_after>import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from ossml.utils import Dataset
from sklearn.externals import joblib


def feature_columns(dataset):
    return [f.name for f in dataset.query_features] + [f.name for f in dataset.shard_features] + ['BID']


def train_payoffs(dataset):
    clf = RandomForestRegressor(verbose=True, n_jobs=-1)
    training_data = dataset.load()
    X = np.array(training_data[feature_columns(dataset)])
    y = np.array(training_data['payoff'])
    clf.fit(X, y)
    return clf


def predict_payoffs(dataset, model):
{'fraction_non_alphanumeric': 0.09669621273166801, 'fraction_numerical': 0.0008058017727639, 'mean_word_length': 4.803738317757009, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '182037', 'n_tokens_mistral': 416, 'n_tokens_neox': 397, 'n_words': 109}