KL-Py 0.0.3__tar.gz → 0.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. {kl_py-0.0.3/src/KL_Py.egg-info → kl_py-0.0.5}/PKG-INFO +1 -1
  2. {kl_py-0.0.3 → kl_py-0.0.5}/pyproject.toml +3 -2
  3. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/KL_Py.py +88 -10
  4. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/__init__.py +3 -1
  5. kl_py-0.0.5/src/KL_Py/automl.py +214 -0
  6. {kl_py-0.0.3 → kl_py-0.0.5/src/KL_Py.egg-info}/PKG-INFO +1 -1
  7. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py.egg-info/SOURCES.txt +1 -0
  8. {kl_py-0.0.3 → kl_py-0.0.5}/LICENSE +0 -0
  9. {kl_py-0.0.3 → kl_py-0.0.5}/README.md +0 -0
  10. {kl_py-0.0.3 → kl_py-0.0.5}/setup.cfg +0 -0
  11. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/__init__.py +0 -0
  12. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/_utils.py +0 -0
  13. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/__init__.py +0 -0
  14. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/base.py +0 -0
  15. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/button.py +0 -0
  16. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/calendar.py +0 -0
  17. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/canvas.py +0 -0
  18. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/checkbox.py +0 -0
  19. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/column.py +0 -0
  20. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/combo.py +0 -0
  21. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/error.py +0 -0
  22. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/frame.py +0 -0
  23. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/graph.py +0 -0
  24. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/helpers.py +0 -0
  25. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/image.py +0 -0
  26. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/input.py +0 -0
  27. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/list_box.py +0 -0
  28. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/menu.py +0 -0
  29. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/multiline.py +0 -0
  30. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/option_menu.py +0 -0
  31. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/pane.py +0 -0
  32. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/progress_bar.py +0 -0
  33. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/radio.py +0 -0
  34. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/separator.py +0 -0
  35. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/sizegrip.py +0 -0
  36. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/slider.py +0 -0
  37. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/spin.py +0 -0
  38. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/status_bar.py +0 -0
  39. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/stretch.py +0 -0
  40. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/tab.py +0 -0
  41. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/table.py +0 -0
  42. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/text.py +0 -0
  43. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/elements/tree.py +0 -0
  44. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/themes.py +0 -0
  45. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/tray.py +0 -0
  46. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/FreeSimpleGUI/window.py +0 -0
  47. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/_custom_pandas.py +0 -0
  48. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/_custom_sqlite.py +0 -0
  49. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/_custom_turtle.py +0 -0
  50. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/_error_classes.py +0 -0
  51. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/_klang_builtins.py +0 -0
  52. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/_translate.py +0 -0
  53. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/dnd/__init__.py +0 -0
  54. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/drag_and_drop/__init__.py +0 -0
  55. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/__init__.py +0 -0
  56. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/__main__.py +0 -0
  57. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/config.py +0 -0
  58. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/dialogs.py +0 -0
  59. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/packaging.py +0 -0
  60. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/shims.py +0 -0
  61. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/ui.py +0 -0
  62. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/utils.py +0 -0
  63. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/export/validation.py +0 -0
  64. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/fsgdnd/__init__.py +0 -0
  65. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/fsgui/__init__.py +0 -0
  66. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/__init__.py +0 -0
  67. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/_utils.py +0 -0
  68. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/base.py +0 -0
  69. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/button.py +0 -0
  70. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/calendar.py +0 -0
  71. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/canvas.py +0 -0
  72. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/center.py +0 -0
  73. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/checkbox.py +0 -0
  74. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/column.py +0 -0
  75. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/combo.py +0 -0
  76. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/error.py +0 -0
  77. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/frame.py +0 -0
  78. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/graph.py +0 -0
  79. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/helpers.py +0 -0
  80. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/image.py +0 -0
  81. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/input.py +0 -0
  82. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/list_box.py +0 -0
  83. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/menu.py +0 -0
  84. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/multiline.py +0 -0
  85. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/option_menu.py +0 -0
  86. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/pane.py +0 -0
  87. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/progress_bar.py +0 -0
  88. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/radio.py +0 -0
  89. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/separator.py +0 -0
  90. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/sizegrip.py +0 -0
  91. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/slider.py +0 -0
  92. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/spin.py +0 -0
  93. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/status_bar.py +0 -0
  94. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/stretch.py +0 -0
  95. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/tab.py +0 -0
  96. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/table.py +0 -0
  97. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/text.py +0 -0
  98. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/elements/tree.py +0 -0
  99. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/replace.py +0 -0
  100. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/tray.py +0 -0
  101. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/hindGui/window.py +0 -0
  102. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/__init__.py +0 -0
  103. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/__main__.py +0 -0
  104. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/config.py +0 -0
  105. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/dialogs.py +0 -0
  106. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/packaging.py +0 -0
  107. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/shims.py +0 -0
  108. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/ui.py +0 -0
  109. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/utils.py +0 -0
  110. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/k2exe/validation.py +0 -0
  111. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/__init__.py +0 -0
  112. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/__main__.py +0 -0
  113. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/config.py +0 -0
  114. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/dialogs.py +0 -0
  115. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/packaging.py +0 -0
  116. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/shims.py +0 -0
  117. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/ui.py +0 -0
  118. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/utils.py +0 -0
  119. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kexe/validation.py +0 -0
  120. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/__init__.py +0 -0
  121. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/__main__.py +0 -0
  122. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/config.py +0 -0
  123. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/dialogs.py +0 -0
  124. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/packaging.py +0 -0
  125. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/shims.py +0 -0
  126. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/ui.py +0 -0
  127. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/utils.py +0 -0
  128. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/kl2exe/validation.py +0 -0
  129. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/__init__.py +0 -0
  130. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/__main__.py +0 -0
  131. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/config.py +0 -0
  132. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/dialogs.py +0 -0
  133. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/packaging.py +0 -0
  134. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/shims.py +0 -0
  135. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/ui.py +0 -0
  136. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/utils.py +0 -0
  137. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klang2exe/validation.py +0 -0
  138. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/__init__.py +0 -0
  139. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/__main__.py +0 -0
  140. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/config.py +0 -0
  141. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/dialogs.py +0 -0
  142. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/packaging.py +0 -0
  143. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/shims.py +0 -0
  144. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/ui.py +0 -0
  145. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/utils.py +0 -0
  146. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klangexe/validation.py +0 -0
  147. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/__init__.py +0 -0
  148. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/__main__.py +0 -0
  149. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/config.py +0 -0
  150. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/dialogs.py +0 -0
  151. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/packaging.py +0 -0
  152. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/shims.py +0 -0
  153. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/ui.py +0 -0
  154. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/utils.py +0 -0
  155. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/klexe/validation.py +0 -0
  156. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/np/__init__.py +0 -0
  157. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pd/__init__.py +0 -0
  158. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/plt/__init__.py +0 -0
  159. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/psgui/__init__.py +0 -0
  160. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/px/__init__.py +0 -0
  161. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/__init__.py +0 -0
  162. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/__main__.py +0 -0
  163. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/config.py +0 -0
  164. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/dialogs.py +0 -0
  165. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/packaging.py +0 -0
  166. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/shims.py +0 -0
  167. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/ui.py +0 -0
  168. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/utils.py +0 -0
  169. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pyexe/validation.py +0 -0
  170. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/pysgdnd/__init__.py +0 -0
  171. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/__init__.py +0 -0
  172. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/__version__.py +0 -0
  173. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/_internal_utils.py +0 -0
  174. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/adapters.py +0 -0
  175. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/api.py +0 -0
  176. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/auth.py +0 -0
  177. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/certifi/__init__.py +0 -0
  178. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/certifi/__main__.py +0 -0
  179. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/certifi/core.py +0 -0
  180. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/certifi/py.typed +0 -0
  181. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/certs.py +0 -0
  182. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/__init__.py +0 -0
  183. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/__main__.py +0 -0
  184. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/api.py +0 -0
  185. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/cd.py +0 -0
  186. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/cli/__init__.py +0 -0
  187. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/cli/__main__.py +0 -0
  188. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/constant.py +0 -0
  189. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/legacy.py +0 -0
  190. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/md.py +0 -0
  191. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/models.py +0 -0
  192. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/py.typed +0 -0
  193. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/utils.py +0 -0
  194. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/charset_normalizer/version.py +0 -0
  195. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/compat.py +0 -0
  196. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/cookies.py +0 -0
  197. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/exceptions.py +0 -0
  198. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/help.py +0 -0
  199. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/hooks.py +0 -0
  200. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/__init__.py +0 -0
  201. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/codec.py +0 -0
  202. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/compat.py +0 -0
  203. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/core.py +0 -0
  204. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/idnadata.py +0 -0
  205. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/intranges.py +0 -0
  206. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/package_data.py +0 -0
  207. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/py.typed +0 -0
  208. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/idna/uts46data.py +0 -0
  209. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/models.py +0 -0
  210. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/packages.py +0 -0
  211. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/sessions.py +0 -0
  212. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/status_codes.py +0 -0
  213. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/structures.py +0 -0
  214. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/__init__.py +0 -0
  215. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/_base_connection.py +0 -0
  216. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/_collections.py +0 -0
  217. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/_request_methods.py +0 -0
  218. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/_version.py +0 -0
  219. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/connection.py +0 -0
  220. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/connectionpool.py +0 -0
  221. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/__init__.py +0 -0
  222. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/emscripten/__init__.py +0 -0
  223. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/emscripten/connection.py +0 -0
  224. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/emscripten/fetch.py +0 -0
  225. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/emscripten/request.py +0 -0
  226. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/emscripten/response.py +0 -0
  227. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/pyopenssl.py +0 -0
  228. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/contrib/socks.py +0 -0
  229. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/exceptions.py +0 -0
  230. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/fields.py +0 -0
  231. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/filepost.py +0 -0
  232. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/http2/__init__.py +0 -0
  233. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/http2/connection.py +0 -0
  234. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/http2/probe.py +0 -0
  235. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/poolmanager.py +0 -0
  236. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/py.typed +0 -0
  237. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/response.py +0 -0
  238. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/__init__.py +0 -0
  239. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/connection.py +0 -0
  240. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/proxy.py +0 -0
  241. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/request.py +0 -0
  242. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/response.py +0 -0
  243. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/retry.py +0 -0
  244. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/ssl_.py +0 -0
  245. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/ssl_match_hostname.py +0 -0
  246. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/ssltransport.py +0 -0
  247. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/timeout.py +0 -0
  248. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/url.py +0 -0
  249. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/util.py +0 -0
  250. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/urllib3/util/wait.py +0 -0
  251. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/requests/utils.py +0 -0
  252. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/sb/__init__.py +0 -0
  253. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/sk/__init__.py +0 -0
  254. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/sns/__init__.py +0 -0
  255. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/__init__.py +0 -0
  256. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/__main__.py +0 -0
  257. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/config.py +0 -0
  258. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/dialogs.py +0 -0
  259. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/packaging.py +0 -0
  260. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/shims.py +0 -0
  261. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/ui.py +0 -0
  262. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/utils.py +0 -0
  263. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/toexe/validation.py +0 -0
  264. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py/when.py +0 -0
  265. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py.egg-info/dependency_links.txt +0 -0
  266. {kl_py-0.0.3 → kl_py-0.0.5}/src/KL_Py.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: KL_Py
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: A Python simplification module
5
5
  Author-email: Abbaskhurram255 <abbaskhurram255@gmail.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -12,13 +12,14 @@ requires = [
12
12
  "PySimpleGUI",
13
13
  "FreeSimpleGUI",
14
14
  "pyinstaller",
15
- "auto-py-to-exe"
15
+ "auto-py-to-exe",
16
+ "joblib"
16
17
  ]
