Skip to content

Hw18#4

Open
SuleimanovShakir wants to merge 20 commits into
mainfrom
hw18
Open

Hw18#4
SuleimanovShakir wants to merge 20 commits into
mainfrom
hw18

Conversation

@SuleimanovShakir
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@iam28th iam28th left a comment

Choose a reason for hiding this comment

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

Шакир, добрый день!

  1. Рефакторинг
    По коду есть закоменченные куски, кое-где не хватает типизации, и не везде порядок импортов соответствует общепринятому. Для борьбы с последним очень рекомендую использовать тулы isort или ruff (сам пользуюсь вторым).
    Тут -3б.
    Великолепный readme, явно заслуживающий 3 доп. баллов (если бы это было первое задание с ним, то накинул бы больше)).
    (12+3)/15

  2. Случайный лес
    Реализация fit похожа на правду, но не распараллелен predict (-10б) и нет примеров (-5б).
    10/25

  3. Тесты
    Здесь всё хорошо, 10/10

Итого у вас (32+3)/50 за это дз.

На репозиторий и код приятно смотреть)
Успехов с защитой в ИБ и в дальнейшей карьере!

Comment thread custom_random_forest.py
Comment on lines +50 to +58
#dump(current_tree, f'{os.getcwd()}/my_randomforest_model_{pid}.joblib')

#processes = [multiprocessing.Process(target=fit_tree, args=(data, pid)) for pid, data in enumerate(self.bootstrapped_data)]
#for proc in processes:
# proc.start()
#for proc in processes:
# proc.join()
#return results
return self
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

закоменченные куски кода конечно стоит убрать...

Comment thread bio_files_processor.py
records = []
while not self.StopIter:
records.append(self.__next__())
return records
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

в этом файле type hint-ов не хватает

Comment thread custom_random_forest.py
'''
probas = self.predict_proba(X)
predictions = np.argmax(probas, axis=1)
return predictions
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

в этом файле type hint-ов не хватает

Comment thread sequence_tools.py
return (float): The mass of the protein.
'''
mass = sum(self.dictionary.get(aa) for aa in self.sequence)
return mass
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

нужно проаннотировать типы

Comment thread custom_random_forest.py
Comment on lines +1 to +7
import numpy as np
from concurrent.futures import ProcessPoolExecutor
from sklearn.base import BaseEstimator
from sklearn.tree import DecisionTreeClassifier
from joblib import dump, load
import os
import multiprocessing
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

порядок импортов неправильный

Suggested change
import numpy as np
from concurrent.futures import ProcessPoolExecutor
from sklearn.base import BaseEstimator
from sklearn.tree import DecisionTreeClassifier
from joblib import dump, load
import os
import multiprocessing
import multiprocessing
import os
from concurrent.futures import ProcessPoolExecutor
import numpy as np
from joblib import dump, load
from sklearn.base import BaseEstimator
from sklearn.tree import DecisionTreeClassifier

Comment thread bio_files_processor.py
# Import modules
from source.folder_parser import folder_parser
from dataclasses import dataclass
import os
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

порядок импортов неправильный

Comment thread bio_files_processor.py
Comment on lines +28 to +31
if output is None:
output_path = f'{input_folder}/{folder_name}/{input_name}'
else:
output_path = f'{input_folder}/{folder_name}/{output}.{format}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if output is None:
output_path = f'{input_folder}/{folder_name}/{input_name}'
else:
output_path = f'{input_folder}/{folder_name}/{output}.{format}'
output_path = f"{input_folder}/{folder_name}/" + (
input_name if output is None else f"{output}.{format}"
)

хотя может и не очень получилось...
но хочется каким-то образом избавиться от повторения `f'{input_folder}/{folder_name}/``

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.

2 participants