Skip to content

TypeError: got an unexpected keyword argument 'fit_params' #385

@ShaLiuYSU

Description

@ShaLiuYSU

Dear developers,

I am now using CASM for fitting. No matter which exLasso or exGeneticAlgorithm method, I always got the following error:
TypeError: got an unexpected keyword argument 'fit_params'

I copy the full fit.json and output below, and please give me some advice on what happened?

{
"problem_specs": {
"data": {
"filename": "train",
"filetype": "selection",
"X": "corr",
"y": "formation_energy",
"kwargs": null
},
"weight": {
"method": "wHullDist",
"kwargs": {
"A": 0.0,
"B": 1.0,
"kT": 0.01
}
},
"cv": {
"method": "KFold",
"kwargs": {
"n_splits": 10,
"shuffle": true
},
"penalty": 0.0
}
},
"estimator": {
"method": "Lasso",
"kwargs": {
"alpha": 0.0001,
"max_iter": 1
}
},
"feature_selection": {
"method": "SelectFromModel",
"kwargs": null
},
"n_halloffame": 25
}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!OUTPUT:
(casm) [LS@mgt fit_2]$ casm-learn -s fit_2_ga.json
Loading fit_2_ga.json

Hall of Fame size: 25

Get problem data...

Reading existing problem specs from: fit_2_ga_specs.pkl

DONE

Estimator:

{
"method": "Lasso",
"kwargs": {
"alpha": 0.0001,
"max_iter": 1,
"fit_intercept": false
}
}

Feature Selection:

{
"method": "SelectFromModel",
"kwargs": {}
}

Fit and select...

/data/home/LS/miniconda3/envs/casm/lib/python3.9/site-packages/sklearn/linear_model/_coordinate_descent.py:695: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 5.873e+00, tolerance: 6.002e-03
model = cd_fast.enet_coordinate_descent(

Iterations: 1

Feature selection threshold: None

DONE Runtime: 0.004479796160012484 (s)

Adding statistics...
Traceback (most recent call last):
File "/data/home/LS/miniconda3/envs/casm/bin/casm-learn", line 7, in
sys.exit(main())
File "/data/home/LS/miniconda3/envs/casm/lib/python3.9/site-packages/casm/scripts/casm_learn.py", line 212, in main
casm.learn.fit_and_select(input,
File "/data/home/LS/miniconda3/envs/casm/lib/python3.9/site-packages/casm/learn/feature_selection.py", line 123, in fit_and_select
indiv.fitness.values = casm.learn.model_selection.cross_val_score(
File "/data/home/LS/miniconda3/envs/casm/lib/python3.9/site-packages/casm/learn/model_selection.py", line 107, in cross_val_score
scores = sklearn.model_selection.cross_val_score(estimator,
File "/data/home/LS/miniconda3/envs/casm/lib/python3.9/site-packages/sklearn/utils/_param_validation.py", line 194, in wrapper
params = func_sig.bind(*args, **kwargs)
File "/data/home/LS/miniconda3/envs/casm/lib/python3.9/inspect.py", line 3045, in bind
return self._bind(args, kwargs)
File "/data/home/LS/miniconda3/envs/casm/lib/python3.9/inspect.py", line 3034, in _bind
raise TypeError(
TypeError: got an unexpected keyword argument 'fit_params'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions