Skip to content

Commit

Permalink
Update scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
doorleyr committed Jun 18, 2020
1 parent 2c60cc1 commit 6c9e58c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion economic_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def return_indicator(self, geogrid_data):
avg_salary=self.get_avg_salary(worker_composition)
# base_ouput=self.get_total_output(self.base_industry_composition)
output=self.get_total_output(industry_composition)
max_output=4e9
max_output=5e9
max_workers_per_km_sq=7500
print(output)
# total_output=base_ouput+new_ouput
Expand Down
6 changes: 3 additions & 3 deletions innovation_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def setup(self,occLevel=3,saveData=True,modelPath='tables/innovation_data',quiet
self.kno_model = None
self.RnD_pc = None

self.kno_bounds = [-12,-7]
self.rnd_bounds = [3,6]
self.sks_bounds = [-11,-5]
self.kno_bounds = [-11,-7]
self.rnd_bounds = [4,5]
self.sks_bounds = [-16,-5]

def return_indicator(self, geogrid_data):
industry_composition = self.grid_to_industries(geogrid_data)
Expand Down
18 changes: 10 additions & 8 deletions mobility_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ def train(self):
X_df=pd.DataFrame(data['X'])
Y_df=pd.DataFrame(data['Y'])
all_df=pd.concat([X_df, Y_df], axis=1)
numerical_cols=[col for col in X_df.columns]
# numerical_cols=[col for col in X_df.columns]
static_types=[k for k in self.types_def if k not in self.int_types_def]
numerical_cols=[col for col in X_df.columns if col not in static_types]
# neigh = LinearRegression(n_neighbors=3)
self.co2_model, self.co2_model_features= fit_rf_regressor(
all_df, cat_cols=[],
numerical_cols=numerical_cols,
y_col='avg_co2', n_estimators=10)
y_col='avg_co2', n_estimators=50)
self.pa_model, self.pa_model_features= fit_rf_regressor(
all_df, cat_cols=[],
numerical_cols=numerical_cols,
y_col='delta_f_physical_activity_pp', n_estimators=10)
y_col='delta_f_physical_activity_pp', n_estimators=50)
co2_model_object={'model': self.co2_model, 'features': self.co2_model_features,
# 'max': self.max_co2, 'min': self.min_co2
}
Expand Down Expand Up @@ -70,10 +72,10 @@ def load_module(self):
except:
print('Model not yet trained. Training now')
self.train()
self.min_co2=2.5
self.max_co2=4
self.min_pa=0.007
self.max_pa=0.008
self.min_co2=5
self.max_co2=12
self.min_pa=0
self.max_pa=0.004


def return_indicator(self, geogrid_data, future_mobility=1):
Expand Down Expand Up @@ -120,7 +122,7 @@ def main():
H = Handler('corktown', quietly=False)
H.add_indicator(M)

geogrid_data=H.geogrid_data()
geogrid_data=H.get_geogrid_data()

M.return_indicator(geogrid_data)

Expand Down

0 comments on commit 6c9e58c

Please sign in to comment.