#ml #voting #ensembling #err #borda #bucklin #condorcet #coombs #reciprocalranking #instantrunoff #fs #featureselection
Гуглил методы голосования (БордА и прочее), и неожиданно наткнулся на их применение в... отборе признаков! Вот уж чего никогда не видел раньше. Есть некий шанс, что это полезно, т.к. один из методов такого "демократического ансамблирования" (Ensemble Reciprocal Ranking) зарулил "лучший одиночный метод" (это был SHAP).
https://towardsdatascience.com/ensemble-feature-selection-for-machine-learning-c0df77b970f9
Гуглил методы голосования (БордА и прочее), и неожиданно наткнулся на их применение в... отборе признаков! Вот уж чего никогда не видел раньше. Есть некий шанс, что это полезно, т.к. один из методов такого "демократического ансамблирования" (Ensemble Reciprocal Ranking) зарулил "лучший одиночный метод" (это был SHAP).
https://towardsdatascience.com/ensemble-feature-selection-for-machine-learning-c0df77b970f9
#python #codegems #fs #expandvars
Пошёл тестировать BAMT. Пример из руководства выпал с ошибкой, смотрю, он пытается создать файл
А лучше всего место для хранения настроек, раз уж локальная директория не подходит, получить с помошью platformdirs :
Пошёл тестировать BAMT. Пример из руководства выпал с ошибкой, смотрю, он пытается создать файл
C:\Users\Roman\BAMT\Nodes_data
Посмеялся, думаю, щас заведу им issue чтоб по дефолту заменили на какое-нить %%LOCALAPPDATA%%\aimclub\BAMT\Nodes_data
Но сначала сам заменил локально, потестить:PermissionError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_3236\1667079916.py in <module>
----> 1 bn.fit_parameters(data)
C:\ProgramData\Anaconda3\lib\site-packages\bamt\networks\base.py in fit_parameters(self, data, dropna, n_jobs)
489
490 if not os.path.isdir(STORAGE):
--> 491 os.makedirs(STORAGE)
492
493 # init folder
C:\ProgramData\Anaconda3\lib\os.py in makedirs(name, mode, exist_ok)
213 if head and tail and not path.exists(head):
214 try:
--> 215 makedirs(head, exist_ok=exist_ok)
216 except FileExistsError:
217 # Defeats race condition when another thread created the path
C:\ProgramData\Anaconda3\lib\os.py in makedirs(name, mode, exist_ok)
213 if head and tail and not path.exists(head):
214 try:
--> 215 makedirs(head, exist_ok=exist_ok)
216 except FileExistsError:
217 # Defeats race condition when another thread created the path
C:\ProgramData\Anaconda3\lib\os.py in makedirs(name, mode, exist_ok)
213 if head and tail and not path.exists(head):
214 try:
--> 215 makedirs(head, exist_ok=exist_ok)
216 except FileExistsError:
217 # Defeats race condition when another thread created the path
C:\ProgramData\Anaconda3\lib\os.py in makedirs(name, mode, exist_ok)
223 return
224 try:
--> 225 mkdir(name, mode)
226 except OSError:
227 # Cannot rely on checking for EEXIST, since the operating system
PermissionError: [WinError 5] Access is denied: '%LOCALAPPDATA%'
Оказалось, питон на винде, в отличие от Проводника, не поддерживает сокращения типа %LOCALAPPDATA%. Получается, перед работой с файловой системой надо сначала любой путь пропускать через os.path.expandvars в качестве лучшей практики.А лучше всего место для хранения настроек, раз уж локальная директория не подходит, получить с помошью platformdirs :
>>> from platformdirs import *
>>> appname = "SuperApp"
>>> appauthor = "Acme"
>>> user_data_dir(appname, appauthor)
'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp'
>>> user_data_dir(appname, appauthor, roaming=True)
'C:\\Users\\trentm\\AppData\\Roaming\\Acme\\SuperApp'
>>> user_cache_dir(appname, appauthor)
'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Cache'
>>> user_log_dir(appname, appauthor)
'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Logs'
>>> user_documents_dir()
'C:\\Users\\trentm\\Documents'
>>> user_downloads_dir()
'C:\\Users\\trentm\\Downloads'
>>> user_pictures_dir()
'C:\\Users\\trentm\\Pictures'
>>> user_videos_dir()
'C:\\Users\\trentm\\Videos'
>>> user_music_dir()
'C:\\Users\\trentm\\Music'
>>> user_desktop_dir()
'C:\\Users\\trentm\\Desktop'
>>> user_runtime_dir(appname, appauthor)
'C:\\Users\\trentm\\AppData\\Local\\Temp\\Acme\\SuperApp'GitHub
GitHub - tox-dev/platformdirs: A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir". - tox-dev/platformdirs
✍1
Forwarded from Artem Ryblov’s Data Science Weekly
Feature Selection in Machine Learning by Soledad Galli
Feature selection is the process of selecting a subset of features from the total variables in a data set to train machine learning algorithms. Feature selection is an important aspect of data mining and predictive modelling.
Feature selection is key for developing simpler, faster, and highly performant machine learning models and can help to avoid overfitting. The aim of any feature selection algorithm is to create classifiers or regression models that run faster and whose outputs are easier to understand by their users.
In this book, you will find the most widely used feature selection methods to select the best subsets of predictor variables from your data. You will learn about filter, wrapper, and embedded methods for feature selection. Then, you will discover methods designed by computer science professionals or used in data science competitions that are faster or more scalable.
First, we will discuss the use of statistical and univariate algorithms in the context of artificial intelligence. Next, we will cover methods that select features through optimization of the model performance. We will move on to feature selection algorithms that are baked into the machine learning techniques. And finally, we will discuss additional methods designed by data scientists specifically for applied predictive modeling.
In this book, you will find out how to:
- Remove useless and redundant features by examining variability and correlation.
- Choose features based on statistical tests such as ANOVA, chi-square, and mutual information.
- Select features by using Lasso regularization or decision tree based feature importance, which are embedded in the machine learning modeling process.
- Select features by recursive feature elimination, addition, or value permutation.
Each chapter fleshes out various methods for feature selection that share common characteristics. First, you will learn the fundamentals of the feature selection method, and next you will find a Python implementation.
The book comes with an accompanying Github repository with the full source code that you can download, modify, and use in your own data science projects and case studies.
Feature selection methods differ from dimensionality reduction methods in that feature selection techniques do not alter the original representation of the variables, but merely select a reduced number of features from the training data that produce performant machine learning models.
Using the Python libraries Scikit-learn, MLXtend, and Feature-engine, you’ll learn how to select the best numerical and categorical features for regression and classification models in just a few lines of code. You will also learn how to make feature selection part of your machine learning workflow.
Link:
- Book
Navigational hashtags: #armbooks
General hashtags: #ml #machinelearning #featureselection #fs
@data_science_weekly
Feature selection is the process of selecting a subset of features from the total variables in a data set to train machine learning algorithms. Feature selection is an important aspect of data mining and predictive modelling.
Feature selection is key for developing simpler, faster, and highly performant machine learning models and can help to avoid overfitting. The aim of any feature selection algorithm is to create classifiers or regression models that run faster and whose outputs are easier to understand by their users.
In this book, you will find the most widely used feature selection methods to select the best subsets of predictor variables from your data. You will learn about filter, wrapper, and embedded methods for feature selection. Then, you will discover methods designed by computer science professionals or used in data science competitions that are faster or more scalable.
First, we will discuss the use of statistical and univariate algorithms in the context of artificial intelligence. Next, we will cover methods that select features through optimization of the model performance. We will move on to feature selection algorithms that are baked into the machine learning techniques. And finally, we will discuss additional methods designed by data scientists specifically for applied predictive modeling.
In this book, you will find out how to:
- Remove useless and redundant features by examining variability and correlation.
- Choose features based on statistical tests such as ANOVA, chi-square, and mutual information.
- Select features by using Lasso regularization or decision tree based feature importance, which are embedded in the machine learning modeling process.
- Select features by recursive feature elimination, addition, or value permutation.
Each chapter fleshes out various methods for feature selection that share common characteristics. First, you will learn the fundamentals of the feature selection method, and next you will find a Python implementation.
The book comes with an accompanying Github repository with the full source code that you can download, modify, and use in your own data science projects and case studies.
Feature selection methods differ from dimensionality reduction methods in that feature selection techniques do not alter the original representation of the variables, but merely select a reduced number of features from the training data that produce performant machine learning models.
Using the Python libraries Scikit-learn, MLXtend, and Feature-engine, you’ll learn how to select the best numerical and categorical features for regression and classification models in just a few lines of code. You will also learn how to make feature selection part of your machine learning workflow.
Link:
- Book
Navigational hashtags: #armbooks
General hashtags: #ml #machinelearning #featureselection #fs
@data_science_weekly