Skip to content
Open

Ny #2

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

1. **mlp_class.py** - класс многослойного персептрона
2. **preprocessing.py** - функции предобработки входных данных
3. **nn_optimization.ipynb** - основной ноутбук с описанием ГА
3. **nn_optimization.ipynb** - основной ноутбук с описанием ГА
4. **check_input_matrix.ipynb** - проверка исходных данных
46 changes: 46 additions & 0 deletions check_input_matrix.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def check_input_matrix(data):\n",
" flag=True\n",
" for t in data.dtypes.iloc[:-1: 1]:\n",
" if str(t).find(\"float\")<0 and str(t).find(\"int\")<0 : ##не int и не float, то плохие данные\n",
" print('Признаки должны иметь численный тип')\n",
" return False\n",
" if (str(data.dtypes.iloc[data.shape[1]-1:]).find(\"int\")<0):\n",
" print('Целевое значение должно быть целочисленным')\n",
" return False\n",
" if data.isnull().sum().sum()>0:\n",
" print('Есть пропуски в данных')\n",
" return False \n",
" return True"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}