Skip to content

Commit

Permalink
move Metric.py to ml_metrics package & update version
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlovicmilena committed Oct 27, 2021
1 parent 930a6f8 commit f24678a
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 19 deletions.
3 changes: 1 addition & 2 deletions immuneML/dsl/instruction_parsers/TrainMLModelParser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import hashlib
import warnings
from inspect import signature
from pathlib import Path
from typing import Tuple
Expand All @@ -11,13 +10,13 @@
from immuneML.dsl.symbol_table.SymbolTable import SymbolTable
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.LeaveOneOutConfig import LeaveOneOutConfig
from immuneML.hyperparameter_optimization.config.ManualSplitConfig import ManualSplitConfig
from immuneML.hyperparameter_optimization.config.ReportConfig import ReportConfig
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
from immuneML.ml_metrics.Metric import Metric
from immuneML.reports.train_ml_model_reports.TrainMLModelReport import TrainMLModelReport
from immuneML.util.ParameterValidator import ParameterValidator
from immuneML.util.ReflectionHandler import ReflectionHandler
Expand Down
2 changes: 1 addition & 1 deletion immuneML/environment/Constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Constants:

VERSION = "2.0.5"
VERSION = "2.0.6"

# encoding constants
FEATURE_DELIMITER = "///"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

from immuneML.data_model.dataset.Dataset import Dataset
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.states.HPAssessmentState import HPAssessmentState
from immuneML.hyperparameter_optimization.states.HPItem import HPItem
from immuneML.hyperparameter_optimization.strategy.HPOptimizationStrategy import HPOptimizationStrategy
from immuneML.ml_metrics.Metric import Metric
from immuneML.reports.ReportResult import ReportResult


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion immuneML/presentation/html/HPHTMLBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

from immuneML.environment.Constants import Constants
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
from immuneML.hyperparameter_optimization.states.HPAssessmentState import HPAssessmentState
from immuneML.hyperparameter_optimization.states.HPItem import HPItem
from immuneML.hyperparameter_optimization.states.HPLabelState import HPLabelState
from immuneML.hyperparameter_optimization.states.HPSelectionState import HPSelectionState
from immuneML.hyperparameter_optimization.states.TrainMLModelState import TrainMLModelState
from immuneML.ml_methods.util.Util import Util as MLUtil
from immuneML.ml_metrics.Metric import Metric
from immuneML.presentation.TemplateParser import TemplateParser
from immuneML.presentation.html.Util import Util
from immuneML.reports.ReportResult import ReportResult
Expand Down
2 changes: 1 addition & 1 deletion immuneML/reports/ml_reports/TrainingPerformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from sklearn.preprocessing import label_binarize

from immuneML.data_model.dataset.Dataset import Dataset
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization import HPSetting
from immuneML.ml_methods.MLMethod import MLMethod
from immuneML.ml_metrics import ml_metrics
from immuneML.ml_metrics.Metric import Metric
from immuneML.reports.ReportOutput import ReportOutput
from immuneML.reports.ReportResult import ReportResult
from immuneML.reports.ml_reports.MLReport import MLReport
Expand Down
2 changes: 1 addition & 1 deletion immuneML/workflows/instructions/MLProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from immuneML.data_model.dataset.Dataset import Dataset
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.core.HPUtil import HPUtil
from immuneML.hyperparameter_optimization.states.HPItem import HPItem
from immuneML.ml_metrics.Metric import Metric
from immuneML.reports.ReportUtil import ReportUtil
from immuneML.reports.ml_reports.MLReport import MLReport
from immuneML.util.PathBuilder import PathBuilder
Expand Down
2 changes: 1 addition & 1 deletion immuneML/workflows/instructions/TrainMLModelInstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

from immuneML.IO.ml_method.MLExporter import MLExporter
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
from immuneML.hyperparameter_optimization.core.HPAssessment import HPAssessment
from immuneML.hyperparameter_optimization.core.HPUtil import HPUtil
from immuneML.hyperparameter_optimization.states.TrainMLModelState import TrainMLModelState
from immuneML.hyperparameter_optimization.strategy.HPOptimizationStrategy import HPOptimizationStrategy
from immuneML.ml_metrics.Metric import Metric
from immuneML.reports.train_ml_model_reports.TrainMLModelReport import TrainMLModelReport
from immuneML.util.ReflectionHandler import ReflectionHandler
from immuneML.workflows.instructions.Instruction import Instruction
Expand Down
2 changes: 1 addition & 1 deletion immuneML/workflows/steps/MLMethodAssessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import pandas as pd
from sklearn import metrics

from immuneML.environment.Metric import Metric
from immuneML.ml_methods.MLMethod import MLMethod
from immuneML.ml_methods.util.Util import Util
from immuneML.ml_metrics import ml_metrics
from immuneML.ml_metrics.Metric import Metric
from immuneML.util.PathBuilder import PathBuilder
from immuneML.workflows.steps.MLMethodAssessmentParams import MLMethodAssessmentParams
from immuneML.workflows.steps.Step import Step
Expand Down
2 changes: 1 addition & 1 deletion immuneML/workflows/steps/MLMethodAssessmentParams.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from pathlib import Path

from immuneML.data_model.dataset.Dataset import Dataset
from immuneML.environment.Metric import Metric
from immuneML.ml_methods.MLMethod import MLMethod
from immuneML.ml_metrics.Metric import Metric
from immuneML.workflows.steps.StepParams import StepParams


