Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
khumam committed Feb 20, 2019
1 parent 5217b60 commit 313cfa7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,14 @@ echo $data->result;

You can change the dataset folder in `src/KnnCsv.php`

### Train data

```php
$fileCsvName = 'file.csv'; //csv file name
$countData = 20; //Number of data will be inserted
$offset = 1; //Create offset random number
$limit = 200; //Create max random number

new KnnTrain($fileCsvName, $countData, $offset, $limit);
```

6 changes: 0 additions & 6 deletions src/KnnTrain.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
class KnnTrain
{

public $trainData;

public function __construct($filePath, $count, $offset, $limit)
{
$fileCsv = '../dataset/' . $filePath;
Expand All @@ -15,15 +13,11 @@ public function __construct($filePath, $count, $offset, $limit)

for ($i = 0; $i < $count; $i++) {


for ($j = 0; $j < $numcount; $j++) {

$train[$j] = rand($offset, $limit);

}
new KnnCsv($filePath, $train, 3, true);
}

//$this->trainData = $train;
}
}

0 comments on commit 313cfa7

Please sign in to comment.