Skip to content

Commit 0680f9d

Browse files
committed
Add docstrings and README for scipy clustering
1 parent d766a2c commit 0680f9d

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Scientific Python: Using SciPy for Optimization
2+
3+
The code in this folder is associated with the Real Python tutorial [_Scientific Python: Using SciPy for Optimization_](https://realpython.com/python-scipy-cluster-optimize/).
4+
5+
The dataset for the SMS spam clustering example, contained in the file SMSSpamCollection in this folder, is discussed in following articles:
6+
7+
Almeida, T.A., Gómez Hidalgo, J.M., Yamakami, A. Contributions to the Study of SMS Spam Filtering: New Collection and Results. Proceedings of the 2011 ACM Symposium on Document Engineering (DOCENG'11), Mountain View, CA, USA, 2011\. [preprint](http://www.dt.fee.unicamp.br/~tiago/smsspamcollection/doceng11.pdf)
8+
9+
Gómez Hidalgo, J.M., Almeida, T.A., Yamakami, A. On the Validity of a New SMS Spam Collection. Proceedings of the 11th IEEE International Conference on Machine Learning and Applications (ICMLA'12), Boca Raton, FL, USA, 2012\. [preprint](http://www.dt.fee.unicamp.br/~tiago/smsspamcollection/icmla12.pdf)
10+
11+
Almeida, T.A., Gómez Hidalgo, J.M., Silva, T.P. Towards SMS Spam Filtering: Results under a New Dataset. International Journal of Information Security Science (IJISS), 2(1), 1-18, 2013\. [Invited paper - [full version](http://www.dt.fee.unicamp.br/~tiago/smsspamcollection/IJISS13.pdf)]
12+
13+
The original data is available from the [author's website](http://www.dt.fee.unicamp.br/~tiago/smsspamcollection/).

python-scipy-cluster-optimize/cluster_sms_spam.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
Clustering example using an SMS spam dataset with SciPy.
3+
4+
Associated with the Real Python article
5+
Scientific Python: Using SciPy for Optimization
6+
Available at: https://realpython.com/python-scipy-cluster-optimize/
7+
"""
18
from pathlib import Path
29
import numpy as np
310
from scipy.cluster.vq import whiten, kmeans, vq

python-scipy-cluster-optimize/minimize_constrained.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
Constrained minimization example code using SciPy.
3+
4+
Associated with the Real Python article
5+
Scientific Python: Using SciPy for Optimization
6+
Available at: https://realpython.com/python-scipy-cluster-optimize/
7+
"""
18
import numpy as np
29
from scipy.optimize import minimize, LinearConstraint
310

python-scipy-cluster-optimize/minimize_scalar.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
Scalar function minimization example using SciPy.
3+
4+
Associated with the Real Python article
5+
Scientific Python: Using SciPy for Optimization
6+
Available at: https://realpython.com/python-scipy-cluster-optimize/
7+
"""
18
from scipy.optimize import minimize_scalar
29

310

0 commit comments

Comments
 (0)