Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new time usage tracking feature to the
TabPFN
library, which includes changes to multiple files to integrate this functionality. The main changes involve adding theTimeUsageTracker
class, updating thefit
andpredict
methods of classifiers and regressors to use this tracker, and adding warnings for CPU usage addressing issue #192Time usage tracking:
src/tabpfn/model/time_tracker.py
: Added theTimeUsageTracker
class to track time usage for code segments, with warnings for segments running longer than a specified threshold.Integration in
TabPFNClassifier
:src/tabpfn/classifier.py
: IntegratedTimeUsageTracker
in thefit
andpredict_proba
methods to start and stop tracking time usage. [1] [2] [3]Integration in
TabPFNRegressor
:src/tabpfn/regressor.py
: IntegratedTimeUsageTracker
in thefit
andpredict
methods to start and stop tracking time usage. [1] [2] [3]Constants and utilities:
src/tabpfn/constants.py
: Added constants for CPU size and time warnings.src/tabpfn/utils.py
: Added a utility function to create theTimeUsageTracker
and integrated warnings for CPU usage in thevalidate_Xy_fit
function. [1] [2] [3]