# Data Test

## CSV Tests - ModelXData.csv.loadCSVURI

    ModelXData.csv.loadCSVURI('https://raw.githubusercontent.com/repetere/modelscript/master/test/mock/data.csv')

## DataSet Tests

### ModelXData.getBinaryValue

          const CSVDataSet = new ModelXData.DataSet(csvData, { debug: false, });
          CSVDataSet.filterColumn(row => row.Salary.toString() === '83000'))

### ModelXData.DataSet.selectColumns

          const cols = ['Age', 'Salary', ];
          const selectedCols = CSVDataSet.selectColumns(cols);

## ModelXData.nlp

### ModelXData.nlp.ColumnVectorizer

    const csvData = [
      {
        'Review': 'This is really good',
        'Liked': 1,
      },
      {
        'Review': 'I would definitely recommend',
        'Liked': 1,
      },
      {
        'Review': 'The wait staff was really rude',
        'Liked': 0,
      },
      {
        'Review': 'Great views',
        'Liked': 1,
      },
      {
        'Review': 'the food was not great',
        'Liked': 0,
      },
      {
        'Review': 'food came out cold, took forever to get seated',
        'Liked': 0,
      },
      {
        'Review': 'we had a great time, and they were really prompt and attentive',
        'Liked': 1,
      },
      {
        'Review': 'the food was bland',
        'Liked': 0,
      },
      {
        'Review': 'not very flavorful',
        'Liked': 0,
      },
      {
        'Review': 'it was kind of so-so',
        'Liked': 0,
      },
    ];
    const eVString = 'I would rate everything Great, views Great, food Great';
    const CSVDataSet = new ModelXData.DataSet(csvData);
    const nlpVectors = new ModelXData.nlp.ColumnVectorizer({
      data: CSVDataSet.columnArray('Review'),
      maxFeatures: 9,
    });
    nlpVectors.fit_transform();

## ModelXData.cross_validation

### ModelXData.cross_validation.train_test_split

          const testArray = [20, 25, 10, 33, 50, 42, 19, 34, 90, 23, ];
          const defaultTrainTestSplitSize = ModelXData.cross_validation.train_test_split(testArray, { test_size: 0.4, });
          const { train, test, } = defaultTrainTestSplitSize;
          expect(train.length).to.equal(6);

## ModelXData.calc

### ModelXData.calc.assocationRuleLearning

          const rawTransactions = [
            ['Cookies', 'Milk', 'Plates', ],
            ['Cups', 'Milk', 'Silverware', ],
            ['Cookies', 'Cups', 'Milk', 'Silverware', ],
            ['Cups', 'Silverware', ],
            ['Cookies', 'Cups', 'Milk', 'Silverware', ],
          ];
          const gt = ModelXData.calc.getTransactions(rawTransactions);
          const arl = await ModelXData.calc.assocationRuleLearning(gt.transactions, {
            valuesMap: gt.valuesMap,
          });