Skip to content

Commit

Permalink
Merge pull request #84 from 1chooo/ho-dev
Browse files Browse the repository at this point in the history
reconstruct Refinaid.Utils
  • Loading branch information
1chooo authored Sep 4, 2023
2 parents 806744b + fc3ab5c commit ad1f8f9
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Refinaid/gui/Utils/Get.py → Refinaid/Utils/Get.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'''
Create Date: 2023/08/31
Author: @1chooo(Hugo ChunHo Lin), @ReeveWu
Version: v0.0.6
Version: v0.0.7
'''

import pandas as pd
Expand Down
16 changes: 8 additions & 8 deletions Refinaid/gui/Utils/Listener.py → Refinaid/Utils/Listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
Version: v0.0.7
'''

from Refinaid.gui.Utils.Update import update_parameters
from Refinaid.gui.Utils.Update import update_plot_x_parameters
from Refinaid.gui.Utils.Update import update_plot_y_parameters
from Refinaid.gui.Utils.Update import update_model_parameters
from Refinaid.gui.Utils.Update import update_preprocessing_data
from Refinaid.gui.Utils.Update import update_training_results
from Refinaid.gui.Utils.Update import update_training_history
from Refinaid.gui.Utils.Update import update_preprocessing_visualization
from Refinaid.Utils.Update import update_parameters
from Refinaid.Utils.Update import update_plot_x_parameters
from Refinaid.Utils.Update import update_plot_y_parameters
from Refinaid.Utils.Update import update_model_parameters
from Refinaid.Utils.Update import update_preprocessing_data
from Refinaid.Utils.Update import update_training_results
from Refinaid.Utils.Update import update_training_history
from Refinaid.Utils.Update import update_preprocessing_visualization

def background_listener(
dataset_dropdown,
Expand Down
4 changes: 2 additions & 2 deletions Refinaid/gui/Utils/Update.py → Refinaid/Utils/Update.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'''
Create Date: 2023/09/02
Author: @1chooo, @ReeveWu
Version: v0.0.6
Version: v0.0.7
'''

import gradio as gr
from Refinaid.Action.Load import get_dataset_x_columns, get_dataset_numeric_columns
from Refinaid.gui.Utils.Get import get_data_setting
from Refinaid.Utils.Get import get_data_setting
from Refinaid.Action.ML_configurations import DatasetConfig, DecisionTreeModelConfig, KNNModelConfig
from Refinaid.Action.Model import training
from Refinaid.Action.Load import get_dataframe
Expand Down
6 changes: 1 addition & 5 deletions Refinaid/gui/Dashborad/Preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ def get_dataset_info(

dataset_header = gr.Markdown("### Dataset")

dataset_choices = [
"Titanic",
"Diabetes",
"House Prices",
]
dataset_choices = self.page_content.dataset_choices

dataset_dropdown = gr.Dropdown(
label="Select Dataset",
Expand Down
4 changes: 3 additions & 1 deletion Refinaid/gui/Dashborad/Training.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def get_training_info(
self, *args: Any, **kwargs: Any) -> Tuple[
gr.Markdown
]:
training_heading = gr.Markdown("## Training")
training_heading = gr.Markdown(
self.page_content.training_header
)

return (
training_heading
Expand Down
9 changes: 5 additions & 4 deletions Refinaid/gui/Example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'''
Create Date: 2023/08/31
Author: @1chooo(Hugo ChunHo Lin), @ReeveWu
Version: v0.0.6
Version: v0.0.7
'''

import gradio as gr
Expand All @@ -22,7 +22,7 @@ def get_picked_up_data_example(
testing_slider,
) -> gr.Examples:
picked_up_data_example = gr.Examples(
[
examples=[
[
"Titanic",
[
Expand Down Expand Up @@ -65,15 +65,16 @@ def get_picked_up_data_example(
20,
],
],
[
inputs=[
dataset_dropdown,
parameters_dropdown,
miss_value_checkbox,
data_scale_dropdown,
training_slider,
validation_slider,
testing_slider,
]
],
label='Data Preprocessing Example',
)

return picked_up_data_example
Expand Down
16 changes: 14 additions & 2 deletions Refinaid/gui/Information.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'''
Create Date: 2023/08/31
Author: @1chooo(Hugo ChunHo Lin), @ReeveWu
Version: v0.0.6
Version: v0.0.7
'''

from typing import Any, Tuple
Expand All @@ -20,5 +20,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
"""

self.preprocessing_header = """\
## Preprocessing
## Data Preprocessing
Let's begin exploring the data preprocessing of machine learning!
"""

self.training_header = """\
## Training
"""

self.dataset_choices = [
"Titanic",
"Diabetes",
"House Prices",
]
4 changes: 2 additions & 2 deletions Refinaid/gui/Launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
'''
Create Date: 2023/08/28
Author: @1chooo(Hugo ChunHo Lin), @ReeveWu
Version: v0.0.6
Version: v0.0.7
'''

import gradio as gr
from Refinaid.gui.Utils.Listener import background_listener
from Refinaid.Utils.Listener import background_listener
from Refinaid.gui.Information import PageContent
from Refinaid.gui.Dashborad.Header import PageHeader
from Refinaid.gui.Dashborad.Preprocessing import PreprocessingComponent
Expand Down
Empty file removed Refinaid/gui/Utils/__init__.py
Empty file.
14 changes: 7 additions & 7 deletions test/wireframe/v_0_0_3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
Create Date: 2023/09/01
Author: @1chooo
Version: v0.0.3
Version: v0.0.7
'''

import sys
Expand All @@ -17,12 +17,12 @@
sys.path.append(project_root)

import gradio as gr
from Refinaid.gui.Utils.Update import update_parameters
from Refinaid.gui.Utils.Update import update_plot_x_parameters
from Refinaid.gui.Utils.Update import update_plot_y_parameters
from Refinaid.gui.Utils.Update import update_model_parameters
from Refinaid.gui.Utils.Update import update_preprocessing_data
from Refinaid.gui.Utils.Update import update_training_results
from Refinaid.Utils.Update import update_parameters
from Refinaid.Utils.Update import update_plot_x_parameters
from Refinaid.Utils.Update import update_plot_y_parameters
from Refinaid.Utils.Update import update_model_parameters
from Refinaid.Utils.Update import update_preprocessing_data
from Refinaid.Utils.Update import update_training_results

demo = gr.Blocks(
title='Refinaid',
Expand Down

0 comments on commit ad1f8f9

Please sign in to comment.