<commit_before>#!/usr/bin/env python3.5
#
# run_model.py
#
# Script to apply a single PyStan model to a test/training sets.
# The training set is loaded in and the model parameters estimated. The
# resulting fitted model is then used to make predictions for the test set.
# The test set predicitons are then written to file.
#
#
# (C) The James Hutton Institute 2016
# Author: <NAME>

"""
run_model.py

A script to run a single PyStan model script on training/test data and
write predictions to a new output file
"""

import logging
import logging.handlers
import os
import pickle
import pystan
import random
import sys
import time

import pandas as pd

from argparse import ArgumentParser


# The fitting/prediction PyStan model
MODEL = """
data {
  int<lower=0> M;  # number of training datapoints
  int<lower=0> N;  # number of test datapoints
  int<lower=0> J;  # number of unique probes
  int<lower=0> K;  # number of arrays
  int<lower=1, upper=J> tagidx_train[M];  # probe indices (training)
  int<lower=1, upper=J> tagidx_test[N];   # probe indices (test)
  int<lower=1, upper=K> arrayidx_train[M];
  int<lower=1, upper=K> arrayidx_train[N];
  vector[M] t_train;
  vector[N] t_test;
  vector[M] x_train;  # training input datapoints
  vector[N] x_test;   # test input datapoints
  vector[M] y;
}
parameters {
  vector[J] a;
  vector[J] b;
  vector[J] g;
  vector[J] d;
  real mu_a;
  real mu_b;  
  real mu_g;
  real mu_d;  
  real<lower=0> sigma_y;<commit_msg>fix bug in multiplexing model definition<commit_after>#!/usr/bin/env python3.5
#
# run_model.py
#
# Script to apply a single PyStan model to a test/training sets.
# The training set is loaded in and the model parameters estimated. The
# resulting fitted model is then used to make predictions for the test set.
# The test set predicitons are then written to file.
#
#
# (C) The James Hutton Institute 2016
# Author: <NAME>

"""
run_model.py

A script to run a single PyStan model script on training/test data and
write predictions to a new output file
"""

import logging
import logging.handlers
import os
import pickle
import pystan
import random
import sys
import time

import pandas as pd

from argparse import ArgumentParser


# The fitting/prediction PyStan model
MODEL = """
data {
  int<lower=0> M;  # number of training datapoints
  int<lower=0> N;  # number of test datapoints
  int<lower=0> J;  # number of unique probes
  int<lower=0> K;  # number of arrays
  int<lower=1, upper=J> tagidx_train[M];  # probe indices (training)
  int<lower=1, upper=J> tagidx_test[N];   # probe indices (test)
  int<lower=1, upper=K> arrayidx_train[M];
  int<lower=1, upper=K> arrayidx_test[N];
  vector[M] t_train;
  vector[N] t_test;
  vector[M] x_train;  # training input datapoints
  vector[N] x_test;   # test input datapoints
  vector[M] y;
}
parameters {
  vector[J] a;
  vector[J] b;
  vector[J] g;
  vector[J] d;
  real mu_a;
  real mu_b;  
  real mu_g;
  real mu_d;  
  real<lower=0> sigma_y;
{'fraction_non_alphanumeric': 0.09716599190283401, 'fraction_numerical': 0.010121457489878543, 'mean_word_length': 4.094501718213058, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '1174208', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1037, 'n_words': 370}