Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create multi_model wrapper and kCollaborator #173

Merged

Conversation

nubs01
Copy link
Contributor

@nubs01 nubs01 commented Dec 29, 2022

Pull Request Checklist

Before sending your pull requests, make sure you followed this list.

Checklist for Pull Request

  • Describe what this PR purpose. For example, for new features describe what problem this PR solves. If there is JIRA task, please include JIRA link.
  • When there are more than one tasks in the PR, use to do list in github mark down.
  • Include unit tests. If small test files are needed for your unit tests, please include them as well. Be conservative in adding test files, try to make them small and local instead of putting it on S3 or external database.
  • Assign reviewer.

Running unit tests

Using tools and libraries installed directly on your system.
For example, to run all tests under graphengine, do:

nose2

modelers: list['h1st.MLModeler']=[],
ensemble_modeler: 'h1st.Modeler' = RuleBasedModeler(MajorityVotingEnsemble),
models: list['h1st.PredictiveModel']=None,
inject_x_in_ensembler: bool=False) -> 'BaseOracle':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one mean build_model return a string value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it returns a kCollaboratorModel. Forgot to fix type annotation. Corrected now, but also strings instead of importing the actual class are accept methods of type annotating.

super().__init__()

def build_model(self, prepared_data: dict,
modelers: list['h1st.MLModeler']=[],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one should be

List[MLModeler]

with

from typing import List
from h1st import MLModeler

@phamhoangtuan phamhoangtuan merged commit 4c6b508 into feat/oracle_with_fuzzy_refactor Jan 4, 2023
@phamhoangtuan phamhoangtuan deleted the feat/kCollaborator_rebased branch January 4, 2023 06:53
hiro-v pushed a commit that referenced this pull request Feb 23, 2023
…ge_with_k1st (#186)

* feat: add user code to user Oracle

* refactor: create OracleModel class, split students and ensemble to models and modelers files

* fix: add condition to build_model func in modeler

* fix: update modeler build_model function and model predict function

* fix: update persist and load function of OracleModel

* fix: fix bug version is overlapped, remove unused Oracle class

* refactor: change param name to be clearer, split persist and load function to more smaller functions to be clearer and easier to read

* fix: rename ensemble to ensembler, add Oracle as backward compability of OracleModel, add func to gen train data for ensembler

* fix: fix FuzzyModel process rules function

* fix: update modeler build_model func comment, update test_oracle UT file

* feat: add evaluation func to modeler

* fix: use logger from loguru, not logging; comment out UT for ts oracle, update test case for fuzzy model

* feat: add ipython notebook to run Oracle with iris data

* feat: add ipython notebook to run oracle with azure iot data

* fix: update tutorial to use new Oracle code

* fix: remove unused lib in TimeSeriesOracle

* feat: add loguru to pyproject

* feat: create multi_model wrapper and kCollaborator (#173)

* feat: create multi_model wrapper and kCollaborator

* fix: type annotations

* fix: debug collaborator & multi model

* feat: add compelete user code for collaborator and multi model

* fix: change OracleModel to Oracle

* feat: add xgboost model wrapper

* fix: remove tensorflow lib

* fix: change TimeSeriesOracleModel to TimeSeriesOracle

* fix: update Model and Modeler code for XGBoost based on Roshan code

* fix: change x to X in k-collaborator, reformat python code

* feat: add Logical OR Ensemble model and modeler

* feat: create oracle similar to collaborator, add hyperparam ingestion for xgboost modeler (#178)

* fix: update var type in xgboost modeler

* fix: add name attribute to XGBoost model

* fix: add name attribute to FuzzyModel, fix approach to create dataframe from list of series in MultiModel

* fix: fix input data in k-collaborator, fix build_model of ensemble

* fix: init ensemble class

* Feat/improved models for build pipeline (#179)

* feat: add some useful ensemble model/modelers

* feat: fix xgboost regression building and create classifier

* feat: abstract data_key and output_key for all predicitive models

* feat: allow collaborator ensemble modeling with explicit labelled_data field

* feat: allow passed hyperparams to override grid search in xgboost

* fix: fix typo, add name to Model classes, change xgboost xgrid search result to int

* fix: add name property to Model, not Modeler

* fix: get student train data

* fix: k-colab can deal with prepared_data is None then only produce fuzzy model

* fix: deal with K-Oracle without prepared data then return only teacher fuzzy model

* fix: return empty df if no df to concat

* fix: add teacher model to Oracle

* fix: XGBoost if no result key then get first column of y_train data as result_key

* fix: remove xgb grid search for hyperparam

* fix: add input_features to stats when building model

* fix: add input_features as columns of prepared_data X_train

* fix: deal with None prepared_data in k-colab when saving input_features stats, deal with None ensemble in Oracle

* fix: order input_features when persist multimodel

* fix: revert student_models.py

* fix: fix NA value when concat list of Series

* fix: convert numpy.ndarray to pandas.DataFrame when running LogisticRegression and RandomForest models predict

* fix: set default value for xgb

* fix: add support parallel running when building k-colab and k-oracle

* feat: Refactor XGB Model

* fix: log

* fix: evaluate func

* refactor: Random forest model

* feat: update random forest student model

* refactor: Logistic regression model

* fix(multi-model): fix logic to append pred result

---------

Co-authored-by: Roshan Nanu <roshan.nanu@gmail.com>
Co-authored-by: Hung Vo <vphungkhtn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants