linearmodels

linearmodels panelOLS: Regression output with stars

时光总嘲笑我的痴心妄想 提交于 2021-02-07 03:12:45
问题 I'm using the linearmodels package to estimate a Panel-OLS. As an example see: import numpy as np from statsmodels.datasets import grunfeld data = grunfeld.load_pandas().data data.year = data.year.astype(np.int64) # MultiIndex, entity - time data = data.set_index(['firm','year']) from linearmodels import PanelOLS mod = PanelOLS(data.invest, data[['value','capital']], entity_effect=True) res = mod.fit(cov_type='clustered', cluster_entity=True) I want to export the regression's output in a .tex

How do I solve the future warning -> % (min_groups, self.n_splits)), Warning) in python?

≡放荡痞女 提交于 2019-12-05 03:26:01
When I run mean_acc() method in my program, there are % (min_groups, self.n_splits)), Warning) errors... def mean_acc(): models = [ RandomForestClassifier(n_estimators=200, max_depth=3, random_state=0), LinearSVC(), MultinomialNB(), LogisticRegression(random_state=0)] CV = 6 cv_df = pd.DataFrame(index=range(CV * len(models))) entries = [] for model in models: model_name = model.__class__.__name__ accuracies = cross_val_score(model, features, labels, scoring='accuracy', cv=CV) for fold_idx, accuracy in enumerate(accuracies): entries.append((model_name, fold_idx, accuracy)) cv_df = pd.DataFrame

Cast string to float is not supported in Linear Model

吃可爱长大的小学妹 提交于 2019-12-04 00:14:45
问题 I keep getting this error in my linear model: Cast string to float is not supported Specifically, the error is on this line: results = m.evaluate(input_fn=lambda: input_fn(df_test), steps=1) If it helps, here's the stack trace: File "tensorflowtest.py", line 164, in <module> m.fit(input_fn=lambda: input_fn(df_train), steps=int(100)) File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py", line 475, in fit max_steps=max_steps) File "

Cast string to float is not supported in Linear Model

南笙酒味 提交于 2019-12-01 03:21:29
I keep getting this error in my linear model: Cast string to float is not supported Specifically, the error is on this line: results = m.evaluate(input_fn=lambda: input_fn(df_test), steps=1) If it helps, here's the stack trace: File "tensorflowtest.py", line 164, in <module> m.fit(input_fn=lambda: input_fn(df_train), steps=int(100)) File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py", line 475, in fit max_steps=max_steps) File "/home/computer/.local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators

How do I solve the future warning -> % (min_groups, self.n_splits)), Warning) in python?

最后都变了- 提交于 2019-11-30 03:08:02
问题 When I run mean_acc() method in my program, there are % (min_groups, self.n_splits)), Warning) errors... def mean_acc(): models = [ RandomForestClassifier(n_estimators=200, max_depth=3, random_state=0), LinearSVC(), MultinomialNB(), LogisticRegression(random_state=0)] CV = 6 cv_df = pd.DataFrame(index=range(CV * len(models))) entries = [] for model in models: model_name = model.__class__.__name__ accuracies = cross_val_score(model, features, labels, scoring='accuracy', cv=CV) for fold_idx,