Skip to content

Commit eae6f57

Browse files
committed
change project namespace
1 parent c804f4c commit eae6f57

30 files changed

+100
-94
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ OpenCF - a PHP Item-based Collaborative Filtering Engine.
44

55
![PHP Composer](https://github.com/phpjuice/opencf/workflows/PHP%20Composer/badge.svg?branch=master)
66
[![Build Status](https://travis-ci.com/phpjuice/opencf.svg?branch=master)](https://travis-ci.com/phpjuice/opencf)
7-
7+
88
## Requirements
9+
910
OpenCF Package requires PHP 5.6+
11+
1012
> **WARNING:** This library may not function correctly on PHP < 5.6.
1113
1214
## Getting Started
1315

1416
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
1517

16-
1718
### Installing
1819

1920
The supported way of installing the OpenCF Package is via Composer.
@@ -26,34 +27,37 @@ $ composer require opencf/opencf
2627

2728
OpenCF Package is designed to be very simple and straightforward to use. All you have to do is to load rating data, then predict future ratings based on the training set provided.
2829

29-
3030
## Running the tests
3131

3232
you can easly run tests using composer
3333

34-
``` bash
34+
```bash
3535
$ composer test
3636
```
3737

3838
## Built With
3939

40-
* [PHP](http://www.php.net) - The programing language used
41-
* [Composer](https://getcomposer.org) - Dependency Management
42-
* [PHPUnit](https://phpunit.de/) - Programmer-oriented testing framework for PHP.
40+
- [PHP](http://www.php.net) - The programing language used
41+
- [Composer](https://getcomposer.org) - Dependency Management
42+
- [PHPUnit](https://phpunit.de/) - Programmer-oriented testing framework for PHP.
4343

4444
## Contributing
4545

4646
Please read [CONTRIBUTING](https://gitlab.com/opencf/opencf/wikis/) for details.
4747

4848
## Versioning
4949

50-
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://gitlab.com/opencf/opencf/tags).
50+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://gitlab.com/opencf/opencf/tags).
5151

5252
## Authors
5353

54-
- [ElHaouari Mohammed](https://github.com/elhaouari-mohammed)
54+
- [ElHaouari Mohammed](https://github.com/elhaouari-mohammed)
5555

5656
See also the list of [contributors](https://gitlab.com/opencf/opencf/graphs/master) who participated in this project.
5757

5858
## License
59-
This project is licensed under the MIT License - see the [LICENSE.md](https://gitlab.com/opencf/opencf/blob/master/LICENSE) file for details
59+
60+
This project is licensed under the MIT License - see the [LICENSE.md](./LICENSE) file for details
61+
62+
![PHP Composer](https://github.com/phpjuice/opencf/workflows/PHP%20Composer/badge.svg?branch=master)
63+
[![Build Status](https://travis-ci.com/phpjuice/opencf.svg?branch=master)](https://travis-ci.com/phpjuice/opencf)

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
},
2626
"autoload": {
2727
"psr-4": {
28-
"OpenCF\\OpenCF\\": "src"
28+
"OpenCF\\": "src"
2929
}
3030
},
3131
"autoload-dev": {
3232
"psr-4": {
33-
"OpenCF\\OpenCF\\Tests\\": "tests"
33+
"OpenCF\\Tests\\": "tests"
3434
}
3535
},
3636
"scripts": {

src/Algorithms/Predictor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms;
3+
namespace OpenCF\Algorithms;
44

5-
use OpenCF\OpenCF\Contracts\IPredictor;
6-
use OpenCF\OpenCF\Contracts\IVector;
5+
use OpenCF\Contracts\IPredictor;
6+
use OpenCF\Contracts\IVector;
77

88
abstract class Predictor implements IPredictor
99
{

src/Algorithms/Recommender.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms;
3+
namespace OpenCF\Algorithms;
44

5-
use OpenCF\OpenCF\Contracts\IRecommender;
6-
use OpenCF\OpenCF\Support\Vector;
5+
use OpenCF\Contracts\IRecommender;
6+
use OpenCF\Support\Vector;
77

88
abstract class Recommender implements IRecommender
99
{
@@ -31,7 +31,7 @@ abstract class Recommender implements IRecommender
3131
/**
3232
* Predictor.
3333
*
34-
* @var \OpenCF\OpenCF\Contracts\IPredictor
34+
* @var \OpenCF\Contracts\IPredictor
3535
*/
3636
protected $predictor;
3737

@@ -80,31 +80,33 @@ public function buildModel()
8080
} catch (\InvalidArgumentException $e) {
8181
continue;
8282
}
83-
}//endforeach
84-
}//endforeach
85-
return $this;
83+
}
84+
}
85+
86+
return $this;
8687
}
8788

8889
/**
8990
* {@inheritdoc}
9091
*/
9192
public function predict(array $evaluation)
9293
{
93-
$preds = [];
94+
$predictions = [];
9495
foreach ($this->model as $key => $items) {
9596
// if the rating is present in the
9697
// evaluation given by the user we skip
9798
if (isset($evaluation[$key])) {
9899
continue;
99100
}
100101
try {
101-
$preds[$key] = $this->predictor
102+
$predictions[$key] = $this->predictor
102103
->getPrediction($evaluation, $key);
103104
} catch (\Exception $e) {
104105
continue;
105106
}
106-
}//endforeach
107-
return $preds;
107+
}
108+
109+
return $predictions;
108110
}
109111

110112
/**

src/Algorithms/Similarity/Cosine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms\Similarity;
3+
namespace OpenCF\Algorithms\Similarity;
44

5-
use OpenCF\OpenCF\Algorithms\Recommender;
5+
use OpenCF\Algorithms\Recommender;
66

77
class Cosine extends Recommender
88
{

src/Algorithms/Similarity/Predictor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms\Similarity;
3+
namespace OpenCF\Algorithms\Similarity;
44

5-
use OpenCF\OpenCF\Algorithms\Predictor as AbstractPredictor;
5+
use OpenCF\Algorithms\Predictor as AbstractPredictor;
66

77
class Predictor extends AbstractPredictor
88
{

src/Algorithms/Similarity/Similarity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms\Similarity;
3+
namespace OpenCF\Algorithms\Similarity;
44

5-
use OpenCF\OpenCF\Contracts\ISimilarity;
6-
use OpenCF\OpenCF\Contracts\IVector;
5+
use OpenCF\Contracts\ISimilarity;
6+
use OpenCF\Contracts\IVector;
77

88
class Similarity implements ISimilarity
99
{

src/Algorithms/Similarity/WeightedCosine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms\Similarity;
3+
namespace OpenCF\Algorithms\Similarity;
44

55
class WeightedCosine extends Cosine
66
{

src/Algorithms/Slopeone/Predictor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms\Slopeone;
3+
namespace OpenCF\Algorithms\Slopeone;
44

5-
use OpenCF\OpenCF\Algorithms\Predictor as AbstractPredictor;
5+
use OpenCF\Algorithms\Predictor as AbstractPredictor;
66

77
class Predictor extends AbstractPredictor
88
{

src/Algorithms/Slopeone/Similarity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace OpenCF\OpenCF\Algorithms\Slopeone;
3+
namespace OpenCF\Algorithms\Slopeone;
44

5-
use OpenCF\OpenCF\Contracts\ISimilarity;
6-
use OpenCF\OpenCF\Contracts\IVector;
5+
use OpenCF\Contracts\ISimilarity;
6+
use OpenCF\Contracts\IVector;
77

88
class Similarity implements ISimilarity
99
{

0 commit comments

Comments
 (0)