17
18
  build-backend = "setuptools.build_meta"
18
19
 
19
20
  [project]
20
21
  name = "KL_Py"
21
- version = "0.0.3"
22
+ version = "0.0.5"
22
23
  authors = [
23
24
  { name="Abbaskhurram255", email="abbaskhurram255@gmail.com" },
24
25
  ]
@@ -1491,13 +1491,19 @@ def auto_dec(start: int = 0):
1491
1491
  return AutoField(start, increment=False)
1492
1492
  typename = TypeT = typeT = TypeVar("T")
1493
1493
  def is_active_process(process: str) -> bool:
1494
- if os.name != "nt" or not isinstance(process, str):
1494
+ if os.name != "nt":
1495
1495
  return False
1496
- process = process.strip("\"'").strip()
1496
+ if not isinstance(process, str):
1497
+ return False
1498
+ process = process\
1499
+ .strip("\"'")\
1500
+ .strip()
1497
1501
  if not process:
1498
1502
  return False
1499
- if not process.lower().endswith(".exe"):
1500
- process_pattern = f"{process}.exe"
1503
+ if not process\
1504
+ .lower()\
1505
+ .endswith(".exe"):
1506
+ process_pattern = f"{process}.exe"
1501
1507
  else:
1502
1508
  process_pattern = process
