Skip to content

Commit d008f2c

Browse files
committed
Initial commit
0 parents  commit d008f2c

27 files changed

+15687
-0
lines changed

.env

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
# https://symfony.com/doc/current/configuration/secrets.html
13+
#
14+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16+
17+
###> symfony/framework-bundle ###
18+
APP_ENV=dev
19+
APP_SECRET=04f078e0e73df4dbe4c0968eec4e475c
20+
###< symfony/framework-bundle ###
21+
22+
APP_DATASET_DEFAULT_CACHE_LIFETIME=31536000

.env.dev

Whitespace-only changes.

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.idea
2+
composer.phar
3+
4+
###> symfony/framework-bundle ###
5+
/.env.local
6+
/.env.local.php
7+
/.env.*.local
8+
/config/secrets/prod/prod.decrypt.private.php
9+
/public/bundles/
10+
/var/
11+
/vendor/
12+
###< symfony/framework-bundle ###
13+
14+
###> friendsofphp/php-cs-fixer ###
15+
/.php-cs-fixer.php
16+
/.php-cs-fixer.cache
17+
###< friendsofphp/php-cs-fixer ###
18+
19+
###> phpstan/phpstan ###
20+
phpstan.neon
21+
###< phpstan/phpstan ###
22+
23+
###> squizlabs/php_codesniffer ###
24+
/.phpcs-cache
25+
/phpcs.xml
26+
###< squizlabs/php_codesniffer ###

.php-cs-fixer.dist.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__)
5+
->exclude('var')
6+
;
7+
8+
return (new PhpCsFixer\Config())
9+
->setRules([
10+
'@Symfony' => true,
11+
'@PSR12' => true,
12+
'single_line_empty_body' => false,
13+
'global_namespace_import' => true,
14+
'yoda_style' => false,
15+
'class_attributes_separation' => false,
16+
'concat_space' => false,
17+
'nullable_type_declaration_for_default_null_value' => true,
18+
'method_argument_space' => false,
19+
])
20+
->setFinder($finder)
21+
;

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# php-dataset-clustering
2+
3+
Example of data clustering using Rubix ML and the K Means algorithm. Written in PHP 8.4 with Symfony Console.
4+
5+
## Most important classes
6+
7+
* [SolveTaskCommand](./src/UI/CLI/SolveTaskCommand.php)
8+
* [DatasetClusterer](./src/Application/ML/DatasetClusterer.php)
9+
* [ArrayDatasetRepository](./src/Infrastructure/Repository/ArrayDatasetRepository.php)
10+
* [ClusteringAnalysisDatasetFactory](./src/Application/Analytics/ClusteringAnalysisDatasetFactory.php)
11+
12+
## Commands
13+
14+
```
15+
Available commands for the "app" namespace:
16+
app:solve-task
17+
```
18+
19+
## Copyrights
20+
21+
Copyright © Rafał Mikołajun 2024.

bin/console

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use App\Kernel;
5+
use Symfony\Bundle\FrameworkBundle\Console\Application;
6+
7+
if (!is_dir(dirname(__DIR__).'/vendor')) {
8+
throw new LogicException('Dependencies are missing. Try running "composer install".');
9+
}
10+
11+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
12+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
13+
}
14+
15+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
16+
17+
return function (array $context) {
18+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
19+
20+
return new Application($kernel);
21+
};

composer.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"type": "project",
3+
"license": "proprietary",
4+
"minimum-stability": "stable",
5+
"prefer-stable": true,
6+
"require": {
7+
"php": ">=8.4",
8+
"ext-ctype": "*",
9+
"ext-iconv": "*",
10+
"doctrine/collections": "^2.2",
11+
"league/csv": "^9.20",
12+
"markrogoyski/math-php": "^2.10",
13+
"rubix/ml": "^2.5",
14+
"symfony/console": "7.1.*",
15+
"symfony/dotenv": "7.1.*",
16+
"symfony/flex": "^2",
17+
"symfony/framework-bundle": "7.1.*",
18+
"symfony/runtime": "7.1.*",
19+
"symfony/yaml": "7.1.*"
20+
},
21+
"require-dev": {
22+
"friendsofphp/php-cs-fixer": "^3.65",
23+
"phpstan/extension-installer": "^1.4",
24+
"phpstan/phpstan": "^2.0",
25+
"phpstan/phpstan-symfony": "^2.0",
26+
"squizlabs/php_codesniffer": "^3.11",
27+
"symfony/maker-bundle": "^1.61"
28+
},
29+
"config": {
30+
"allow-plugins": {
31+
"php-http/discovery": true,
32+
"phpstan/extension-installer": true,
33+
"symfony/flex": true,
34+
"symfony/runtime": true
35+
},
36+
"sort-packages": true
37+
},
38+
"autoload": {
39+
"psr-4": {
40+
"App\\": "src/"
41+
}
42+
},
43+
"autoload-dev": {
44+
"psr-4": {
45+
"App\\Tests\\": "tests/"
46+
}
47+
},
48+
"replace": {
49+
"symfony/polyfill-ctype": "*",
50+
"symfony/polyfill-iconv": "*",
51+
"symfony/polyfill-php72": "*",
52+
"symfony/polyfill-php73": "*",
53+
"symfony/polyfill-php74": "*",
54+
"symfony/polyfill-php80": "*",
55+
"symfony/polyfill-php81": "*",
56+
"symfony/polyfill-php82": "*"
57+
},
58+
"scripts": {
59+
"auto-scripts": {
60+
"cache:clear": "symfony-cmd",
61+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
62+
},
63+
"post-install-cmd": [
64+
"@auto-scripts"
65+
],
66+
"post-update-cmd": [
67+
"@auto-scripts"
68+
],
69+
"code-check": [
70+
"./vendor/bin/phpcs",
71+
"./vendor/bin/php-cs-fixer check -vvv"
72+
],
73+
"code-fix": [
74+
"./vendor/bin/phpcbf",
75+
"./vendor/bin/php-cs-fixer fix"
76+
],
77+
"phpstan": [
78+
"./vendor/bin/phpstan"
79+
]
80+
},
81+
"conflict": {
82+
"symfony/symfony": "*"
83+
},
84+
"extra": {
85+
"symfony": {
86+
"allow-contrib": false,
87+
"require": "7.1.*"
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)