kumoai 2.10.0.dev202509231831__cp313-cp313-macosx_11_0_arm64.whl → 2.14.0.dev202512161731__cp313-cp313-macosx_11_0_arm64.whl
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.
Potentially problematic release.
This version of kumoai might be problematic. Click here for more details.
- kumoai/__init__.py +22 -11
- kumoai/_version.py +1 -1
- kumoai/client/client.py +17 -16
- kumoai/client/endpoints.py +1 -0
- kumoai/client/pquery.py +6 -2
- kumoai/client/rfm.py +37 -8
- kumoai/connector/utils.py +23 -2
- kumoai/experimental/rfm/__init__.py +164 -46
- kumoai/experimental/rfm/backend/__init__.py +0 -0
- kumoai/experimental/rfm/backend/local/__init__.py +42 -0
- kumoai/experimental/rfm/{local_graph_store.py → backend/local/graph_store.py} +49 -86
- kumoai/experimental/rfm/backend/local/sampler.py +315 -0
- kumoai/experimental/rfm/backend/local/table.py +119 -0
- kumoai/experimental/rfm/backend/snow/__init__.py +37 -0
- kumoai/experimental/rfm/backend/snow/sampler.py +274 -0
- kumoai/experimental/rfm/backend/snow/table.py +135 -0
- kumoai/experimental/rfm/backend/sqlite/__init__.py +32 -0
- kumoai/experimental/rfm/backend/sqlite/sampler.py +353 -0
- kumoai/experimental/rfm/backend/sqlite/table.py +126 -0
- kumoai/experimental/rfm/base/__init__.py +25 -0
- kumoai/experimental/rfm/base/column.py +66 -0
- kumoai/experimental/rfm/base/sampler.py +773 -0
- kumoai/experimental/rfm/base/source.py +19 -0
- kumoai/experimental/rfm/base/sql_sampler.py +60 -0
- kumoai/experimental/rfm/{local_table.py → base/table.py} +245 -156
- kumoai/experimental/rfm/{local_graph.py → graph.py} +425 -137
- kumoai/experimental/rfm/infer/__init__.py +6 -0
- kumoai/experimental/rfm/infer/dtype.py +79 -0
- kumoai/experimental/rfm/infer/pkey.py +126 -0
- kumoai/experimental/rfm/infer/time_col.py +62 -0
- kumoai/experimental/rfm/infer/timestamp.py +7 -4
- kumoai/experimental/rfm/pquery/__init__.py +4 -4
- kumoai/experimental/rfm/pquery/{backend.py → executor.py} +24 -58
- kumoai/experimental/rfm/pquery/{pandas_backend.py → pandas_executor.py} +278 -224
- kumoai/experimental/rfm/rfm.py +669 -246
- kumoai/experimental/rfm/sagemaker.py +138 -0
- kumoai/jobs.py +1 -0
- kumoai/pquery/predictive_query.py +10 -6
- kumoai/spcs.py +1 -3
- kumoai/testing/decorators.py +1 -1
- kumoai/testing/snow.py +50 -0
- kumoai/trainer/trainer.py +12 -10
- kumoai/utils/__init__.py +3 -2
- kumoai/utils/progress_logger.py +239 -4
- kumoai/utils/sql.py +3 -0
- {kumoai-2.10.0.dev202509231831.dist-info → kumoai-2.14.0.dev202512161731.dist-info}/METADATA +15 -5
- {kumoai-2.10.0.dev202509231831.dist-info → kumoai-2.14.0.dev202512161731.dist-info}/RECORD +50 -32
- kumoai/experimental/rfm/local_graph_sampler.py +0 -176
- kumoai/experimental/rfm/local_pquery_driver.py +0 -404
- kumoai/experimental/rfm/utils.py +0 -344
- {kumoai-2.10.0.dev202509231831.dist-info → kumoai-2.14.0.dev202512161731.dist-info}/WHEEL +0 -0
- {kumoai-2.10.0.dev202509231831.dist-info → kumoai-2.14.0.dev202512161731.dist-info}/licenses/LICENSE +0 -0
- {kumoai-2.10.0.dev202509231831.dist-info → kumoai-2.14.0.dev202512161731.dist-info}/top_level.txt +0 -0
|
@@ -1,33 +1,49 @@
|
|
|
1
1
|
kumoai/kumolib.cpython-313-darwin.so,sha256=waBv-DiZ3WcasxiCQ-OM9EbSTgTtCfBTZIibXAK-JiQ,232816
|
|
2
2
|
kumoai/_logging.py,sha256=U2_5ROdyk92P4xO4H2WJV8EC7dr6YxmmnM-b7QX9M7I,886
|
|
3
3
|
kumoai/mixin.py,sha256=MP413xzuCqWhxAPUHmloLA3j4ZyF1tEtfi516b_hOXQ,812
|
|
4
|
-
kumoai/_version.py,sha256=
|
|
5
|
-
kumoai/__init__.py,sha256=
|
|
4
|
+
kumoai/_version.py,sha256=Jl8ktnE2P6ILw6odswVKnWpEdIEM8pujIZDXaj6F7AQ,39
|
|
5
|
+
kumoai/__init__.py,sha256=Nn9YH_x9kAeEFn8RWbP95slZow0qFnakPZZ1WADe1hY,10843
|
|
6
6
|
kumoai/formatting.py,sha256=jA_rLDCGKZI8WWCha-vtuLenVKTZvli99Tqpurz1H84,953
|
|
7
7
|
kumoai/futures.py,sha256=oJFIfdCM_3nWIqQteBKYMY4fPhoYlYWE_JA2o6tx-ng,3737
|
|
8
|
-
kumoai/jobs.py,sha256=
|
|
8
|
+
kumoai/jobs.py,sha256=NrdLEFNo7oeCYSy-kj2nAvCFrz9BZ_xrhkqHFHk5ksY,2496
|
|
9
9
|
kumoai/exceptions.py,sha256=b-_sdbAKOg50uaJZ65GmBLdTo4HANdjl8_R0sJpwaN0,833
|
|
10
10
|
kumoai/databricks.py,sha256=e6E4lOFvZHXFwh4CO1kXU1zzDU3AapLQYMxjiHPC-HQ,476
|
|
11
|
-
kumoai/spcs.py,sha256=
|
|
11
|
+
kumoai/spcs.py,sha256=N31d7rLa-bgYh8e2J4YzX1ScxGLqiVXrqJnCl1y4Mts,4139
|
|
12
12
|
kumoai/_singleton.py,sha256=UTwrbDkoZSGB8ZelorvprPDDv9uZkUi1q_SrmsyngpQ,836
|
|
13
13
|
kumoai/experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
kumoai/experimental/rfm/
|
|
15
|
-
kumoai/experimental/rfm/
|
|
16
|
-
kumoai/experimental/rfm/
|
|
17
|
-
kumoai/experimental/rfm/
|
|
18
|
-
kumoai/experimental/rfm/utils.py,sha256=3IiBvT_aLBkkcJh3H11_50yt_XlEzHR0cm9Kprrtl8k,11123
|
|
19
|
-
kumoai/experimental/rfm/local_table.py,sha256=sbTN9Ddz5aZf5o1OWzuU-ZH5PpXYeFoeGrhtNbpNnzg,16209
|
|
20
|
-
kumoai/experimental/rfm/rfm.py,sha256=i2J4sobKG_yVQS6GCUzReEi7DUmKJ28dWPdoeyPSDtE,34557
|
|
21
|
-
kumoai/experimental/rfm/local_graph_store.py,sha256=z2QFuCyGYb4CS04AIK526DNQbdwRB3Ua9vxRHeoDzN0,13271
|
|
14
|
+
kumoai/experimental/rfm/graph.py,sha256=5_MINngYv4_Wzn18tbxa5jrM1rGfOlIzGWM7KogoCqw,40388
|
|
15
|
+
kumoai/experimental/rfm/__init__.py,sha256=slliYcrh80xPtQQ_nnsp3ny9IbmHCyirmdZUfKTdME4,6064
|
|
16
|
+
kumoai/experimental/rfm/sagemaker.py,sha256=_hTrFg4qfXe7uzwqSEG_wze-IFkwn7qde9OpUodCpbc,4982
|
|
17
|
+
kumoai/experimental/rfm/rfm.py,sha256=6fs6_7qBSboH57o5237RgjaXSsfvDZyINYJPxggQ4YY,50566
|
|
22
18
|
kumoai/experimental/rfm/authenticate.py,sha256=FiuHMvP7V3zBZUlHMDMbNLhc-UgDZgz4hjVSTuQ7DRw,18888
|
|
23
|
-
kumoai/experimental/rfm/
|
|
24
|
-
kumoai/experimental/rfm/
|
|
25
|
-
kumoai/experimental/rfm/
|
|
19
|
+
kumoai/experimental/rfm/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
kumoai/experimental/rfm/backend/sqlite/__init__.py,sha256=cA-PZL1oTaLxthZbfLSudexImtF6jRsGkdjSp-66dCM,914
|
|
21
|
+
kumoai/experimental/rfm/backend/sqlite/table.py,sha256=fSn-CsOKK584Qgn8a-k8eymykoOrIX5w0CCzOBNW0Zk,4677
|
|
22
|
+
kumoai/experimental/rfm/backend/sqlite/sampler.py,sha256=QtDUFvO-QbYd4Q4it8JGXfWgRxTG-fH4iNonr_TiKAk,14384
|
|
23
|
+
kumoai/experimental/rfm/backend/local/__init__.py,sha256=2s9sSA-E-8pfkkzCH4XPuaSxSznEURMfMgwEIfYYPsg,1014
|
|
24
|
+
kumoai/experimental/rfm/backend/local/table.py,sha256=-R_9nncosByAfSMfUt6HgCUNoW_MLGJW3F5SnAd4Ru0,3744
|
|
25
|
+
kumoai/experimental/rfm/backend/local/graph_store.py,sha256=48ctIQJ8POmLSWyomNAP5nwNjFFbzAN5rcGSgfqbSeM,11902
|
|
26
|
+
kumoai/experimental/rfm/backend/local/sampler.py,sha256=85HoHCDiFOiuD_vFPZRx9JCyQUlLsqgsuB3NAw50wNw,10836
|
|
27
|
+
kumoai/experimental/rfm/backend/snow/__init__.py,sha256=BYfsiuJ4Ee30GjG9EuUtitMHXnRfvVKi85zNlIwldV4,993
|
|
28
|
+
kumoai/experimental/rfm/backend/snow/table.py,sha256=--kC_jh4kbXDulvWWwqERjZOKUQrAP506ksKtzQY7qk,4841
|
|
29
|
+
kumoai/experimental/rfm/backend/snow/sampler.py,sha256=eH5Tlms9eWRSdUsoZboC7k2yPNF-gx31UjBLhvyD9TE,10710
|
|
30
|
+
kumoai/experimental/rfm/pquery/__init__.py,sha256=X0O3EIq5SMfBEE-ii5Cq6iDhR3s3XMXB52Cx5htoePw,152
|
|
31
|
+
kumoai/experimental/rfm/pquery/pandas_executor.py,sha256=wYI9a3smClR2pQGwsYRdmpOm0PlUsbtyW9wpAVpCEe4,18492
|
|
32
|
+
kumoai/experimental/rfm/pquery/executor.py,sha256=f7-pJhL0BgFU9E4o4gQpQyArOvyrZtwxFmks34-QOAE,2741
|
|
26
33
|
kumoai/experimental/rfm/infer/multicategorical.py,sha256=0-cLpDnGryhr76QhZNO-klKokJ6MUSfxXcGdQ61oykY,1102
|
|
27
34
|
kumoai/experimental/rfm/infer/categorical.py,sha256=VwNaKwKbRYkTxEJ1R6gziffC8dGsEThcDEfbi-KqW5c,853
|
|
35
|
+
kumoai/experimental/rfm/infer/time_col.py,sha256=7R5Itl8RRBOr61qLpRTanIqrUVZFZcAXzDA9lCw4nx4,1820
|
|
36
|
+
kumoai/experimental/rfm/infer/pkey.py,sha256=ubNqW1LIjLKiXbjXELAY3g6n2f3u2Eis_uC2DEiXFiU,4393
|
|
28
37
|
kumoai/experimental/rfm/infer/id.py,sha256=ZIO0DWIoiEoS_8MVc5lkqBfkTWWQ0yGCgjkwLdaYa_Q,908
|
|
29
|
-
kumoai/experimental/rfm/infer/
|
|
30
|
-
kumoai/experimental/rfm/infer/
|
|
38
|
+
kumoai/experimental/rfm/infer/dtype.py,sha256=ZZ6ztqJnTR1CaC2z5Uhf0o0rSdNThnss5tem5JNQkck,2607
|
|
39
|
+
kumoai/experimental/rfm/infer/__init__.py,sha256=krdMFN8iKZlSFOl-M5MW1KuSviQV3H1E18jj2uB8g6Q,469
|
|
40
|
+
kumoai/experimental/rfm/infer/timestamp.py,sha256=vM9--7eStzaGG13Y-oLYlpNJyhL6f9dp17HDXwtl_DM,1094
|
|
41
|
+
kumoai/experimental/rfm/base/sql_sampler.py,sha256=U8sgIWeJnfTEcIlt9_3UR7l8QWa4hLp_4Qxy1ma4060,1866
|
|
42
|
+
kumoai/experimental/rfm/base/__init__.py,sha256=8nCg154X94HTLVOATcO54tX3axFm8QlZG9T1M3ZasnI,549
|
|
43
|
+
kumoai/experimental/rfm/base/table.py,sha256=neGldEZaweoJ8VRgnEnaSpAISSkSTkgXxItuuywBM4E,20010
|
|
44
|
+
kumoai/experimental/rfm/base/sampler.py,sha256=aCD98t0CUhAvGXEFv24Vq2g4otuclpKkkyL1rMR_mFg,31449
|
|
45
|
+
kumoai/experimental/rfm/base/source.py,sha256=RqlI_kBoRV0ADb8KdEKn15RNHMdFUzEVzb57lIoyBM4,294
|
|
46
|
+
kumoai/experimental/rfm/base/column.py,sha256=izCJmufJcd1RSi-ptFMfrue-JYag38MJxizka7ya0-A,2319
|
|
31
47
|
kumoai/encoder/__init__.py,sha256=VPGs4miBC_WfwWeOXeHhFomOUocERFavhKf5fqITcds,182
|
|
32
48
|
kumoai/graph/graph.py,sha256=iyp4klPIMn2ttuEqMJvsrxKb_tmz_DTnvziIhCegduM,38291
|
|
33
49
|
kumoai/graph/__init__.py,sha256=n8X4X8luox4hPBHTRC9R-3JzvYYMoR8n7lF1H4w4Hzc,228
|
|
@@ -37,8 +53,9 @@ kumoai/artifact_export/config.py,sha256=jOPDduduxv0uuB-7xVlDiZglfpmFF5lzQhhH1SMk
|
|
|
37
53
|
kumoai/artifact_export/job.py,sha256=GEisSwvcjK_35RgOfsLXGgxMTXIWm765B_BW_Kgs-V0,3275
|
|
38
54
|
kumoai/artifact_export/__init__.py,sha256=BsfDrc3mCHpO9-BqvqKm8qrXDIwfdaoH5UIoG4eQkc4,238
|
|
39
55
|
kumoai/utils/datasets.py,sha256=ptKIUoBONVD55pTVNdRCkQT3NWdN_r9UAUu4xewPa3U,2928
|
|
40
|
-
kumoai/utils/__init__.py,sha256=
|
|
41
|
-
kumoai/utils/progress_logger.py,sha256=
|
|
56
|
+
kumoai/utils/__init__.py,sha256=6S-UtwjeLpnCYRCCIEWhkitPYGaqOGXC1ChE13DzXiU,256
|
|
57
|
+
kumoai/utils/progress_logger.py,sha256=onADUiA-oeW0EsV4wMeIv2xg1Jioo4Cjce3W39qtNQI,9322
|
|
58
|
+
kumoai/utils/sql.py,sha256=f6lR6rBEW7Dtk0NdM26dOZXUHDizEHb1WPlBCJrwoq0,118
|
|
42
59
|
kumoai/utils/forecasting.py,sha256=-nDS6ucKNfQhTQOfebjefj0wwWH3-KYNslIomxwwMBM,7415
|
|
43
60
|
kumoai/codegen/generate.py,sha256=SvfWWa71xSAOjH9645yQvgoEM-o4BYjupM_EpUxqB_E,7331
|
|
44
61
|
kumoai/codegen/naming.py,sha256=_XVQGxHfuub4bhvyuBKjltD5Lm_oPpibvP_LZteCGk0,3021
|
|
@@ -56,8 +73,9 @@ kumoai/codegen/handlers/__init__.py,sha256=k8TB_Kn-1BycBBi51kqFS2fZHCpCPgR9-3J9g
|
|
|
56
73
|
kumoai/codegen/handlers/utils.py,sha256=58b2GCgaTBUp2aId7BLMXMV0ENrusbNbfw7mlyXAXPE,1447
|
|
57
74
|
kumoai/codegen/handlers/connector.py,sha256=afGf_GreyQ9y6qF3QTgSiM416qtUcP298SatNqUFhvQ,3828
|
|
58
75
|
kumoai/codegen/handlers/table.py,sha256=POHpA-GFYFGTSuerGmtigYablk-Wq1L3EBvsOI-iFMQ,3956
|
|
76
|
+
kumoai/testing/snow.py,sha256=ubx3yJP0UHxsNiar1-jNdv8ZfszKc8Js3_Gg70uf008,1487
|
|
59
77
|
kumoai/testing/__init__.py,sha256=goHIIo3JE7uHV7njo4_aTd89mVVR74BEAZ2uyBaOR0w,170
|
|
60
|
-
kumoai/testing/decorators.py,sha256=
|
|
78
|
+
kumoai/testing/decorators.py,sha256=83tMifuPTpUqX7zHxMttkj1TDdB62EBtAP-Fjj72Zdo,1607
|
|
61
79
|
kumoai/connector/glue_connector.py,sha256=HivT0QYQ8-XeB4QLgWvghiqXuq7jyBK9G2R1py_NnE4,4697
|
|
62
80
|
kumoai/connector/databricks_connector.py,sha256=YQy203XHZGzNJ8bPUjUOnrVt2KlpgMdVuTHpc6sVCcs,7574
|
|
63
81
|
kumoai/connector/snowflake_connector.py,sha256=K0s-H9tW3rve8g2x1PbyxvzSpkROfGQZz-Qa4PoT4UE,9022
|
|
@@ -65,15 +83,15 @@ kumoai/connector/bigquery_connector.py,sha256=IkyRqvF8Cg96kApUuuz86eYnl-BqBmDX1f
|
|
|
65
83
|
kumoai/connector/source_table.py,sha256=QLT8bEYaxeMwy-b168url0VfnkTrs5K6VKLbxTI4hEY,17539
|
|
66
84
|
kumoai/connector/__init__.py,sha256=9g6oNJ0qHWFlL5enTSoK4_SSH_5hP74xUDZx-9SggC4,842
|
|
67
85
|
kumoai/connector/file_upload_connector.py,sha256=swp03HgChOvmNPJetuujBSAqADe7NRmS_T0F3o9it4w,7008
|
|
68
|
-
kumoai/connector/utils.py,sha256=
|
|
86
|
+
kumoai/connector/utils.py,sha256=wlqQxMmPvnFNoCcczGkKYjSu05h8OhWh4fhTzQm_2bQ,64694
|
|
69
87
|
kumoai/connector/s3_connector.py,sha256=3kbv-h7DwD8O260Q0h1GPm5wwQpLt-Tb3d_CBSaie44,10155
|
|
70
88
|
kumoai/connector/base.py,sha256=cujXSZF3zAfuxNuEw54DSL1T7XCuR4t0shSMDuPUagQ,5291
|
|
71
89
|
kumoai/pquery/__init__.py,sha256=uTXr7t1eXcVfM-ETaM_1ImfEqhrmaj8BjiIvy1YZTL8,533
|
|
72
|
-
kumoai/pquery/predictive_query.py,sha256=
|
|
90
|
+
kumoai/pquery/predictive_query.py,sha256=UXn1s8ztubYZMNGl4ijaeidMiGlFveb1TGw9qI5-TAo,24901
|
|
73
91
|
kumoai/pquery/prediction_table.py,sha256=QPDH22X1UB0NIufY7qGuV2XW7brG3Pv--FbjNezzM2g,10776
|
|
74
92
|
kumoai/pquery/training_table.py,sha256=elmPDZx11kPiC_dkOhJcBUGtHKgL32GCBvZ9k6U0pMg,15809
|
|
75
|
-
kumoai/client/pquery.py,sha256=
|
|
76
|
-
kumoai/client/client.py,sha256=
|
|
93
|
+
kumoai/client/pquery.py,sha256=IQ8As-OOJOkuMoMosphOsA5hxQYLCbzOQJO7RezK8uY,7091
|
|
94
|
+
kumoai/client/client.py,sha256=Jda8V9yiu3LbhxlcgRWPeYi7eF6jzCKcq8-B_vEd1ik,8514
|
|
77
95
|
kumoai/client/graph.py,sha256=zvLEDExLT_RVbUMHqVl0m6tO6s2gXmYSoWmPF6YMlnA,3831
|
|
78
96
|
kumoai/client/online.py,sha256=pkBBh_DEC3GAnPcNw6bopNRlGe7EUbIFe7_seQqZRaw,2720
|
|
79
97
|
kumoai/client/source_table.py,sha256=VCsCcM7KYcnjGP7HLTb-AOSEGEVsJTWjk8bMg1JdgPU,2101
|
|
@@ -82,17 +100,17 @@ kumoai/client/jobs.py,sha256=iu_Wrta6BQMlV6ZtzSnmhjwNPKDMQDXOsqVVIyWodqw,17074
|
|
|
82
100
|
kumoai/client/utils.py,sha256=lz1NubwMDHCwzQRowRXm7mjAoYRd5UjRQIwXdtWAl90,3849
|
|
83
101
|
kumoai/client/connector.py,sha256=x3i2aBTJTEMZvYRcWkY-UfWVOANZjqAso4GBbcshFjw,3920
|
|
84
102
|
kumoai/client/table.py,sha256=cQG-RPm-e91idEgse1IPJDvBmzddIDGDkuyrR1rq4wU,3235
|
|
85
|
-
kumoai/client/rfm.py,sha256=
|
|
86
|
-
kumoai/client/endpoints.py,sha256=
|
|
103
|
+
kumoai/client/rfm.py,sha256=NxKk8mH2A-B58rSXhDWaph4KeiSyJYDq-RO-vAHh7es,3726
|
|
104
|
+
kumoai/client/endpoints.py,sha256=iF2ZD25AJCIVbmBJ8tTZ8y1Ch0m6nTp18ydN7h4WiTk,5382
|
|
87
105
|
kumoai/trainer/config.py,sha256=-2RfK10AsVVThSyfWtlyfH4Fc4EwTdu0V3yrDRtIOjk,98
|
|
88
106
|
kumoai/trainer/util.py,sha256=bDPGkMF9KOy4HgtA-OwhXP17z9cbrfMnZGtyGuUq_Eo,4062
|
|
89
107
|
kumoai/trainer/job.py,sha256=Wk69nzFhbvuA3nEvtCstI04z5CxkgvQ6tHnGchE0Lkg,44938
|
|
90
108
|
kumoai/trainer/baseline_trainer.py,sha256=LlfViNOmswNv4c6zJJLsyv0pC2mM2WKMGYx06ogtEVc,4024
|
|
91
109
|
kumoai/trainer/__init__.py,sha256=zUdFl-f-sBWmm2x8R-rdVzPBeU2FaMzUY5mkcgoTa1k,939
|
|
92
110
|
kumoai/trainer/online_serving.py,sha256=9cddb5paeZaCgbUeceQdAOxysCtV5XP-KcsgFz_XR5w,9566
|
|
93
|
-
kumoai/trainer/trainer.py,sha256=
|
|
94
|
-
kumoai-2.
|
|
95
|
-
kumoai-2.
|
|
96
|
-
kumoai-2.
|
|
97
|
-
kumoai-2.
|
|
98
|
-
kumoai-2.
|
|
111
|
+
kumoai/trainer/trainer.py,sha256=hBXO7gwpo3t59zKFTeIkK65B8QRmWCwO33sbDuEAPlY,20133
|
|
112
|
+
kumoai-2.14.0.dev202512161731.dist-info/RECORD,,
|
|
113
|
+
kumoai-2.14.0.dev202512161731.dist-info/WHEEL,sha256=oqGJCpG61FZJmvyZ3C_0aCv-2mdfcY9e3fXvyUNmWfM,136
|
|
114
|
+
kumoai-2.14.0.dev202512161731.dist-info/top_level.txt,sha256=YjU6UcmomoDx30vEXLsOU784ED7VztQOsFApk1SFwvs,7
|
|
115
|
+
kumoai-2.14.0.dev202512161731.dist-info/METADATA,sha256=KWUAt1fRBVkMYxzoTC05hXG7_hKqef0tygcTAFVHKtg,2557
|
|
116
|
+
kumoai-2.14.0.dev202512161731.dist-info/licenses/LICENSE,sha256=TbWlyqRmhq9PEzCaTI0H0nWLQCCOywQM8wYH8MbjfLo,1102
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
from typing import Dict, List, Optional, Tuple
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
import pandas as pd
|
|
5
|
-
from kumoapi.model_plan import RunMode
|
|
6
|
-
from kumoapi.rfm.context import EdgeLayout, Link, Subgraph, Table
|
|
7
|
-
from kumoapi.typing import Stype
|
|
8
|
-
|
|
9
|
-
import kumoai.kumolib as kumolib
|
|
10
|
-
from kumoai.experimental.rfm.local_graph_store import LocalGraphStore
|
|
11
|
-
from kumoai.experimental.rfm.utils import normalize_text
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class LocalGraphSampler:
|
|
15
|
-
def __init__(self, graph_store: LocalGraphStore) -> None:
|
|
16
|
-
self._graph_store = graph_store
|
|
17
|
-
self._sampler = kumolib.NeighborSampler(
|
|
18
|
-
self._graph_store.node_types,
|
|
19
|
-
self._graph_store.edge_types,
|
|
20
|
-
{
|
|
21
|
-
'__'.join(edge_type): colptr
|
|
22
|
-
for edge_type, colptr in self._graph_store.colptr_dict.items()
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
'__'.join(edge_type): row
|
|
26
|
-
for edge_type, row in self._graph_store.row_dict.items()
|
|
27
|
-
},
|
|
28
|
-
self._graph_store.time_dict,
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
def __call__(
|
|
32
|
-
self,
|
|
33
|
-
entity_table_names: Tuple[str, ...],
|
|
34
|
-
node: np.ndarray,
|
|
35
|
-
time: np.ndarray,
|
|
36
|
-
run_mode: RunMode,
|
|
37
|
-
num_neighbors: List[int],
|
|
38
|
-
exclude_cols_dict: Dict[str, List[str]],
|
|
39
|
-
) -> Subgraph:
|
|
40
|
-
|
|
41
|
-
(
|
|
42
|
-
row_dict,
|
|
43
|
-
col_dict,
|
|
44
|
-
node_dict,
|
|
45
|
-
batch_dict,
|
|
46
|
-
num_sampled_nodes_dict,
|
|
47
|
-
num_sampled_edges_dict,
|
|
48
|
-
) = self._sampler.sample(
|
|
49
|
-
{
|
|
50
|
-
'__'.join(edge_type): num_neighbors
|
|
51
|
-
for edge_type in self._graph_store.edge_types
|
|
52
|
-
},
|
|
53
|
-
{}, # time interval based sampling
|
|
54
|
-
entity_table_names[0],
|
|
55
|
-
node,
|
|
56
|
-
time // 1000**3, # nanoseconds to seconds
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
table_dict: Dict[str, Table] = {}
|
|
60
|
-
for table_name, node in node_dict.items():
|
|
61
|
-
batch = batch_dict[table_name]
|
|
62
|
-
|
|
63
|
-
if len(node) == 0:
|
|
64
|
-
continue
|
|
65
|
-
|
|
66
|
-
df = self._graph_store.df_dict[table_name]
|
|
67
|
-
|
|
68
|
-
num_sampled_nodes = num_sampled_nodes_dict[table_name].tolist()
|
|
69
|
-
stype_dict = { # Exclude target columns:
|
|
70
|
-
column_name: stype
|
|
71
|
-
for column_name, stype in
|
|
72
|
-
self._graph_store.stype_dict[table_name].items()
|
|
73
|
-
if column_name not in exclude_cols_dict.get(table_name, [])
|
|
74
|
-
}
|
|
75
|
-
primary_key: Optional[str] = None
|
|
76
|
-
if table_name in entity_table_names:
|
|
77
|
-
primary_key = self._graph_store.pkey_name_dict.get(table_name)
|
|
78
|
-
|
|
79
|
-
columns: List[str] = []
|
|
80
|
-
if table_name in entity_table_names:
|
|
81
|
-
columns += [self._graph_store.pkey_name_dict[table_name]]
|
|
82
|
-
columns += list(stype_dict.keys())
|
|
83
|
-
|
|
84
|
-
if len(columns) == 0:
|
|
85
|
-
table_dict[table_name] = Table(
|
|
86
|
-
df=pd.DataFrame(index=range(len(node))),
|
|
87
|
-
row=None,
|
|
88
|
-
batch=batch,
|
|
89
|
-
num_sampled_nodes=num_sampled_nodes,
|
|
90
|
-
stype_dict=stype_dict,
|
|
91
|
-
primary_key=primary_key,
|
|
92
|
-
)
|
|
93
|
-
continue
|
|
94
|
-
|
|
95
|
-
# Only store unique rows in `df` above a certain threshold:
|
|
96
|
-
unique_node, inverse_node = np.unique(node, return_inverse=True)
|
|
97
|
-
if len(node) > 1.05 * len(unique_node):
|
|
98
|
-
df = df.iloc[unique_node]
|
|
99
|
-
row = inverse_node
|
|
100
|
-
else:
|
|
101
|
-
df = df.iloc[node]
|
|
102
|
-
row = None
|
|
103
|
-
df = df.reset_index(drop=True)
|
|
104
|
-
|
|
105
|
-
# Filter data frame to minimal set of columns:
|
|
106
|
-
df = df[columns]
|
|
107
|
-
|
|
108
|
-
# Normalize text (if not already pre-processed):
|
|
109
|
-
for column_name, stype in stype_dict.items():
|
|
110
|
-
if stype == Stype.text:
|
|
111
|
-
df[column_name] = normalize_text(df[column_name])
|
|
112
|
-
|
|
113
|
-
table_dict[table_name] = Table(
|
|
114
|
-
df=df,
|
|
115
|
-
row=row,
|
|
116
|
-
batch=batch,
|
|
117
|
-
num_sampled_nodes=num_sampled_nodes,
|
|
118
|
-
stype_dict=stype_dict,
|
|
119
|
-
primary_key=primary_key,
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
link_dict: Dict[Tuple[str, str, str], Link] = {}
|
|
123
|
-
for edge_type in self._graph_store.edge_types:
|
|
124
|
-
edge_type_str = '__'.join(edge_type)
|
|
125
|
-
|
|
126
|
-
row = row_dict[edge_type_str]
|
|
127
|
-
col = col_dict[edge_type_str]
|
|
128
|
-
|
|
129
|
-
if len(row) == 0:
|
|
130
|
-
continue
|
|
131
|
-
|
|
132
|
-
# Do not store reverse edge type if it is a replica:
|
|
133
|
-
rev_edge_type = Subgraph.rev_edge_type(edge_type)
|
|
134
|
-
rev_edge_type_str = '__'.join(rev_edge_type)
|
|
135
|
-
if (rev_edge_type in link_dict
|
|
136
|
-
and np.array_equal(row, col_dict[rev_edge_type_str])
|
|
137
|
-
and np.array_equal(col, row_dict[rev_edge_type_str])):
|
|
138
|
-
link = Link(
|
|
139
|
-
layout=EdgeLayout.REV,
|
|
140
|
-
row=None,
|
|
141
|
-
col=None,
|
|
142
|
-
num_sampled_edges=(
|
|
143
|
-
num_sampled_edges_dict[edge_type_str].tolist()),
|
|
144
|
-
)
|
|
145
|
-
link_dict[edge_type] = link
|
|
146
|
-
continue
|
|
147
|
-
|
|
148
|
-
layout = EdgeLayout.COO
|
|
149
|
-
if np.array_equal(row, np.arange(len(row))):
|
|
150
|
-
row = None
|
|
151
|
-
if np.array_equal(col, np.arange(len(col))):
|
|
152
|
-
col = None
|
|
153
|
-
|
|
154
|
-
# Store in compressed representation if more efficient:
|
|
155
|
-
num_cols = table_dict[edge_type[2]].num_rows
|
|
156
|
-
if col is not None and len(col) > num_cols + 1:
|
|
157
|
-
layout = EdgeLayout.CSC
|
|
158
|
-
colcount = np.bincount(col, minlength=num_cols)
|
|
159
|
-
col = np.empty(num_cols + 1, dtype=col.dtype)
|
|
160
|
-
col[0] = 0
|
|
161
|
-
np.cumsum(colcount, out=col[1:])
|
|
162
|
-
|
|
163
|
-
link = Link(
|
|
164
|
-
layout=layout,
|
|
165
|
-
row=row,
|
|
166
|
-
col=col,
|
|
167
|
-
num_sampled_edges=(
|
|
168
|
-
num_sampled_edges_dict[edge_type_str].tolist()),
|
|
169
|
-
)
|
|
170
|
-
link_dict[edge_type] = link
|
|
171
|
-
|
|
172
|
-
return Subgraph(
|
|
173
|
-
anchor_time=time,
|
|
174
|
-
table_dict=table_dict,
|
|
175
|
-
link_dict=link_dict,
|
|
176
|
-
)
|