<commit_before>package io.prediction.e2.evaluation

import org.scalatest.{Matchers, FlatSpec}
import org.apache.spark.rdd.RDD
import io.prediction.e2.fixture.SharedSparkContext
import io.prediction.e2.engine.LabeledPoint



import scala.language.reflectiveCalls

object CrossValidationTest {
  case class TrainingData(labeledPoints: Seq[LabeledPoint])
  case class Query(features: Array[String])
  case class ActualResult(label: String)

  case class EmptyEvaluationParams()

  def toTrainingData(labeledPoints: RDD[LabeledPoint]) = TrainingData(labeledPoints.collect().toSeq)
  def toQuery(labeledPoint: LabeledPoint) = Query(labeledPoint.features)
  def toActualResult(labeledPoint: LabeledPoint) = ActualResult(labeledPoint.label)

}


class CrossValidationTest extends FlatSpec with Matchers
with SharedSparkContext{


  val Label1 = "l1"
  val Label2 = "l2"
  val Label3 = "l3"
  val Label4 = "l4"
  val Attribute1 = "a1"
  val NotAttribute1 = "na1"
  val Attribute2 = "a2"
  val NotAttribute2 = "na2"

  val labeledPoints = Seq(
    LabeledPoint(Label1, Array(Attribute1, Attribute2)),
    LabeledPoint(Label2, Array(NotAttribute1, Attribute2)),<commit_msg>remove unused import<commit_after>package io.prediction.e2.evaluation

import org.scalatest.{Matchers, FlatSpec}
import org.apache.spark.rdd.RDD
import io.prediction.e2.fixture.SharedSparkContext
import io.prediction.e2.engine.LabeledPoint

object CrossValidationTest {
  case class TrainingData(labeledPoints: Seq[LabeledPoint])
  case class Query(features: Array[String])
  case class ActualResult(label: String)

  case class EmptyEvaluationParams()

  def toTrainingData(labeledPoints: RDD[LabeledPoint]) = TrainingData(labeledPoints.collect().toSeq)
  def toQuery(labeledPoint: LabeledPoint) = Query(labeledPoint.features)
  def toActualResult(labeledPoint: LabeledPoint) = ActualResult(labeledPoint.label)

}


class CrossValidationTest extends FlatSpec with Matchers
with SharedSparkContext{


  val Label1 = "l1"
  val Label2 = "l2"
  val Label3 = "l3"
  val Label4 = "l4"
  val Attribute1 = "a1"
  val NotAttribute1 = "na1"
  val Attribute2 = "a2"
  val NotAttribute2 = "na2"

  val labeledPoints = Seq(
    LabeledPoint(Label1, Array(Attribute1, Attribute2)),
    LabeledPoint(Label2, Array(NotAttribute1, Attribute2)),
{'fraction_non_alphanumeric': 0.09424083769633508, 'fraction_numerical': 0.02181500872600349, 'mean_word_length': 5.7441176470588236, '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': '4046062', 'n_tokens_mistral': 775, 'n_tokens_neox': 732, 'n_words': 165}