blobcity / autoai

Python based framework for Automatic AI for Regression and Classification over numerical data. Performs model search, hyper-parameter tuning, and high-quality Jupyter Notebook code generation.
Apache License 2.0
175 stars 43 forks source link

Add QuadraticDiscriminantAnalysis #152

Closed Thilakraj1998 closed 2 years ago

Thilakraj1998 commented 3 years ago

Add QuadraticDiscriminantAnalysis model into the library.

API Reference for required parameters: https://scikit-learn.org/stable/modules/generated/sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis.html

Dependencies if any, must be appropriately added. Test run of the train function on a classification problem(ClassificationTest.py) must pass, and the function must attempt to train an QuadraticDiscriminantAnalysis as a potential best fit model.

vikneshwara-r-b commented 3 years ago

Hello @Thilakraj1998 . Shall I contribute to this issue?

vikneshwara-r-b commented 3 years ago

Hi @Thilakraj1998 . I have installed all dependencies in requirements.txt and tensorflow in the autoai repository using cond env. For doing sanity check I executed the ClassificationTest.py , but I recieved the following error.

Traceback (most recent call last): File "/Users/user_name/Desktop/foss/autoai/ClassificationTest.py", line 25, in <module> model=bc.train(file=file_path,target=target,features=features) # function to test AutoAI Process File "/Users/user_name/Desktop/foss/autoai/blobcity/main/driver.py", line 51, in train modelClass = modelSearch(CleanedDF,target,dc) File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 125, in modelSearch best=trainOnFull(dataframe,target,modelsList,trainOnSample(dataframe,target,modelsList,DictClass),DictClass) File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 87, in trainOnSample modelScore={m:cvScore(models[m][0](),X,Y,k) for m in tqdm_notebook(models) } File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 87, in <dictcomp> modelScore={m:cvScore(models[m][0](),X,Y,k) for m in tqdm_notebook(models) } File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 60, in cvScore accuracy = cross_val_score(model, X, Y, cv = k,n_jobs=-2) File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/sklearn/model_selection/_validation.py", line 510, in cross_val_score cv_results = cross_validate( File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/sklearn/model_selection/_validation.py", line 267, in cross_validate results = parallel( File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/joblib/parallel.py", line 1056, in __call__ self.retrieve() File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/joblib/parallel.py", line 935, in retrieve self._output.extend(job.get(timeout=self.timeout)) File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 542, in wrap_future_result return future.result(timeout=timeout) File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/concurrent/futures/_base.py", line 445, in result return self.__get_result() File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result raise self._exception joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker. The exit codes of the workers are {SIGSEGV(-11)}

Hardware setup OS - MacOS Big Sur (Version 11.3.1) Processor - 2.6Ghz 6 Core Intel Core i7 Memory - 16GB

I have attached the env info in txt file below.How to resolve the issue?

autoai_env.txt

Thilakraj1998 commented 3 years ago

@vikneshwara-r-b cross_val_score(model, X, Y, cv = k,n_jobs=-2) here -2 is not a valid value for n_job. either number of core present in the system or -1 to consider all cores

vikneshwara-r-b commented 3 years ago

@Thilakraj1998 After changing n_jobs=-1 or no of cores present in the system n_jobs=6, I still recieve the same error

Traceback (most recent call last): File "/Users/user_name/Desktop/foss/autoai/ClassificationTest.py", line 25, in model=bc.train(file=file_path,target=target,features=features) # function to test AutoAI Process File "/Users/user_name/Desktop/foss/autoai/blobcity/main/driver.py", line 51, in train modelClass = modelSearch(CleanedDF,target,dc) File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 125, in modelSearch best=trainOnFull(dataframe,target,modelsList,trainOnSample(dataframe,target,modelsList,DictClass),DictClass) File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 87, in trainOnSample modelScore={m:cvScore(models[m][0](),X,Y,k) for m in tqdm_notebook(models) } File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 87, in modelScore={m:cvScore(models[m][0](),X,Y,k) for m in tqdm_notebook(models) } File "/Users/user_name/Desktop/foss/autoai/blobcity/main/modelSelection.py", line 60, in cvScore accuracy = cross_val_score(model, X, Y, cv = k,n_jobs=-1) File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/sklearn/model_selection/_validation.py", line 510, in cross_val_score cv_results = cross_validate( File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/sklearn/model_selection/_validation.py", line 267, in cross_validate results = parallel( File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/joblib/parallel.py", line 1056, in call self.retrieve() File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/joblib/parallel.py", line 935, in retrieve self._output.extend(job.get(timeout=self.timeout)) File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 542, in wrap_future_result return future.result(timeout=timeout) File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/concurrent/futures/_base.py", line 445, in result return self.__get_result() File "/Users/user_name/opt/miniconda3/envs/autoai/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result raise self._exception joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker.

The exit codes of the workers are {SIGSEGV(-11)}

Thilakraj1998 commented 3 years ago

@vikneshwara-r-b do check the whether the version of joblib is latest

vikneshwara-r-b commented 3 years ago

Yes.Iam using the latest one