Expand Down
2 changes: 1 addition & 1 deletion test/dsl/semantic_model/test_semanticModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from immuneML.environment.Constants import Constants
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.ReportConfig import ReportConfig
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
from immuneML.hyperparameter_optimization.strategy.GridSearch import GridSearch
from immuneML.ml_methods.LogisticRegression import LogisticRegression
from immuneML.ml_metrics.Metric import Metric
from immuneML.util.PathBuilder import PathBuilder
from immuneML.util.RepertoireBuilder import RepertoireBuilder
from immuneML.workflows.instructions.TrainMLModelInstruction import TrainMLModelInstruction
Expand Down
2 changes: 1 addition & 1 deletion test/integration_tests/test_receptorClassification.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from immuneML.environment.Constants import Constants
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.environment.SequenceType import SequenceType
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.ReportConfig import ReportConfig
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
from immuneML.hyperparameter_optimization.strategy.GridSearch import GridSearch
from immuneML.ml_methods.LogisticRegression import LogisticRegression
from immuneML.ml_metrics.Metric import Metric
from immuneML.simulation.dataset_generation.RandomDatasetGenerator import RandomDatasetGenerator
from immuneML.workflows.instructions.TrainMLModelInstruction import TrainMLModelInstruction

Expand Down
2 changes: 1 addition & 1 deletion test/integration_tests/test_sequenceClassification.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from immuneML.environment.Constants import Constants
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.environment.SequenceType import SequenceType
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.ReportConfig import ReportConfig
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
from immuneML.hyperparameter_optimization.strategy.GridSearch import GridSearch
from immuneML.ml_methods.LogisticRegression import LogisticRegression
from immuneML.ml_metrics.Metric import Metric
from immuneML.simulation.dataset_generation.RandomDatasetGenerator import RandomDatasetGenerator
from immuneML.workflows.instructions.TrainMLModelInstruction import TrainMLModelInstruction

Expand Down
2 changes: 1 addition & 1 deletion test/reports/analysis_reports/test_CVFeaturePerformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.Label import Label
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
Expand All @@ -18,6 +17,7 @@
from immuneML.hyperparameter_optimization.states.TrainMLModelState import TrainMLModelState
from immuneML.hyperparameter_optimization.strategy.GridSearch import GridSearch
from immuneML.ml_methods.ProbabilisticBinaryClassifier import ProbabilisticBinaryClassifier
from immuneML.ml_metrics.Metric import Metric
from immuneML.reports.ReportResult import ReportResult
from immuneML.reports.train_ml_model_reports.CVFeaturePerformance import CVFeaturePerformance

Expand Down
3 changes: 1 addition & 2 deletions test/reports/ml_reports/test_TrainingPerformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from immuneML.data_model.encoded_data.EncodedData import EncodedData
from immuneML.environment.Constants import Constants
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.Metric import Metric
from immuneML.ml_methods.LogisticRegression import LogisticRegression
from immuneML.reports.ReportResult import ReportResult
from immuneML.reports.ml_reports.TrainingPerformance import TrainingPerformance


class TestEvaluation(unittest.TestCase):

def setUp(self) -> None:
Expand All @@ -29,7 +29,6 @@ def _create_dummy_lr_model(self):
return dummy_lr, encoded_tr

def _create_report(self, path):

report = TrainingPerformance.build_object(name='testcase')

report.train_dataset = Dataset()
Expand Down
2 changes: 1 addition & 1 deletion test/reports/ml_reports/test_mLSettingsPerformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.Label import Label
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
from immuneML.hyperparameter_optimization.config.SplitType import SplitType
from immuneML.hyperparameter_optimization.strategy.GridSearch import GridSearch
from immuneML.ml_methods.LogisticRegression import LogisticRegression
from immuneML.ml_metrics.Metric import Metric
from immuneML.reports.ReportResult import ReportResult
from immuneML.reports.train_ml_model_reports.MLSettingsPerformance import MLSettingsPerformance
from immuneML.util.PathBuilder import PathBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.Label import Label
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.hyperparameter_optimization.HPSetting import HPSetting
from immuneML.hyperparameter_optimization.config.ReportConfig import ReportConfig
from immuneML.hyperparameter_optimization.config.SplitConfig import SplitConfig
Expand All @@ -19,6 +18,7 @@
from immuneML.hyperparameter_optimization.strategy.GridSearch import GridSearch
from immuneML.ml_methods.LogisticRegression import LogisticRegression
from immuneML.ml_methods.SVM import SVM
from immuneML.ml_metrics.Metric import Metric
from immuneML.preprocessing.filters.ClonesPerRepertoireFilter import ClonesPerRepertoireFilter
from immuneML.reports.data_reports.SequenceLengthDistribution import SequenceLengthDistribution
from immuneML.util.PathBuilder import PathBuilder
Expand Down
2 changes: 1 addition & 1 deletion test/workflows/steps/test_MLMethodAssessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from immuneML.environment.Constants import Constants
from immuneML.environment.EnvironmentSettings import EnvironmentSettings
from immuneML.environment.LabelConfiguration import LabelConfiguration
from immuneML.environment.Metric import Metric
from immuneML.ml_methods.LogisticRegression import LogisticRegression
from immuneML.ml_metrics.Metric import Metric
from immuneML.util.PathBuilder import PathBuilder
from immuneML.util.RepertoireBuilder import RepertoireBuilder
from immuneML.workflows.steps.MLMethodAssessment import MLMethodAssessment
Expand Down

0 comments on commit f24678a

Please sign in to comment.