ikeid
@ikeid

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

XMeansでのOSエラー

解決したいこと

機械学習で特徴量を生成するためにxmeansを使おうとしたところ、OSエラーがでてしまったので解決したいです。
x_normは(10996, 35)のtrain dataをスタンドスケールしたものです。

発生している問題・エラー

OSError                                   Traceback (most recent call last)
Input In [18], in <cell line: 3>()
      1 xm_c = kmeans_plusplus_initializer(x_norm, 2).initialize()
      2 xm_cluster = xmeans(data=x_norm, initial_centers=xm_c)
----> 3 xm_cluster.process()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pyclustering\cluster\xmeans.py:218, in xmeans.process(self)
    207 """!
    208 @brief Performs cluster analysis in line with rules of X-Means algorithm.
    209 
   (...)
    214 
    215 """
    217 if self.__ccore is True:
--> 218     self.__process_by_ccore()
    220 else:
    221     self.__process_by_python()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pyclustering\cluster\xmeans.py:234, in xmeans.__process_by_ccore(self)
    227 """!
    228 @brief Performs cluster analysis using CCORE (C/C++ part of pyclustering library).
    229 
    230 """
    232 ccore_metric = metric_wrapper.create_instance(self.__metric)
--> 234 result = wrapper.xmeans(self.__pointer_data, self.__centers, self.__kmax, self.__tolerance, self.__criterion,
    235                         self.__alpha, self.__beta, self.__repeat, self.__random_state,
    236                         ccore_metric.get_pointer())
    238 self.__clusters = result[0]
    239 self.__centers = result[1]

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pyclustering\core\xmeans_wrapper.py:26, in xmeans(sample, centers, kmax, tolerance, criterion, alpha, beta, repeat, random_state, metric_pointer)
     23 ccore = ccore_library.get()
     25 ccore.xmeans_algorithm.restype = POINTER(pyclustering_package)
---> 26 package = ccore.xmeans_algorithm(pointer_data, pointer_centers, c_size_t(kmax), c_double(tolerance),
     27                                  c_uint(criterion), c_double(alpha), c_double(beta), c_size_t(repeat),
     28                                  c_longlong(random_state), metric_pointer)
     30 result = package_extractor(package).extract()
     31 ccore.free_pyclustering_package(package)

OSError: exception: access violation reading 0x0000000000000008

該当するソースコード

xm_c = kmeans_plusplus_initializer(x_norm, 2).initialize()
xm_cluster = xmeans(data=x_norm, initial_centers=xm_c)
xm_cluster.process()
0

No Answers yet.

Your answer might help someone💌