Question: I tried uploading to IBM Cloud Object Storage (ICOS) with the following code, and some files could not uploaded.
Failed files contain the symbol "[" or "]" in the file name.

```
TransferUtility Utl = new TransferUtility(objClient);
TransferUtilityUploadDirectoryRequest request = new   TransferUtilityUploadDirectoryRequest
{
    BucketName = "Correct Backet name"
    Directory = "Correct directory name" ex. "C:\\testd1\\testd2"
    KeyPrefix = "Correct prefix"
    SearchOption = SearchOption.AllDirectories,
    SearchPattern = "*.*"
};

Utl.UploadDirectory(request);

```

---

Language:.NET C#

API: AWSSDK.Core 3.3.22.5, AWSSDK.S3 3.3.18.2 

Exception name：Amazon.S3.AmazonS3Exception  

Message："Invalid Argument"

InnerException name：Amazon.Runtime.Internal.HttpErrorResponseException  

Message："The remote server returned an error: (400) Bad Request"

Files with ordinary name such as "test.txt" can be uploaded without problems.  

This phenomenon does not occur with AWS S3 or another S3 compatible storage service.  

(But I have tried on only one of other S3 compatible services...) 

Could you tell me why I can not upload to ICOS and what solutions are there?

Best Regards.

Answer: 
There is no "correct" for something that is not at all well-defined.

The elbow method is an extremely crude heuristic for which I am not aware of any formal definition, nor a reference.

Both methods will supposedly most often yield the same k...

But by the concept of k-means, the "correct" way to use it is with squared errors, *not* with Euclidean distance. Because k-means minimizes squared errors, it does not minimize Euclidean distances (try to prove this! You can't because there are counterexamples).
I find many examples around that use this formula, claiming that they calculate the distortion. However in my understanding is seems wrong:

```py
distortions.append(sum(np.min(cdist(X, kmeanModel.cluster_centers_, 'euclidean'), axis=1)) / X.shape[0])

```

If you want to calculate the sum of squared distances, it should be:

```py
distortions.append(sum(np.min(cdist(X, kmeanModel.cluster_centers_, 'euclidean'), axis=1)**2) / X.shape[0])

```