<commit_before>#include "View.h"

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
typedef boost::numeric::ublas::matrix<double> MatrixD;

using namespace std;

typedef set<Cluster*> setCp;

View::View(const MatrixD data,
	   vector<int> global_row_indices,
	   vector<int> global_col_indices,
	   map<int, map<string, double> > &hypers_m,
	   int SEED, int N_GRID) : n_grid(N_GRID), rng(SEED) {
  assert(global_row_indices.size()==data.size1());
  assert(global_col_indices.size()==data.size2());
  //
  crp_alpha = 0.8;
  crp_score = 0;
  data_score = 0;
  //
  for(int data_col_idx=0; data_col_idx<data.size2(); data_col_idx++) {
    vector<double> col_data = extract_col(data, data_col_idx);
    int global_col_idx = global_col_indices[data_col_idx];
    map<string, double> &hypers = hypers_m[global_col_idx];
    insert_col(col_data, global_row_indices, global_col_idx, hypers);
  }
}

View::View(int SEED) : rng(SEED) {
  n_grid = 31;
  crp_alpha = 0.8;
  crp_score = 0;
  data_score = 0;
}

double View::get_num_vectors() const {
  return cluster_lookup.size();
}

double View::get_num_cols() const {
  return global_to_local.size();
}

int View::get_num_clusters() const {
  return clusters.size();
}

double View::get_crp_score() const {
  return crp_score;
}

double View::get_data_score() const {
  return data_score;
}

double View::get_score() const {
  return crp_score + data_score;
}

double View::get_crp_alpha() const {
  return crp_alpha;
}

vector<double> get_crp_alpha_grid() const {
  return crp_alpha_grid;
}

vector<string> View::get_hyper_strings() {
  vector<string> hyper_strings;
  hyper_strings.push_back("r");
  hyper_strings.push_back("nu");
  hyper_strings.push_back("s");<commit_msg>add View:: prefix to get_crp_alpha_grid definition<commit_after>#include "View.h"

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
typedef boost::numeric::ublas::matrix<double> MatrixD;

using namespace std;

typedef set<Cluster*> setCp;

View::View(const MatrixD data,
	   vector<int> global_row_indices,
	   vector<int> global_col_indices,
	   map<int, map<string, double> > &hypers_m,
	   int SEED, int N_GRID) : n_grid(N_GRID), rng(SEED) {
  assert(global_row_indices.size()==data.size1());
  assert(global_col_indices.size()==data.size2());
  //
  crp_alpha = 0.8;
  crp_score = 0;
  data_score = 0;
  //
  for(int data_col_idx=0; data_col_idx<data.size2(); data_col_idx++) {
    vector<double> col_data = extract_col(data, data_col_idx);
    int global_col_idx = global_col_indices[data_col_idx];
    map<string, double> &hypers = hypers_m[global_col_idx];
    insert_col(col_data, global_row_indices, global_col_idx, hypers);
  }
}

View::View(int SEED) : rng(SEED) {
  n_grid = 31;
  crp_alpha = 0.8;
  crp_score = 0;
  data_score = 0;
}

double View::get_num_vectors() const {
  return cluster_lookup.size();
}

double View::get_num_cols() const {
  return global_to_local.size();
}

int View::get_num_clusters() const {
  return clusters.size();
}

double View::get_crp_score() const {
  return crp_score;
}

double View::get_data_score() const {
  return data_score;
}

double View::get_score() const {
  return crp_score + data_score;
}

double View::get_crp_alpha() const {
  return crp_alpha;
}

vector<double> View::get_crp_alpha_grid() const {
  return crp_alpha_grid;
}

vector<string> View::get_hyper_strings() {
  vector<string> hyper_strings;
  hyper_strings.push_back("r");
  hyper_strings.push_back("nu");
  hyper_strings.push_back("s");
{'fraction_non_alphanumeric': 0.14030261348005502, 'fraction_numerical': 0.007702888583218707, 'mean_word_length': 5.334494773519164, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, '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': '4762059', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1391, 'n_words': 244}