This repository has been archived by the owner on Jan 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
376 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,3 +114,4 @@ pip-wheel-metadata/ | |
.DS_Store | ||
*.sublime-project | ||
*.sublime-workspace | ||
*.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
CWD=$(shell pwd) | ||
PKG=foreshadow | ||
TST=tests | ||
|
||
clean: | ||
find ./$(PKG) -name "*.pyc" -exec rm -rfv {} \; | ||
|
||
test: | ||
tox -r | ||
poetry run tox -r | ||
|
||
.PHONY: test clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.. _architecture: | ||
|
||
Project Architecture | ||
==================== | ||
|
||
.. note:: | ||
Open the diagram in a new tab to see the full details. | ||
|
||
UML Class Diagram | ||
----------------- | ||
|
||
.. uml:: foreshadow_class.uml | ||
|
||
UML Sequence Diagrams | ||
--------------------- | ||
|
||
Main Sequence Diagram | ||
^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. uml:: foreshadow_sequence_main.uml | ||
|
||
|
||
Hyperparameter Optimization Sequence Diagram | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. uml:: foreshadow_sequence_hyp.uml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
@startuml | ||
|
||
skinparam BackgroundColor transparent | ||
skinparam Shadowing false | ||
|
||
' Diagram setup | ||
hide empty members | ||
left to right direction | ||
set namespaceSeparator none | ||
|
||
package foreshadow.utils { | ||
class check_df << (M,lemonchiffon) >> | ||
} | ||
package foreshadow.logging { | ||
class ForeshadowLogger | ||
} | ||
package foreshadow.intents { | ||
abstract class BaseIntent { | ||
list engineering_pipeline | ||
list preprocessing_pipeline | ||
resolve_intent() | ||
} | ||
|
||
class DropIntent | ||
class NumericalIntent | ||
class CategoricalIntent | ||
class TextIntent | ||
|
||
BaseIntent <|-- DropIntent | ||
BaseIntent <|-- NumericalIntent | ||
BaseIntent <|-- CategoricalIntent | ||
BaseIntent <|-- TextIntent | ||
|
||
note "Config for intentless transformations (cleaner) are placed in\nBaseIntent's specification" as N1 | ||
} | ||
|
||
together { | ||
package foreshadow.transformers.core { | ||
abstract class SmartTransformer { | ||
bool fixed_fit | ||
log_decision() | ||
} | ||
|
||
class ParallelProcessor | ||
class SigCopy | ||
class DropFeature | ||
|
||
class wrap_transformer << (M,lemonchiffon) >> | ||
wrap_transformer o-- SigCopy | ||
} | ||
|
||
package foreshadow.transformers.smart { | ||
SmartTransformer <|-- Cleaner | ||
SmartTransformer <|-- Engineerer | ||
SmartTransformer <|-- Scaler | ||
SmartTransformer <|-- Imputer | ||
SmartTransformer <|-- CategoricalEncoder | ||
SmartTransformer <|-- TextEncoder | ||
SmartTransformer <|-- Reducer | ||
} | ||
|
||
package foreshadow.transformers.internal { | ||
class FancyImpute | ||
class UncommonRemover | ||
class BoxCox | ||
|
||
FancyImpute o-- Imputer | ||
CategoricalEncoder o-- UncommonRemover | ||
Scaler o-- BoxCox | ||
|
||
class DaysSince | ||
class NumericalFeatuerizer | ||
class CategoricalFeatuerizer | ||
|
||
Engineerer o-- DaysSince | ||
Engineerer o-- NumericalFeatuerizer | ||
Engineerer o-- CategoricalEncoder | ||
|
||
class ToString | ||
class SplitDate | ||
class FinancialCleaner | ||
|
||
Cleaner o-- ToString | ||
Cleaner o-- SplitDate | ||
Cleaner o-- FinancialCleaner | ||
|
||
class Boruta | ||
class Hypothesis | ||
|
||
Reducer o-- Boruta | ||
Reducer o-- Hypothesis | ||
} | ||
|
||
package foreshadow.transformers.external { | ||
note "All sklearn transformers are mirrored\nand pandas wrapped here." as N3 | ||
} | ||
} | ||
|
||
package foreshadow.config { | ||
class ConfigManager { | ||
json framework_config | ||
json user_config | ||
json local_config | ||
} | ||
} | ||
|
||
package foreshadow.tuners { | ||
class WrappedTuner { | ||
BaseEstimator tuner_type | ||
} | ||
} | ||
package foreshadow.core { | ||
abstract class BaseFeatureMapper { | ||
split_columns() | ||
join_columns() | ||
} | ||
|
||
class Foreshadow | ||
class DataPreparer { | ||
bool is_y_var | ||
} | ||
class FeatureCleaner | ||
class IntentResolver | ||
class FeatureEngineerer | ||
class FeaturePreprocessor | ||
class FeatureReducer | ||
|
||
class ColumnInfoSharer | ||
|
||
class SerializerMixin << (X,peru) >> | ||
|
||
Foreshadow "0..2" o-- DataPreparer | ||
Foreshadow "0..1" o-- sklearn.RandomizedSearchCV | ||
|
||
DataPreparer o-- FeatureCleaner | ||
DataPreparer o-- IntentResolver | ||
DataPreparer "0..1" o-- FeatureEngineerer | ||
DataPreparer o-- FeaturePreprocessor | ||
DataPreparer "0..1" o-- FeatureReducer | ||
|
||
SerializerMixin <|-- DataPreparer | ||
SerializerMixin <|-- FeatureCleaner | ||
SerializerMixin <|-- IntentResolver | ||
SerializerMixin <|-- FeatureEngineerer | ||
SerializerMixin <|-- FeaturePreprocessor | ||
SerializerMixin <|-- FeatureReducer | ||
|
||
BaseFeatureMapper <|-- DataPreparer | ||
BaseFeatureMapper <|-- FeatureCleaner | ||
BaseFeatureMapper <|-- IntentResolver | ||
BaseFeatureMapper <|-- FeatureEngineerer | ||
BaseFeatureMapper <|-- FeaturePreprocessor | ||
BaseFeatureMapper <|-- FeatureReducer | ||
} | ||
package foreshadow.estimators { | ||
class MetaEstimator | ||
class AutoEstimator | ||
|
||
MetaEstimator "0..1" o-- AutoEstimator | ||
MetaEstimator o-- DataPreparer | ||
|
||
Foreshadow "0..1" o-- MetaEstimator | ||
} | ||
package sklearn.base { | ||
class TransformerMixin << (X,peru) >> | ||
class BaseEstimator | ||
} | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@startuml | ||
|
||
skinparam BackgroundColor transparent | ||
skinparam Shadowing false | ||
|
||
participant User | ||
|
||
User -> Foreshadow: ~__init__() | ||
|
||
note over Foreshadow | ||
pipeline = Pipeline([ | ||
('dp', DataPreparer()), | ||
('lr', LogisticRegression()), | ||
]) | ||
end note | ||
|
||
Foreshadow -> OptimizerWrapper: ~__init__(pipeline, RandomizedSearchCV) | ||
|
||
User -> Foreshadow: fit(X, y) | ||
Foreshadow -> OptimizerWrapper: fit(X, y) | ||
OptimizerWrapper -> RandomizedSearchCV ++: fit_pipelines(X, y) | ||
return best_pipeline | ||
OptimizerWrapper -> RandomizedSearchCV ++: fit_params(X, y) | ||
return best_pipeline_params | ||
|
||
OptimizerWrapper --> Foreshadow: self | ||
Foreshadow --> User: self | ||
|
||
@enduml |
Oops, something went wrong.