diff --git a/practical-k-means/README.md b/practical-k-means/README.md index 85caea2df3..c525dac0d4 100644 --- a/practical-k-means/README.md +++ b/practical-k-means/README.md @@ -11,8 +11,10 @@ Follow the instructions below to get up and running with a Jupyter notebook and These notebooks have dependencies. One way to install these dependencies is to use the Anaconda Python distribution. ```bash -(base) $ conda install jupyter matplotlib numpy pandas seaborn scikit-learn -(base) $ conda install -c conda-forge kneed +(base) $ conda install -c conda-forge \ + jupyter "matplotlib=3.11" "numpy=2.5" "pandas=3.1" \ + "seaborn=0.13" "scikit-learn=1.9" +(base) $ conda install -c conda-forge "kneed=0.9" ``` You can also install all the requirements using `pip` and the `requirements.txt` file included in this directory. @@ -26,7 +28,7 @@ $ python3 -m pip install -r requirements.txt Open the notebook that accompanies the sections of the article that work with synthetic data: ```bash -(base) $ jupyter notebook practical-kmeans-synthetic.ipynb +(base) $ jupyter notebook practical-k-means-syntethic.ipynb ``` ### Cancer Gene Expression Data Notebook @@ -34,5 +36,5 @@ Open the notebook that accompanies the sections of the article that work with sy Open the notebook that accompanies the sections of the article that work with TCGA cancer gene expression data: ```bash -(base) $ jupyter notebook practical-kmeans-cancer-gene-expression.ipynb +(base) $ jupyter notebook practical-k-means-cancer-gene-expression.ipynb ``` diff --git a/practical-k-means/practical-k-means-cancer-gene-expression.ipynb b/practical-k-means/practical-k-means-cancer-gene-expression.ipynb index 56ad5753ef..580e2d0f10 100644 --- a/practical-k-means/practical-k-means-cancer-gene-expression.ipynb +++ b/practical-k-means/practical-k-means-cancer-gene-expression.ipynb @@ -359,8 +359,8 @@ "plt.figure(figsize=(8, 8))\n", "\n", "scat = sns.scatterplot(\n", - " \"component_1\",\n", - " \"component_2\",\n", + " x=\"component_1\",\n", + " y=\"component_2\",\n", " s=50,\n", " data=pcadf,\n", " hue=\"predicted_cluster\",\n", diff --git a/practical-k-means/practical-k-means-syntethic.ipynb b/practical-k-means/practical-k-means-syntethic.ipynb index 0b03fbbc6b..f2b8e4b1f4 100644 --- a/practical-k-means/practical-k-means-syntethic.ipynb +++ b/practical-k-means/practical-k-means-syntethic.ipynb @@ -407,8 +407,8 @@ "dbscan.fit(scaled_features)\n", "\n", "# Compute the silhouette scores for each algorithm\n", - "kmeans_silhouette = silhouette_score(scaled_features, kmeans.labels_).round(2)\n", - "dbscan_silhouette = silhouette_score(scaled_features, dbscan.labels_).round(2)" + "kmeans_silhouette = round(silhouette_score(scaled_features, kmeans.labels_), 2)\n", + "dbscan_silhouette = round(silhouette_score(scaled_features, dbscan.labels_), 2)" ] }, { diff --git a/practical-k-means/requirements.txt b/practical-k-means/requirements.txt index 4ea830f125..6dbbd57f6e 100644 --- a/practical-k-means/requirements.txt +++ b/practical-k-means/requirements.txt @@ -1,7 +1,7 @@ -jupyter -kneed -matplotlib -numpy -pandas -seaborn -scikit-learn \ No newline at end of file +jupyter==1.1.1 +kneed==0.9.0 +matplotlib==3.11.2 +numpy==2.5.5 +pandas==3.1.1 +scikit-learn==1.9.1 +seaborn==0.13.2