1503
1509
  try:
@@ -1509,12 +1515,13 @@ def is_active_process(process: str) -> bool:
1509
1515
  text=True,
1510
1516
  check=False
1511
1517
  )
1512
- if process_pattern.lower() not in result.stdout.lower():
1513
- return False
1518
+ if process_pattern.lower()\
1519
+ not in result.stdout.lower():
1520
+ return False
1514
1521
  return True
1515
1522
  except Exception:
1516
1523
  return False
1517
- is_running_process = is_running_app = is_active_process
1524
+ is_running_process = is_running_app = is_app_running = is_active_process
1518
1525
  def run_process(
1519
1526
  command: str | list[str] | tuple[str, ...],
1520
1527
  new_window: bool = False,
@@ -4188,6 +4195,76 @@ def asset(to_filename: str) -> str:
4188
4195
  except Exception as e:
4189
4196
  return ""
4190
4197
  define_asset = to_asset = get_asset = new_asset = load_asset = naya_asset = asset
4198
+ def get_app_data_dir(
4199
+ app_name: str | None = None,
4200
+ volatile: bool = False
4201
+ ) -> str:
4202
+ home: Path = Path.home()
4203
+ base_dir: Path
4204
+ if sys.platform == "win32":
4205
+ base_dir = Path(
4206
+ os.environ.get(
4207
+ "LOCALAPPDATA",
4208
+ home / "AppData" / "Local"
4209
+ )
4210
+ )
4211
+ if volatile:
4212
+ base_dir = base_dir / "Temp"
4213
+ elif sys.platform == "darwin":
4214
+ if volatile:
4215
+ base_dir = home / "Library" / "Caches"
4216
+ else:
4217
+ base_dir = home / "Library" / "Application Support"
4218
+ else:
4219
+ if volatile:
4220
+ base_dir = Path(
4221
+ os.environ.get(
4222
+ "XDG_CACHE_HOME",
4223
+ home / ".cache"
4224
+ )
4225
+ )
4226
+ else:
4227
+ base_dir = Path(
4228
+ os.environ.get(
4229
+ "XDG_DATA_HOME",
4230
+ home / ".local" / "share"
4231
+ )
4232
+ )
4233
+ if not isinstance(app_name, str)\
4234
+ or not app_name.strip():
4235
+ return str(base_dir)
4236
+ try:
4237
+ app_dir: Path = base_dir / app_name.strip()
4238
+ app_dir\
4239
+ .mkdir(
4240
+ parents=True,
4241
+ exist_ok=True
4242
+ )
4243
+ return str(app_dir)
4244
+ except OSError:
4245
+ return str(base_dir)
4246
+ make_appdata_dir = make_app_data_dir = make_local_data_dir = make_cache_dir = get_appdata_dir = get_local_data_dir = get_cache_dir = get_app_data_dir
4247
+ def to_cache_asset(
4248
+ app_name: str | None = None,
4249
+ filename: str | None = None,
4250
+ volatile: bool = False
4251
+ ) -> str:
4252
+ base: str = get_app_data_dir(
4253
+ app_name=app_name,
4254
+ volatile=volatile
4255
+ )
4256
+ if not isinstance(filename, str)\
4257
+ or not filename.strip():
4258
+ return base
4259
+ result_path = Path(base) / filename.strip()
4260
+ result_path\
4261
+ .parent\
4262
+ .mkdir(
4263
+ parents=True,
4264
+ exist_ok=True
4265
+ )
4266
+ return str(result_path)
4267
+ naya_cache_asset = new_cache_asset = cache_asset = to_cache_dir = to_cache_asset
4191
4268
  ## belongs at the bottom of KL_Py.py
4192
4269
  ## a helper function for def= operator
4193
4270
  def get_initial_of(x: Any) -> Any:
@@ -4200,8 +4277,8 @@ def get_initial_of(x: Any) -> Any:
4200
4277
  case "int":
4201
4278
  out = 0
4202
4279
  case "flt" | "float" | "dbl" | "double" | "Number" | "nr":
4203
- # a number is both a float, and int
4204
- # lets just assume its a float
4280
+ # a number is both a float, and int
4281
+ # lets just assume its a float
4205
4282
  out = 0.0
4206
4283
  case "bool" | "haal":
4207
4284
  out = False
@@ -4397,4 +4474,5 @@ if __name__ == "__main__":
4397
4474
  print(Date("2026-07-22 12.01 am").day_nr())
4398
4475
  print(Date("2026-07-22 12.01 am").time_and_day())
4399
4476
  print(Date("2002-07-22 12.01 am").yr(2004).d(21).d(), nahi_format_nums=Han)
4400
- print(Date.day_today())
4477
+ print(Date.day_today())
4478
+
@@ -3,6 +3,7 @@ from ._custom_turtle import *
3
3
  from ._custom_sqlite import *
4
4
  from ._custom_pandas import *
5
5
  from ._klang_builtins import *
6
+ from .automl import *
6
7
  from KL_Py import FreeSimpleGUI
7
8
  from KL_Py import dnd
8
9
  from KL_Py import drag_and_drop
@@ -14,4 +15,5 @@ from KL_Py import plt
14
15
  from KL_Py import psgui
15
16
  from KL_Py import px
16
17
  from KL_Py import pysgdnd
17
- from KL_Py import sk
18
+ from KL_Py import sk
19
+ import KL_Py
@@ -0,0 +1,214 @@
1
+ import pandas as pd
2
+ import numpy as np
3
+ import joblib
4
+ from sklearn.model_selection import train_test_split, RepeatedKFold, cross_val_score
5
+ from sklearn.pipeline import Pipeline
6
+ from sklearn.compose import ColumnTransformer
7
+ from sklearn.impute import SimpleImputer
8
+ from sklearn.preprocessing import OneHotEncoder
9
+ from sklearn.ensemble import HistGradientBoostingRegressor, HistGradientBoostingClassifier
10
+ from sklearn.metrics import mean_absolute_error, accuracy_score, r2_score
11
+ from sklearn.inspection import permutation_importance
12
+ import matplotlib.pyplot as plt
13
+ import time
14
+
15
+ def auto_ml_train(
16
+ df: pd.DataFrame,
17
+ target_col: str,
18
+ problem_type: str = 'auto', # 'regression', 'classification', or 'auto'
19
+ test_size: float = 0.2,
20
+ save_path: str = 'model.pkl',
21
+ verbose: bool = True
22
+ ):
23
+ """
24
+ Trains a pipeline that handles missing values, categoricals, and auto-tunes HGB.
25
+ Works on 50 rows or 500k rows. Returns trained pipeline + metrics.
26
+
27
+ Usage:
28
+ model, metrics = auto_ml_train(df, target_col='price')
29
+ preds = model.predict(new_df)
30
+ """
31
+ if not isinstance(df, pd.DataFrame):
32
+ try:
33
+ df = pd.DataFrame(df)
34
+ except Exception:
35
+ return
36
+ start_time = time.time()
37
+ X = df.drop(target_col, axis=1)
38
+ y = df[target_col]
39
+ n_samples = X.shape[0]
40
+ # 1. Auto-detect problem type
41
+ if problem_type == 'auto':
42
+ if y.nunique() <= 20 and y.dtype in ['object', 'bool'] or y.nunique() == 2:
43
+ problem_type = 'classification'
44
+ else:
45
+ problem_type = 'regression'
46
+ # 2. Auto-detect column types
47
+ numeric_cols = X.select_dtypes(include=['int64', 'float64']).columns.tolist()
48
+ categorical_cols = X.select_dtypes(include=['object', 'category', 'bool']).columns.tolist()
49
+ if verbose:
50
+ print(f"Problem: {problem_type} | Rows: {n_samples}")
51
+ print(f"Numeric: {len(numeric_cols)} | Categorical: {len(categorical_cols)}")
52
+ # 3. Preprocessing
53
+ numeric_transformer = Pipeline(steps=[
54
+ ('imputer', SimpleImputer(strategy='median'))
55
+ ])
56
+ categorical_transformer = Pipeline(steps=[
57
+ ('imputer', SimpleImputer(strategy='most_frequent')),
58
+ ('onehot', OneHotEncoder(handle_unknown='ignore', sparse_output=False))
59
+ ])
60
+ preprocessor = ColumnTransformer(
61
+ transformers=[
62
+ ('num', numeric_transformer, numeric_cols),
63
+ ('cat', categorical_transformer, categorical_cols)
64
+ ],
65
+ remainder='drop'
66
+ )
67
+ # 4. Auto-tune HGB based on data size - FIXED FOR SPEED
68
+ if problem_type == 'regression':
69
+ Model = HistGradientBoostingRegressor
70
+ scoring = 'neg_mean_absolute_error'
71
+ metric_fn = mean_absolute_error
72
+ metric_name = 'MAE'
73
+ else:
74
+ Model = HistGradientBoostingClassifier
75
+ scoring = 'accuracy'
76
+ metric_fn = accuracy_score
77
+ metric_name = 'Accuracy'
78
+
79
+ if n_samples < 500: # Small data mode
80
+ model_params = dict(
81
+ max_depth=3, max_leaf_nodes=15, min_samples_leaf=20,
82
+ learning_rate=0.01, max_iter=100, l2_regularization=1.0,
83
+ max_features=0.8, early_stopping=True, validation_fraction=0.2,
84
+ n_iter_no_change=5, random_state=432
85
+ )
86
+ elif n_samples < 5000: # Medium data
87
+ model_params = dict(
88
+ max_depth=5, max_leaf_nodes=31, learning_rate=0.05,
89
+ max_iter=200, early_stopping=True, validation_fraction=0.1,
90
+ n_iter_no_change=10, random_state=432
91
+ )
92
+ else: # Big data - NO EARLY STOPPING to avoid hanging
93
+ model_params = dict(
94
+ learning_rate=0.1,
95
+ max_iter=100,
96
+ early_stopping=False,
97
+ random_state=432
98
+ )
99
+ # 5. Full pipeline
100
+ pipe = Pipeline(steps=[
101
+ ('preprocessor', preprocessor),
102
+ ('model', Model(**model_params))
103
+ ])
104
+ # 6. Train/test split
105
+ X_train, X_test, y_train, y_test = train_test_split(
106
+ X, y, test_size=test_size, random_state=432
107
+ )
108
+ # 7. Fit
109
+ if verbose: print("Training...")
110
+ pipe.fit(X_train, y_train)
111
+ # 8. Test metrics
112
+ preds = pipe.predict(X_test)
113
+ test_score = metric_fn(y_test, preds)
114
+ # 9. Cross-val for honest score - fewer repeats on big data
115
+ n_repeats = 3 if n_samples < 10000 else 1
116
+ cv = RepeatedKFold(n_splits=5, n_repeats=n_repeats, random_state=432)
117
+ cv_scores = cross_val_score(pipe, X, y, cv=cv, scoring=scoring, n_jobs=-1)
118
+ cv_mean = -cv_scores.mean() if problem_type == 'regression' else cv_scores.mean()
119
+ cv_std = cv_scores.std()
120
+ metrics: dict[str, ] = {
121
+ f'test_{metric_name}': test_score,
122
+ f'cv_{metric_name}_mean': cv_mean,
123
+ f'cv_{metric_name}_std': cv_std,
124
+ 'n_samples': n_samples,
125
+ 'problem_type': problem_type,
126
+ 'train_time_sec': round(time.time() - start_time, 2)
127
+ }
128
+ if problem_type == 'regression':
129
+ metrics['test_R2'] = r2_score(y_test, preds)
130
+ if verbose:
131
+ print(f"\nTest {metric_name}: {test_score:.4f}")
132
+ if problem_type == 'regression':
133
+ print(f"Test R2: {metrics['test_R2']:.4f}")
134
+ print(f"CV {metric_name}: {cv_mean:.4f} +/- {cv_std:.4f}")
135
+ print(f"Train time: {metrics['train_time_sec']} sec")
136
+ # 10. Save
137
+ joblib.dump(pipe, save_path)
138
+ if verbose: print(f"\nModel saved to {save_path}")
139
+ return pipe, metrics
140
+ auto_train = auto_ml_train
141
+ def auto_ml_predict(model_path: str, df_new: pd.DataFrame):
142
+ if not isinstance(df_new, pd.DataFrame):
143
+ try:
144
+ df_new = pd.DataFrame(df_new)
145
+ except Exception:
146
+ return
147
+ pipe = joblib.load(model_path)
148
+ return pipe.predict(df_new)
149
+ auto_predict = auto_ml_predict
150
+ def get_feature_importance(
151
+ model_path: str,
152
+ df_sample: pd.DataFrame,
153
+ target_col: str,
154
+ top_n: int = 10,
155
+ plot: bool = True
156
+ ):
157
+ """
158
+ Loads a saved pipeline and returns permutation importance.
159
+
160
+ Usage:
161
+ top_features = get_feature_importance('model.pkl', df.sample(300), 'MedHouseVal')
162
+ """
163
+ if not isinstance(df_sample, pd.DataFrame):
164
+ try:
165
+ df_sample = pd.DataFrame(df_sample)
166
+ except Exception:
167
+ return
168
+ pipe = joblib.load(model_path)
169
+ X = df_sample.drop(target_col, axis=1)
170
+ y = df_sample[target_col]
171
+ # Get feature names after preprocessing
172
+ preprocessor = pipe.named_steps['preprocessor']
173
+ num_cols = preprocessor.transformers_[0][2]
174
+ # Check if we have categorical columns
175
+ cat_cols_list = preprocessor.transformers_[1][2]
176
+ if len(cat_cols_list) > 0:
177
+ cat_transformer = preprocessor.transformers_[1][1]
178
+ cat_cols = cat_transformer.named_steps['onehot'].get_feature_names_out(cat_cols_list)
179
+ feature_names = list(num_cols) + list(cat_cols)
180
+ else:
181
+ feature_names = list(num_cols)
182
+ n_repeats = 5 if X.shape[0] < 5000 else 2
183
+ r = permutation_importance(
184
+ pipe, X, y, n_repeats=n_repeats, random_state=432, n_jobs=-1
185
+ )
186
+ importances = pd.Series(r.importances_mean, index=feature_names)
187
+ importances = importances.sort_values(ascending=False).head(top_n)
188
+ if plot:
189
+ plt.figure(figsize=(8, 6))
190
+ importances.plot(kind='barh')
191
+ plt.title(f'Top {top_n} Feature Importances')
192
+ plt.xlabel('Mean decrease in score')
193
+ plt.gca().invert_yaxis()
194
+ plt.tight_layout()
195
+ plt.show()
196
+ return importances.round(4)
197
+ feature_importance = get_feature_importance
198
+ def explain_model_simple(model_path, df_sample, target_col, business_metric="price"):
199
+ importances = get_feature_importance(model_path, df_sample, target_col, top_n=3, plot=False)
200
+ total = importances.sum()
201
+ top1, top2, top3 = importances.index[0], importances.index[1], importances.index[2]
202
+ pct1, pct2, pct3 = importances.iloc / total * 100
203
+
204
+ explanation = f"""
205
+ What drives your {business_metric}:
206
+ 1. {top1}: Drives {pct1.iloc[0]:.0f}% of the decision
207
+ 2. {top2}: Drives {pct2.iloc[1]:.0f}% of the decision
208
+ 3. {top3}: Drives {pct3.iloc[2]:.0f}% of the decision
209
+
210
+ Everything else combined is less important than {top3}.
211
+ """
212
+ return explanation
213
+ #Usage:
214
+ #print(explain_model_simple('model.pkl', df, 'MedHouseVal', 'house price'))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: KL_Py
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: A Python simplification module
5
5
  Author-email: Abbaskhurram255 <abbaskhurram255@gmail.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -9,6 +9,7 @@ src/KL_Py/_custom_turtle.py
9
9
  src/KL_Py/_error_classes.py
10
10
  src/KL_Py/_klang_builtins.py
11
11
  src/KL_Py/_translate.py
12
+ src/KL_Py/automl.py
12
13
  src/KL_Py/when.py
13
14
  src/KL_Py.egg-info/PKG-INFO
14
15
  src/KL_Py.egg-info/SOURCES.txt
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes