<commit_before>package org.dizhang.seqspark.stat

import breeze.linalg.{DenseMatrix => BDM}
import org.apache.spark.mllib.linalg.{Vector, Vectors}
import org.apache.spark.mllib.feature.{PCA => SPCA}
import org.apache.spark.rdd.RDD
import org.dizhang.seqspark.ds.Genotype
import org.dizhang.seqspark.worker.Data
import org.dizhang.seqspark.util.General._

/**
  * perform PCA for
  */
class PCA[A: Genotype](vcf: Data[A]) {

  def geno = implicitly[Genotype[A]]

  def transpose: RDD[Vector] = {
    val input = vcf
    val byColAndRow = input.zipWithIndex().flatMap{
      case (v, ri) =><commit_msg>testing<commit_after>package org.dizhang.seqspark.stat

import breeze.linalg.{DenseMatrix => BDM}
import org.apache.spark.mllib.linalg.{Vector, Vectors}
import org.apache.spark.mllib.feature.{PCA => SPCA}
import org.apache.spark.rdd.RDD
import org.dizhang.seqspark.ds.Genotype
import org.dizhang.seqspark.worker.Data
import org.dizhang.seqspark.util.General._

/**
  * perform PCA for
  */
@SerialVersionUID(103L)
class PCA[A: Genotype](vcf: Data[A]) extends Serializable {

  def geno = implicitly[Genotype[A]]

  def transpose: RDD[Vector] = {
    val input = vcf
    val byColAndRow = input.zipWithIndex().flatMap{
      case (v, ri) =>
{'fraction_non_alphanumeric': 0.13640032284100082, 'fraction_numerical': 0.002421307506053269, 'mean_word_length': 4.344827586206897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '409574', 'n_tokens_mistral': 491, 'n_tokens_neox': 462, 'n_words': 85}