# cellrank.ul.models.GAM¶

Fit Generalized Additive Models (GAMs) using `pygam`.

Parameters

Attributes

 `adata` Annotated data object. `conf_int` Array of shape (n_samples, 2) containing the lower and upper bounds of the confidence interval. `model` Underlying model. `prepared` Whether the model is prepared for fitting. `shape` Number of cells in `adata`. `w` Filtered weights of shape (n_filtered_cells,) used for fitting. `w_all` Unfiltered weights of shape (n_cells,). `x` Filtered independent variables of shape (n_filtered_cells, 1) used for fitting. `x_all` Unfiltered independent variables of shape (n_cells, 1). `x_hat` Filtered independent variables used when calculating default confidence interval, usually same as `x`. `x_test` Independent variables of shape (n_samples, 1) used for prediction. `y` Filtered dependent variables of shape (n_filtered_cells, 1) used for fitting. `y_all` Unfiltered dependent variables of shape (n_cells, 1). `y_hat` Filtered dependent variables used when calculating default confidence interval, usually same as `y`. `y_test` Prediction values of shape (n_samples,) for `x_test`.

Methods

 `confidence_interval`([x_test]) Calculate the confidence interval. Return a copy of self. `default_confidence_interval`([x_test]) Calculate the confidence interval, if the underlying `model` has no method for it. `fit`([x, y, w]) Fit the model. `plot`([figsize, same_plot, hide_cells, perc, ...]) Plot the smoothed gene expression. `predict`([x_test, key_added]) Run the prediction. `prepare`(gene, lineage[, backward, ...]) Prepare the model to be ready for fitting. `read`(fname[, adata, copy]) Deserialize self from a file. `write`(fname[, write_adata, ext]) Serialize self to a file.

## Examples¶
{"ft_lang_label":"__label__en","ft_lang_prob":0.5422996,"math_prob":0.8016032,"size":2796,"snap":"2021-43-2021-49","text_gpt3_token_len":699,"char_repetition_ratio":0.11783668,"word_repetition_ratio":0.07065217,"special_character_ratio":0.24284692,"punctuation_ratio":0.22782259,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99488693,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,5,null,4,null,4,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-19T14:12:53Z\",\"WARC-Record-ID\":\"<urn:uuid:9f17f73a-2e29-49e1-b7ec-2572b91f609d>\",\"Content-Length\":\"37847\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d5691450-742e-4b35-ada7-bc7ac013be93>\",\"WARC-Concurrent-To\":\"<urn:uuid:bb5ae0e7-6ee9-453e-bda0-50311ece15b1>\",\"WARC-IP-Address\":\"104.17.33.82\",\"WARC-Target-URI\":\"https://cellrank.readthedocs.io/en/stable/api/cellrank.ul.models.GAM.html\",\"WARC-Payload-Digest\":\"sha1:4ZI3MQY4TMDJCFF7NU5SZ2EFIEGCFJEP\",\"WARC-Block-Digest\":\"sha1:2PFWAMC2S5CSYGEQCUKTOB34LH63S2PL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585270.40_warc_CC-MAIN-20211019140046-20211019170046-00703.warc.gz\"}"}