<commit_before>from __future__ import absolute_import, division, print_function
import numpy as np


def load_behav(filename, TR = 2.0):
    """
    Loads in clean data from `behavdata.txt`.

    Parameters
    ----------
    filename : str

    TR : float

    Returns
    -------
    Numpy array with columns
    """
    raw = [row.split() for row in open(filename, "r").readlines()[1:]]
    float_T = list(np.array(raw, dtype=float).T)
    onset, gain, loss, decision = float_T[0], float_T[1], float_T[2], float_T[5]
    data = np.array([onset // TR, gain, loss, decision], dtype=int).T
    return data


def svm(data, behav):
    """
    Estimates coefficients for 

    Parameters<commit_msg>WIP: Revisions to support vector machine<commit_after>from __future__ import absolute_import, division, print_function
import numpy as np


def load_behav(filename, TR = 2.0):
    """
    Loads in clean data from `behavdata.txt`.

    Parameters
    ----------
    filename : str

    TR : float

    Returns
    -------
    Numpy array with columns
    """
    raw = [row.split() for row in open(filename, "r").readlines()[1:]]
    float_T = list(np.array(raw, dtype=float).T)
    onset, gain, loss, decision = float_T[0], float_T[1], float_T[2], float_T[5]
    data = np.array([onset // TR, gain, loss, decision], dtype=int).T
    return data
    

def svm(data, behav):
    """
    Estimates coefficients for 

    Parameters
{'fraction_non_alphanumeric': 0.14385964912280702, 'fraction_numerical': 0.009824561403508772, 'mean_word_length': 2.7526315789473683, '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': '6390813', 'n_tokens_mistral': 474, 'n_tokens_neox': 452, 'n_words': 132}