Skip to content

Final hw python bi#4

Open
CaptnClementine wants to merge 91 commits into
mainfrom
final_hw_python_bi
Open

Final hw python bi#4
CaptnClementine wants to merge 91 commits into
mainfrom
final_hw_python_bi

Conversation

@CaptnClementine

Copy link
Copy Markdown
Owner

No description provided.

CaptnClementine and others added 30 commits October 6, 2023 22:11
 This function counts sulphur-containing amino acids (Cysteine and Methionine) in a protein sequence.

@ANugmanova ANugmanova left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В целом, очень хороший репозиторий, молодец!:) Маленькая ошибочка с количеством деревьев, так что 49/50. Но +2 доп за дополнительные тесты и аккуратный репозиторий

Comment thread README.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Очень крутой README! В целом, "Script contents" не обязатольно было добавлять, кому интересно все равно посмотрит в коде, а вот докстринги для каждого класса лучше добавить (в bio_files_processor.py есть не везде)

Comment thread custom_random_forest.py
from matplotlib.colors import ListedColormap
from sklearn.tree import DecisionTreeClassifier
from sklearn.base import BaseEstimator
from multiprocessing import Process, Queue

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
_data = [(X, y)] * self.n_estimators

with ProcessPoolExecutor(max_workers=self.n_jobs) as executor:
results = list(executor.map(self._fit_batch_trees, _data))

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 main.py
bool: True if the sequence conforms to the alphabet, False otherwise.
"""
pass

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Обычно между классами 2 строки, а то там сверху был 1, тут 3:)

Comment thread custom_random_forest.py
return results, ids


def predict_proba(self, X: np.ndarray, n_jobs: int = 1) -> np.ndarray:

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
def _fit_batch_trees(self, args: Tuple[np.ndarray, np.ndarray]) -> Tuple[List[DecisionTreeClassifier], List[np.ndarray]]:

X, y = args
self.classes_ = sorted(np.unique(y))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

в init тогда тоже лучше добавить эту переменную, просто присвоить None

Comment thread custom_random_forest.py
results = []
ids = []

for tr in range(self.n_estimators):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

у тебя получается, что при объявлении потоков self.n_estimators вызовов и тут вот столько же деревьев, суммарно self.n_estimators^2 деревьев, так что тут можно просто одно обучить:)

Comment thread Showcases.ipynb

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Хороший ноутбук, здорово, что добавила объяснение к примерам

@@ -0,0 +1,28 @@
import pytest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тесты хорошие!

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